gwcelery.tasks.gcn module¶
Subsystem for sending, receiving, and processing Gamma-ray Coordinates Network [GCN] notices.
References
[GCN] | https://gcn.gsfc.nasa.gov |
-
(task)
gwcelery.tasks.gcn.
broker
[source]¶ Single-client VOEvent broker for sending notices to GCN.
This is a basic VOEvent broker. It binds to the address
gcn_broker_address
and accepts one connection at a time from any host whose address is listed ingcn_broker_accept_addresses
.
-
(task)
gwcelery.tasks.gcn.
send
(payload)[source]¶ Send a VOEvent to GCN.
Under the hood, this task just pushes the payload onto a Redis queue, and
broker()
sends it.
-
gwcelery.tasks.gcn.
handler
= {<sphinx.ext.autodoc.importer._MockObject object>: [<@task: gwcelery.tasks.external_triggers.handle_sn_gcn of gwcelery>, <@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>, <@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>, <@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>, <@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>, <@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>, <@task: gwcelery.tasks.external_triggers.handle_grb_gcn of gwcelery>, <@task: gwcelery.tasks.gcn.validate.validate_voevent of gwcelery>, <@task: gwcelery.tasks.gcn.validate.validate_voevent of gwcelery>, <@task: gwcelery.tasks.gcn.validate.validate_voevent 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...
-
(task)
gwcelery.tasks.gcn.
listen
[source]¶ Listen to GCN notices forever. GCN notices are dispatched asynchronously to tasks that have been registered with
gwcelery.tasks.gcn.handler()
.