Data.integrate¶
- Data.integrate(xcol=None, ycol=None, result=None, header=None, result_name=None, output='data', bounds=<function AnalysisMixin.<lambda>>, **kargs)¶
Integrate a column of data, optionally returning the cumulative integral.
- Parameters:
xcol (index) – The X data column index (or header)
ycol (index)
The Y data column index (or header)
- Keyword Arguments:
result (index or None) – Either a column index (or header) to overwrite with the cumulative data, or True to add a new column or None to not store the cumulative result.
result_name (str) – The metadata name for the final result
header (str) – The name of the header for the results column.
output (Str) – What to return - ‘data’ (default) - this object, ‘result’: final result
bounds (callable) – A function that evaluates for each row to determine if the data should be integrated over.
**kargs – Other keyword arguments are fed direct to the scipy.integrate.cumtrapz method
- Returns:
(
Stoner.Data
) – The newly modified Data object.
Note
This is a pass through to the scipy.integrate.cumtrapz routine which just uses trapezoidal integration. A better alternative would be to offer a variety of methods including simpson’s rule and interpolation of data. If xcol or ycol are not specified then the current values from the
Stoner.Core.DataFile.setas
attribute are used.