piel.analysis.signals.time.core.split#

Functions#

separate_per_pulse_threshold(...)

Separates pulses in a signal into two categories based on two threshold values.

split_compose_per_pulse_threshold(...)

Separates pulses in a signal into two categories based on two threshold values.

Module Contents#

separate_per_pulse_threshold(signal_data: piel.types.TimeSignalData, first_signal_threshold: float, second_signal_threshold: float, trigger_delay_s: float, trigger_window_s: float = 2.5e-08, first_pre_pulse_time_s: float = 1e-09, first_post_pulse_time_s: float = 1e-09, second_pre_pulse_time_s: float = 1e-09, second_post_pulse_time_s: float = 1e-09, noise_std_multiplier: float = 3.0, data_time_signal_kwargs: Dict | None = None) List[piel.types.MultiTimeSignalData][source]#

Separates pulses in a signal into two categories based on two threshold values.

Parameters:
  • signal_data (TimeSignalData) – The input signal data containing multiple pulses.

  • first_signal_threshold (float) – The higher threshold to categorize pulses.

  • second_signal_threshold (float) – The lower threshold to categorize pulses.

  • trigger_delay_s (float) – Minimum time (in seconds) between pulses to prevent overlap.

  • first_pre_pulse_time_s (float, optional) – Time (in seconds) to include before each detected pulse. Defaults to 0.01.

  • first_post_pulse_time_s (float, optional) –

    Time (in seconds) to include after each detected pulse.

    Defaults to 0.01. second_pre_pulse_time_s (float, optional): Time (in seconds) to include before each detected pulse.

    Defaults to 0.01.

  • second_post_pulse_time_s (float, optional) – Time (in seconds) to include after each detected pulse. Defaults to 0.01.

  • noise_std_multiplier (float, optional) – Multiplier for noise standard deviation to set detection threshold. Defaults to 3.0.

  • data_time_signal_kwargs (dict, optional) – Additional keyword arguments for DataTimeSignalData.

Returns:

A list containing a single MultiTimeSignalData instance:
  • high_threshold_pulses: List of DataTimeSignalData for pulses above first_signal_threshold.

  • low_threshold_pulses: List of DataTimeSignalData for pulses above second_signal_threshold but below first_signal_threshold.

Return type:

List[MultiTimeSignalData]

split_compose_per_pulse_threshold(signal_data: piel.types.TimeSignalData, first_signal_threshold: float, second_signal_threshold: float, trigger_delay_s: float, first_pre_pulse_time_s: float = 1e-09, first_post_pulse_time_s: float = 1e-09, second_pre_pulse_time_s: float = 1e-09, second_post_pulse_time_s: float = 1e-09, noise_std_multiplier: float = 3.0, start_time_s: float | None = None, end_time_s: float | None = None, data_time_signal_kwargs: Dict | None = None) piel.types.MultiTimeSignalData[source]#

Separates pulses in a signal into two categories based on two threshold values.

Parameters:
  • signal_data (TimeSignalData) – The input signal data containing multiple pulses.

  • first_signal_threshold (float) – The higher threshold to categorize pulses.

  • second_signal_threshold (float) – The lower threshold to categorize pulses.

  • trigger_delay_s (float) – Minimum time (in seconds) between pulses to prevent overlap.

  • first_pre_pulse_time_s (float, optional) – Time (in seconds) to include before each detected first pulse. Defaults to 0.01.

  • first_post_pulse_time_s (float, optional) – Time (in seconds) to include after each detected first pulse. Defaults to 0.01.

  • second_pre_pulse_time_s (float, optional) – Time (in seconds) to include before each detected second pulse. Defaults to 0.01.

  • second_post_pulse_time_s (float, optional) – Time (in seconds) to include after each detected second pulse. Defaults to 0.01.

  • noise_std_multiplier (float, optional) – Multiplier for noise standard deviation to set detection threshold. Defaults to 3.0.

  • data_time_signal_kwargs (dict, optional) – Additional keyword arguments for DataTimeSignalData.

  • start_time_s (float, optional) – Start time of the composed signal. If not provided, uses the first pulse’s start time.

  • end_time_s (float, optional) – End time of the composed signal. If not provided, uses the last pulse’s end time.

Returns:

The composed full signals as [low_threshold_pulse_signal, high_threshold_pulse_signal]

Return type:

List[TimeSignalData]