File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,20 @@ def indicator_wets_only(self):
97
97
98
98
return
99
99
100
+ def apply_indicator (self ):
101
+ """ Test the indicator developed using indicator_wets_only on drys """
102
+ ### eventually return these from other func
103
+ dtw_thresh = 0.301
104
+ hrs_thresh = 7000
100
105
106
+ ## get only dryland cells
107
+ mask_wet = np .isnan (self .mat_wetlands .reshape (- 1 ))
108
+ mat_nonwet_dtw = self .mat_dtw [mask_wet ]
109
+ mat_dry_dtw = mat_nonwet_dtw [~ np .isnan (mat_nonwet_dtw )].reshape (- 1 , mat_nonwet_dtw .shape [1 ])
101
110
111
+ # apply conditions
112
+ result = ((mat_dry_dtw <= dtw_thresh ).sum (axis = 1 ) > hrs_thresh ).sum ()
113
+ print (result )
102
114
103
115
104
116
def optimize (self , increment = 1 ):
@@ -216,4 +228,5 @@ def dtw_wet_avg_ann(self):
216
228
'WNC' , 'Wetlands_Paper' , 'Results_Default' )
217
229
res = Wetlands (PATH_res )
218
230
# res.optimize(increment=10)
219
- res .indicator_wets_only ()
231
+ # res.indicator_wets_only()
232
+ res .apply_indicator ()
You can’t perform that action at this time.
0 commit comments