Fix half pixel offset for point probing #319
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.