-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualize_DEMv0.m
91 lines (75 loc) · 2.12 KB
/
visualize_DEMv0.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
% This is a matlab routine to visualize elevation maps, cumulative depositional maps, and topographical x-sections generated by AquaTellUs. The code creates movies of 1) topographical evolution and flowpath switches and 2)cumulative deposition.
% Written by Irina Overeem, updated March 2016.
numcol=120;
%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
% 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=1: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(4)
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')