Skip to content
Snippets Groups Projects

Reenable combined sky maps now using multi-ordering

Compare and
8 files
+ 232
86
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 15
6
@@ -59,7 +59,8 @@ def _create_base_alert_dict(classification, superevent, alert_type,
@gracedb.task(shared=False)
def _add_external_coinc_to_alert(alert_dict, superevent):
def _add_external_coinc_to_alert(alert_dict, superevent,
combined_skymap_filename):
external_event = gracedb.get_event(superevent['em_type'])
alert_dict['external_coinc'] = {
@@ -74,6 +75,10 @@ def _add_external_coinc_to_alert(alert_dict, superevent):
'time_sky_position_coincidence_far': superevent['space_coinc_far']
}
if combined_skymap_filename:
alert_dict['external_coinc']['combined_skymap_filename'] = \
combined_skymap_filename
return alert_dict
@@ -131,7 +136,7 @@ def _send(self, alert_dict, skymap, brokerhost):
@app.task(bind=True, ignore_result=True, queue='kafka', shared=False)
def send(self, skymap_and_classification, superevent, alert_type,
raven_coinc=False):
raven_coinc=False, combined_skymap_filename=None):
"""Send an public alert to all currently connected kafka brokers.
Parameters
@@ -169,7 +174,8 @@ def send(self, skymap_and_classification, superevent, alert_type,
if raven_coinc and alert_type != 'retraction':
canvas = (
_add_external_coinc_to_alert.s(alert_dict, superevent)
_add_external_coinc_to_alert.s(alert_dict, superevent,
combined_skymap_filename)
|
group(
(
@@ -200,7 +206,8 @@ def _create_skymap_classification_tuple(skymap, classification):
@app.task(shared=False, ignore_result=True)
def download_skymap_and_send_alert(classification, superevent, alert_type,
skymap_filename=None, raven_coinc=False):
skymap_filename=None, raven_coinc=False,
combined_skymap_filename=False):
"""Wrapper for send function when caller has not already downloaded the
skymap.
@@ -233,14 +240,16 @@ def download_skymap_and_send_alert(classification, superevent, alert_type,
|
_create_skymap_classification_tuple.s(classification)
|
send.s(superevent, alert_type, raven_coinc=raven_coinc)
send.s(superevent, alert_type, raven_coinc=raven_coinc,
combined_skymap_filename=combined_skymap_filename)
)
else:
canvas = send.s(
(None, classification),
superevent,
alert_type,
raven_coinc=raven_coinc
raven_coinc=raven_coinc,
combined_skymap_filename=combined_skymap_filename
)
canvas.apply_async()
Loading