Raster calculation



I am programming a little tool for change detection in forests.
I am using two indices. After indices differencing of each index, I want to combine the results(intersect them).
I want to calculate a range for areas where I know from ground-truthing that a change occurred, for both indices.
After that, all the values in that range are set to one and the rest is zero.
The last step is to add the two images. All pixels with a value of two are classified as change.
I want to use band maths for that task but it is not working the same way as in the desktop application.
Has anyone an Idea how to solve my problem with snappy.

Thank you all for anykind of help


I could probably handle it in arcgis where I am more familiar with this process.
But I am also interested how is it possible in SNAP…