Cloud and water mask out

Hello. I am trying to do this same process to make cloud and water out.

But It has error with “)”
Although I wrote same everything

Maybe it works if you add a space between or and $5.cloud_mask_Post at the beginning of the second line.

unfortunately It is not solution

if multiple products of same extent and pixel size are loaded in SNAP, they can be jointly used in the band maths. The $5 indicates that you are working on product #5 (you probably know that).

I remember that this caused problems in my band maths as well. Maybe the expression works if you remove all other products from SNAP so that only the used one remains.

Same thing:disappointed:

I removed all product and opened only product 5

How about switching from 0.0 to simply 0?

I think the or in
IF w or x THEN y ELSE z
could make trouble.
Can you split it in a nested condition?
IF w then y ELSE (IF x THEN y ELSE z)

Like this?

this works for me

It is interesting. What do you think why software is doing like this. We both are using same process in the same software

Which version of SNAP do you use?
For me, it is working too. Okay, I use a different product but in general, the expression is the same.
Have you tried with a different product?

I use Snap 6.0.7. Yes I tried other product but same thing happened again. In your image at the left you chose show mask. But I cannot chose it, it isn’t working in my snap in this process. May it be solution problem?

It could be you can’t select this options because your product doesn’t have masks.
Maybe you can provide me one product so I can check what’s wrong.
I’ll send a separate private message.

I sent product to you

I’ve used exactly the same expression
Here in textual form. Maybe you try to copy it and past it in the expression editor.

if (cloud_mask_Pre > 0 or cloud_mask_Post > 0 or ((B3_Pre 
- B8_Pre)/(B3_Post + B8_Post))>= 0.0) then 1 else 0

But I couldn’t test it till the end and generate an image, because you haven’t provided the data directory which belongs to the product.
But at least the expression is accepted.


Thank you soo much. It is working. I am very happy. It is interesting, although textual form is same, process now is working. Now there is no errors. I just copy and pasted

Where are you from? Which local have you set for your operating system?
Maybe the is one sign which looks similar to another one.
Maybe, by your keyboard settings, you don’t get e.g. a minus but something which looks like a minus. Just a weird example.

I am from Azerbaijan. I use windows operating system. Anyway problem was solved:) Thank you again