@@ -94,9 +94,6 @@ def measurements(self) -> Tuple[str, ...]:
94
94
_measurements = ["classes_l3_l4" , "water_seasonality" ]
95
95
return _measurements
96
96
97
- def native_transform (self , xx ):
98
- return xx
99
-
100
97
def fuser (self , xx ):
101
98
return xx
102
99
@@ -175,12 +172,16 @@ def l3_class(self, xx: xr.Dataset):
175
172
)
176
173
elif b == "canopy_cover_class" :
177
174
# aquatic_veg: (mangroves > 0) & (mangroves != nodata)
175
+ # mangroves.nodata = 255 or nan
178
176
l3_mask = expr_eval (
179
- "where((a>0)&(a<nodata), m, b)" ,
177
+ "where((( a>0)&(a<nodata)&(nodata==nodata))|((a>0)&(nodata!=nodata) ), m, b)" ,
180
178
{"a" : xx [b ].data , "b" : l3_mask },
181
179
name = "mark_mangroves" ,
182
180
dtype = "uint8" ,
183
- ** {"nodata" : NODATA , "m" : self .output_classes ["aquatic_veg" ]},
181
+ ** {
182
+ "nodata" : xx [b ].attrs ["nodata" ],
183
+ "m" : self .output_classes ["aquatic_veg" ],
184
+ },
184
185
)
185
186
186
187
# all unmarked values (0) is terretrial veg
@@ -199,15 +200,15 @@ def l3_class(self, xx: xr.Dataset):
199
200
200
201
# Mask nans with NODATA
201
202
l3_mask = expr_eval (
202
- "where((a!=a)|(b>=nodata ), nodata, e)" ,
203
+ "where((a!=a)|(( b>=_n)&(_n==_n))|(b!=b ), nodata, e)" ,
203
204
{
204
205
"a" : si5 ,
205
206
"b" : xx .veg_frequency .data ,
206
207
"e" : l3_mask ,
207
208
},
208
209
name = "mark_nodata" ,
209
210
dtype = "uint8" ,
210
- ** {"nodata" : NODATA },
211
+ ** {"_n" : xx . veg_frequency . attrs [ "nodata" ], " nodata" : NODATA },
211
212
)
212
213
213
214
# Now add the water frequency
0 commit comments