[SciPy-User] Quick interpolation question

Jose Gomez-Dans jgomezdans at gmail.com
Mon Apr 4 14:59:22 EDT 2011


Hi,

I just want to interpolate, in the simplest possible terms, a 3D dataset.
Linear interpolation, nearest neighbour, all that would suffice (this is to
start off some algorithm, so no accurate estimate is required). In new scipy
versions, things like griddata would be useful, but currently I only have
scipy 0.8. So I have a "cube" (data[:,:,:], (NixNjxNk)) array, and an array
of flags (flags[:,:,:,], True or False) of the same size. I want to
interpolate my data for the elements of data where the corresponding element
of  flag is False, using eg the nearest valid datapoint in data, or some
linear combination of "close by" points.

I sort of think that map_coordinates would work, but I would need to filter
data, and recalculate all the locations, so not efficient. Other ideas are
to use np.interp1d and do it dimension by dimension. Would work, but clumsy.

In essence, what I need is some "gapfilling" simple multi-dimensional
interpolation that works fast (Ni, Nj and Nk are pretty large, >500 each).
Any suggestions?
Thanks!

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20110404/896591b6/attachment.html>


More information about the SciPy-User mailing list