Extrapolation
The 1D interpolation methods now support extrapolation using these methods:
Constant
: Set all points outside the range of the interpolator toextrapValue
.Edge
: Use the value of the left/right edge.Linear
: Uses linear extrapolation using the two points closest to the edge.Native
(default): Uses the native method of the interpolator to extrapolate. For Linear1D it will be a linear extrapolation, and for Cubic and Hermite splines it will be cubic extrapolation.Error
: Raises anValueError
ifx
is outside the range.
These are passed in as an argument to eval
and derivEval
:
let valEdge = interp.eval(x, Edge)
let valConstant = interp.eval(x, Constant, NaN)