forked from gremau/NMEG_FluxProc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUNM_RBD_calc_rhprofile_mean.m
41 lines (35 loc) · 1.18 KB
/
UNM_RBD_calc_rhprofile_mean.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
function RH_Avg = UNM_RBD_calc_rhprofile_mean( RH_table )
RH_Avg = NaN(height(RH_table),1);
% JUST 36 M
i1 = DOYidx( 41.4167 ); i2 = DOYidx( 161.375 );
RH_Avg(i1:i2,:) = RH_table.RH_36_Avg(i1:i2,:);
% EVERY HMP EXCEPT 36 M
i1 = DOYidx( 196.5625 ); i2 = DOYidx( 201.6458 );
RH_Avg(i1:i2,:) = ...
nanmean([RH_table.RH_1p5_Avg(i1:i2,:) , ...
RH_table.RH_4p5_Avg(i1:i2,:),...
RH_table.RH_8p75_Avg(i1:i2,:),...
RH_table.RH_16_Avg(i1:i2,:),...
RH_table.RH_24_Avg(i1:i2,:)] , ...
2 ); %average along rows
i1 = DOYidx( 208.3958 ); i2 = DOYidx( 221.5417 );
RH_Avg(i1:i2,:) = ...
nanmean([RH_table.RH_1p5_Avg(i1:i2,:) , ...
RH_table.RH_4p5_Avg(i1:i2,:),...
RH_table.RH_8p75_Avg(i1:i2,:),...
RH_table.RH_16_Avg(i1:i2,:),...
RH_table.RH_24_Avg(i1:i2,:)] , ...
2 );
% ALL PROFILE HMPS
i1 = DOYidx( 229.3958 ); i2 = 17567;
RH_Avg(i1:i2,:) = ...
nanmean([RH_table.RH_1p5_Avg(i1:i2,:) , ...
RH_table.RH_4p5_Avg(i1:i2,:),...
RH_table.RH_8p75_Avg(i1:i2,:),...
RH_table.RH_16_Avg(i1:i2,:),...
RH_table.RH_24_Avg(i1:i2,:),...
RH_table.RH_36_Avg(i1:i2,:)] , ...
2 );
scale = find(RH_Avg > 1.1);
RH_Avg(scale) = RH_Avg(scale) ./ 100;
end