scipp.scipy.integrate.simpson#

scipp.scipy.integrate.simpson(da, dim, **kwargs)#

Integrate data array along the given dimension with the composite Simpson’s rule.

This is a wrapper around scipy.integrate.simpson().

Examples: :rtype: DataArray

>>> x = sc.geomspace(dim='x', start=0.1, stop=0.4, num=4, unit='m')
>>> da = sc.DataArray(x*x, coords={'x': x})
>>> from scipp.scipy.integrate import simpson
>>> simpson(da, 'x')
<scipp.DataArray>
Dimensions: Sizes[]
Data:
                            float64            [m^3]  ()  0.021