halomod.halo_exclusion.cumsimps

halomod.halo_exclusion.cumsimps(func, dx)[source]

A very simplistic cumulative simpsons rule integrator. func is an array, h is the equal spacing. It is somewhat inaccurate in the first few bins, since we just truncate the integral, regardless of whether it is odd or even numbered.

Examples

>>> x = np.linspace(0,1,1001)
>>> y = np.sin(x)
>>> print cumsimps(y,0.001)/(1-np.cos(x))