|
fosanalysis
A framework to evaluate distributed fiber optic sensor data
|
Abstract class for anomaly identification. More...
Public Member Functions | |
| np.array | run (self, np.array x, np.array y, np.array z, bool make_copy=True, str timespace=None, bool identify_only=False, *args, **kwargs) |
Mask strain reading anomalies with NaNs. | |
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. | |
Protected Member Functions | |
| tuple | _map_2d (self, np.array x, np.array y, np.array z, np.array SRA_array, str timespace=None, *args, **kwargs) |
| Estimate, which entries are strain reading anomalies, in 2D. | |
| tuple | _run_1d (self, np.array x, np.array z, np.array SRA_array, *args, **kwargs) |
| Estimate, which entries are strain reading anomalies, in 1D. | |
| tuple | _run_2d (self, np.array x, np.array y, np.array z, np.array SRA_array, *args, **kwargs) |
| Native two-dimensional operation implementation. | |
Abstract class for anomaly identification.
Strain reading anomalies (SRAs) are implausible data points. SRAs are replaced by NaN values, effectively marking them as dropouts.
Definition at line 19 of file masking.py.
|
protected |
Estimate, which entries are strain reading anomalies, in 2D.
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.
| x | Array of measuring point positions. |
| y | Array of time stamps. |
| z | Array of strain data in accordance to x and y. |
| timespace | For more, see timespace. Defaults to timespace. |
| *args | Additional positional arguments to customize the behaviour. Will be passed to the chosen method to call. |
| **kwargs | Additional keyword arguments to customize the behaviour. Will be passed to the chosen method to call. |
(x, y, z). They correspond to the input variables of the same name. Each of those might be changed. | SRA_array | Array of boolean values indicating SRAs by True and a valid entries by False. This function returns the SRA_array instead of the z array. |
Definition at line 80 of file masking.py.
|
protected |
Estimate, which entries are strain reading anomalies, in 1D.
This operation might be applied to on a 2D array by _map_2d(). This function is called, if:
z is 1D or"1d_space" or "1d_time". | x | Array of coordinate positions. Dependent on timespace it may hold:
|
| z | Array of strain data in accordance to x and y. |
| *args | Additional positional arguments to customize the behaviour. |
| **kwargs | Additional keyword arguments to customize the behaviour. |
(x, z). They correspond to the input variables of the same name. Each of those might be changed. | SRA_array | Array of boolean values indicating SRAs by True and a valid entries by False. This function returns the SRA_array instead of the z array. |
Reimplemented in fosanalysis.preprocessing.masking.GTM, fosanalysis.preprocessing.masking.OSCP, and fosanalysis.preprocessing.masking.ZSOD.
Definition at line 55 of file masking.py.
|
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".
| x | Array of measuring point positions. |
| y | Array of time stamps. |
| z | Array of strain data in accordance to x and y. |
| *args | Additional positional arguments to customize the behaviour. |
| **kwargs | Additional keyword arguments to customize the behaviour. |
(x, y, z). They correspond to the input variables of the same name. Each of those might be changed. | SRA_array | Array of boolean values indicating SRAs by True and a valid entries by False. This function returns the SRA_array instead of the z array. |
Reimplemented in fosanalysis.preprocessing.masking.GTM, fosanalysis.preprocessing.masking.OSCP, and fosanalysis.preprocessing.masking.ZSOD.
Definition at line 68 of file masking.py.
| np.array fosanalysis.preprocessing.masking.AnomalyMasker.run | ( | self, | |
| np.array | x, | ||
| np.array | y, | ||
| np.array | z, | ||
| bool | make_copy = True, | ||
| str | timespace = None, | ||
| bool | identify_only = False, | ||
| * | args, | ||
| ** | kwargs ) |
Mask strain reading anomalies with NaNs.
The strain data is replaced by NaN for all entries in the returned array being True.
| identify_only | If set to true, the array contains boolean values, indicating a SRA by True and a valid entry by False. |
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:
x as the coordinate data, if it matches the shape of z.y as the coordinate data, if it matches the shape of z.z.If z is a 2D array, three option are available, based on timespace:
| x | Array of measuring point positions. |
| y | Array of time stamps. |
| z | Array of strain data in accordance to x and y. |
| timespace | For more, see timespace. Defaults to timespace. |
| make_copy | Switch, whether a deepcopy of the passed data should be done. Defaults to True. |
| *args | Additional positional arguments to customize the behaviour. Will be passed to the chosen method to call. |
| **kwargs | Additional keyword arguments to customize the behaviour. Will be passed to the chosen method to call. |
(x, y, z). They correspond to the input variables of the same name. Each of those might be changed. Definition at line 25 of file masking.py.