Injections using NMMA

Injections files

For a parameter estimation run on simulated data (i.e., when no observational data is available), an injection-file line is required in your config.ini-file pointing a dat or json injection file. The injection file itself contains a list of values for each source parameter (such as masses, spins, distance etc.) and is used to generate synthetic electromagnetic or gravitational-wave signals for particular sources (e.g. BNS, NSBH).

Generating injections files

To generate an injection file, NMMA provides the command-line utility nmma_create_injection. This generates a json style injection file by drawing from a prior file. An example of a prior file called bns.prior for binary neutron star systems with aligned spins is given below:

mass_1 = Uniform(name='mass_1', minimum=1., maximum=2.)
mass_2 = Uniform(name='mass_2', minimum=1., maximum=2.)
chi_1 = bilby.gw.prior.AlignedSpin(name='chi_1', a_prior=Uniform(minimum=0, maximum=0.05))
chi_2 = bilby.gw.prior.AlignedSpin(name='chi_2', a_prior=Uniform(minimum=0, maximum=0.05))
luminosity_distance = bilby.gw.prior.UniformComovingVolume(name='luminosity_distance', minimum=10, maximum=100, unit='Mpc', latex_label='$d_L$')
dec =  Cosine(name='dec', boundary='reflective')
ra =  Uniform(name='ra', minimum=0, maximum=2 * np.pi, boundary='periodic')
cos_theta_jn = Uniform(name='cos_theta_jn', minimum=-1, maximum=1)
psi = Uniform(name='psi', minimum=0, maximum=np.pi, boundary='periodic')
phase = Uniform(name='phase', minimum=0, maximum=2 * np.pi, boundary='periodic')

Running the command

nmma_create_injection --prior-file bns.prior -n 10 -s 42 --eos-file <EOSdata.dat> --binary-type BNS -e json -f injection_bns --duration 128

will create an injection file injection_bns.json for 10 BNS sources each having a duration of 128 s. The eos-file command is useful, when information from a particular EOS should be used. Here, the path and file name to the EOS file needs to be provided.

Additional examples and files

Taking the Metzger (2017) blue kilonova model as an example, a set of injections can be generated by simply using this Me2017.prior file (all are found in nmma/priors/). Example EOS files can be found here. Using the same command as above

nmma_create_injection --prior-file priors/Me2017.prior --eos-file example_files/eos/ALF2.dat --binary-type BNS --n-injection 100 --original-parameters --extension json

an injection.json is generated with the Me2017.prior including a number of injections specified by –n-injection.

Last modified: le 2023/06/15 14:48