I am currently programming a python operator for snap.
In the method “computeTileStack” I get the data from the bands in tiles (getSourceTile) and read the samples (getSamplesFloat) from there. I convert this to a numpy array for convenience. This is working fine.
Additionally, I need the latitude and longitude values for each pixel (needed for lookup in a lookup table). So I would like to have a numpy array of the same size as the samples array with the latitute data and one with the longitute data.
My first try was to use a bandmath expression to add a new band to the source product that contains this information (expression = ‘LAT’ or ‘LON’). Then I also can use getSourceTile and so on. But these additional bands should not be added to the source or target product. Is there another way to get this information without creating new bands?
Thanks for any tipps.