resistics.mask.data module

class resistics.mask.data.MaskData(sampleFreq: float, numLevels: int, evalFreq, **kwargs)[source]

Bases: resistics.common.base.ResisticsBase

Class for holding information about window masking

Attributes
maskNamestr

The name of the mask

sampleFreqfloat

The sampling frequency of the data in Hz

numLevelsint

Number of decimation levels

evalFreqList[float]

The evaluation frequnecies

constraintsDict

Constraints index by evaluation frequency, statistic and component

insideOutDict

Flag stating whether to mask values inside constraints (False) or outside constraints (True), indexed by evaluation frequency, statistic and component

maskWindowsDict

Dictionary for storing the masked windows for each evaluation frequency

statsList

Statistics to use in the masking

Methods

__init__(sampleFreq, numLevels, evalFreq, kwargs)

Initialise maskData

setStats(stats)

Set the statistics used in the MaskData

addConstraint(stat, constraint, insideOut)

Add constraints for statistic stat for all evaluation frequencies

addConstraintLevel(stat, constraint, level, insideOut)

Add constraints for statistic stat for all evaluation frequencies for a single decimation level

addConstraintFreq(stat, constraint, level, eIdx, insideOut)

Add a constraint for statistic stat for a particular evaluation frequency

getConstraintFreq(level, eIdx, stat = “”)

Get the constraints for a evaluation frequency provided by the level and the evaluation frequency index and optional request constraints only for a particular statistic

getMaskWindowsFreq(level, eIdx)

Get a set of the masked windows for an evaluation frequency identified by decimation level and evaluation frequency index

prepareDicts()

Prepare the storage dictionaries given a new set of statistics

resetMaskWindows()

Clear the masked windows

view(level)

View the masked windows at a particular decimation level

printList()

Class status returned as list of strings

printConstraints()

Print constraint information to the console

printConstraintsList()

Return constraint information as a list of strings

addConstraint(self, stat: str, constraint: Dict[str, List], insideOut: List[str] = []) → None[source]

Add a constraint for all levels and evaluation frequencies

Parameters
statstr

The statistic to be constrained

constraintDict

The constraint parameter specified as {“statistic component”: [valueMin, valueMax]}

insideOutList[str], optional with default as range specified is range to include

The constraints for which the range specified in the constraint is the range to exclude rather than include

addConstraintFreq(self, stat: str, constraint: Dict[str, List], declevel: int, eIdx: int, insideOut: List[str] = []) → None[source]

Add a constraint for an evaluation frequency

Parameters
statstr

The statistic to be constrained

constraintDict

The constraint parameter specified as {“statistic component”: [valueMin, valueMax]}

declevelint

The decimation level

eIdxint

Evaluation Frequency index

insideOutList[str], optional with default as range specified is range to include

The constraints for which the range specified in the constraint is the range to exclude rather than include

addConstraintLevel(self, stat: str, constraint: Dict[str, List], declevel: int, insideOut: List[str] = []) → None[source]

Add a constraint for a whole decimation level

Parameters
statstr

The statistic to be constrained

constraintDict

The constraint parameter specified as {“statistic component”: [valueMin, valueMax]}

declevelint

The decimation level

insideOutList[str], optional with default as range specified is range to include

The constraints for which the range specified in the constraint is the range to exclude rather than include

getConstraintFreq(self, declevel: int, eIdx: int, stat: str = '')[source]

Get constraints for an evaluation frequency

Parameters
declevelint

The decimation level

eIdxint

Evaluation Frequency index

statstr

The statistic for which to return the constraints

Returns
outlist

Constraints for the evaluation frequency

getMaskWindowsFreq(self, declevel: int, eIdx: int) → Set[int][source]

Get a set of the masked windows (used by WindowSelector)

Parameters
declevelint

The decimation level

eIdxint

Evaluation Frequency index

Returns
outSet[int]

A set with the indices of the masked windows

prepareDicts(self) → None[source]

Prepare dictionaries for storing masking information

printConstraints(self) → None[source]

Print information about the constraints

printConstraintsList(self) → List[str][source]

Constraint information as a list of strings

Returns
outList[str]

List of strings with information

printList(self) → List[str][source]

Class information as a list of strings

Returns
outList[str]

List of strings with information

resetMaskWindows(self) → None[source]

Reset/Clear the masked windows

setStats(self, stats)[source]

Set the statistics to use for the constraints

Parameters
statsList[str]

A list of statistics for which constraints will be provided

view(self, declevel: int = 0, **kwargs) → matplotlib.figure.Figure[source]

Produces a 2-D plot with all the masked windows along the bottom for a decimation level

Parameters
declevelint, optional

The decimation level. Default is 0.

figmatplotlib.pyplot.figure, optional

A figure object

plotfontsDict, optional

A dictionary of plot fonts