TriggerDecider#

class jinwu.lightcurve.TriggerDecider(time: ndarray, counts: ndarray, dt: float, bg: BackgroundSimple)[source]#

Bases: object

Decide triggerability from a binned counts lightcurve or event times.

Core checks#

  • sliding_window(window=1200): scan max Li&Ma SNR over all windows.

  • head_window(window=1200): Li&Ma SNR of the first window only.

  • cumulative_from_t0(target=7): grow cumulatively from T0.

Inputs#

time : 1D array of bin left edges (monotonic increasing). counts : 1D array of ON-region counts per bin (non-negative). dt : float bin width in seconds (assumed constant). bg : BackgroundSimple with (n_off_ref, t_off_ref, area_ratio).

Methods Summary

cumulative_from_t0(*[, target, t0_mode, ...])

decide(*[, window, target, step, t0_mode])

from_counts(time, counts, dt, bg)

from_events(events, *, dt, bg[, t_start, t_end])

head_window(*[, window, target])

sliding_window(*[, window, step, target])

Methods Documentation

cumulative_from_t0(*, target: float = 7.0, t0_mode: Literal['first_nonzero', 'first_time'] = 'first_nonzero', max_window: float | None = 1200) Tuple[bool, dict][source]#
decide(*, window: float = 1200.0, target: float = 7.0, step: float | None = None, t0_mode: Literal['first_nonzero', 'first_time'] = 'first_nonzero') dict[source]#
classmethod from_counts(time: ndarray, counts: ndarray, dt: float | None, bg: BackgroundSimple) TriggerDecider[source]#
classmethod from_events(events: ndarray, *, dt: float, bg: BackgroundSimple, t_start: float | None = None, t_end: float | None = None) TriggerDecider[source]#
head_window(*, window: float = 1200.0, target: float = 7.0) Tuple[bool, dict][source]#
sliding_window(*, window: float = 1200.0, step: float | None = None, target: float = 7.0) Tuple[bool, dict][source]#