19Simple test to see if IMRPhenomXP_NRTidalv3 have changed
20Adapted from test_SEOBNRv5HM_ROM.py.
33 phase = np.unwrap(np.angle(h))
37 return np.sqrt( np.sum( (x-y)**2 ) )
41 compute the difference between two waveforms
42 and compare to expected value
45 LALparams = lal.CreateDict()
48 lalsimulation.SimInspiralWaveformParamsInsertTidalLambda1(LALparams, lambda1)
49 lalsimulation.SimInspiralWaveformParamsInsertTidalLambda2(LALparams, lambda2)
70 approximant=approximant
73 pars1 = common_pars.copy()
75 pars2 = common_pars.copy()
76 pars2.update({"m2":1.0*lal.MSUN_SI})
77 hp1, hc1 = lalsimulation.SimInspiralChooseFDWaveform(**pars1)
78 hp2, hc2 = lalsimulation.SimInspiralChooseFDWaveform(**pars2)
93 return hp_amp_diff, hp_phase_diff, hc_amp_diff, hc_phase_diff
102 This test checks that IMRPhenomXP_NRTidalv3 hasn't changed.
103 It does this by generating two IMRPhenomXP_NRTidalv3 waveforms and computing
104 their difference (according to their amplitude
and phases)
105 and compares them to pre-computed values.
107 these pre-computed values were computed using the following line:
109 `expected_result = np.array(
gen_test_data(lalsimulation.IMRPhenomXP_NRTidalv3))`
112 expected_result = np.array([34.92128149, 1092.39559414, 34.92128149, 1092.55480085])
113 new_result = np.array(gen_test_data(lalsimulation.IMRPhenomXP_NRTidalv3))
114 np.testing.assert_allclose(new_result, expected_result, rtol=0.002, err_msg="IMRPhenomXP_NRTidalv3 test failed", verbose=
True)
118if __name__ ==
'__main__':
119 args = sys.argv[1:]
or [
"-v",
"-rs",
"--junit-xml=junit-IMRPhenomXP_NRTidalv3.xml"]
120 sys.exit(pytest.main(args=[__file__] + args))
def test_IMRPhenomXP_NRTidalv3()
This test checks that IMRPhenomXP_NRTidalv3 hasn't changed.
def gen_test_data(approximant)
compute the difference between two waveforms and compare to expected value