Skip to content

Commit

Permalink
alternative wet flag for nans
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachHoppinen committed Sep 5, 2023
1 parent 2f1dbaa commit b1aa973
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spicy_snow/processing/wet_snow.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def id_newly_wet_snow(dataset: xr.Dataset, wet_thresh: int = -2, inplace: bool =
# identify possible newly wet snow in regions FCF > 0.5 with deltaVV
dataset['wet_flag'] = dataset['wet_flag'].where(((dataset['fcf'] < 0.5) | (dataset['deltaVV'] > wet_thresh)), 1)

# mask nans from Sentinel-1 data
dataset['wet_flag'] = dataset['wet_flag'].where(~dataset['deltaVV'].isnull())

if not inplace:
return dataset

Expand Down Expand Up @@ -73,6 +76,9 @@ def id_newly_frozen_snow(dataset: xr.Dataset, freeze_thresh: int = 2, inplace: b
# identify possible re-freezing by increases of deltaGammaNaught of 2dB
dataset['freeze_flag'] = dataset['freeze_flag'].where(dataset['deltaGamma'] < freeze_thresh, 1)

# mask nans from Sentinel-1 data
dataset['freeze_flag'] = dataset['freeze_flag'].where(~dataset['deltaVV'].isnull())

if not inplace:
return dataset

Expand Down Expand Up @@ -105,6 +111,9 @@ def id_wet_negative_si(dataset: xr.Dataset, wet_SI_thresh = 0, inplace: bool = F
# identify wetting of snow by negative snow index with snow present
dataset['alt_wet_flag'] = dataset['alt_wet_flag'].where(((dataset['ims'] != 4) | (dataset['snow_index'] > wet_SI_thresh)), 1)

# mask nans from Sentinel-1 data
dataset['alt_wet_flag'] = dataset['alt_wet_flag'].where(~dataset['deltaVV'].isnull())

if not inplace:
return dataset

Expand Down

0 comments on commit b1aa973

Please sign in to comment.