I am trying to add a CWIM mask using scl mask with Band Math in an existing Graph. I’m not sure why it won’t work. here is the expression,
Here is the full error.
I am trying to add a CWIM mask using scl mask with Band Math in an existing Graph. I’m not sure why it won’t work. here is the expression,
Here is the full error.
I just tried on an original S2 L2A product. It works
What processing steps do you apply before the Band Maths. Maybe this breaks it.
I was editing an existing graph xml. This is the original.
Then I wanted to add the CWIM Band math as in the Original post
What do you think?
It should work. The resampling should not break it.
I think there is either in the BandMaths GUI or in the operator an error.
The dev team should further investigate.
However, you can try this expression. I think this is doing what you actually want (If one of the masks is on the zero otherwise one).
Your version should actually work too.
if (scl_topographic_and_casted_shadows || scl_cloud_shadow || scl_cloud_medium_proba || scl_thin_cirrus || scl_cloud_high_proba
|| scl_snow_ice || scl_water) then 0 else 1
Masks are actually boolean, but are converted to 255 or zero. This conversion is probably not correctly considered somewhere.
Here the original expression for the devs:
if (scl_topographic_and_casted_shadows + scl_cloud_shadow +
scl_cloud_medium_proba + scl_thin_cirrus + scl_cloud_high_proba
+ scl_snow_ice + scl_water) < 255 then 0 else 1