spectrochempy.trapezoid๏ƒ

trapezoid(dataset, **kwargs)[source]๏ƒ

Integrate using the composite trapezoidal rule.

Wrapper of scipy.integrate.trapezoid.

Performs the integration along the last or given dimension.

Parameters
  • dataset (NDDataset) โ€“ Dataset to be integrated.

  • **kwargs โ€“ Additional keywords parameters. See Other Parameters.

Returns

NDDataset โ€“ Definite integral as approximated by trapezoidal rule.

Other Parameters

dim (int or str, optional, default: "x") โ€“ Dimension along which to integrate. If an integer is provided, it is equivalent to the numpy axis parameter for numpy.ndarray.

See also

simpson

Integrate using the composite simpson rule.

Example

>>> dataset = scp.read('irdata/nh4y-activation.spg')
>>> dataset[:,1250.:1800.].trapezoid()
NDDataset: [float64] a.u..cm^-1 (size: 55)