-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualize_DEM.m
147 lines (122 loc) · 3.13 KB
/
visualize_DEM.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
% This is a routine to visualize elevation maps, cumulative depositional maps, and topographical x-sections generated by AquaTellUs
% written by Irina Overeem, updated July 2018
numcol=200;
numrow=200;
%read in the stack of topographical grids from the 'topo.dat' files
findex = dir('topo*.dat');
numfiles = length(findex)-1;
topodata = cell(1, numfiles);
for k = 1:numfiles
myfilename = sprintf('topo%d.dat', k);
topodata{k} = importdata(myfilename);
end
%read in the flowpath arrays from the 'flowpath.dat'files
flowpathdata = cell(1, numfiles);
for l = 1:numfiles
fpfilename = sprintf('flowpath%d.dat', l);
flowpathdata{l} = importdata(fpfilename);
end
% read in the median grainsize data stack from the files
grainsizedata = cell(1, numfiles);
%
for m = 1:numfiles
fpfilename = sprintf('GSD%d.dat', m);
grainsizedata{m} = importdata(fpfilename);
end
% % %
% % % %visualize the elevation grid and movie it through the simulation
% figure(1)
% for n=1:1:numfiles
% imagesc(topodata{:,n});
% %caxis([-5 10])
% colorbar()
% hold on
% t=flowpathdata{1,n};
% tt=t+1;
% plot(tt(:,2),tt(:,1),'k');
% title(['Topographical Changes due to Flood Deposition', ' ','Year # ',int2str(n)],'Color','b')
% K(n) = getframe;
% end
% movie2avi(K,'channelswitches.avi')
%
% %
% % %movie the sedimentation per timestep (difference grids)
figure(2)
for p=2:1:numfiles
imagesc(topodata{:,p}-topodata{:,1});
title(['Cumulative Flood Event Deposition', ' ','Year # ',int2str(p)],'Color','b')
colormap(jet)
caxis([-0.5 1.5])
colorbar()
L(p-1) = getframe;
end
movie2avi(L,'cumulativedeposition.avi')
%
%
% figure(3)
% for q=2:1:numfiles
% imagesc(grainsizedata{:,q});
% caxis([1 500])
% colorbar()
% title(['Grain size pattern due to Flood Deposition', ' ','Year # ',int2str(q)],'Color','b')
% M(q) = getframe;
% end
% movie2avi(M,'grainsizepatterns.avi')
%
% %plot a series of cross-sections
figure(5)
xpos1=numcol*(1/5);
xpos2=numcol*(2/5);
xpos3=numcol*(3/5);
xpos4=numcol*(4/5);
xs=(topodata{:,numfiles});
subplot(4,1,1);
plot(xs(xpos1,:));
ylabel('h in m');
legend('X-section 36')
subplot(4,1,2);
plot(xs(xpos2,:));
ylabel('h in m');
legend('X-section 64')
subplot(4,1,3);
plot(xs(xpos3,:));
ylabel('h in m');
legend('X-section 108')
subplot(4,1,4);
plot(xs(xpos4,:));
ylabel('h in m');
legend('X-section 144')
% %plot a series of longitudinal-sections
figure(6)
xpos1=numrow*(1/2)+8;
xpos2=numrow*(1/2)+4;
xpos3=numrow*(1/2);
xpos4=numrow*(1/2)-16;
xs=(topodata{:,numfiles});
subplot(4,1,1);
plot(xs(:,xpos1));
ylabel('h in m');
legend('longsection 4km from main axis')
subplot(4,1,2);
plot(xs(:,xpos2));
ylabel('h in m');
legend('longsection 2km from main axis')
subplot(4,1,3);
plot(xs(:,xpos3));
ylabel('h in m');
legend('longsection at main axis')
subplot(4,1,4);
plot(xs(:,xpos4));
ylabel('h in m');
legend('longsection 8km from main axis')
figure(7)
xs=(topodata{:,numfiles});
long_centerline_position=numrow*(1/2);
plot(xs(:,long_centerline_position));
ylabel('h in m');
legend('longsection through main axis')
% calculate the slopes along the longitudinal profile
ytopo=xs(:,long_centerline_position);
for p=5:1:numrow-10
slope(p)=(ytopo(p+1)-ytopo(p))/500;
end