Commit b58a143f authored by Jean-Gregoire Ducoin's avatar Jean-Gregoire Ducoin Committed by Ducoin Jean-Gregoire

add the p(astro) informations in the circular

parent 30ad6305
Pipeline #48086 passed with stages
in 4 minutes and 44 seconds
......@@ -35,6 +35,7 @@ def guess_skyloc_pipeline(comments):
def compose(gracedb_id, authors=(), mailto=False,
service=rest.DEFAULT_SERVICE_URL, client=None):
"""Compose GCN Circular draft"""
if client is None:
client = rest.GraceDb(service)
event = client.superevent(gracedb_id).json()
......@@ -74,7 +75,6 @@ def compose(gracedb_id, authors=(), mailto=False,
latency=issued_time-event_time.datetime)
break
skymaps = list(skymaps.values())
em_brightfile = 'source_classification.json'
if em_brightfile in files:
source_classification = client.files(
......@@ -82,6 +82,24 @@ def compose(gracedb_id, authors=(), mailto=False,
else:
source_classification = {}
# adding the p_atro informations if available
preferred_event_files = client.files(preferred_event_id).json()
p_astro_file = 'p_astro_gstlal.json'
if p_astro_file in preferred_event_files:
p_astro = client.files(preferred_event_id,
'p_astro_gstlal.json').json()
p_BBH = p_astro["BBH"]
p_BNS = p_astro["BNS"]
p_NSBH = p_astro["NSBH"]
p_Terr = p_astro["Terr"]
else:
p_astro = None
p_BBH = None
p_BNS = None
p_NSBH = None
p_Terr = None
o = urllib.parse.urlparse(client.service_url)
kwargs = dict(
......@@ -99,7 +117,12 @@ def compose(gracedb_id, authors=(), mailto=False,
skymaps=skymaps,
prob_has_ns=source_classification.get('Prob NS2'),
prob_has_remnant=source_classification.get('Prob EMbright'),
include_ellipse=None)
include_ellipse=None,
p_astro=p_astro,
p_BBH=p_BBH,
p_BNS=p_BNS,
p_NSBH=p_NSBH,
p_Terr=p_Terr)
if skymaps:
preferred_skymap = skymaps[-1]['filename']
......
......@@ -96,8 +96,27 @@ semi-minor axis, position angle of the semi-minor axis):
{{- ' ' }}{{ a.round().to_string(fields=1, unit='deg') }},
{{- ' ' }}{{ b.round().to_string(fields=1, unit='deg') }},
{{- ' ' }}{{ pa.round().to_string(fields=1, unit='deg') }})
{% endif %}
{% if p_astro is not none -%}
The categorical astrophysical probabilities for the candidate event as
computed by the P_astro pipeline are:
BNS probability: {{ p_BNS }}
BBH probability: {{ p_BBH }}
NSBH probability: {{ p_NSBH }}
Terrestrial probability: {{ p_Terr }}
For more details on the P_astro pipeline, please consult
this technical document: <https://dcc.ligo.org/T1800072>
{%- else -%}
No P_astro information available
{% endif %}
{% endif -%}
Updates on our analysis of this event will be sent as they become
available.
{%- endfilter -%}
{"coinc.xml": "https://gracedb-dev1.ligo.org/api/events/M1234/files/coinc.xml", "initial.data": "https://gracedb-dev1.ligo.org/api/events/M1234/files/initial.data", "initial.data,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/initial.data,0", "event.log,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/event.log,0", "psd.xml.gz,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/psd.xml.gz,0", "event.log": "https://gracedb-dev1.ligo.org/api/events/M1234/files/event.log", "bayestar.fits.gz,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/bayestar.fits.gz,0", "psd.xml.gz": "https://gracedb-dev1.ligo.org/api/events/M1234/files/psd.xml.gz", "coinc.xml,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/coinc.xml,0", "bayestar.fits.gz": "https://gracedb-dev1.ligo.org/api/events/M1234/files/bayestar.fits.gz"}
{"coinc.xml": "https://gracedb-dev1.ligo.org/api/events/M1234/files/coinc.xml", "initial.data": "https://gracedb-dev1.ligo.org/api/events/M1234/files/initial.data", "initial.data,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/initial.data,0", "event.log,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/event.log,0", "psd.xml.gz,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/psd.xml.gz,0", "event.log": "https://gracedb-dev1.ligo.org/api/events/M1234/files/event.log", "bayestar.fits.gz,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/bayestar.fits.gz,0", "psd.xml.gz": "https://gracedb-dev1.ligo.org/api/events/M1234/files/psd.xml.gz", "coinc.xml,0": "https://gracedb-dev1.ligo.org/api/events/M1234/files/coinc.xml,0", "bayestar.fits.gz": "https://gracedb-dev1.ligo.org/api/events/M1234/files/bayestar.fits.gz","p_astro_gstlal.json":"https://gracedb-dev1.ligo.org/api/events/M1234/files/p_astro_gstlal.json"}
{"BNS": 0.7827870526188024, "BBH": 0.0, "NSBH": 0.0, "Terr": 0.21721294733807747}
\ No newline at end of file
{"coinc.xml": "https://gracedb-dev1.ligo.org/api/events/S1234/files/coinc.xml", "initial.data": "https://gracedb-dev1.ligo.org/api/events/S1234/files/initial.data", "initial.data,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/initial.data,0", "event.log,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/event.log,0", "psd.xml.gz,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/psd.xml.gz,0", "event.log": "https://gracedb-dev1.ligo.org/api/events/S1234/files/event.log", "bayestar.fits.gz,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/bayestar.fits.gz,0", "psd.xml.gz": "https://gracedb-dev1.ligo.org/api/events/S1234/files/psd.xml.gz", "coinc.xml,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/coinc.xml,0", "bayestar.fits.gz": "https://gracedb-dev1.ligo.org/api/events/S1234/files/bayestar.fits.gz", "LALInference.fits.gz": "https://gracedb-dev1.ligo.org/api/events/S1234/files/LALInference.fits.gz", "LALInference.fits.gz,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/LALInference.fits.gz,0", "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"}
{"coinc.xml": "https://gracedb-dev1.ligo.org/api/events/S1234/files/coinc.xml", "initial.data": "https://gracedb-dev1.ligo.org/api/events/S1234/files/initial.data", "initial.data,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/initial.data,0", "event.log,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/event.log,0", "psd.xml.gz,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/psd.xml.gz,0", "event.log": "https://gracedb-dev1.ligo.org/api/events/S1234/files/event.log", "bayestar.fits.gz,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/bayestar.fits.gz,0", "psd.xml.gz": "https://gracedb-dev1.ligo.org/api/events/S1234/files/psd.xml.gz", "coinc.xml,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/coinc.xml,0", "bayestar.fits.gz": "https://gracedb-dev1.ligo.org/api/events/S1234/files/bayestar.fits.gz", "LALInference.fits.gz": "https://gracedb-dev1.ligo.org/api/events/S1234/files/LALInference.fits.gz", "LALInference.fits.gz,0": "https://gracedb-dev1.ligo.org/api/events/S1234/files/LALInference.fits.gz,0", "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", "source_classification.json": "https://gracedb-dev1.ligo.org/api/events/S1234/files/source_classification.json"}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment