[SciPy-user] spline interpolation

Jordan Dawe jdawe at eos.ubc.ca
Thu Nov 9 18:14:26 EST 2006


Robert Kern wrote:

Jordan Dawe wrote:

I've been looking at scipy's interpolation routines and I can't make
heads or tails of them.  I just want to do a spline interp1d like matlab
does.  Is there any way to do this?


I don't know exactly what features you want from Matlab's interp1d, but you
probably want scipy.interpolate.UnivariateSpline.

 I want a cubic spline fit that passes through every point it is fit to.  I
haven't been able to figure out how to make UnivariateSpline do this; it
goes near the points, but is not constrained to satisfy the points exactly.
Matlab does this by a series of piecewise spline interpolations that are
continuous in the first two derivatives at each data point.

Matlab's man page:

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/index.html?/access/helpdesk/help/techdoc/ref/interp1.html

I believe it is essentially implementing the cubic spline interpolation
algorithm from Numerical Recipes:

http://www.nrbook.com/a/bookcpdf/c3-3.pdf

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20061109/3f347c24/attachment.html>


More information about the SciPy-User mailing list