gwcelery.tasks.em_bright module

This module computes the probabilities that there is a neutron star in the binary, and that the coalescence event resulted in creation of tidally disrupted matter.

The result is returned in the form of a JSON file:

‘{“HasNS”: 1.0, “HasRemnant”: 1.0}’

  • HasNS: The probability that at least one of the component masses
    in the binary is a neutron star. The definition of a neutron star in this context simply means an object with mass less than 3.0 solar mass.
  • HasRemnant: The probability that the binary system can produce
    tidally disrupted matter during coalescence. This is computed using the fitting formula in arXiv:1807.00011 We are currently using an extremely stiff equation of state (2H) to compute the compactness of the neutron star. This results in a higher chance of labelling a systems with non-zero HasRemnant value.

Qualitative source properties for CBC events.

(task)gwcelery.tasks.em_bright.handle(alert)[source]

LVAlert handler to plot and upload a visualization of every em_bright.json.

(task)gwcelery.tasks.em_bright.plot(contents)[source]

Make a visualization of the source properties.

Examples

>>> from gwcelery.tasks import em_bright
>>> contents = '{"HasNS": 0.9137, "HasRemnant": 0.0}'
>>> em_bright.plot(contents)

(Source code, png, hires.png, pdf)

_images/gwcelery-tasks-em_bright-1.png
(task)gwcelery.tasks.em_bright.em_bright_posterior_samples(posterior_file_content)[source]

Returns the probability of having a NS component and remnant using LALInference posterior samples.

Parameters:posterior_file_content (hdf5 posterior file content) –
Returns:JSON formatted string storing HasNS and HasRemnant probabilities
Return type:str

Examples

>>> em_bright_posterior_samples(GraceDb().files('S190930s',
... 'LALInference.posterior_samples.hdf5').read())
{"HasNS": 0.014904901243599122, "HasRemnant": 0.0}
(task)gwcelery.tasks.em_bright.classifier_other(mass1, mass2, spin1z, spin2z, snr)[source]

Returns the boolean probability of having a NS component and the probability of having non-zero disk mass. This method is used for pipelines that do not provide the data products necessary for computation of the source properties probabilities.

Parameters:
  • mass1 (float) – Primary mass in solar masses
  • mass2 (float) – Secondary mass in solar masses
  • spin1z (float) – Dimensionless primary aligned spin component
  • spin2z (float) – Dimensionless secondary aligned spin component
  • snr (float) – Signal to noise ratio
Returns:

JSON formatted string storing HasNS and HasRemnant probabilities

Return type:

str

Examples

>>> em_bright.classifier_other(2.0, 1.0, 0.0, 0.0, 10.)
'{"HasNS": 1.0, "HasRemnant": 1.0}'
(task)gwcelery.tasks.em_bright.classifier_gstlal(mass1, mass2, spin1z, spin2z, snr)[source]

Returns the probability of having a NS component and the probability of having non-zero disk mass in the detected event. This method will be using the data products obtained from the weekly supervised learning runs for injections campaigns. The data products are in pickle formatted RandomForestClassifier objects. The method predict_proba of these objects provides us the probabilities of the coalesence being EM-Bright and existence of neutron star in the binary.

Parameters:
  • mass1 (float) – Primary mass in solar masses
  • mass2 (float) – Secondary mass in solar masses
  • spin1z (float) – Dimensionless primary aligned spin component
  • spin2z (float) – Dimensionless secondary aligned spin component
  • snr (float) – Signal to noise ratio
Returns:

JSON formatted string storing HasNS and HasRemnant probabilities

Return type:

str

Examples

>>> em_bright.classifier_gstlal(2.0, 1.0, 0.0, 0.0, 10.)
'{"HasNS": 1.0, "HasRemnant": 1.0}'