-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define consistent nodata propagation for interp_points
and allow to return interpolator
#560
Conversation
…erpolator return option
…d add a lot of tests
interp_points
and re-structureinterp_points
and allow to return interpolator
This PR is finalized, and ready for review! 😄 @adehecq @erikmannerfelt @atedstone We now have a fully consistent point interpolation with all benefits and (normally) none of the limitations of existing implementations:
All the tests allow to check the robustness of the implementation:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few comments, but otherwise looking good to me!
Thanks! 🙌
Most of the line changes in this PR are due to re-structuring, moving out functions of the
Raster
class (see #539, in preparation for #383) into their own module, here only those linked tointerp_points
.This PR also adds a nodata propagation scheme (as
scipy.interpolate.interpn
does not support nodata propagation natively except for methods "nearest" and "linear") and allows to return an interpolator that contains this nodata propagation (to optimize speed of iterative methods calling the same interpolator several times, such as DEM coregistration).It turned out that interpolation of
map_coordinates
with splines of order 3/5 does not match "cubic" or "quintic" ininterpn
, only order 0/1 do match for "nearest" and "linear", so all other are dropped. The nodata propagation and accuracy of results for values near the edge of NaNs is now tested thoroughly! 😄Resolves #559
Starts addressing #539 for functions related to
interp_points
TO-DO:
return_interpolator
,interpn
,