gwcelery.tasks.gcn module

Tasks to send and receive Gamma-ray Coordinates Network [GCN] notices.

References

GCN

https://gcn.gsfc.nasa.gov

gwcelery.tasks.gcn.handler = {gcn.NoticeType.LVC_EARLY_WARNING: [<@task: gwcelery.tasks.gcn.validate of gwcelery>], gcn.NoticeType.LVC_PRELIMINARY: [<@task: gwcelery.tasks.gcn.validate of gwcelery>], gcn.NoticeType.LVC_INITIAL: [<@task: gwcelery.tasks.gcn.validate of gwcelery>], gcn.NoticeType.LVC_UPDATE: [<@task: gwcelery.tasks.gcn.validate of gwcelery>], gcn.NoticeType.LVC_RETRACTION: [<@task: gwcelery.tasks.gcn.validate of gwcelery>], gcn.NoticeType.SNEWS: [<@task: gwcelery.tasks.external_triggers.handle_snews_gcn of gwcelery>], gcn.NoticeType.FERMI_GBM_FLT_POS: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>], gcn.NoticeType.FERMI_GBM_GND_POS: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>], gcn.NoticeType.FERMI_GBM_FIN_POS: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>], gcn.NoticeType.SWIFT_BAT_GRB_POS_ACK: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>], gcn.NoticeType.FERMI_GBM_SUBTHRESH: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>], gcn.NoticeType.INTEGRAL_WAKEUP: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>], gcn.NoticeType.INTEGRAL_REFINED: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>], gcn.NoticeType.INTEGRAL_OFFLINE: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>], gcn.NoticeType.AGILE_MCAL_ALERT: [<@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>]}

Function decorator to register a handler callback for specified GCN notice types. The decorated function is turned into a Celery task, which will be automatically called whenever a matching GCN notice is received.

Parameters
  • *keys – List of GCN notice types to accept

  • **kwargs – Additional keyword arguments for celery.Celery.task().

Examples

Declare a new handler like this:

@gcn.handler(gcn.NoticeType.FERMI_GBM_GND_POS,
             gcn.NoticeType.FERMI_GBM_FIN_POS)
def handle_fermi(payload):
    root = lxml.etree.fromstring(payload)
    # do work here...
exception gwcelery.tasks.gcn.SendingError[source]

Bases: RuntimeError

A generic error associated with sending VOEvents.

(task)gwcelery.tasks.gcn.send(message)[source]

Send a VOEvent to GCN.

This task will be retried several times if the VOEvent cannot be sent. See the Raises section below for circumstances that cause a retry.

Parameters

message (bytes) – The raw VOEvent file contents.

Raises

SendingError – If the VOEvent could not be sent because there were no network peers connected to the VOEvent broadcaster.

(task)gwcelery.tasks.gcn.validate(payload)[source]

Validate LIGO/Virgo GCN notices.

Check that the contents of a public LIGO/Virgo GCN matches the original VOEvent in GraceDB.

Notes

If the VOEvent broadcaster is disabled by setting voevent_broadcaster_whitelist to an empty list, then this task becomes a no-op.