halomod.tools.spline_integral

halomod.tools.spline_integral()[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 x if no explicit xmin is given.

Parameters
  • x – The co-ordinates of the integral

  • f – The integrand at x (same shape as x).

  • 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 xmin to xmax.

Return type

integral