[SciPy-dev] interp2d and sandbox/delaunay

John Travers jtravs at gmail.com
Mon Oct 16 11:29:15 CDT 2006


Hi Travis, and others,

On 12/10/06, Travis Oliphant <oliphant at ee.byu.edu> wrote:
> John Travers wrote:
> >As previously stated, I think it needs to be reorganised/split into
> >several parts, but I'll leave that to other threads.
> >
> >In this post I'm wondering about the status of interp2d.
> >
> >
> interp2d is not at all what it should be.

While thinking about this problem I have had a few ideas that might be
worth considering.
Interp2d is used for _interpolation_ of data. It comes to mind that
most people (esp with scattered data) really want smoothing (closely
fitting a smoothing surface) to their data. Maybe we should provide a
function smooth2d or fit2d which does this using surfit (which
although, as I've said, is very bad for interpolation, is actually
very good for smoothing). This would effectively be the original
interp2d but with the smoothing factor s > 0 (0 is for the ill advised
interpolation).

> >I have recently implemented netlib->dierckx->regrid. Which
> >interpolates nicely for regular rectangular grids -> this could be
> >used in interp2d, except that it doesn't work on scattered data (is
> >this required? I think so yes).
> >
> Yes, interp2d should work on scattered data, I think.

OK, we have a patch waiting for putting regrid into interp2d. The
delaunay code in the sandbox looks like it is fine for the scattered
data. So our new interp2d should call regrid for regular data, and use
natural neighbour interpolation from delaunay for scattered data. I
can submit a patch for this, but we need delaunay out of sandbox for
this to work. (and it means interpolate will depend on another
module).

Speaking about the current module setup, we should really actually
have a scipy.approximation.spline (contents of fitpack, currently in
interpolate) module. At the moment it is just confusing (calling
scipy.interpolate.fitpack2.SmoothBivariateSpline for smoothing and not
interpolation???)  then we could also have
scipy.approximate.smooth2d() and leave scipy.interpolate with interp1d
etc.

Anybody have any comments on this? Is delaunay ready to be moved, how
about the module reorganisation (would break api).

Best regards,
John


More information about the Scipy-dev mailing list