scipp.scipy.integrate.trapezoid#

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

Integrate data array along the given dimension with the composite trapezoidal rule.

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

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 trapezoid
>>> trapezoid(da, 'x')
<scipp.DataArray>
Dimensions: Sizes[]
Data:
                            float64            [m^3]  ()  0.0217094