Resampling#
Module with routines for data and curve resampling and smoothing based on splines.
- resample(curve, n_points=None, smooth=0, periodic=False, derivative=0, order=5, iterations=1)[source]#
Resample a curve using equidistant points along a curve.
Arguments
- curvemxd array
Coordinates for the reference points of the curve.
- n_pointsint
Number of equidistant points to evaluate the curve on.
- smoothint or float
Smoothness factor.
- periodicbool
If True, assume the curve is a closed loop.
- derivativeint
If > 0, return the n-th derivative of the curve.
- orderint
The spline order to use to interpolate the curve.
- iterationsint
Iterate the resampling process this amount of time.
Returns
- curvenxd array
Resampled curve along n_points equidistant points.
- resample_1d(data, n_points=None, smooth=0, periodic=False, derivative=0, order=5, iterations=0)[source]#
Resample 1d data using n equidistant points
Arguments
- curvemxd array
Coordinates for the reference points of the curve.
- n_pointsint
Number of equidistant points to evaluate the curve on.
- smoothint or float
Smoothness factor.
- periodicbool
If True, assume the curve is a closed loop.
- derivativeint
If > 0, return the n-th derivative of the curve.
- orderint
The spline order to use to interpolate the curve.
- iterationsint
Iterate the resampling process this amount of time.
Returns
- curvenxd array
Resampled curve along n_points equidistant points.
- resample_nd(curve, n_points=None, smooth=0, periodic=False, derivative=0, order=5, iterations=1)[source]#
Resample n points using n equidistant points along a curve
Arguments
- curvemxd array
Coordinates for the reference points of the curve.
- n_pointsint
Number of equidistant points to evaluate the curve on.
- smoothint or float
Smoothness factor.
- periodicbool
If True, assume the curve is a closed loop.
- derivativeint
If > 0, return the n-th derivative of the curve.
- orderint
The spline order to use to interpolate the curve.
- iterationsint
Iterate the resampling process this amount of time.
Returns
- curvenxd array
Resampled curve along n_points equidistant points.