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

Class for resampling one-dimensional or two-dimensional strain data. More...

Inheritance diagram for fosanalysis.preprocessing.resizing.Resampler:

Public Member Functions

 __init__ (self, np.array target_x=None, np.array target_time=None, str method=None, dict method_kwargs=None, str timespace="1d_space", *args, **kwargs)
 Construct a Resampler instance.
 
- Public Member Functions inherited from fosanalysis.preprocessing.base.Task
 __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

 method = method
 Name of the interpolation method used.
 
 method_kwargs = method_kwargs if method_kwargs is not None else {}
 Additional keyword arguments for the interpolation function.
 
 target_time = target_time
 Points in time, where strain values should be resampled.
 
 target_x = target_x
 Points in space, where strain values should be resampled.
 
- Public Attributes inherited from fosanalysis.preprocessing.base.Task
 timespace = timespace
 Indicator, which approach is used for operations on a 2d array.
 

Protected Member Functions

tuple _run_1d (self, np.array x, np.array z, *args, **kwargs)
 Resamples (by interpolating) one-dimensional data.
 
tuple _run_2d (self, np.array x, np.array y, np.array z, *args, **kwargs)
 Resample a strain array using both spatial and temporal coordinates.
 
- Protected Member Functions inherited from fosanalysis.preprocessing.base.Task
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.
 

Detailed Description

Class for resampling one-dimensional or two-dimensional strain data.

In contrast, to Downsampler, the target points are given in the respective dimensions (datetime.datetime objects in time; sensor coordinates in space) and irregular spacing along an axis is possible.

Definition at line 318 of file resizing.py.

Constructor & Destructor Documentation

◆ __init__()

fosanalysis.preprocessing.resizing.Resampler.__init__ ( self,
np.array target_x = None,
np.array target_time = None,
str method = None,
dict method_kwargs = None,
str timespace = "1d_space",
* args,
** kwargs )

Construct a Resampler instance.

Parameters
target_xPoints in space, where strain values should be resampled.
Parameters
target_timePoints in time, where strain values should be resampled.
Parameters
methodName of the interpolation method used.

For 1D operation, this is either a function object or a string representing a function name, which will be passed to fosanalysis.utils.interpolation.scipy_interpolate1d(), defaulting to "interp1d".

For 2D operation, use one of the options for the method keyword argument accepted by scipy.interpolate.interpn(), defaulting to "linear".

Parameters
method_kwargsAdditional keyword arguments for the interpolation function.
Parameters
timespaceIndicator, 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.
    Parameters
    *argsAdditional positional arguments, will be passed to the superconstructor.
    **kwargsAdditional keyword arguments, will be passed to the superconstructor.

Definition at line 325 of file resizing.py.

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

Member Function Documentation

◆ _run_1d()

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

Resamples (by interpolating) one-dimensional data.

Parameters
xArray of measuring point positions or time stamps
zArray of strain data in accordance to x.
*argsAdditional positional arguments, ignored.
**kwargsAdditional keyword arguments, ignored.
Returns
Returns a tuple like (target_x, target_z).
Return values
target_xArray of target points (space or time).
target_zArray of resampled strain.

Reimplemented from fosanalysis.preprocessing.base.Task.

Definition at line 359 of file resizing.py.

◆ _run_2d()

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

Resample a strain array using both spatial and temporal coordinates.

Parameters
xOriginal spatial (x-coordinate) data.
yOriginal temporal (y-coordinate) data.
zOriginal strain values.
*argsAdditional positional arguments, ignored.
**kwargsAdditional keyword arguments, ignored.
Returns
Returns a tuple like (x, y, z).
Return values
xThis is the target_x
ytarget_time
zResampled strain array, according to target_x and target_time.

Reimplemented from fosanalysis.preprocessing.base.Task.

Definition at line 387 of file resizing.py.

Member Data Documentation

◆ method

fosanalysis.preprocessing.resizing.Resampler.method = method

Name of the interpolation method used.

For 1D operation, this is either a function object or a string representing a function name, which will be passed to fosanalysis.utils.interpolation.scipy_interpolate1d(), defaulting to "interp1d".

For 2D operation, use one of the options for the method keyword argument accepted by scipy.interpolate.interpn(), defaulting to "linear".

Definition at line 356 of file resizing.py.

◆ method_kwargs

fosanalysis.preprocessing.resizing.Resampler.method_kwargs = method_kwargs if method_kwargs is not None else {}

Additional keyword arguments for the interpolation function.

Definition at line 358 of file resizing.py.

◆ target_time

fosanalysis.preprocessing.resizing.Resampler.target_time = target_time

Points in time, where strain values should be resampled.

Definition at line 346 of file resizing.py.

◆ target_x

fosanalysis.preprocessing.resizing.Resampler.target_x = target_x

Points in space, where strain values should be resampled.

Definition at line 344 of file resizing.py.


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