interpax.CubicHermiteSpline

class interpax.CubicHermiteSpline(x: Real[Array, 'n'] | Real[ndarray, 'n'], y: Num[Array, 'n ...'] | Num[ndarray, 'n ...'], dydx: Num[Array, 'n ...'] | Num[ndarray, 'n ...'], axis: int = 0, extrapolate: bool | str | None = None, check: bool = True)Source

Piecewise-cubic interpolator matching values and first derivatives.

The result is represented as a PPoly instance.

Parameters:
  • x (array_like, shape (n,)) – 1-D array containing values of the independent variable. Values must be real, finite and in strictly increasing order.

  • y (array_like) – Array containing values of the dependent variable. It can have arbitrary number of dimensions, but the length along axis (see below) must match the length of x. Values must be finite.

  • dydx (array_like) – Array containing derivatives of the dependent variable. It can have arbitrary number of dimensions, but the length along axis (see below) must match the length of x. Values must be finite.

  • axis (int, optional) – Axis along which y is assumed to be varying. Meaning that for x[i] the corresponding values are np.take(y, i, axis=axis). Default is 0.

  • extrapolate ({bool, 'periodic', None}, optional) – If bool, determines whether to extrapolate to out-of-bounds points based on first and last intervals, or to return NaNs. If ‘periodic’, periodic extrapolation is used. If None (default), it is set to True.

  • check (bool) – Whether to perform checks on the input. Should be False if used under JIT.

See also

Akima1DInterpolator

Akima 1D interpolator.

PchipInterpolator

PCHIP 1-D monotonic cubic interpolator.

CubicSpline

Cubic spline data interpolator.

PPoly

Piecewise polynomial in terms of coefficients and breakpoints

Methods

__call__(x[, nu, extrapolate])

Evaluate the piecewise polynomial or its derivative.

antiderivative([nu])

Construct a new piecewise polynomial representing the antiderivative.

construct_fast(c, x[, extrapolate, axis])

Construct the piecewise polynomial without making checks.

derivative([nu])

Construct a new piecewise polynomial representing the derivative.

extend(c, x[, right])

Not currently implemented.

from_bernstein_basis(bp[, extrapolate])

Not currently implemented.

from_spline(tck[, extrapolate])

Not currently implemented.

integrate(a, b[, extrapolate])

Compute a definite integral over a piecewise polynomial.

roots([discontinuity, extrapolate])

Not currently implemented.

solve([y, discontinuity, extrapolate])

Not currently implemented.

Attributes

axis

Axis along which to interpolate.

c

Array of spline coefficients, shape(order, knots-1, ...).

extrapolate

Whether to extrapolate beyond domain of known values.

x

Array of knot values, shape(knots).