gwcelery.tasks.external_triggers module¶
This module listens to the GCN VOevent XML notices from SNEWS and the Fermi, Swift, and SVOM missions, as well as Kafka JSON alerts from CHIME and the targeted searches from Fermi and Swift. It is also responsible for carrying out tasks related to external trigger-gravitational wave coincidences, including looking for temporal coincidences, creating combined GRB-GW sky localization probability maps, and computing their joint temporal and spatio-temporal false alarm rates.
There are two GCN, one Kafka, and three IGWN Alert message handlers in the gwcelery.tasks.external_triggers module:
handle_snews_gcn()is called for each SNEWS GCN.handle_grb_gcn()is called for each external missions that send VOEvent XML alerts, such as Fermi, Swift, and SVOM.handle_kafka_alert()is called for external missions that send Kafka JSON alerts, currently Fermi,
handle_superevent_igwn_alert()is called for each superevent trigger IGWN Alert.handle_snews_igwn_alert()is called for each SNEWS external trigger IGWN Alert.handle_grb_igwn_alert()is called for each Fermi and Swift external trigger IGWN Alert.handle_frb_igwn_alert()is called for each CHIME external trigger IGWN Alert.handle_hen_igwn_alert()is called for each IceCube external trigger IGWN Alert.
Flow charts¶
GCN VOEvent Ingestion¶
Kafka Alert Ingestion¶
IGWN Alert Handling¶
Tasks¶
- gwcelery.tasks.external_triggers.REQUIRED_LABELS_BY_TASK = {'SoG': {'ADVOK', 'RAVEN_ALERT', 'SKYMAP_READY'}, 'compare': {'EM_COINC', 'EM_READY', 'EXT_SKYMAP_READY'}}¶
These labels should be present on an external event to consider it to be ready for sky map comparison or for post-alert analysis, such as a measurment of the speed of gravity (SoG).
- gwcelery.tasks.external_triggers.FERMI_GRB_CLASS_VALUE = 4¶
This is the index that denote GRBs within Fermi’s Flight Position classification.
- gwcelery.tasks.external_triggers.P_ASTRO_THRESH = 0.5¶
This value denotes the threshold of the equivalent p_astro estimate, above which we will consider the external event. This is currently used for Fermi Flight notices, CHIME FRB events, and IceCube events
- gwcelery.tasks.external_triggers.NOTICE_TYPE_DICT = {'110': 'FERMI_GBM_INITIAL_ALERT', '111': 'FERMI_GBM_FLIGHT_POSITION', '112': 'FERMI_GBM_GROUND_POSITION', '115': 'FERMI_GBM_FINAL_POSITION', '131': 'FERMI_GBM_SUBTHRESHOLD', '202': 'SVOM_ECLAIRS_WAKEUP', '60': 'SWIFT_BAT_GRB_ALERT', '61': 'SWIFT_BAT_GRB_POSITION'}¶
These map known GCN notice type IDs to their rough string equivalent. This is only needed while we still support VOEvent XML format alerts. See https://gcn.gsfc.nasa.gov/filtering.html for this list.
- (task)gwcelery.tasks.external_triggers.handle_snews_gcn(payload)[source]¶
Handles the GCN notice payload from SNEWS alerts.
Prepares the alert to be sent to graceDB as external events, updating the info if it already exists.
- Parameters:
payload (bytes) – XML GCN notice alert packet in bytes string format
- (task)gwcelery.tasks.external_triggers.handle_grb_gcn(payload)[source]¶
Handles the payload from Fermi, Swift, and SVOM GCN notices.
Filters out candidates likely to be noise. Creates external events from the notice if new notice, otherwise updates existing event. Then creates and/or grabs external sky map to be uploaded to the external event.
More info for these notices can be found at: Fermi-GBM: https://gcn.gsfc.nasa.gov/fermi_grbs.html Fermi-GBM sub: https://gcn.gsfc.nasa.gov/fermi_gbm_subthresh_archive.html Swift: https://gcn.gsfc.nasa.gov/swift.html SVOM-ECLAIRS: https://gcn.nasa.gov/missions/svom
- Parameters:
payload (bytes) – XML GCN notice alert packet in bytes string format
- (task)gwcelery.tasks.external_triggers.handle_kafka_alert(alert)[source]¶
Handles the payload from Kafka JSON notices. Currently this only includes events a from a MOU partner in our joint subthreshold targeted search, as well as FRBs from CHIME.
Filters out candidates likely to be noise. Creates external events from the notice if new notice, otherwise updates existing event. Then creates and/or grabs external sky map to be uploaded to the external event.
More info for these notices can be found at: Fermi-GBM: https://gcn.gsfc.nasa.gov/fermi_grbs.html Swift: https://gcn.gsfc.nasa.gov/swift.html SVOM-ECLAIRS: https://gcn.nasa.gov/missions/svom
- Parameters:
alert (dict) – Kafka alert packet
- (task)gwcelery.tasks.external_triggers.handle_superevent_igwn_alert(alert)[source]¶
Parse an IGWN alert message related to superevent triggers and dispatch it to other tasks.
Notes
This IGWN alert message handler is triggered by creating a new superevent, a label associated with completeness of skymaps or change in state, or if a sky map file is uploaded:
New superevent triggers a coincidence search with
gwcelery.tasks.raven.coincidence_search().If other type of IGWN alert, pass to _handle_skymaps to decide whether to re-run RAVEN pipeline based on labels or whether to add labels that could start this process.
- Parameters:
alert (dict) – IGWN alert packet
- (task)gwcelery.tasks.external_triggers.handle_grb_igwn_alert(alert)[source]¶
Parse an IGWN alert message related to GRB external triggers and dispatch it to other tasks.
Notes
This IGWN alert message handler is triggered by creating a new GRB external trigger event, a label associated with completeness of skymaps or change in state, or if a sky map file is uploaded:
New event triggers a coincidence search with
gwcelery.tasks.raven.coincidence_search().If other type of IGWN alert, pass to _handle_skymaps to decide whether to re-run RAVEN pipeline based on labels or whether to add labels that could start this process.
- Parameters:
alert (dict) – IGWN alert packet
- (task)gwcelery.tasks.external_triggers.handle_frb_igwn_alert(alert)[source]¶
Parse an IGWN alert message related to FRB external triggers and dispatch it to other tasks.
Notes
This IGWN alert message handler is triggered by creating a new FRB external trigger event, a label associated with completeness of skymaps or change in state, or if a sky map file is uploaded:
New event triggers a coincidence search with
gwcelery.tasks.raven.coincidence_search().If other type of IGWN alert, pass to _handle_skymaps to decide whether to re-run RAVEN pipeline based on labels or whether to add labels that could start this process.
- Parameters:
alert (dict) – IGWN alert packet
- (task)gwcelery.tasks.external_triggers.handle_hen_igwn_alert(alert)[source]¶
Parse an IGWN alert message related to HEN external triggers and dispatch it to other tasks.
Notes
This IGWN alert message handler is triggered by creating a new HEN external trigger event, a label associated with completeness of skymaps or change in state, or if a sky map file is uploaded:
New event triggers a coincidence search with
gwcelery.tasks.raven.coincidence_search().If other type of IGWN alert, pass to _handle_skymaps to decide whether to re-run RAVEN pipeline based on labels or whether to add labels that could start this process.
- Parameters:
alert (dict) – IGWN alert packet
- (task)gwcelery.tasks.external_triggers.handle_snews_igwn_alert(alert)[source]¶
Parse an IGWN alert message related to Supernovae external triggers and dispatch it to other tasks.
Notes
This igwn_alert message handler is triggered whenever a new Supernovae external event is created:
New event triggers a coincidence search with
gwcelery.tasks.raven.coincidence_search().
- Parameters:
alert (dict) – IGWN alert packet
- (task)gwcelery.tasks.external_triggers._launch_external_detchar(event)[source]¶
Launch detchar tasks for an external event.
- (task)gwcelery.tasks.external_triggers._create_replace_external_event_and_skymap(events, payload, search, pipeline, label=None, ext_group='External', notice_date=None, notice_type=None, skymap=None, skymap_link=None, use_radec=False)[source]¶
Either create a new external event or replace an old one if applicable Then either uploads a given sky map, try to download one given a link, or create one given coordinates.
- Parameters:
events (list) – List of external events sharing the same trigger ID
payload (bytes) – VOEvent or JSON of event being considered, in bytes string format
search (str) – Search of external event
pipeline (str) – Pipeline of external evevent
label (list) – Label to be uploaded along with external event. If None, removes ‘NOT_GRB’ label from event
ext_group (str) – Group of external event, ‘External’ or ‘Test’
notice_date (str) – External event trigger time in ISO format
notice_type (str) – GCN notice type
skymap (str) – Base64 encoded sky map
skymap_link (str) – Link to external sky map to be downloaded
use_radec (bool) – If True, try to create sky map using given coordinates