@@ -233,14 +233,15 @@ def overlay_sim_true(self, dtw_thresh=0.08, hrs_thresh=5185):
233
233
df_subs ['dry' ] = df_subs .index .map (lambda x : df_dtw .loc [x , 'dry' ]
234
234
if x in df_dtw .index .values else 1 )
235
235
n_wets = df_subs [df_subs ['dry' ]< 0 ].shape [0 ] + df_subs [df_subs ['dry' ]== 0 ].shape [0 ]
236
+
236
237
## converts dfs to matrix of wetland types
237
238
## -2: inactive | -1: wetland (ccap) | 0: wetland(nonccap) | 1: upland
238
- mat_lows = res_base .fill_grid (df_subs .dry , fill_value = - 2 )
239
- mask_in_ccap = ~ self .mask_wet & self .mask_z
240
- df_lows = pd .DataFrame (mat_lows .reshape (- 1 ), columns = ['type' ])
239
+ mat_lows = res_base .fill_grid (df_subs .dry , fill_value = - 2 )
240
+ mask_in_ccap = ~ self .mask_wet & self .mask_z
241
+ df_lows = pd .DataFrame (mat_lows .reshape (- 1 ), columns = ['type' ])
241
242
df_lows ['true' ] = mask_in_ccap
242
- # return
243
- df_lows [ 'sim' ] = df_lows [ 'type' ]. apply ( lambda x : True if x == - 1 or x == 0 else False )
243
+ df_lows [ 'sim' ] = df_lows [ 'type' ]. apply ( lambda x : True if x == - 1 or x == 0 else False )
244
+
244
245
## get rid of inactive cells
245
246
df_lows = df_lows [df_lows ['type' ]> - 2 ]
246
247
@@ -399,16 +400,14 @@ def dtw_wet_avg_ann(self):
399
400
PATH_res = op .join (op .expanduser ('~' ), 'Google_Drive' ,
400
401
'WNC' , 'Wetlands_Paper' , 'Results_Default' )
401
402
res = Wetlands (PATH_res , z_thresh = 3.75 )
402
- # res.optimize(increment=10)
403
+
404
+ ### steps
403
405
# res.make_indicator(dtw_inc=0.01, hrs_per=50, masked=True, seasonal=False)
404
406
# res.apply_indicator(0.08, hrs_thresh=5182)
405
- res .check_performance ()
406
- res .overlay_sim_true ()
407
+ # res.find_cells(0.08, hrs_thresh=5182)
408
+ # res.plot_wets_drys()
409
+ # res.overlay_sim_true()
407
410
408
411
## wetland masked, nonseasonal: dtw <= 0.08; hrs_thesh >=5182 ------- best
409
412
## nonseasonal indicators: dtw < 0.05; hrs_thresh>4443
410
413
## seasonal indicators : dtw < 0.17; hrs_thresh > 1211
411
-
412
- # res.find_cells(0.08, hrs_thresh=5182)
413
- # res.plot_wets_drys()
414
- # print len(res.ts_day)
0 commit comments