Hi there,
I’m using bandmath expression to get the information about LAT and LON and add them as bands in a product.
My problem is that the operator seems to work well until a point where (don’t know for which reason) the pixels get assigned to the same value.
Here is my code:
BandDescriptor = jpy.get_type('org.esa.snap.core.gpf.common.BandMathsOp$BandDescriptor')
lat = BandDescriptor()
lat.name = 'Latitude'
lat.type = 'float64'
lat.expression = 'LAT'
newBand = jpy.array('org.esa.snap.core.gpf.common.BandMathsOp$BandDescriptor', 1)
newBand[0] = lat
parameters = HashMap()
parameters.put('targetBands', newBands)
prod = GPF.createProduct('BandMaths', parameters, source)
If I plot the pixel values of the ‘Latitude’ band inside prod I get the following results:
As can be seen, in the bottom area the pixels are all of the same value (41.31)
If I try doing the process on the same image through Band Maths operator in SNAP GUI, I get the correct output:
What is wrong with my BandMaths procedure for getting LAT value? Is there a wat to get the correct values through snappy?
Thank you!
Kind regards,
Davide