Skip to content

Change deprecated key distance to luminosity_distance #375

@ThibeauWouters

Description

@ThibeauWouters

Describe the bug
There are a few instances where NMMA makes use of the key distance rather than luminosity_distance, but the former seems to be deprecated in favour of the latter. Therefore, one should make sure to remove all references to the former. grepping in NMMA, it seems the deprecated key occurs in the following files:

  • nmma/em/injection_summary.py
  • nmma/eos/create_injection.py
  • nmma/pbilby/analysis/main.py
  • in the example file injections.dat on NMMA found here

This bug can cause unexpected behavior when running injections with nmma-create-injection.py: when giving luminosity distances under the column name distance, the values are ignored and instead, values are sampled from the provided prior.

To Reproduce
Steps to reproduce the behavior:

  1. Download example injections file injections.dat from NMMA repository.
  2. Run the following command
nmma-create-injection \
    --prior-file ./Bu2022Ye.prior \
    --injection-file ./injections.dat \
    --eos-file ../injections_tidal/36022_macroscopic.dat \
    --binary-type BNS \
    --extension json \
    -f ./injection_Bu2022Ye \
    --generation-seed 42 \
    --aligned-spin \
    --eject

where the EOS could be replaced by this EOS file and an example of a prior file is:

timeshift=0
luminosity_distance = Uniform(name='luminosity_distance', minimum=0., maximum=800., latex_label='$d_L$')
inclination_EM = Uniform(name='inclination_EM', minimum=0., maximum=np.pi/2., latex_label='$\\iota$')
log10_mej_dyn  = Uniform(name='log10_mej_dyn', minimum=-3, maximum=-1.7, latex_label='$\\log_{10}M^{\\rm{dyn}}_{\\rm{ej}}$')
vej_dyn = Uniform(name='vej_dyn', minimum=0.12, maximum=0.25, latex_label='$V^{\\rm{dyn}}_{\\rm{ej}}$')
Yedyn = Uniform(name='Yedyn', minimum=0.15, maximum=0.3, latex_label='$Y_{\\rm{e}}$')
log10_mej_wind = Uniform(name='log10_mej_wind', minimum=-2, maximum=-0.89, latex_label='$\\log_{10}M^{\\rm{wind}}_{\\rm{ej}}$')
vej_wind = Uniform(name='vej_wind', minimum=0.03, maximum=0.15, latex_label='$V^{\\rm{wind}}_{\\rm{ej}}$')
alpha = Gaussian(mu=0., sigma=4e-3, name='alpha',latex_label='$\\alpha$')
ratio_zeta = Uniform(minimum=0.10, maximum=0.50, name='ratio_zeta',latex_label='$\\zeta$')
ratio_epsilon = Uniform(minimum=0.00, maximum=1.0, name='ratio_epsilon',latex_label='$\\varepsilon$')
cos_theta_jn = Uniform(name='cos_theta_jn', minimum=-1, maximum=1, boundary='reflective')

Expected behavior
The injected luminosity distances are the ones written down in the distance column of the injections.dat file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions