ssec / sift

A visualization application for satellite imagery
http://sift.ssec.wisc.edu/
GNU General Public License v3.0
48 stars 14 forks source link

Fix half pixel offset for point probing #319

Closed djhoese closed 3 years ago

djhoese commented 3 years ago

Cherry-pick'd from EUMETSAT GitLab.

Original commit description

The conversion from picking coordinates to geographic coordinates (longitude/latitude), reprojection to grid coordinates and finally to grid indices performs 'round()' in the very last step.

This seems to be responsible for the half pixel offset as replacing that by 'floor()' generates grid indices which do not show this half pixel offset.

TODO: It has to be verified in the future, whether this fix is the right one once the coordinate setup has been revised - now the display and the picking matchi but the display itself still has a half pixel shift: MSG grid point 1856, 1856 is not centered on the Nadir (0 deg E, 0 deg N), but its upper left corner.