fosanalysis
A framework to evaluate distributed fiber optic sensor data
Loading...
Searching...
No Matches
fosanalysis.preprocessing.base.Task Class Reference

Abstract base class for preprocessing task classes. More...

Inheritance diagram for fosanalysis.preprocessing.base.Task:

Public Member Functions

 __init__ (self, str timespace="1d_space", *args, **kwargs)
 Construct an instance of the class.
 
tuple run (self, np.array x=None, np.array y=None, np.array z=None, bool make_copy=True, str timespace=None, *args, **kwargs)
 Each preprocessing.Task object has a run() method.
 
- Public Member Functions inherited from fosanalysis.preprocessing.base.Base
 __init__ (self, *args, **kwargs)
 Construct an instance of the class.
 
- 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

 timespace = timespace
 Indicator, which approach is used for operations on a 2d array.
 

Protected Member Functions

tuple _map_2d (self, np.array x, np.array y, np.array z, str timespace=None, *args, **kwargs)
 Apply the 1D operation along either the space or time timespace.
 
tuple _run_1d (self, np.array x, np.array z, *args, **kwargs)
 Reimplementations describe a one-dimensional operation.
 
tuple _run_2d (self, np.array x, np.array y, np.array z, *args, **kwargs)
 Native two-dimensional operation implementation.
 

Detailed Description

Abstract base class for preprocessing task classes.

Definition at line 56 of file base.py.

Constructor & Destructor Documentation

◆ __init__()

fosanalysis.preprocessing.base.Task.__init__ ( self,
str timespace = "1d_space",
* args,
** kwargs )

Construct an instance of the class.

As this is an abstract class, it may not be instantiated directly itself.

Parameters
timespaceIndicator, which approach is used for operations on a 2d array. For more, see timespace.
*argsAdditional positional arguments, will be passed to the superconstructor.
**kwargsAdditional keyword arguments, will be passed to the superconstructor.

Definition at line 60 of file base.py.

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

Member Function Documentation

◆ _map_2d()

tuple fosanalysis.preprocessing.base.Task._map_2d ( self,
np.array x,
np.array y,
np.array z,
str timespace = None,
* args,
** kwargs )
protected

Apply the 1D operation along either the space or time timespace.

Used for carrying out 1D-only algorithms on a 2D array row- or column-wise.

Parameters
xArray of measuring point positions.
yArray of time stamps.
zArray of strain data in accordance to x and y.
timespaceIndicator, which approach is used for operations on a 2d array. For more, see timespace. Defaults to timespace.
*argsAdditional positional arguments to customize the behaviour. Will be passed to the chosen method to call.
**kwargsAdditional keyword arguments to customize the behaviour. Will be passed to the chosen method to call.
Returns
Returns a tuple like (x, y, z). They correspond to the input variables of the same name. Each of those might be changed.

Definition at line 203 of file base.py.

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

◆ _run_1d()

tuple fosanalysis.preprocessing.base.Task._run_1d ( self,
np.array x,
np.array z,
* args,
** kwargs )
protected

Reimplementations describe a one-dimensional operation.

This operation might be applied to on a 2D array by _map_2d(). This function is called, if:

  • the z is 1D or
  • timespace is set to "1d_space" or "1d_time".
    Parameters
    xArray of coordinate positions. Dependent on timespace it may hold:
    • x: sensor coordinates, (timespace = "1d_space")
    • y: time data (timespace = "1d_time")
    • indices, if none of both previous options match the z's shape.
    zArray of strain data in accordance to x and y.
    *argsAdditional positional arguments to customize the behaviour.
    **kwargsAdditional keyword arguments to customize the behaviour.
    Returns
    Returns a tuple like (x, z). They correspond to the input variables of the same name. Each of those might be changed.

Reimplemented in fosanalysis.preprocessing.filtering.Cluster, fosanalysis.preprocessing.filtering.Limit, fosanalysis.preprocessing.filtering.SlidingFilter, fosanalysis.preprocessing.repair.ScipyInterpolation1D, and fosanalysis.preprocessing.resizing.Resampler.

Definition at line 161 of file base.py.

Here is the caller graph for this function:

◆ _run_2d()

tuple fosanalysis.preprocessing.base.Task._run_2d ( self,
np.array x,
np.array y,
np.array z,
* args,
** kwargs )
protected

Native two-dimensional operation implementation.

Needs to be reimplemented by sub-classes. This function is only called, if z is 2D and timespace is "2D".

Parameters
xArray of measuring point positions.
yArray of time stamps.
zArray of strain data in accordance to x and y.
*argsAdditional positional arguments to customize the behaviour.
**kwargsAdditional keyword arguments to customize the behaviour.
Returns
Returns a tuple like (x, y, z). They correspond to the input variables of the same name. Each of those might be changed.

Reimplemented in fosanalysis.preprocessing.filtering.Cluster, fosanalysis.preprocessing.filtering.Limit, fosanalysis.preprocessing.filtering.SlidingFilter, fosanalysis.preprocessing.repair.ScipyInterpolation1D, and fosanalysis.preprocessing.resizing.Resampler.

Definition at line 184 of file base.py.

Here is the caller graph for this function:

◆ run()

tuple fosanalysis.preprocessing.base.Task.run ( self,
np.array x = None,
np.array y = None,
np.array z = None,
bool make_copy = True,
str timespace = None,
* args,
** kwargs )

Each preprocessing.Task object has a run() method.

The actual operations are reimplemented in _run_1d() and _run_2d(). This method decides based on the argument, how is operated over the data. If z is a 1D array, the array to pass to _run_1d() is determined:

  1. Use x as the coordinate data, if it matches the shape of z.
  2. Use y as the coordinate data, if it matches the shape of z.
  3. Generate an array with indices of the shape of z.

If z is a 2D array, three option are available, based on timespace: Available options:

  • "2D": Use the native 2D implementation.
  • "1d_space": Use the native 1D implementation, in the space domain. This is repeated for each time stamp in the measurement campaign. An iteration step processes a complete reading of sensor length.
  • "1d_time": Use the native 1D implementation, in the time domain. This is repeated for each gage location along the sensor. An iteration step processes a time series for a sensor position.
Parameters
xArray of measuring point positions.
yArray of time stamps.
zArray of strain data in accordance to x and y.
timespaceIndicator, which approach is used for operations on a 2d array. For more, see timespace. Defaults to timespace.
make_copySwitch, whether a deepcopy of the passed data should be done. Defaults to True.
*argsAdditional positional arguments to customize the behaviour. Will be passed to the chosen method to call.
**kwargsAdditional keyword arguments to customize the behaviour. Will be passed to the chosen method to call.
Returns
Returns a tuple like (x, y, z). They correspond to the input variables of the same name. Each of those might be changed.

Reimplemented from fosanalysis.preprocessing.base.Base.

Reimplemented in fosanalysis.preprocessing.filtering.Limit, fosanalysis.preprocessing.filtering.SlidingFilter, and fosanalysis.preprocessing.repair.ScipyInterpolation1D.

Definition at line 81 of file base.py.

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

Member Data Documentation

◆ timespace

fosanalysis.preprocessing.base.Task.timespace = timespace

Indicator, which approach is used for operations on a 2d array.

Available options:

  • "2D": Use the native 2D implementation.
  • "1d_space": Use the native 1D implementation, in the space domain. This is repeated for each time stamp in the measurement campaign. An iteration step processes a complete reading of sensor length.
  • "1d_time": Use the native 1D implementation, in the time domain. This is repeated for each gage location along the sensor. An iteration step processes a time series for a sensor position.

Definition at line 80 of file base.py.


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