Skip to content

Commit

Permalink
make nodata condition explicit in ue
Browse files Browse the repository at this point in the history
  • Loading branch information
Emma Ai committed Dec 2, 2024
1 parent ae4f5eb commit 7faca9b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions odc/stats/plugins/lc_fc_wo_a0.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,17 @@ def native_transform(self, xx):
**{"_nan": np.nan},
)

# get high ue pixels
# get high ue valid pixels
ue = expr_eval(
"where((a<_v), _nan, 1)",
"where((a<_v)|(a>=nodata), _nan, 1)",
{"a": xx["ue"].data},
name="get_high_ue",
dtype="float32",
**{"_v": self.ue_threshold, "_nan": np.nan},
**{
"_v": self.ue_threshold,
"_nan": np.nan,
"nodata": xx["ue"].attrs["nodata"],
},
)
xx = xx.drop_vars(["ue"])

Expand Down

0 comments on commit 7faca9b

Please sign in to comment.