-
Notifications
You must be signed in to change notification settings - Fork 2
/
dg_riverdischarge_decade_compare.m
54 lines (40 loc) · 2.09 KB
/
dg_riverdischarge_decade_compare.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
% dg_riverdischarge_decade_compare.m
%if ~exist('flow_chesapeake_monthly')
load('riverdischarge.mat');
%end %if
p1ind = find(yyyylist <= 1999);
p2ind = find(yyyylist > 1999);
flow_chesapeake_monthly_p1 = nanmean(flow_chesapeake_monthly(p1ind,:),1);
flow_chesapeake_monthly_p2 = nanmean(flow_chesapeake_monthly(p2ind,:),1);
flow_chesapeake_monthly_p1p2 = [flow_chesapeake_monthly_p1; flow_chesapeake_monthly_p2];
flow_hudson_monthly_p1 = nanmean(flow_hudson_monthly(p1ind,:),1);
flow_hudson_monthly_p2 = nanmean(flow_hudson_monthly(p2ind,:),1);
flow_hudson_monthly_p1p2 = [flow_hudson_monthly_p1; flow_hudson_monthly_p2];
%bar(flow_hudson_monthly_p1p2')
%bar(flow_chesapeake_monthly_p1p2')
[errp1_hudson] = dg_ci(flow_hudson_monthly(p1ind,:)');
[errp2_hudson] = dg_ci(flow_hudson_monthly(p2ind,:)');
[errp1_chesapeake] = dg_ci(flow_chesapeake_monthly(p1ind,:)');
[errp2_chesapeake] = dg_ci(flow_chesapeake_monthly(p2ind,:)');
figure(1)
h_hudson = barerrorbar({flow_hudson_monthly_p1p2'},{flow_hudson_monthly_p1p2',[errp1_hudson,errp2_hudson],'k.'});
title('Hudson River Monthly Discharge Comparison')
legend('1977-1999','2000-2016')
xlabel('Month')
ylabel('Discharge (m^{3}/s)')
eval(['print -depsc -r300 MonthlyHudsonDischargeDecadalCompare.eps'])
figure(2)
h_chesapeake = barerrorbar({flow_chesapeake_monthly_p1p2'},{flow_chesapeake_monthly_p1p2',[errp1_chesapeake,errp2_chesapeake],'k.'});
title('Chesapeake Monthly Discharge Comparison')
legend('1977-1999','2000-2016')
xlabel('Month')
ylabel('Discharge (m^{3}/s)')
eval(['print -depsc -r300 MonthlyChesapeakeDischargeDecadalCompare.eps'])
flow_chesapeake_all_p1 = nanmean(nanmean(flow_chesapeake_monthly(p1ind,:),2))
flow_chesapeake_all_p2 = nanmean(nanmean(flow_chesapeake_monthly(p2ind,:),2))
flow_hudson_all_p1 = nanmean(nanmean(flow_hudson_monthly(p1ind,:),2))
flow_hudson_all_p2 = nanmean(nanmean(flow_hudson_monthly(p2ind,:),2))
flow_chesapeake_JFMA_p1 = nanmean(flow_chesapeake_JFMA(p1ind))
flow_chesapeake_JFMA_p2 = nanmean(flow_chesapeake_JFMA(p2ind))
flow_hudson_JFMA_p1 = nanmean(flow_hudson_JFMA(p1ind))
flow_hudson_JFMA_p2 = nanmean(flow_hudson_JFMA(p2ind))