BoundedBlockageFinder

class BoundedBlockageFinder(settings: Optional[dict] = None)

Bases: ClassicBlockageFinder

Subclass of ClassicBlockageFinder that adds baseline range constraints for event detection.

This event finder enforces a user-defined minimum and maximum baseline range and refines the Gaussian baseline fitting procedure accordingly. It filters data outside the specified baseline window and raises errors if the computed baseline falls outside those bounds.

Public Methods

BoundedBlockageFinder.get_empty_settings(globally_available_plugins=None, standalone=False)

Get a dict populated with keys needed to initialize the filter if they are not set yet. This dict must have the following structure, but Min, Max, and Options can be skipped or explicitly set to None if they are not used. Value and Type are required. All values provided must be consistent with Type. EventFinder objects MUST include a MetaReader object in settings

settings = {'Parameter 1': {'Type': <int, float, str, bool>,
                                 'Value': <value> or None,
                                 'Options': [<option_1>, <option_2>, ... ] or None,
                                 'Min': <min_value> or None,
                                 'Max': <max_value> or None
                                },
                ...
                }
Parameters:
  • globally_available_plugins (Mapping[str, List[str]]) – a dict containing all data plugins that exist to date, keyed by metaclass. Must include “MetaReader” as a key, with explicitly set Type MetaReader.

  • standalone (bool) – False if this is called as part of a GUI, True otherwise. Default False

Returns:

the dict that must be filled in to initialize the filter

Return type:

Mapping[str, Mapping[str, Union[int, float, str, list[Union[int,float,str,None], None]]]]

Private Methods

BoundedBlockageFinder._get_baseline_stats(data)

Get the local amplitude, mean, and standard deviation for a chunk of data.

Parameters:

data (npt.NDArray[np.float64]) – Chunk of timeseries data to compute statistics on.

Returns:

Tuple of mean and standard deviation.

Return type:

tuple[float, float]

BoundedBlockageFinder._validate_settings(settings)

Validate that the settings dict contains the correct information for use by the subclass.

Parameters:

settings (dict) – Parameters for event detection.

Raises:

ValueError – If the settings dict does not contain the correct information.