[SciPy-User] interpolate.bispl{rep, ev} need some love, or I'm using them incorrectly...

Kurt Smith kwmsmith@gmail....
Thu Mar 4 16:30:11 CST 2010


On Thu, Mar 4, 2010 at 4:10 PM,  <josef.pktd@gmail.com> wrote:
> On Thu, Mar 4, 2010 at 4:47 PM, Kurt Smith <kwmsmith@gmail.com> wrote:
>> I've been trying to get interpolation working on a not-too-large array
>> (512 X 512) using interpolate.interp2d, which is a nice wrapper for
>> interpolate.bispl{rep,ev}.  Apparently these routines are meant to
>> work on smallish arrays (~ 50 X 50) and give me a segfault when I hand
>> them anything about (200 X 200) or so.  When they do work, they're
>> prohibitively slow.
>>
>> My question is:  what is the usecase for these bivariate spline
>> routines?  I've discovered ndimage.spline_filter and
>> ndimage.map_coordinates -- these fit my purposes much better; fast and
>> nice interface.  What is the difference between the two approaches?
>
> >From the docs, I think, bispl is a true 2dim spline, while
> ndimage.spline_filter is a sequence of 1d filter applied along each
> axis.
>
> For function approximation  200*200=40000  is a large number of points
> For  z = f(x,y) I wouldn't usually get as many observations as in an
> image, and the number of knot points might be required to be smallish.
>
> I don't know anything about the c or fortran internals of either of them.

Thanks.

It looks like interpolate.bisplrep is suitable for irregularly spaced
data, whereas ndimage.spline_filter & map_coordinates require gridded
data (naturally, since they're used on image-like data).


>
> Josef
>


More information about the SciPy-User mailing list