bilby-dev / nessai-bilby

Interface and plugin for using nessai in bilby
MIT License
1 stars 1 forks source link

nessai cannot reparameterise unbounded recalibration prior bounds #12

Closed SSL32081 closed 1 month ago

SSL32081 commented 2 months ago

It appears that the recalibration prior bounds are unbounded and are causing issues when running with nessai.

The error message is:

  File "/cvmfs/software.igwn.org/conda/envs/igwn-py311-20240910/lib/python3.11/site-packages/nessai/proposal/flowproposal.py", line 740, in set_rescaling
    self.configure_reparameterisations(self.reparameterisations)
  File "/cvmfs/software.igwn.org/conda/envs/igwn-py311-20240910/lib/python3.11/site-packages/nessai/proposal/flowproposal.py", line 658, in configure_reparameterisations
    r = rc(prior_bounds=prior_bounds, **default_config)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/cvmfs/software.igwn.org/conda/envs/igwn-py311-20240910/lib/python3.11/site-packages/nessai/reparameterisations/rescale.py", line 232, in __init__
    super().__init__(parameters=parameters, prior_bounds=prior_bounds)
  File "/cvmfs/software.igwn.org/conda/envs/igwn-py311-20240910/lib/python3.11/site-packages/nessai/reparameterisations/base.py", line 75, in __init__
    raise RuntimeError(
RuntimeError: Reparameterisation rescaletobounds_chirp_mass_mass_ratio_a_1_a_2_tilt_1_tilt_2_phi_12_phi_jl_luminosity_distance_theta_jn_psi_phase_azimuth_zenith_L1_time_recalib_H1_amplitude_0_recalib_H1_amplitude_1_recalib_H1_amplitude_2_recalib_H1_amplitude_3_recalib_H1_amplitude_4_recalib_H1_amplitude_5_recalib_H1_amplitude_6_recalib_H1_amplitude_7_recalib_H1_amplitude_8_recalib_H1_amplitude_9_recalib_H1_phase_0_recalib_H1_phase_1_recalib_H1_phase_2_recalib_H1_phase_3_recalib_H1_phase_4_recalib_H1_phase_5_recalib_H1_phase_6_recalib_H1_phase_7_recalib_H1_phase_8_recalib_H1_phase_9_recalib_L1_amplitude_0_recalib_L1_amplitude_1_recalib_L1_amplitude_2_recalib_L1_amplitude_3_recalib_L1_amplitude_4_recalib_L1_amplitude_5_recalib_L1_amplitude_6_recalib_L1_amplitude_7_recalib_L1_amplitude_8_recalib_L1_amplitude_9_recalib_L1_phase_0_recalib_L1_phase_1_recalib_L1_phase_2_recalib_L1_phase_3_recalib_L1_phase_4_recalib_L1_phase_5_recalib_L1_phase_6_recalib_L1_phase_7_recalib_L1_phase_8_recalib_L1_phase_9 requires finite prior bounds. Received: {'chirp_mass': array([ 10., 200.]), 'mass_ratio': array([0.05, 1.  ]), 'a_1': array([0.  , 0.99]), 'a_2': array([0.  , 0.99]), 'tilt_1': array([0.        , 3.14159265]), 'tilt_2': array([0.        , 3.14159265]), 'phi_12': array([0.        , 6.28318531]), 'phi_jl': array([0.        , 6.28318531]), 'luminosity_distance': array([   10., 10000.]), 'theta_jn': array([0.        , 3.14159265]), 'psi': array([0.        , 3.14159265]), 'phase': array([0.        , 6.28318531]), 'azimuth': array([0.        , 6.28318531]), 'zenith': array([0.        , 3.14159265]), 'L1_time': array([1.41087124e+09, 1.41087124e+09]), 'recalib_H1_amplitude_0': array([-inf,  inf]), 'recalib_H1_amplitude_1': array([-inf,  inf]), 'recalib_H1_amplitude_2': array([-inf,  inf]), 'recalib_H1_amplitude_3': array([-inf,  inf]), 'recalib_H1_amplitude_4': array([-inf,  inf]), 'recalib_H1_amplitude_5': array([-inf,  inf]), 'recalib_H1_amplitude_6': array([-inf,  inf]), 'recalib_H1_amplitude_7': array([-inf,  inf]), 'recalib_H1_amplitude_8': array([-inf,  inf]), 'recalib_H1_amplitude_9': array([-inf,  inf]), 'recalib_H1_phase_0': array([-inf,  inf]), 'recalib_H1_phase_1': array([-inf,  inf]), 'recalib_H1_phase_2': array([-inf,  inf]), 'recalib_H1_phase_3': array([-inf,  inf]), 'recalib_H1_phase_4': array([-inf,  inf]), 'recalib_H1_phase_5': array([-inf,  inf]), 'recalib_H1_phase_6': array([-inf,  inf]), 'recalib_H1_phase_7': array([-inf,  inf]), 'recalib_H1_phase_8': array([-inf,  inf]), 'recalib_H1_phase_9': array([-inf,  inf]), 'recalib_L1_amplitude_0': array([-inf,  inf]), 'recalib_L1_amplitude_1': array([-inf,  inf]), 'recalib_L1_amplitude_2': array([-inf,  inf]), 'recalib_L1_amplitude_3': array([-inf,  inf]), 'recalib_L1_amplitude_4': array([-inf,  inf]), 'recalib_L1_amplitude_5': array([-inf,  inf]), 'recalib_L1_amplitude_6': array([-inf,  inf]), 'recalib_L1_amplitude_7': array([-inf,  inf]), 'recalib_L1_amplitude_8': array([-inf,  inf]), 'recalib_L1_amplitude_9': array([-inf,  inf]), 'recalib_L1_phase_0': array([-inf,  inf]), 'recalib_L1_phase_1': array([-inf,  inf]), 'recalib_L1_phase_2': array([-inf,  inf]), 'recalib_L1_phase_3': array([-inf,  inf]), 'recalib_L1_phase_4': array([-inf,  inf]), 'recalib_L1_phase_5': array([-inf,  inf]), 'recalib_L1_phase_6': array([-inf,  inf]), 'recalib_L1_phase_7': array([-inf,  inf]), 'recalib_L1_phase_8': array([-inf,  inf]), 'recalib_L1_phase_9': array([-inf,  inf])}
mj-will commented 2 months ago

Hi @SSL32081, I'm moving this issue to https://github.com/bilby-dev/nessai-bilby since this isn't really an issue with bilby itself.

mj-will commented 2 months ago

Following up on this, this occurs because in older versions of the nessai the default reparameterisation assumed bounded priors. As of version v0.13.0, this was changed.

So to fix this, I'd recommend upgrading the version of nessai you're using to the latest release (0.13.2). If that's not possible, let me know and I can recommend another fix.

SSL32081 commented 2 months ago

Following up on this, this occurs because in older versions of the nessai the default reparameterisation assumed bounded priors. As of version v0.13.0, this was changed.

So to fix this, I'd recommend upgrading the version of nessai you're using to the latest release (0.13.2). If that's not possible, let me know and I can recommend another fix.

Thanks!! In that case, let me try again with an environment of my own. (I was using one of the IGWN environments before...)

SSL32081 commented 1 month ago

Hi @mj-will, I have tried a new run with the most up-to-date Nessai, and it is working with calibration priors on. Thanks a lot for the help, and I believe we can close this issue!

mj-will commented 1 month ago

Great, thanks for confirming that @SSL32081!