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:
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?