-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfloc_plot.m
246 lines (232 loc) · 8.08 KB
/
floc_plot.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
% floc_plot - makes plots after floc_proc
set_colors
s2d = 1. /(3600.*24.);
% index in elev
iiz = find(elev>=0.5,1,'first');
fprintf(1,'in floc_plot, iiz = %d and elev(iiz) = %f\n',iiz,elev(iiz))
fprintf(fid,'%d, %d, %d, %3.1f, ',nz,NCS,iiz,elev(iiz))
% text string for plot labels
ets = sprintf(' at z = %4.1f mab',elev(iiz));
%% floc conc plots - pcolor version = muds, wst, fdiamt
figure(13); clf
subplot(311)
pcolorjw( s2d*tz, h+z_w, log10(muds+eps))
caxis([-2.5 1.5])
set(gca,'xticklabel','','fontsize',14)
colorbar
title('log_{10} Total Floc Concentration (kg/m^3)')
% fraction-weighted ws
wst = squeeze(sum(repmat(ws(1:NCS),1,nz,nt).*m)./sum(m));
subplot(312)
pcolorjw( s2d*tz, h+z_w, 1e3*wst)
set(gca,'xticklabel','','fontsize',14)
colorbar
title('Floc Settling Velocity (mm/s)')
ylabel('Elevation (m)')
% fraction-weighted size
subplot(313)
fdiamt = squeeze(sum(repmat(fdiam(1:NCS),1,nz,nt).*m)./sum(m));
pcolorjw( s2d*tz, h+z_w, 1e6*fdiamt)
colorbar
title('Floc Diameter (\mum)')
set(gca,'fontsize',14)
xlabel('Days','fontsize',16)
pfn=sprintf('floc_conc_run%02d.png',cas)
if(iplot),print('-dpng','-r300',pfn); end
%% sand conc plots - snds, wssdt, fdiamsdt
figure(14); clf
subplot(311)
pcolorjw( s2d*tz, h+z_w, log10(snds+eps))
set(gca,'xticklabel','','fontsize',14)
caxis([-2.5 1.5])
colorbar
title('log_{10} Total Sand Concentration (kg/m^3)')
% fraction-weighted ws
wssdt = squeeze(sum(repmat(ws(NNN+NCS+1:NCS+NNN+NND),1,nz,nt).*snd)./sum(snd));
subplot(312)
pcolorjw( s2d*tz, h+z_w, 1e3*wssdt)
set(gca,'xticklabel','','fontsize',14)
colorbar
ylabel('Elevation (m)','fontsize',16)
title('Sand Settling Velocity (mm/s)')
% fraction-weighted size
subplot(313)
fdiamsdt = squeeze(sum(repmat(fdiam(NNN+NCS+1:NCS+NNN+NND),1,nz,nt).*snd)./sum(snd));
pcolorjw( s2d*tz, h+z_w, 1e6*fdiamsdt)
colorbar
set(gca,'fontsize',14)
xlabel('Days','fontsize',16)
title('Sand Diameter (\mum)')
pfn=sprintf('sand_conc_run%02d.png',cas)
if(iplot),print('-dpng','-r300',pfn); end
%% fraction-weighted size of both sand and flocs - fdiamall
figure(15); clf
subplot(211)
h1=plot(s2d*ocean_time, 1e6*fdiamsdt(iiz,:) );
hold on
h2=plot(s2d*ocean_time, 1e6*fdiamt(iiz,:) );
h3=plot(s2d*ocean_time, 1e6*fdiamall(iiz,:) );
legend([h1;h2;h3],'Sand','Flocs','Combined')
ylabel('Mass-weighted Mean Diameter (\mum)')
subplot(212)
pcolorjw( s2d*tz, h+z_w, 1e6*fdiamt)
colorbar
title(['Floc + Sand Diameter (\mum)',ets])
set(gca,'fontsize',14)
xlabel('Days','fontsize',16)
pfn=sprintf('floc+sand_size_run%02d.png',cas)
if(iplot),print('-dpng','-r300',pfn); end
%fprintf(fid,'Mean conc and size at %f mab:\n flocs: %f %5.1f\n sand: %f %5.1f\n',...
fprintf(fid,'%7.4f, %5.1f, %7.4f, %5.1f\n',...
nanmean(muds(iiz,:)),nanmean(1e6*fdiamt(iiz,:)),...
nanmean(snds(iiz,:)),nanmean(1e6*fdiamsdt(iiz,:)))
%% line plots of concs and diam
figure(16); clf
h1=plot(s2d*ocean_time, snds(iiz,:),'linewidth',2,'color',sand_color);
hold on
h2=plot(s2d*ocean_time, muds(iiz,:),'linewidth',2,'color',floc_color);
h3=plot(s2d*ocean_time, (snds(iiz,:)+muds(iiz,:)),'linewidth',2,'color',comb_color);
% iiz=9
% h4=plot(s2d*ocean_time, snds(iiz,:),'--','linewidth',2,'color',sand_color)
% hold on
% h5=plot(s2d*ocean_time, muds(iiz,:),'--','linewidth',2,'color',floc_color)
% h6=plot(s2d*ocean_time, (snds(iiz,:)+muds(iiz,:)),'--','linewidth',2,'color',comb_color);
title(['Modeled Concentration of Flocs and Sand',ets])
legend([h1;h2;h3],'Sand','Flocs','Combined')
%% line plots of combined conc and diam
figure(17); clf
h1=plot(s2d*ocean_time, vcomb1(iiz,:),'linewidth',2,'color',abss1c_color);
hold on
h2=plot(s2d*ocean_time, vcomb4(iiz,:),'linewidth',2,'color',abss3c_color);
% h2=plot(s2d*ocean_time, vcomb25(iiz,:),'linewidth',2,'color',abss2c_color)
h3=plot(s2d*ocean_time, (r_ac9f(3,:)+r_ac9s(iiz,:)+eps),'linewidth',2,'color',ac9c_color);
h4=plot(s2d*ocean_time, (r_lisstf(3,:)+r_lissts(iiz,:)+eps),'linewidth',2,'color',lisstc_color);
title(['Combined Response to Flocs and Sand', ets])
legend([h1;h2;h3;h4],'1 MHz ABSS','4 MHz ABSS','ac9','LISST')
%% Plot acoustic response
figure(18); clf
subplot(311)
pcolorjw( s2d*tz, h+z_w, v25)
colorbar
title('Flocs Acoustic Response at 2.5 MHz')
set(gca,'xticklabel','','fontsize',14)
%xlabel('Days')
%ylabel('Elevation (m)')
xlim([0 32.8])
caxis([ 0 .5])
ylim([0 3])
subplot(312)
pcolorjw( s2d*tz, h+z_w, vsn25)
colorbar
title('Sand Acoustic Response')
set(gca,'xticklabel','','fontsize',14)
%xlabel('Days')
ylabel('Elevation (m)','fontsize',16)
xlim([0 32.8])
caxis([ 0 .5])
ylim([0 3])
subplot(313)
pcolorjw( s2d*tz, h+z_w, vcomb25)
colorbar
title('Combined Acoustic Response')
set(gca,'fontsize',14)
xlabel('Days','fontsize',16)
%ylabel('Elevation (m)')
xlim([0 32.8])
caxis([ 0 .5])
ylim([0 3])
pfn=sprintf('both_acoustic_response_run%02d.png',cas)
if(iplot),print('-dpng','-r300',pfn); end
%% Plot optical responses - pcolor version
figure(19); clf
subplot(311)
pcolorjw( s2d*tz, h+z_w, log10(r_ac9f+eps))
colorbar
title('Flocs Optical (ac-9) Response')
set(gca,'xticklabel','','fontsize',14)
%ylabel('Elevation (m)')
xlim([0 32.8])
caxis([-3 1])
ylim([0 3])
subplot(312)
pcolorjw( s2d*tz, h+z_w, log10(r_ac9s+eps))
colorbar
title('Sand Optical Response')
set(gca,'xticklabel','','fontsize',14)
ylabel('Elevation (m)','fontsize',16)
xlim([0 32.8])
caxis([ -3 1])
ylim([0 3])
subplot(313)
pcolorjw( s2d*tz, h+z_w, log10(r_ac9f+r_ac9s+eps))
colorbar
title('Combined Optical Response')
set(gca,'fontsize',14)
xlabel('Days','fontsize',16)
%ylabel('Elevation (m)','fontsize',14)
xlim([0 32.8])
caxis([ -3 1])
ylim([0 3])
pfn=sprintf('pcol_both_optical_response_run%02d.png',cas)
if(iplot),print('-dpng','-r300',pfn); end
%% line version
figure(20); clf;
h1=plot(s2d*ocean_time, r_ac9s(iiz,:),'linewidth',2,'color',ac9s_color);
hold on
h2=plot(s2d*ocean_time, r_ac9f(iiz,:),'linewidth',2,'color',ac9f_color);
h3=plot(s2d*ocean_time, r_lissts(iiz,:),'linewidth',2,'color',lissts_color);
h4=plot(s2d*ocean_time, r_lisstf(iiz,:),'linewidth',2,'color',lisstf_color);
title(['Optical Response to Flocs and Sand',ets])
ylabel('Concentration (kg/m^3)')
legend([h1;h2;h3;h4],'ac9 sand','ac9 flocs','LISST sand','LISST flocs');
pfn=sprintf('line_both_optical_response_run%02d.png',cas)
if(iplot),print('-dpng','-r300',pfn); end
%% time series of sand, flocs and combined masses
figure(21); clf
h1=plot(s2d*ocean_time, vcomb1(iiz,:),'linewidth',2,'color',abss1c_color);
hold on
%h2=plot(s2d*ocean_time, vcomb4(iiz,:),'linewidth',2,'color',abss3c_color);
h3=plot(s2d*ocean_time, (r_ac9f(3,:)+r_ac9s(iiz,:)+eps),'linewidth',2,'color',ac9c_color);
h4=plot(s2d*ocean_time, (r_lisstf(3,:)+r_lissts(iiz,:)+eps),'linewidth',2,'color',lisstc_color);
title(['Combined Response to Flocs and Sand',ets])
legend([h1;h3;h4],'1 MHz ABSS','ac9','LISST')
%% time series of both combined responses
% TODO Edit this to plot estimated size
% figure(10); clf
% h1=plot(s2d*ocean_time, vcomb1(iiz,:),'linewidth',2,'color',abss1c_color);
% hold on
% h2=plot(s2d*ocean_time, vcomb4(iiz,:),'linewidth',2,'color',abss3c_color);
% h3=plot(s2d*ocean_time, (r_ac9f(3,:)+r_ac9s(iiz,:)+eps),'linewidth',2,'color',ac9c_color);
% h4=plot(s2d*ocean_time, (r_lisstf(3,:)+r_lissts(iiz,:)+eps),'linewidth',2,'color',lisstc_color);
% title(['Combined Response to Flocs and Sand',ets])
% legend([h1;h2;h3;h4],'1 MHz ABSS','4 MHz ABSS','ac9','LISST')
%%
load cmap_plusminus
figure(22)
pcolorjw( s2d*tz, h+z_w, vcomb25-vsn25)
colorbar
colormap(cmap_plusminus)
title('Difference: Combined - Sand Acoustic Response','fontsize',16)
xlabel('Days','fontsize',16)
ylabel('Elevation (m)','fontsize',16)
xlim([0 32.8])
caxis([ -.25 .25])
ylim([0 3])
pfn=sprintf('acoustic_diff_run%02d.png',cas)
if(iplot),print('-dpng','-r300',pfn); end
%% overall acoustic response to conc
tsed = muds+snds;
figure(23); clf
h1=plot(tsed(:),vcomb25(:),'.','color',abss2c_color);
set(h1,'markersize',14);
hold on
h2=plot(muds(:),v25(:),'.','color',abss2f_color);
set(h2,'markersize',14);
h3=plot(snds(:),vsn25(:),'.','color',abss2s_color);
set(h3,'markersize',14);
xlabel('Mass Concentration (kg/m^3)','fontsize',16)
ylabel('Acoustic Response','fontsize',16)
h4=legend([h3;h2;h1],'Sand','Flocs','Combined');
set(h4,'fontsize',14)
pfn = sprintf('acoustic_response_scatter%2d.png',cas)
if(iplot),print('-dpng','-r300',pfn); end