Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gwcelery
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Sushant Sharma-Chaudhary
gwcelery
Commits
87da0d0a
Commit
87da0d0a
authored
6 months ago
by
Sushant Sharma-Chaudhary
Browse files
Options
Downloads
Patches
Plain Diff
HIGH PROFILE label changes
parent
0c5bc907
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gwcelery/tasks/rrt_utils.py
+41
-3
41 additions, 3 deletions
gwcelery/tasks/rrt_utils.py
with
41 additions
and
3 deletions
gwcelery/tasks/rrt_utils.py
+
41
−
3
View file @
87da0d0a
import
json
import
numpy
as
np
from
ligo.skymap.io
import
read_sky_map
from
ligo.skymap.postprocess.crossmatch
import
crossmatch
...
...
@@ -32,12 +33,23 @@ def check_high_profile(skymap, em_bright,
far_list_sorted
[
0
][
"
search
"
]
!=
"
BBH
"
:
gracedb
.
create_label
.
si
(
'
HIGH_PROFILE
'
,
superevent_id
).
delay
()
gracedb
.
upload
.
delay
(
None
,
None
,
superevent_id
,
"
Superevent labeled HIGH_PROFILE since
\
event with lowest FAR is a Burst event.
"
)
return
"
Event with the lowest FAR is a Burst event. Applying label
"
# annotation number condition
preferred_event
=
superevent
[
'
preferred_event_data
'
]
if
preferred_event
[
"
search
"
]
==
"
SSM
"
:
gracedb
.
create_label
.
si
(
'
HIGH_PROFILE
'
,
superevent_id
).
delay
()
gracedb
.
upload
.
delay
(
None
,
None
,
superevent_id
,
"
Superevent labeled HIGH_PROFILE since
\
preferred event is from SSM search.
"
)
return
"
Preferred event is from SSM. Applying label
"
if
preferred_event
[
"
group
"
]
==
"
CBC
"
:
em_bright_dict
=
json
.
loads
(
em_bright
)
has_remnant
=
em_bright_dict
[
'
HasRemnant
'
]
pastro_dict
=
json
.
loads
(
p_astro
)
...
...
@@ -50,10 +62,36 @@ def check_high_profile(skymap, em_bright,
cl
=
90
result
=
crossmatch
(
gw_skymap
,
contours
=
[
cl
/
100
])
sky_area
=
result
.
contour_areas
[
0
]
is_far_away
=
not
(
gw_skymap
.
meta
.
get
(
'
distmean
'
,
np
.
nan
)
<
2000
)
if
p_terr
<
0.5
:
if
(
p_bns
>
0.1
or
p_nsbh
>
0.1
or
has_remnant
>
0.1
or
sky_area
<
100
):
# noqa: E501
if
p_bns
>
0.1
:
gracedb
.
create_label
.
si
(
'
HIGH_PROFILE
'
,
superevent_id
).
delay
()
gracedb
.
upload
.
delay
(
None
,
None
,
superevent_id
,
"
Superevent labeled HIGH_PROFILE
\
because p_BNS > 10%
"
)
return
"
p_BNS condition satisfied. Applying label
"
elif
p_nsbh
>
0.1
:
gracedb
.
create_label
.
si
(
'
HIGH_PROFILE
'
,
superevent_id
).
delay
()
gracedb
.
upload
.
delay
(
None
,
None
,
superevent_id
,
"
Superevent labeled HIGH_PROFILE
\
because p_NSBH> 10%
"
)
return
"
p_NSBH condition satisfied. Applying label
"
elif
has_remnant
>
0.1
:
gracedb
.
create_label
.
si
(
'
HIGH_PROFILE
'
,
superevent_id
).
delay
()
gracedb
.
upload
.
delay
(
None
,
None
,
superevent_id
,
"
Superevent labeled HIGH_PROFILE
\
because p_HasRemnant> 10%
"
)
return
"
p_HasRemnant condition satisfied. Applying label
"
elif
(
sky_area
<
100
and
not
is_far_away
):
gracedb
.
create_label
.
si
(
'
HIGH_PROFILE
'
,
superevent_id
).
delay
()
return
"
Annotations condition satisfied. Applying label
"
gracedb
.
upload
.
delay
(
None
,
None
,
superevent_id
,
"
Superevent labeled HIGH_PROFILE
\
because area of 90% confidence level
\
in the skymap is < 100 sq.deg and mean
\
posterior distance is < 2 Gpc
"
)
return
"
Skymap & distance condition satisfied. Applying label
"
return
"
No conditions satisfied. Skipping
"
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