GlacioHack / xdem

Analysis of digital elevation models (DEMs)
https://xdem.readthedocs.io/
MIT License
122 stars 37 forks source link

Generalize `scipy.interpolate.RectBivariateSpline` into any regular grid interpolator in `NuthKaab` for consistent package-wide resampling #542

Open rhugonnet opened 4 weeks ago

rhugonnet commented 4 weeks ago

The scipy.interpolate.RectBivariateSpline interpolator is a special-case of regular grid interpolation (corresponding to scipy.interpn(method="splinef2d"), while our 2D point interpolation/resampling can use any other method of interpn ("linear" which is the default, "cubic", etc). We should keep using the interpolator directly for computational efficiency (instead of multiple calls of Raster.interp_points()), but generalize to any resampling method, with a consistent default ("linear" as elsewhere).

Opened https://github.com/GlacioHack/geoutils/issues/559 for this, and we should also add a config option for this!