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

Class that calculates the modified zscore over a moving window. More...

Inheritance diagram for fosanalysis.preprocessing.masking.SlidingModifiedZscore:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
radiusInradius of the sliding window. Defaults to 0, which disables the sliding window operation, essentially equivalent to ModifiedZscoreDetection.
thresholdRelative height threshold above which a pixel is flagged as SRA.

Defaults to 3.5.

Parameters
timespace
*argsAdditional positional arguments, will be passed to the superconstructor.
**kwargsAdditional keyword arguments, will be passed to the superconstructor.

Definition at line 689 of file masking.py.

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

Member Function Documentation

◆ _get_z_score()

np.array fosanalysis.preprocessing.masking.SlidingModifiedZscore._get_z_score ( self,
np.array z )
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.

Parameters
zArray containing strain data.
Returns
Returns an array modified z-score.

Reimplemented from fosanalysis.preprocessing.masking.ZSOD.

Definition at line 707 of file masking.py.

Member Data Documentation

◆ radius

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.


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