Band Maths with sources from different products

I’d like to take the difference between the same band in two different products using the Snap GUI, but can’t figure out what band-maths expression to use. Based on the advice in this thread and the documentation on the BandMaths operator I’ve tried all of

B1 - $sourceProduct.1.B1
B1 - $sourceProduct1.B1
B1 - $sourceProducts.1.B1
B1 - $sourceProducts1.B1

but all of them give the same “Undefined symbol” error. I’m sure I’m one daft error away from getting this right. Any help would be much appreciated.

In the GUI you should be able to just click on the first band (of the first product) then type “-” (or whatever mathematical operator you need) and then click on the second band (of the second product), so that proper names will appear in the expression editor.

The GUI only shows one copy of each band. I’ve just got a list with B1, B2, etc., without any designation of which product each one is from.

It seems that your products are not compatible.
To use the Band Maths they must have the same width and height.

If they are compatible you can choose at the top of the expression editor between both or more products.

After switching there between the products the bands of the other product are shown with the reference ID as prefix.

1 Like

Thank you Marco, that solved my problem.

Hi. Can u tell me which version of SNAP has been used for this? In my SNAP 3.0 version on the window of Band math expression editor, the product selection tab doesn’t appear.

The latest version is version 6. Plus some updates. So you are far behind. I suggest that you update.
However, in general, the product selection should also work in version 3.
The products need to have the same size (width, height).

Thanks. The stacked image and version 6 gave me that option. Thanks a lot.