halotools.empirical_models.custom_spline(table_abscissa, table_ordinates, **kwargs)[source]

Convenience wrapper around InterpolatedUnivariateSpline, written specifically to handle the edge case of a spline table being built from a single point.


abscissa values defining the interpolation


ordinate values defining the interpolation

kint, optional

Degree of the desired spline interpolation. Default is 1.


Function object to use to evaluate the interpolation of the input table_abscissa & table_ordinates


Only differs from UnivariateSpline in two respects. First, the degree of the spline interpolation is automatically chosen to be the maximum allowable degree permitted by the number of abscissa points. Second, the behavior differs for the case where the input tables have only a single element. In this case, the default behavior of the scipy function is to raise an exception. The custom_spline instead returns a constant-valued function where the returned value is simply the scalar value of the input ordinates.