Triggering Systems#

Triggering systems are responsible for selecting relevant signal segments in flow cytometry. They define the criteria by which signal acquisition is initiated or segmented, such as threshold crossings, time windows, or double-threshold logic.

These classes are typically used in the digital signal processing pipeline to isolate particle events from continuous analog traces. Each triggering system supports customization of buffer size, thresholds, and detector inputs.

Available Triggering Systems#

class FixedWindow(trigger_detector_name, threshold, max_triggers=-1, pre_buffer=64, post_buffer=64)[source]

Bases: FIXEDWINDOW, BaseTrigger

Fixed window triggering scheme.

This triggering strategy uses a fixed-size window around predefined event times or positions. It is best suited for idealized or pre-segmented data where uniform windowing is acceptable.

Parameters:
  • trigger_detector_name (str)

  • threshold (Quantity | str)

  • max_triggers (int)

  • pre_buffer (int)

  • post_buffer (int)

run(dataframe)[source]

Run the fixed window triggering algorithm on the provided DataFrame.

Parameters:

dataframe (pd.DataFrame) – DataFrame containing the signal data with a ‘Time’ column and detector signals.

Returns:

A DataFrame containing the detected trigger windows.

Return type:

TriggerDataFrame

class DynamicWindow(trigger_detector_name, threshold, max_triggers=-1, pre_buffer=64, post_buffer=64)[source]

Bases: DYNAMICWINDOW, BaseTrigger

Dynamic window triggering scheme.

A dynamic threshold-based triggering system that extracts segments based on real-time signal amplitude crossings. It supports pre- and post-buffering, maximum trigger count, and a configurable detector channel.

Parameters:
  • trigger_detector_name (str)

  • threshold (Quantity | str)

  • max_triggers (int)

  • pre_buffer (int)

  • post_buffer (int)

run(dataframe)[source]

Run the dynamic window triggering algorithm on the provided DataFrame.

Parameters:

dataframe (pd.DataFrame) – DataFrame containing the signal data with a ‘Time’ column and detector signals.

Returns:

A DataFrame containing the detected trigger windows.

Return type:

TriggerDataFrame

class DoubleThreshold(trigger_detector_name, upper_threshold, lower_threshold=<Quantity(nan, 'volt')>, min_window_duration=None, debounce_enabled=True, max_triggers=-1, pre_buffer=64, post_buffer=64)[source]

Bases: DOUBLETHRESHOLD, BaseTrigger

Double threshold triggering scheme.

A more advanced system using both a lower and upper threshold. Events are only captured if the signal first rises above a lower bound and then exceeds a higher one — useful for noise rejection and pulse validation.

Parameters:
  • trigger_detector_name (str)

  • upper_threshold (Quantity | str)

  • lower_threshold (Quantity | None)

  • min_window_duration (Quantity | None)

  • debounce_enabled (bool)

  • max_triggers (int)

  • pre_buffer (int)

  • post_buffer (int)

run(dataframe)[source]

Run the double threshold triggering algorithm on the provided DataFrame.

Parameters:

dataframe (pd.DataFrame) – DataFrame containing the signal data with a ‘Time’ column and detector signals.

Returns:

A DataFrame containing the detected trigger windows.

Return type:

TriggerDataFrame

Usage Notes#

Triggering systems are passed to the SignalProcessing class during cytometer configuration:

from FlowCyPy.triggering_system import DynamicWindow

triggering = DynamicWindow(
    trigger_detector_name='forward',
    threshold=10 * units.microvolt,
    pre_buffer=20,
    post_buffer=20
)

signal_processing = SignalProcessing(
    digitizer=...,
    analog_processing=...,
    triggering_system=triggering,
    peak_algorithm=...
)