From 7faca9b786fa37b4b70627fc728b94a56540acd7 Mon Sep 17 00:00:00 2001 From: Emma Ai Date: Mon, 2 Dec 2024 08:05:49 +0000 Subject: [PATCH] make nodata condition explicit in ue --- odc/stats/plugins/lc_fc_wo_a0.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/odc/stats/plugins/lc_fc_wo_a0.py b/odc/stats/plugins/lc_fc_wo_a0.py index 9f963c4..109161a 100644 --- a/odc/stats/plugins/lc_fc_wo_a0.py +++ b/odc/stats/plugins/lc_fc_wo_a0.py @@ -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"])