janosch314 / GWFish

Simulation of detector networks with Fisher-matrix PE
33 stars 20 forks source link

IMRPhenomXHM: input domain error #45

Closed jacopok closed 6 months ago

jacopok commented 1 year ago

The following code:

from GWFish.modules.waveforms import hphc_amplitudes
import numpy as np

params = {
    'mass_1': 20.,
    'mass_2': 20.,
    'theta_jn': 0.,
    'dec': 0., 
    'ra': 0., 
    'psi': 0., 
    'phase': 0., 
    'geocent_time': 1748607640., 
    'redshift': 0., 
    'luminosity_distance': 1.,
}

polarizations, timevector = hphc_amplitudes(
    'lalsim_IMRPhenomXHM',
    params,
    np.linspace(1e-3, 4., num=100),
    plot=None
)

fails with error message:

XLALGPSSetREAL8(): overflow: -inf out of range of a 32-bit signed integer
XLAL Error - XLALGPSSetREAL8 (XLALTime.c:83): Input domain error
XLAL Error - XLALGPSAdd (XLALTime.c:135): Internal function call failed: Input domain error
XLAL Error - IMRPhenomXHM_MultiMode2 (LALSimIMRPhenomXHM.c:1631): Failed to shift the coalescence time to t=0. Tried to apply a shift of -1/df with df = 0.
XLAL Error - IMRPhenomXHM_MultiMode2 (LALSimIMRPhenomXHM.c:1631): Internal function call failed: Input domain error
XLAL Error - XLALSimIMRPhenomXHMFrequencySequence (LALSimIMRPhenomXHM.c:1341): IMRPhenomXPHM_hplushcross failed to generate IMRPhenomXPHM waveform.
XLAL Error - XLALSimIMRPhenomXHMFrequencySequence (LALSimIMRPhenomXHM.c:1341): Internal function call failed: Input domain error
XLAL Error - XLALSimInspiralChooseFDWaveformSequence (LALSimInspiralWaveformCache.c:1395): Internal function call failed: Input domain error
Traceback (most recent call last):
  File "/home/jacopo/Documents/GWFish-1/IMRPhenomXHM_bug.py", line 17, in <module>
    polarizations, timevector = hphc_amplitudes(
  File "/home/jacopo/Documents/GWFish-1/GWFish/modules/waveforms.py", line 26, in hphc_amplitudes
    hphc = lal_caller(waveform[7:], frequencyvector, **parameters)
  File "/home/jacopo/Documents/GWFish-1/GWFish/modules/waveforms.py", line 138, in lal_caller
    h_plus, h_cross = lalsim.SimInspiralChooseFDWaveformSequence(
RuntimeError: Internal function call failed: Input domain error

Moving the frequency vector to higher frequencies seems to have no effect. Other approximants seem to generate the waveform without issue. It appears that the frequency spacing df is somehow required by this approximant but not passed.

(This is not blocking anymore for the LGWA plots: moving to IMRPhenomXPHM halfway solves the issue there! I'll comment more on that shortly - I'm only creating this issue to document the debugging process)