Pixel shift PLIA

I have recently implemented the computation of the projected local incidence angle based on a DEM and an orbit file in Python. I mainly followed the Java implementation in SNAP. The outcome looks good, but a pixel shift (southeast <-> northwest) seems to be present (using the same external DEM and gravity model). I have checked my code often, but I can’t find any issue, which could cause this problem. The computation can be compared with computing a hillshade, therefore I applied a hillshading on the DEM using QGIS. Surprisingly, the outcome of the Python package fits very well with the hillshade, but not with the one from SNAP. Is this comparison via a hillshade even allowed? Is there any possibility to debug the Java code of SNAP to see at which point both depart?
Please download and compare the images below:

PLIA_90m_Py.tif (298.3 KB)
PLIA_90m_Snap.tif (298.3 KB)

Any advice/help would be very welcome.
Thank you in advance!

PS: I am using SNAP 6.0. Please let me know if you need further information or data files.

I was not allowed to put a third image into the post, please find the shading below:

shading.tif (298.3 KB)

Please check that the definition of the pixel location is identical - is 0,0 at the centre of the 1st pixel or in the upper left corner for example?

Each pixel center corresponds to a latitude, longitude and height value. Which means that indexing the array at (0,0) will return the coordinates at the pixel location (0.5, 0.5). But Snap should do the same, doesn’t it?

Thanks for your help, @mengdahl!
The issue was indeed a different definition of the origin within the Geotiff tags, which resulted in this 1/2 pixel shift.

@claxn @mengdahl did you work out whether SNAP gives the coordinates of the pixel center or top left for its lat-long grids and orthorectifiedLat orthorectifiedLon bands?

SNAP coordinates should be for the centre of the pixel.

1 Like

great, thank you!