Skip to content

Commit

Permalink
precautionary thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
thornoe committed Mar 15, 2024
1 parent f35877e commit 1b66bca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gis/script_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,11 +858,11 @@ def ecological_status(self, j, dfIndicator, dfVP, suffix="obs", index=None):
for t in dfEco.columns:
# Precautionary conversion of imputed status to categorical scale
conditions = [
dfEco[t] < 0.5, # Bad
(dfEco[t] >= 0.5) & (dfEco[t] < 1.5), # Poor
(dfEco[t] >= 1.5) & (dfEco[t] < 2.5), # Moderate
(dfEco[t] >= 2.5) & (dfEco[t] < 3.5), # Good
dfEco[t] >= 3.5, # High
dfEco[t] < 1, # Bad
(dfEco[t] >= 1) & (dfEco[t] < 2), # Poor
(dfEco[t] >= 2) & (dfEco[t] < 3), # Moderate
(dfEco[t] >= 3) & (dfEco[t] < 4), # Good
dfEco[t] >= 4, # High
]
# Ecological status as a categorical index from Bad to High quality
dfEco[t] = np.select(conditions, [0, 1, 2, 3, 4], default=np.nan)
Expand Down

0 comments on commit 1b66bca

Please sign in to comment.