Mondaic
This API reference is not for the latest stable Salvus version.

salvus.toolbox.helpers.interpolate

Interpolation helpers.

Functions

monotonic_cubic_hermite_spline()

def monotonic_cubic_hermite_spline(
    x: numpy.ndarray, y: numpy.ndarray, xi: numpy.ndarray
) -> numpy.ndarray:
    ...

Cubic interpolation that preserves monotonicity.

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

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