Mosaicing with Snappy - adding conditions

I am trying to mosaic using snappy with some conditions - I would like the final mosaic to have a cloud and land mask applied. So I am adding a condition to my mosaic that reads:

Conds=jpy.array('org.esa.snap.core.gpf.common.MosaicOp$Condition',1)
Conds[0]=Condition("cloud_land_mask","not cln_cloudy and notc ln_land", "false")

Before I am able to put this as a parameter for the mosaic I get the error:
RuntimeError: no matching Java method overloads found regarding the Conds[0] line.

Would anybody be able to help me with this?

Thanks!

You wrote the third argument (named output) of the constructor as a string, like so: "false"

However, the Condition class requires the output argument to be a boolean (True or False), as you can verify here. Further, in your expression (the second argument), after the and operator, you wrote “notc ln_land”. As far as I’m aware, “notc” is not a valid operator; did you mean “not cln_land”?

Putting it all together you get:

Conds[0]=Condition("cloud_land_mask","not cln_cloudy and not cln_land", False)

1 Like