[SciPy-Dev] Bivariate interpolation and NaN

Ole Nielsen ole.moller.nielsen@gmail....
Fri Jun 10 01:26:01 CDT 2011


Dear Scipy developers

I am working on a project where we need to interpolate from gridded data to
individual points.
We want it to be fast, bilinear (i.e. smooting is not important) and be able
to deal with NaN in a sensible way.

I looked at a few and settled for RectBivariateSpline which is part of
scipy.interpolate.
It works well but, we have encountered two problems:

   1. If there is a single NaN in the grid, all interpolated points become
   NaN even if the surrounding pixels are valid floating point numbers. I would
   have expected NaNs only for points whose immediate neighbours contain NaN.
   2. We have noticed small 'overshoots', i.e. interpolated values may be
   outside the range of the gridded data. Can anyone tell me if this is
   expected?

I am interested in thoughts on whether it is possible to achieve this. If
there is a need to reproduce my observations, I can provide that.

Cheers and thanks
Ole Nielsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20110610/0c475125/attachment.html 


More information about the SciPy-Dev mailing list