[SciPy-User] Spline Interpolation with non continuous data
Eric Carlson
ecarlson at eng.ua.edu
Mon Jun 24 16:44:34 EDT 2013
Hello,
pchip sometimes does wonders ("wonders"=="oscillation-free") on data
with piecewise continuous derivatives. Spline fits of degree 1 should
also work. OTOH, sometimes pchip makes little difference from regular
cubic splines, and in those cases the filtering may be your only option
import scipy.interpolate
from numpy import linspace
xdata = ...
ydata = ...
f_approx = scipy.interpolate.pchip(xdata,ydata)
####Now that you have continuous function, use it many ways,
### for example:
xeval = linspace(x_low, x_high, 201) #set evaluation points
yeval = f_approx(xeval)
Cheers,
Eric
On 6/22/2013 9:14 AM, Franz Engel wrote:
> Hi,
>
> I try to interpolated a spline throw a dataset (the record of a robot
> motion path). Usually it works really good, always when the robot drives
> without stops. But if the robot stops he moves a little bit backwards.
> If this happens I can’t use my “normal” method with the
> interpolate.UnivariateSpline-function(http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.UnivariateSpline.html),
> because the robot motion is not longer continuously. Does somebody has
> an idea which function could solve my problem? Or is there a good filter
> to reduce the redundant robot path. (the backwards path is only a little
> bit displaced relative to path without stops)
>
> Regards,
>
> Franz
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
More information about the SciPy-User
mailing list