salvus.toolbox.helpers.interpolate
Interpolation helpers.
Functions
monotonic_cubic_hermite_spline()
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
xnumpy.ndarray — X location of spline anchor points.ynumpy.ndarray — Y values of spline anchor points.xinumpy.ndarray — X values to interpolate at.
Returns numpy.ndarray — The interpolated values at xi.