Commit 7d192824 authored by Jean-Gregoire Ducoin's avatar Jean-Gregoire Ducoin Committed by Min-A Cho

add the p(astro) informations in the circular

parent 85426ed4
......@@ -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()
......@@ -82,6 +83,23 @@ def compose(gracedb_id, authors=(), mailto=False,
else:
source_classification = {}
# adding the p_atro informations if available
try:
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"]
except Exception:
pass
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,24 @@ 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 p(astro) obtained from the FGCM counts posterior are the following:
BNS probability: {{ p_BNS }}{{ "\n" }}
BBH probability: {{ p_BBH }}{{ "\n" }}
NSBH probability: {{ p_NSBH }}{{ "\n" }}
Terrestrial probability: {{ p_Terr }}{{ "\n" }}
For the p(astro) definition details see: https://git.ligo.org/shasvath.kapadia/Multicomponent_FGMC_Rates-pAstro/blob/master/Review/multicomponent_fgmc.pdf
{%- else -%}
No p_atro information available
{% endif %}
Updates on our analysis of this event will be sent as they become
available.
{%- endfilter -%}
{"BNS": 0.7827870526188024, "BBH": 0.0, "NSBH": 0.0, "Terr": 0.21721294733807747}
\ No newline at end of file
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