Mondaic

salvus.toolbox.helpers.interpolate

salvus.toolbox.helpers.interpolate salvus toolbox helpers interpolate

Interpolation helpers.

Functions

monotonic_cubic_hermite_spline()

def monotonic_cubic_hermite_spline(
    x: npt.NDArray, y: npt.NDArray, xi: npt.NDArray
) -> npt.NDArray: ...

Cubic interpolation that preserves monotonicity.

Implements the Fritsch-Carlson method from https://en.wikipedia.org/wiki/Monotone_cubic_interpolation.

Parameters
  • x npt.NDArray — X location of spline anchor points.
  • y npt.NDArray — Y values of spline anchor points.
  • xi npt.NDArray — X values to interpolate at.
Returns npt.NDArray — The interpolated values at xi.