|
fosanalysis
A framework to evaluate distributed fiber optic sensor data
|
Object to integrate a function \(y = f(x)\) given by discrete argument data \(x\) and associated values \(y\). More...
Public Member Functions | |
| __init__ (self, str interpolation="trapezoidal", *args, **kwargs) | |
| Constructs an Integrator object. | |
| np.array | antiderivative (self, np.array x_values, np.array y_values, float initial=0.0, str interpolation=None, *args, **kwargs) |
Calculates the antiderivative \(F(x) = \int f(x) dx + C\) to the given function over the given segment (indicated by start_index and end_index). | |
| float | integrate_segment (self, np.array x_values, np.array y_values, int start_index=None, int end_index=None, float initial=0.0, str interpolation=None, *args, **kwargs) |
Calculates integral over the given segment (indicated by start_index and end_index) \(F(x)|_{a}^{b} = \int_{a}^{b} f(x) dx + C\). | |
Public Member Functions inherited from fosanalysis.utils.base.Task | |
| __init__ (self, *args, **kwargs) | |
Public Member Functions inherited from fosanalysis.utils.base.Base | |
| __init__ (self, *args, **kwargs) | |
| Construct the object and warn about unused/unknown arguments. | |
Public Attributes | |
| interpolation = interpolation | |
| Algorithm, which should be used to interpolate between data points. | |
Object to integrate a function \(y = f(x)\) given by discrete argument data \(x\) and associated values \(y\).
Definition at line 13 of file integration.py.
| fosanalysis.utils.integration.Integrator.__init__ | ( | self, | |
| str | interpolation = "trapezoidal", | ||
| * | args, | ||
| ** | kwargs ) |
Constructs an Integrator object.
| interpolation | Algorithm, which should be used to interpolate between data points. For more, see interpolation. |
| *args | Additional positional arguments, will be passed to the superconstructor. |
| **kwargs | Additional keyword arguments, will be passed to the superconstructor. |
Definition at line 17 of file integration.py.
| np.array fosanalysis.utils.integration.Integrator.antiderivative | ( | self, | |
| np.array | x_values, | ||
| np.array | y_values, | ||
| float | initial = 0.0, | ||
| str | interpolation = None, | ||
| * | args, | ||
| ** | kwargs ) |
Calculates the antiderivative \(F(x) = \int f(x) dx + C\) to the given function over the given segment (indicated by start_index and end_index).
The given values are assumed to be preprocessed (NaNs are stripped already).
| x_values | List of x-positions \(x\). |
| y_values | List of y-values \(y\) matching \(x\). |
| initial | The interpolation constant \(C\). |
| interpolation | Algorithm, which should be used to interpolate between data points. Defaults to interpolation. For more, see interpolation. |
| *args | Additional positional arguments, will be passed to the called integration function. |
| **kwargs | Additional keyword arguments, will be passed to the called integration function. |
Definition at line 32 of file integration.py.
| float fosanalysis.utils.integration.Integrator.integrate_segment | ( | self, | |
| np.array | x_values, | ||
| np.array | y_values, | ||
| int | start_index = None, | ||
| int | end_index = None, | ||
| float | initial = 0.0, | ||
| str | interpolation = None, | ||
| * | args, | ||
| ** | kwargs ) |
Calculates integral over the given segment (indicated by start_index and end_index) \(F(x)|_{a}^{b} = \int_{a}^{b} f(x) dx + C\).
The given values are assumed to be preprocessed (NaNs are stripped already).
| x_values | List of x-positions \(x\). |
| y_values | List of y-values \(y\) matching \(x\). |
| start_index | Index, where the integration should start (index of \(a\)). Defaults to the first item of x_values (0). |
| end_index | Index, where the integration should stop (index of \(b\)). This index is included. Defaults to the first item of x_values (len(x_values) -1). |
| initial | The interpolation constant \(C\). |
| interpolation | Algorithm, which should be used to interpolate between data points. For more, see interpolation. |
| *args | Additional positional arguments, will be passed to the called integration function. |
| **kwargs | Additional keyword arguments, will be passed to the called integration function. |
Definition at line 54 of file integration.py.
| fosanalysis.utils.integration.Integrator.interpolation = interpolation |
Algorithm, which should be used to interpolate between data points.
Available options:
"trapezoidal": (default) Using the trapezoidal rule. integrate_segment() uses scipy.integrate.trapezoid. antiderivative() uses scipy.integrate.cumulative_trapezoid. Definition at line 31 of file integration.py.