Skip to content
Snippets Groups Projects
Commit a3d88d08 authored by Cody Messick's avatar Cody Messick
Browse files

Integrate MLy into superevent manager

parent 95763862
No related branches found
No related tags found
1 merge request!897Integrate MLy into superevent manager
......@@ -51,6 +51,7 @@ has all data products required to make it ready for annotations."""
'cbc_mbta',
'burst_olib',
'burst_cwb',
'burst_mly',
shared=False)
def handle(payload):
"""Respond to IGWN alert topics from low-latency search pipelines and
......@@ -230,7 +231,7 @@ def get_category(event):
def get_ts(event):
"""Get time extent of an event, depending on pipeline-specific parameters.
* For CWB, use the event's ``duration`` field.
* For CWB and MLy, use the event's ``duration`` field.
* For oLIB, use the ratio of the event's ``quality_mean`` and
``frequency_mean`` fields.
* For all other pipelines, use the
......@@ -263,6 +264,9 @@ def get_ts(event):
attribs = event['extra_attributes']['LalInferenceBurst']
d_t_start = d_t_end = (attribs['quality_mean'] /
attribs['frequency_mean'])
elif pipeline == 'mly':
attribs = event['extra_attributes']['MLyBurst']
d_t_start = d_t_end = attribs['duration']
else:
d_t_start = app.conf['superevent_d_t_start'].get(
pipeline, app.conf['superevent_default_d_t_start'])
......@@ -301,6 +305,9 @@ def get_snr(event):
elif pipeline == 'olib':
attribs = event['extra_attributes']['LalInferenceBurst']
return attribs['omicron_snr_network']
elif pipeline == 'mly':
attribs = event['extra_attributes']['MLyBurst']
return attribs['SNR']
else:
raise NotImplementedError('SNR attribute not found')
......
......@@ -883,6 +883,37 @@ def test_parse_trigger_burst_5():
p2.assert_called_once_with('EM_Selected', 'S123456')
def test_parse_trigger_burst_6():
"""New less-significant MLy trigger, which is complete, no intersecting
superevent. New superevent created and labeled EM_Selected.
"""
event_dictionary = {'graceid': 'G123456',
'gpstime': 1.0,
'group': 'Burst',
'pipeline': 'MLy',
'search': 'AllSky',
'offline': False,
'far': 1e-6,
'instruments': 'H1,L1',
'labels': ['SKYMAP_READY'],
'superevent': None,
'superevent_neighbours': SUPEREVENTS_NEIGHBOURS,
'extra_attributes': {
'MLyBurst': {
'duration': 5.0,
'SNR': 100.0}}}
payload = dict(object=event_dictionary,
data=event_dictionary,
alert_type='new',
uid='G123456')
with patch('gwcelery.tasks.gracedb.create_superevent',
return_value='S123456') as p1, \
patch('gwcelery.tasks.gracedb.create_label') as p2:
superevents.handle(payload)
p1.assert_called_once()
p2.assert_called_once_with('EM_Selected', 'S123456')
def test_S190421ar_spiir_scenario(): # noqa: N802
"""Test to ensure that a low FAR event with accidental high
SNR is not promoted to the preferred event status. For example, here,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment