File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
odc/stats/plugins/l34_utils Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -21,20 +21,31 @@ def lc_level3(xx: xr.Dataset, urban_mask):
21
21
)
22
22
23
23
# Mask urban results with bare sfc (210)
24
- # and urban mask
25
24
26
25
res = expr_eval (
27
- "where((a==_u)&(c>0) , b, a)" ,
26
+ "where((a==_u), b, a)" ,
28
27
{
29
28
"a" : res ,
30
29
"b" : xx .artificial_surface .data ,
31
- "c" : urban_mask ,
32
30
},
33
31
name = "mark_urban" ,
34
32
dtype = "float32" ,
35
33
** {"_u" : 210 },
36
34
)
37
35
36
+ # Enforce non-urban mask area to be n/artificial (216)
37
+
38
+ res = expr_eval (
39
+ "where((b<=0)&(a==_u), _nu, a)" ,
40
+ {
41
+ "a" : res ,
42
+ "b" : urban_mask ,
43
+ },
44
+ name = "mask_non_urban" ,
45
+ dtype = "float32" ,
46
+ ** {"_u" : 215 , "_nu" : 216 },
47
+ )
48
+
38
49
# Mark nodata to 255 in case any nan
39
50
res = expr_eval (
40
51
"where(a==a, a, nodata)" ,
You can’t perform that action at this time.
0 commit comments