SlidingWindowMethod¶
- class gdt.core.trigger.SlidingWindowMethod(algorithms: dict, background_window: int, background_offset: int, resolution: int, channel_edges: list, det_names: list, n: int = 1, verbose: bool = True)[source]¶
Bases:
objectClass for applying a sliding window trigger which identifies transients by looking for windows where n detectors to exceed a given significance threshold above background.
- Parameters:
algorithms (dict) – Dictionary defining the set of trigger algorithms applied in the trigger method
background_window (int) – Length of time in integer milliseconds used to compute background counts
background_offset (int) – Time offset in integer milliseconds between the end of the trigger and background windows
resolution (int) – The time resolution in integer milliseconds of binned PHAII data used for the trigger method. All other timescales (windows, offsets) should be multiples of this value
channel_edges (list) – List of channel edges used to define energy bins for PHAII data
det_names (list) – Names of required detector numbers for the trigger method
n (int) – Minimum number of detectors needed for trigger
verbose (float) – Show progress bars when True
Attributes Summary
Dictionary defining the set of trigger algorithms
Methods Summary
apply_holdoff(triggers, holdoff)Apply a holdoff which ignores triggers occurring within the holdoff timescale of a prior trigger.
apply_trigger([holdoff, debug])Applies the set of trigger algorithms to prepared data
lightcurve_plot(trigger[, time_range, ...])Plot detector light curves with trigger overlay.
prepare_data(ttes[, time_range])Method to prepare TTE data into a PHAII format for use with trigger algorithms.
waterfall_plot(triggers, **kwargs)Create a waterfall plot showing all trigger windows as a function of algorithm number versus time.
Attributes Documentation
- algorithms¶
Dictionary defining the set of trigger algorithms
- Type:
(dict)
Methods Documentation
- apply_holdoff(triggers: list, holdoff: float)[source]¶
Apply a holdoff which ignores triggers occurring within the holdoff timescale of a prior trigger.
- Parameters:
triggers (list) – List of Trigger objects
holdoff (float) – Trigger holdoff time in seconds
- Returns:
(list)
- apply_trigger(holdoff: float = None, debug: bool = False)[source]¶
Applies the set of trigger algorithms to prepared data
- Parameters:
holdoff (float, optional) – Trigger holdoff time in seconds. Set to 300 sec to replicate GCN trigger notices.
debug (bool, optional) – Show debugging information when True
- Returns:
(list of Trigger)
- lightcurve_plot(trigger: Trigger, time_range: tuple = None, detectors: list = None, figsize: tuple = None, resolution: int = None, legend: bool = True)[source]¶
Plot detector light curves with trigger overlay.
- Parameters:
trigger (Trigger) – The trigger to overlay
time_range (tuple) – Start and end of time range to plot in seconds
detectors (list) – List of detector numbers to plot
figsize (tuple) – Dimensions of the figure in inches
resolution (int) – Lightcurve resolution in integer milliseconds
legend (bool) – Show legend when True
- Returns:
(tuple)
- prepare_data(ttes: list, time_range: list = None)[source]¶
Method to prepare TTE data into a PHAII format for use with trigger algorithms.
- Parameters:
ttes (list) – List of Tte objects
time_range (list) – List with [tstart, tstop]
- waterfall_plot(triggers: list, **kwargs)[source]¶
Create a waterfall plot showing all trigger windows as a function of algorithm number versus time.
- Parameters:
triggers (list) – List of triggers
kwargs (optional) – Optional arguments passed to rectangular patches drawn for each trigger
- Returns:
(list)