halomod.tools.spline_integral¶
- halomod.tools.spline_integral(x: ndarray, f: ndarray, xmin: [None, <class 'float'>]=None, xmax: [None, <class 'float'>]=None, log: bool = True) float[source]¶
Perform an integral using a spline function over a vector of data.
The purpose of this function is to do robust integration when the bounds of integration don’t necessarily fall on a particular x co-ordinate. It falls back to integrating over all
xif no explicitxminis given.- Parameters:
x – The co-ordinates of the integral
f – The integrand at
x(same shape asx).xmin – The lower bound of the integral.
xmax – The upper bound of the integral.
log – Whether to interpolate the integrand in log space.
- Returns:
The integral from
xmintoxmax.- Return type:
integral