IntraCUSUM¶
class IntraCUSUM(settings: Optional[dict] = None)
Bases: CUSUM
Abstract base class to analyze and flag the start and end times of regions of interest in a timeseries for further analysis.
Public Methods¶
- IntraCUSUM.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 }, ... }
Private Methods¶
- IntraCUSUM._define_event_metadata_types()¶
Build a dict of metadata along with associated datatypes for use by the database writer downstream. Keys must match columns defined in _populate_event_metadata() All of this metadata must be populated during fitting. Options for dtypes are int, float, str, bool
- IntraCUSUM._define_event_metadata_units()¶
Build a dict of metadata along with associated datatypes for use by the database writer downstream. Keys must match columns defined in _populate_event_metadata() All of this metadata must be populated during fitting. Options for dtypes are int, float, str, bool
- IntraCUSUM._populate_event_metadata(data, samplerate, baseline_mean, baseline_std, sublevel_metadata)¶
Assemble a list of metadata to save in the event database later. Note that keys ‘start_time_s’ and ‘index’ are already handled in the base class and should not be touched here.
- Parameters:
data (npt.NDArray[np.float64]) – an array of data from which to extract the locations of sublevel transitions
samplerate (float) – the sampling rate
baseline_mean (Optional[float]) – the local mean value of the baseline current
baseline_std (Optional[float]) – the local standard deviation of the baseline current
sublevel_metadata (Mapping[str, List[Numeric]]) – the dict of sublevel metadata built by self._populate_sublevel_metadata()
- Returns:
a dict of event metadata values
- Return type: