gwcelery.tasks.p_astro_other module

Computation of p_astro by source category. See Kapadia et al (2019), arXiv:1903.06881, for details.

gwcelery.tasks.p_astro_other.read_mean_values()[source]

Reads the mean values in the file pointed to by a url.

Returns:mean_values_dict – mean values read from url file
Return type:dictionary
(task)gwcelery.tasks.p_astro_other.compute_p_astro(snr, far, mass1, mass2, pipeline, instruments)[source]

Task to compute p_astro by source category.

Parameters:
  • snr (float) – event’s SNR
  • far (float) – event’s cfar
  • mass1 (float) – event’s mass1
  • mass2 (float) – event’s mass2
  • instruments (set) – set of instruments that detected the event
Returns:

p_astros – JSON dump of the p_astro by source category

Return type:

str

Example

>>> p_astros = json.loads(compute_p_astro(files))
>>> p_astros
{'BNS': 0.999, 'BBH': 0.0, 'NSBH': 0.0, 'Terrestrial': 0.001}