|
2 | 2 | %calc_All calculates all signatures in the toolbox. |
3 | 3 | % If a signature function can calculate multiple signatures |
4 | 4 | % (e.g. sig_x_percentile) only one signature is calculated (e.g. Q95). |
5 | | -% Note: This function is primarily intended to test all signatures and |
| 5 | +% Note: This function is primarily intended to test all signatures and |
6 | 6 | % not all functionalities are used (e.g. plotting). |
7 | 7 | % |
8 | 8 | % INPUT |
|
55 | 55 |
|
56 | 56 | % optional input arguments |
57 | 57 | addParameter(ip, 'start_water_year', 10, @isnumeric) % when does the water year start? Default: 10 |
58 | | -addParameter(ip, 'plot_results', false, @islogical) % whether to plot results |
| 58 | +addParameter(ip, 'plot_results', false, @islogical) % whether to plot results |
59 | 59 |
|
60 | 60 | parse(ip, Q_mat, t_mat, P_mat, PET_mat, T_mat, varargin{:}) |
61 | 61 | start_water_year = ip.Results.start_water_year; |
|
122 | 122 | SeasonalTranslation_error_str = strings(size(Q_mat,1),1); |
123 | 123 | Recession_a_Seasonality = NaN(size(Q_mat,1),1); |
124 | 124 | Recession_a_Seasonality_error_str = strings(size(Q_mat,1),1); |
| 125 | +AverageStorage = NaN(size(Q_mat,1),1); |
| 126 | +AverageStorage_error_str = strings(size(Q_mat,1),1); |
| 127 | +MRC_num_segments = NaN(size(Q_mat,1),1); |
| 128 | +MRC_num_segments_error_str = strings(size(Q_mat,1),1); |
| 129 | +First_Recession_Slope = NaN(size(Q_mat,1),1); |
| 130 | +Mid_Recession_Slope = NaN(size(Q_mat,1),1); |
| 131 | +EventRR_TotalRR_ratio = NaN(size(Q_mat,1),1); |
125 | 132 | SnowDayRatio = NaN(size(Q_mat,1),1); |
126 | 133 | SnowDayRatio_error_str = strings(size(Q_mat,1),1); |
127 | 134 | SnowStorage = NaN(size(Q_mat,1),1); |
|
140 | 147 | high_Q_duration_error_str = strings(size(Q_mat,1),1); |
141 | 148 | high_Q_frequency = NaN(size(Q_mat,1),1); |
142 | 149 | high_Q_frequency_error_str = strings(size(Q_mat,1),1); |
| 150 | +IE_effect = NaN(size(Q_mat,1),1); |
| 151 | +SE_effect = NaN(size(Q_mat,1),1); |
| 152 | +IE_thresh_signif = NaN(size(Q_mat,1),1); |
| 153 | +IE_thresh = NaN(size(Q_mat,1),1); |
| 154 | +SE_thresh_signif = NaN(size(Q_mat,1),1); |
| 155 | +SE_thresh = NaN(size(Q_mat,1),1); |
| 156 | +SE_slope = NaN(size(Q_mat,1),1); |
| 157 | +Storage_thresh_signif = NaN(size(Q_mat,1),1); |
| 158 | +Storage_thresh = NaN(size(Q_mat,1),1); |
| 159 | +min_Qf_perc = NaN(size(Q_mat,1),1); |
| 160 | +R_Pvol_RC = NaN(size(Q_mat,1),1); |
| 161 | +R_Pint_RC = NaN(size(Q_mat,1),1); |
| 162 | +EventGraph_error_str = strings(size(Q_mat,1),1); |
143 | 163 |
|
144 | 164 | % loop over all catchments |
145 | 165 | for i = 1:size(Q_mat,1) |
146 | | - |
| 166 | + |
147 | 167 | [AC1(i),~,AC1_error_str(i)] = sig_Autocorrelation(Q_mat{i},t_mat{i}); |
148 | 168 | [BaseflowRecessionK(i),~,BaseflowRecessionK_error_str(i)] = ... |
149 | 169 | sig_BaseflowRecessionK(Q_mat{i},t_mat{i},'eps',0.001*median(Q_mat{i},'omitnan')); |
|
186 | 206 | [SeasonalTranslation(i,1),SeasonalTranslation(i,2),~,SeasonalTranslation_error_str(i)] = ... |
187 | 207 | sig_SeasonalTranslation(Q_mat{i},t_mat{i},P_mat{i},PET_mat{i}); |
188 | 208 | [Recession_a_Seasonality(i),~,Recession_a_Seasonality_error_str(i)] = sig_SeasonalVarRecessions(Q_mat{i},t_mat{i}); |
| 209 | + [AverageStorage(i),~,AverageStorage_error_str(i)] = ... |
| 210 | + sig_StorageFromBaseflow(Q_mat{i},t_mat{i},P_mat{i},PET_mat{i}, ... |
| 211 | + 'start_water_year',start_water_year,'plot_results', plot_results); |
| 212 | + [MRC_num_segments(i),Segment_slopes,~,MRC_num_segments_error_str(i)] = ... |
| 213 | + sig_MRC_SlopeChanges(Q_mat{i},t_mat{i},'plot_results',plot_results); |
| 214 | + First_Recession_Slope(i) = Segment_slopes(1); |
| 215 | + if length(Segment_slopes) >= 2 |
| 216 | + Mid_Recession_Slope(i) = Segment_slopes(2); |
| 217 | + end |
| 218 | + EventRR_TotalRR_ratio(i) = EventRR(i)/TotalRR(i); |
189 | 219 | [SnowDayRatio(i),~,SnowDayRatio_error_str(i)] = sig_SnowDayRatio(Q_mat{i},t_mat{i},P_mat{i},T_mat{i}); |
190 | 220 | [SnowStorage(i),~,SnowStorage_error_str(i)] = sig_SnowStorage(Q_mat{i},t_mat{i},P_mat{i}); |
191 | | - [StorageFraction(i,1),StorageFraction(i,2),StorageFraction(i,3),~,StorageFraction_error_str(i)] = ... |
| 221 | + [StorageFraction(i,1),StorageFraction(i,2),StorageFraction(i,3),~,StorageFraction_error_str(i)] = ... |
192 | 222 | sig_StorageFraction(Q_mat{i},t_mat{i},P_mat{i},PET_mat{i}); |
193 | 223 | [StorageFromBaseflow(i),~,StorageFromBaseflow_error_str(i)] = ... |
194 | 224 | sig_StorageFromBaseflow(Q_mat{i},t_mat{i},P_mat{i},PET_mat{i}); |
|
197 | 227 | [Q95(i),~,Q95_error_str(i)] = sig_x_percentile(Q_mat{i},t_mat{i},95); |
198 | 228 | [high_Q_duration(i),~,high_Q_duration_error_str(i)] = sig_x_Q_duration(Q_mat{i},t_mat{i},'high'); |
199 | 229 | [high_Q_frequency(i),~,high_Q_frequency_error_str(i)] = sig_x_Q_frequency(Q_mat{i},t_mat{i},'high'); |
200 | | - |
| 230 | + [IE_effect(i),SE_effect(i),IE_thresh_signif(i),IE_thresh(i), ... |
| 231 | + SE_thresh_signif(i),SE_thresh(i),SE_slope(i),Storage_thresh(i), ... |
| 232 | + Storage_thresh_signif(i),min_Qf_perc(i),R_Pvol_RC(i),R_Pint_RC(i),~,EventGraph_error_str(i)] ... |
| 233 | + = sig_EventGraphThresholds(Q_mat{i},t_mat{i},P_mat{i},'plot_results',plot_results); |
201 | 234 | end |
202 | 235 |
|
203 | 236 | % add results to struct array |
|
261 | 294 | results.SeasonalTranslation_error_str = SeasonalTranslation_error_str; |
262 | 295 | results.Recession_a_Seasonality = Recession_a_Seasonality; |
263 | 296 | results.Recession_a_Seasonality_error_str = Recession_a_Seasonality_error_str; |
| 297 | +results.AverageStorage = AverageStorage; |
| 298 | +results.MRC_num_segments = MRC_num_segments; |
| 299 | +results.MRC_num_segments_error_str = MRC_num_segments_error_str; |
| 300 | +results.First_Recession_Slope = First_Recession_Slope; |
| 301 | +results.Mid_Recession_Slope = Mid_Recession_Slope; |
| 302 | +results.EventRR_TotalRR_ratio = EventRR_TotalRR_ratio; |
264 | 303 | results.SnowDayRatio = SnowDayRatio; |
265 | 304 | results.SnowDayRatio_error_str = SnowDayRatio_error_str; |
266 | 305 | results.SnowStorage = SnowStorage; |
|
279 | 318 | results.high_Q_duration_error_str = high_Q_duration_error_str; |
280 | 319 | results.high_Q_frequency = high_Q_frequency; |
281 | 320 | results.high_Q_frequency_error_str = high_Q_frequency_error_str; |
282 | | - |
| 321 | +results.IE_effect = IE_effect; |
| 322 | +results.SE_effect = SE_effect; |
| 323 | +results.IE_thresh_signif = IE_thresh_signif; |
| 324 | +results.SE_thresh_signif = SE_thresh_signif; |
| 325 | +results.IE_thresh = IE_thresh; |
| 326 | +results.SE_thresh = SE_thresh; |
| 327 | +results.SE_slope = SE_slope; |
| 328 | +results.Storage_thresh_signif = Storage_thresh_signif; |
| 329 | +results.Storage_thresh = Storage_thresh; |
| 330 | +results.min_Qf_perc = min_Qf_perc; |
| 331 | +results.R_Pvol_RC = R_Pvol_RC; |
| 332 | +results.R_Pint_RC = R_Pint_RC; |
| 333 | +results.EventGraph_error_str = EventGraph_error_str; |
283 | 334 | end |
0 commit comments