Add new VOEvent parameters

Add the following (optional) parameters for creating VOEvents:
  * BNS (probability that source is BNS)
  * NSBH (probability that source is NS-BH)
  * BBH (probability that source is BBH)
  * Terrestrial (probability that the source is terrestrial/noise)
parent f5579005
Pipeline #41185 passed with stages
in 3 minutes and 40 seconds
......@@ -1829,7 +1829,8 @@ class GraceDb(GsiRest):
def createVOEvent(self, object_id, voevent_type, skymap_type=None,
skymap_filename=None, skymap_image_filename=None, internal=True,
open_alert=False, hardware_inj=False, CoincComment=False,
ProbHasNS=None, ProbHasRemnant=None, *args, **kwargs):
ProbHasNS=None, ProbHasRemnant=None, BNS=None, NSBH=None,
BBH=None, Terrestrial=None, *args, **kwargs):
"""Create a new VOEvent
Signature:
......@@ -1857,11 +1858,18 @@ class GraceDb(GsiRest):
(True/False)
CoincComment: whether the candidate has a possible counterpart
GRB (True/False)
The following arguments are optional and only apply to CBC events:
ProbHasNS: probability that at least one object in the binary is
less than 3 M_sun (optional)
ProbHasRemnant: probability that there is matter in the
surroundings of the central object (optional)
BNS: probability that the source is a binary neutron star merger
NSBH: probability that the source is a neutron star-black hole
merger
BBH: probability that the source is a binary black hole merger
Terrestrial: probability that the source is terrestrial (i.e.,
a background noise fluctuation or a glitch)
"""
is_superevent = kwargs.pop('is_superevent', False)
if is_superevent:
......@@ -1906,6 +1914,14 @@ class GraceDb(GsiRest):
body['ProbHasNS'] = ProbHasNS
if ProbHasRemnant is not None:
body['ProbHasRemnant'] = ProbHasRemnant
if BNS is not None:
body['BNS'] = BNS
if NSBH is not None:
body['NSBH'] = NSBH
if BBH is not None:
body['BBH'] = BBH
if Terrestrial is not None:
body['Terrestrial'] = Terrestrial
return self.post(uri, body=body)
......
......@@ -593,6 +593,10 @@ class TestSuperevents(TestGraceDb):
'CoincComment': False,
'ProbHasNS': 0.1,
'ProbHasRemnant': 0.9,
'BNS': 0.2,
'NSBH': 0.3,
'BBH': 0.4,
'Terrestrial': 0.5,
}
response = self._gracedb.createVOEvent(self.superevent_id, 'PR',
**pr_voevent)
......@@ -624,6 +628,10 @@ class TestSuperevents(TestGraceDb):
'CoincComment': False,
'ProbHasNS': 0.2,
'ProbHasRemnant': 0.9,
'BNS': 0.2,
'NSBH': 0.3,
'BBH': 0.4,
'Terrestrial': 0.5,
}
response = self._gracedb.createVOEvent(self.superevent_id, 'UP',
**up_voevent)
......
......@@ -85,7 +85,8 @@ class TestVOEvents(TestGraceDb):
"""Create an update VOEvent"""
r = self._gracedb.createVOEvent(self._graceid, "Update",
skymap_filename="fake_skymap.txt", skymap_type="FAKE",
skymap_image_filename="fake_skymap_image.txt")
skymap_image_filename="fake_skymap_image.txt",
ProbHasRemnant=0.2, BBH=0.1, Terrestrial=0.3)
rdict = r.json()
self.assertTrue('voevent_type' in list(rdict.keys()))
......
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