fosanalysis
A framework to evaluate distributed fiber optic sensor data
Loading...
Searching...
No Matches
fosanalysis.utils.integration.Integrator Class Reference

Object to integrate a function \(y = f(x)\) given by discrete argument data \(x\) and associated values \(y\). More...

Inheritance diagram for fosanalysis.utils.integration.Integrator:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

fosanalysis.utils.integration.Integrator.__init__ ( self,
str interpolation = "trapezoidal",
* args,
** kwargs )

Constructs an Integrator object.

Parameters
interpolationAlgorithm, which should be used to interpolate between data points. For more, see interpolation.
*argsAdditional positional arguments, will be passed to the superconstructor.
**kwargsAdditional keyword arguments, will be passed to the superconstructor.

Definition at line 17 of file integration.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ antiderivative()

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).

Parameters
x_valuesList of x-positions \(x\).
y_valuesList of y-values \(y\) matching \(x\).
initialThe interpolation constant \(C\).
interpolationAlgorithm, which should be used to interpolate between data points. Defaults to interpolation. For more, see interpolation.
*argsAdditional positional arguments, will be passed to the called integration function.
**kwargsAdditional keyword arguments, will be passed to the called integration function.

Definition at line 32 of file integration.py.

◆ integrate_segment()

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).

Parameters
x_valuesList of x-positions \(x\).
y_valuesList of y-values \(y\) matching \(x\).
start_indexIndex, where the integration should start (index of \(a\)). Defaults to the first item of x_values (0).
end_indexIndex, where the integration should stop (index of \(b\)). This index is included. Defaults to the first item of x_values (len(x_values) -1).
initialThe interpolation constant \(C\).
interpolationAlgorithm, which should be used to interpolate between data points. For more, see interpolation.
*argsAdditional positional arguments, will be passed to the called integration function.
**kwargsAdditional keyword arguments, will be passed to the called integration function.

Definition at line 54 of file integration.py.

Member Data Documentation

◆ interpolation

fosanalysis.utils.integration.Integrator.interpolation = interpolation

Algorithm, which should be used to interpolate between data points.

Available options:

Definition at line 31 of file integration.py.


The documentation for this class was generated from the following file: