Injections & observational data

Injections & observational data#

Injections#

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, distance etc.) and is used to generate synthetic electromagnetic or gravitational-wave signals for particular sources (e.g. BNS, NSBH).

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.

Create GW signal injection

For a binary neutron star merger, we can use the GWBNS.prior file to generate synthetic signals. Running the command

nmma-create-injection --prior-file GWBNS.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.

Create EM signal injection

Taking the Metzger (2017) blue kilonova model as an example, a set of injections can be generated by using this Me2017.prior file. Here, we include information from an EOS called ALF2.dat for the generation of 100 synthetic electromagnetic kilonova signals:

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

or for the Bu2019lm model:

nmma-create-injection --prior-file priors/Bu2019lm.prior --eos-file example_files/eos/ALF2.dat --binary-type BNS --n-injection 100 --original-parameters --extension json --aligned-spin

There are other options for creating an injection file, such as a pre-computed simulation set. In this case a prior is still needed, but it will only be applied where it is necessary. Taking the Petrov et al. 2022 samples and the Bu2019lm prior as an example:

nmma-create-injection --injection-file example_files/sim_events/injections.dat --prior-file priors/Bu2019lm.prior --eos-file example_files/eos/ALF2.dat --binary-type BNS --n-injection 100 --original-parameters --extension json --aligned-spin

Observational data#

In contrast to synthetic data, NMMA can make use of observational data both from electromagnetic and gravitational-wave observations. In order to make sure that the NMMA framework can smoothly read in and interpret observed signals, a short description of the data structure can be found below.

Electromagnetic data

Observatories provide observational data as a measured flux or as spectral flux density which needs to be converted to the AB magnitude system in order to be used within NMMA. It is important to distinguish between different spectral filters in order to run a consistent analysis. Current available filters can be checked in utils.py. A specific flux or respective magnitude measurement comes along with a specific time stamp which needs to be in the ISOT time format. For further details, see here.

Example: AT2017gfo data excerpt

2017-08-18T00:00:00.000 ps1::g 17.41000 0.02000
2017-08-18T00:00:00.000 ps1::r 17.56000 0.04000
2017-08-18T00:00:00.000 ps1::i 17.48000 0.03000
2017-08-18T00:00:00.000 ps1::z 17.59000 0.03000
2017-08-18T00:00:00.000 ps1::y 17.46000 0.01000
2017-08-18T00:00:00.000 2massj 17.88000 0.03000
2017-08-18T00:00:00.000 2massh 18.26000 0.15000
2017-08-18T00:00:00.000 2massk 18.62000 0.11000
2017-08-18T05:32:38.400 ps1::i 17.24000 0.06000
2017-08-18T05:32:38.400 ps1::z 17.26000 0.06000
2017-08-18T05:32:38.400 ps1::y 17.38000 0.10000
2017-08-18T10:04:48.000 ps1::g 17.46000 0.08000
2017-08-18T10:04:48.000 ps1::r 17.32000 0.07000
2017-08-18T10:04:48.000 ps1::i 17.42000 0.05000
2017-08-18T18:11:31.200 ps1::g 18.05000 0.12000
2017-08-18T18:11:31.200 ps1::r 17.89000 0.03000
2017-08-18T18:11:31.200 2massj 17.51000 0.03000
2017-08-18T18:11:31.200 2massh 17.64000 0.04000
2017-08-18T18:11:31.200 2massk 17.91000 0.05000

The first column represents the ISOT time, followed by the filter or spectral band in the second column, the measured AB magnitude and its respective error are given in the third and fourth column. This data structure detailed above is also applicable for other astrophysical sources (SNe, GRBs) or models implemented in NMMA.

Example: transient data downloaded from SkyPortal/fritz:

"id","mjd","mag","magerr","limiting_mag","filter","instrument_name","instrument_id","snr","magsys","origin","altdata","ra","dec","ra_unc","dec_unc","created_at","annotations","owner","Edit","Delete"
"518817455","60257.28104169993","","","19.30739974975586","ztfr","ZTF","1","","ab","None","","","","","","2023-12-07T05:49:42.369500","","[object Object]","",""
"518817456","60257.282500000205","","","19.347900390625","ztfr","ZTF","1","","ab","None","","","","","","2023-12-07T05:49:42.369555","","[object Object]","",""
"518817457","60257.36459490005","","","20.112499237060547","ztfg","ZTF","1","","ab","None","","","","","","2023-12-07T05:49:42.369574","","[object Object]","",""

Data downloaded from a source’s photometry table on SkyPortal take the comma-separated format above. These files must be converted to NMMA format (see first example above) before running analyses. Run convert-skyportal-lcs --filepath <path/to/lcs.csv> to perform the conversion.