Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Leo Pound Singer
ligo-followup-advocate
Commits
f1a23df6
Commit
f1a23df6
authored
Oct 09, 2019
by
Brandon Piotrzkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get p_astro and em_bright from superevent instead of preferred event
parent
29be9a54
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
33 additions
and
14 deletions
+33
-14
CHANGES.md
CHANGES.md
+3
-0
ligo/followup_advocate/__init__.py
ligo/followup_advocate/__init__.py
+19
-11
ligo/followup_advocate/test/data/S1234/files.json
ligo/followup_advocate/test/data/S1234/files.json
+3
-1
ligo/followup_advocate/test/data/S1234/files/em_bright.json
ligo/followup_advocate/test/data/S1234/files/em_bright.json
+0
-0
ligo/followup_advocate/test/data/S1234/files/p_astro.json
ligo/followup_advocate/test/data/S1234/files/p_astro.json
+0
-0
ligo/followup_advocate/test/data/S5678/files.json
ligo/followup_advocate/test/data/S5678/files.json
+5
-1
ligo/followup_advocate/test/data/S5678/files/em_bright.json
ligo/followup_advocate/test/data/S5678/files/em_bright.json
+0
-0
ligo/followup_advocate/test/data/S5678/files/em_bright.json,0
.../followup_advocate/test/data/S5678/files/em_bright.json,0
+1
-0
ligo/followup_advocate/test/data/S5678/files/p_astro.json
ligo/followup_advocate/test/data/S5678/files/p_astro.json
+0
-0
ligo/followup_advocate/test/data/S5678/files/p_astro.json,0
ligo/followup_advocate/test/data/S5678/files/p_astro.json,0
+1
-0
setup.cfg
setup.cfg
+1
-1
No files found.
CHANGES.md
View file @
f1a23df6
...
...
@@ -14,6 +14,9 @@
-
Change EM_Bright section to simply state the probability of HasNS
and HasRemnant instate of relative amount of evidence.
-
Get p_astro and em_bright files from the superevent instead of the
preferred event in order to accomodate PE-based results.
## 1.1.2 (2019-09-25)
-
Remove check that sky map has
`public`
and
`sky_loc`
tags in order to
...
...
ligo/followup_advocate/__init__.py
View file @
f1a23df6
...
...
@@ -76,23 +76,31 @@ def main_dict(gracedb_id, client):
filename
=
filename
,
latency
=
issued_time
-
event_time
.
datetime
)
skymaps
=
list
(
skymaps
.
values
())
preferred_event_files
=
client
.
files
(
preferred_event_id
).
json
()
em_brightfile
=
'em_bright.json'
if
em_brightfile
in
preferred_event_files
:
# Grab latest p_astro and em_bright files
superevent_files
=
client
.
files
(
gracedb_id
).
json
()
em_brightfilename
=
'em_bright'
p_astrofilename
=
'p_astro'
em_brightfiles
=
[]
p_astrofiles
=
[]
for
file
in
superevent_files
:
if
em_brightfilename
in
file
:
em_brightfiles
.
append
(
file
)
elif
p_astrofilename
in
file
:
p_astrofiles
.
append
(
file
)
if
em_brightfiles
:
source_classification
=
client
.
files
(
preferred_event
_id
,
em_brightfile
).
json
()
gracedb
_id
,
em_brightfile
s
[
-
1
]
).
json
()
source_classification
=
{
key
:
100
*
value
for
key
,
value
in
source_classification
.
items
()}
else
:
source_classification
=
{}
# adding the p_atro informations if available
p_astro_file
=
'p_astro.json'
if
p_astro_file
in
preferred_event_files
:
classifications
=
client
.
files
(
preferred_event_id
,
p_astro_file
).
json
()
# Convert to percent for consistency with em_bright
if
p_astrofiles
:
classifications
=
client
.
files
(
gracedb_id
,
p_astrofiles
[
-
1
]).
json
()
classifications
=
{
key
:
100
*
value
for
key
,
value
in
classifications
.
items
()}
else
:
...
...
ligo/followup_advocate/test/data/S1234/files.json
View file @
f1a23df6
...
...
@@ -15,5 +15,7 @@
"S1234-1-Initial.xml"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/S1234-1-Initial.xml"
,
"S1234-2-Update.xml"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/S1234-2-Update.xml"
,
"coincidence_far.json"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/coincidence_far.json"
,
"bayestar-gbm.fits.gz"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/bayestar-gbm.fits.gz"
"bayestar-gbm.fits.gz"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/bayestar-gbm.fits.gz"
,
"p_astro.json"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/p_astro.json"
,
"em_bright.json"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/em_bright.json"
}
ligo/followup_advocate/test/data/
M
1234/files/em_bright.json
→
ligo/followup_advocate/test/data/
S
1234/files/em_bright.json
View file @
f1a23df6
File moved
ligo/followup_advocate/test/data/
M
1234/files/p_astro.json
→
ligo/followup_advocate/test/data/
S
1234/files/p_astro.json
View file @
f1a23df6
File moved
ligo/followup_advocate/test/data/S5678/files.json
View file @
f1a23df6
...
...
@@ -14,5 +14,9 @@
"S5678-1-Initial.xml"
:
"https://gracedb-dev1.ligo.org/api/events/S5678/files/S5678-1-Initial.xml"
,
"S5678-2-Update.xml"
:
"https://gracedb-dev1.ligo.org/api/events/S5678/files/S5678-2-Update.xml"
,
"coincidence_far.json"
:
"https://gracedb-dev1.ligo.org/api/events/S5678/files/coincidence_far.json"
,
"bayestar-gbm.fits.gz"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/bayestar-gbm.fits.gz"
"bayestar-gbm.fits.gz"
:
"https://gracedb-dev1.ligo.org/api/events/S1234/files/bayestar-gbm.fits.gz"
,
"p_astro.json"
:
"https://gracedb-dev1.ligo.org/api/events/S5678/files/p_astro.json"
,
"em_bright.json"
:
"https://gracedb-dev1.ligo.org/api/events/S5678/files/em_bright.json"
,
"p_astro.json,0"
:
"https://gracedb-dev1.ligo.org/api/events/S5678/files/p_astro.json,0"
,
"em_bright.json,0"
:
"https://gracedb-dev1.ligo.org/api/events/S5678/files/em_bright.json,0"
}
ligo/followup_advocate/test/data/
M
5678/files/em_bright.json
→
ligo/followup_advocate/test/data/
S
5678/files/em_bright.json
View file @
f1a23df6
File moved
ligo/followup_advocate/test/data/S5678/files/em_bright.json,0
0 → 100644
View file @
f1a23df6
{"HasNS": 1.0, "HasRemnant": 0.0}
\ No newline at end of file
ligo/followup_advocate/test/data/
M
5678/files/p_astro.json
→
ligo/followup_advocate/test/data/
S
5678/files/p_astro.json
View file @
f1a23df6
File moved
ligo/followup_advocate/test/data/S5678/files/p_astro.json,0
0 → 100644
View file @
f1a23df6
{"BNS": 0.0, "NSBH": 0.6778160323909137, "BBH": 0.0, "MassGap": 0.0, "Terrestrial": 0.32218396760908624}
\ No newline at end of file
setup.cfg
View file @
f1a23df6
...
...
@@ -42,7 +42,7 @@ console_scripts =
[options.package_data]
ligo.followup_advocate.templates = *.jinja2
ligo.followup_advocate.test = data/*/*.json, data/*/files/*.json, data/*/files/*.xml, data/*/files/*.fits, data/*/files/*.fits.gz, data/*/files/*.data, data/*/files/*.fits.gz*
ligo.followup_advocate.test = data/*/*.json, data/*/files/*.json, data/*/files/*.xml, data/*/files/*.fits, data/*/files/*.fits.gz, data/*/files/*.data, data/*/files/*.fits.gz*
, data/*/files/*.json*
[versioneer]
VCS = git
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment