|
fosanalysis
A framework to evaluate distributed fiber optic sensor data
|
Class that calculates the modified zscore over a moving window. More...
Public Member Functions | |
| __init__ (self, int radius=0, float threshold=3.5, str timespace="1d_space", *args, **kwargs) | |
| Construct an instance of the class. | |
Public Member Functions inherited from fosanalysis.preprocessing.masking.ZSOD | |
| __init__ (self, float threshold=3.5, str timespace="1d_space", *args, **kwargs) | |
| Construct an instance of the class. | |
Public Member Functions inherited from fosanalysis.preprocessing.masking.AnomalyMasker | |
| 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. | |
Public Attributes | |
| int | radius = radius |
| Inradius of the sliding window. | |
Public Attributes inherited from fosanalysis.preprocessing.masking.ZSOD | |
| threshold = threshold | |
| Relative height threshold above which a pixel is flagged as SRA. | |
Protected Member Functions | |
| np.array | _get_z_score (self, np.array z) |
| Calculates the modified z-score with the absolute deviation of current vicinity. | |
Protected Member Functions inherited from fosanalysis.preprocessing.masking.ZSOD | |
| np.array | _get_outlier_mask (self, np.array z_score) |
| Mask entries as SRA, whose z-scores exceed threshold. | |
| 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) |
| Estimate which entries are strain reading anomalies in 2D. | |
Protected Member Functions inherited from fosanalysis.preprocessing.masking.AnomalyMasker | |
| 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. | |
Class that calculates the modified zscore over a moving window.
The window is defined by the given radius and has a width of \(2r+1\). The median will be calculated only for the current vicinity.
Definition at line 683 of file masking.py.
| fosanalysis.preprocessing.masking.SlidingModifiedZscore.__init__ | ( | self, | |
| int | radius = 0, | ||
| float | threshold = 3.5, | ||
| str | timespace = "1d_space", | ||
| * | args, | ||
| ** | kwargs ) |
Construct an instance of the class.
| radius | Inradius of the sliding window. Defaults to 0, which disables the sliding window operation, essentially equivalent to ModifiedZscoreDetection. |
| threshold | Relative height threshold above which a pixel is flagged as SRA. |
Defaults to 3.5.
| timespace | |
| *args | Additional positional arguments, will be passed to the superconstructor. |
| **kwargs | Additional keyword arguments, will be passed to the superconstructor. |
Definition at line 689 of file masking.py.
|
protected |
Calculates the modified z-score with the absolute deviation of current vicinity.
If the MAD is zero, the mean of the absolute deviation will be used.
| z | Array containing strain data. |
Reimplemented from fosanalysis.preprocessing.masking.ZSOD.
Definition at line 707 of file masking.py.
| int fosanalysis.preprocessing.masking.SlidingModifiedZscore.radius = radius |
Inradius of the sliding window.
Defaults to 0, which disables the sliding window operation, essentially equivalent to ModifiedZscoreDetection.
Definition at line 706 of file masking.py.