pypore.strategies.threshold_strategy module¶
- class pypore.strategies.threshold_strategy.ThresholdStrategy¶
Bases: object
Abstract base class defining the behavior that a ThresholdStrategy should implement. These methods will be called by find_events().
A threshold is defined as a absolute value distance away from the baseline that the current must pass in order to trigger an event.
Example implementations–
- pypore.strategies.noise_based_threshold_strategy.NoiseBasedThresholdStrategy – Use the noise level to define event start and end thresholds.
- compute_ending_threshold(double baseline, double variance)¶
(Note: this is a cpdef wrapper for the cdef method compute_ending_threshold_c(). This method is accessible from Python, while compute_ending_threshold_c() is only accessible from Cython. However, to subclass this class, you must implement the compute_ending_threshold_c() version.)
Compute the starting threshold for the event.
Parameters: - baseline (double) – The current baseline.
- variance (double) – The variance of the baseline.
Returns: The threshold (magnitude of the change) to trigger the end of an event.
- compute_starting_threshold(double baseline, double variance)¶
(Note: this is a cpdef wrapper for the cdef method compute_starting_threshold_c(). This method is accessible from Python, while compute_starting_threshold_c() is only accessible from Cython. However, to subclass this class, you must implement the compute_starting_threshold_c() version.)
Compute the starting threshold for the event.
Parameters: - baseline (double) – The current baseline.
- variance (double) – The variance of the baseline.
Returns: The threshold (magnitude of the change) to trigger the start an event.