|
fosanalysis
A framework to evaluate distributed fiber optic sensor data
|
Class for resampling one-dimensional or two-dimensional strain data. More...
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. | |
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.
| 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.
| target_x | Points in space, where strain values should be resampled. |
| target_time | Points in time, where strain values should be resampled. |
| 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".
| method_kwargs | Additional keyword arguments for the interpolation function. |
| 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. | *args | Additional positional arguments, will be passed to the superconstructor. |
| **kwargs | Additional keyword arguments, will be passed to the superconstructor. |
Definition at line 325 of file resizing.py.
|
protected |
Resamples (by interpolating) one-dimensional data.
| x | Array of measuring point positions or time stamps |
| z | Array of strain data in accordance to x. |
| *args | Additional positional arguments, ignored. |
| **kwargs | Additional keyword arguments, ignored. |
(target_x, target_z). | target_x | Array of target points (space or time). |
| target_z | Array of resampled strain. |
Reimplemented from fosanalysis.preprocessing.base.Task.
Definition at line 359 of file resizing.py.
|
protected |
Resample a strain array using both spatial and temporal coordinates.
| x | Original spatial (x-coordinate) data. |
| y | Original temporal (y-coordinate) data. |
| z | Original strain values. |
| *args | Additional positional arguments, ignored. |
| **kwargs | Additional keyword arguments, ignored. |
(x, y, z). | x | This is the target_x |
| y | target_time |
| z | Resampled strain array, according to target_x and target_time. |
Reimplemented from fosanalysis.preprocessing.base.Task.
Definition at line 387 of file resizing.py.
| 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.
| 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.
| 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.
| 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.