Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gwcelery
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
emfollow
gwcelery
Commits
a3d88d08
Commit
a3d88d08
authored
2 years ago
by
Cody Messick
Browse files
Options
Downloads
Patches
Plain Diff
Integrate MLy into superevent manager
parent
95763862
No related branches found
No related tags found
1 merge request
!897
Integrate MLy into superevent manager
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gwcelery/tasks/superevents.py
+8
-1
8 additions, 1 deletion
gwcelery/tasks/superevents.py
gwcelery/tests/test_tasks_superevents.py
+31
-0
31 additions, 0 deletions
gwcelery/tests/test_tasks_superevents.py
with
39 additions
and
1 deletion
gwcelery/tasks/superevents.py
+
8
−
1
View file @
a3d88d08
...
...
@@ -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
'
)
...
...
This diff is collapsed.
Click to expand it.
gwcelery/tests/test_tasks_superevents.py
+
31
−
0
View file @
a3d88d08
...
...
@@ -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,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment