18"""Simple test to see if PhenomPv3HM has changed
31 phase = np.unwrap(np.angle(h))
35 return np.sqrt( np.sum( (x-y)**2 ) )
39 compute the difference between two waveforms
40 and compare to expected value
63 approximant=lalsimulation.IMRPhenomPv3HM
66 pars1=common_pars.copy()
68 pars2=common_pars.copy()
69 pars2.update({
"m2":20.*lal.MSUN_SI})
71 hp1, hc1 = lalsimulation.SimInspiralChooseFDWaveform(**pars1)
72 hp2, hc2 = lalsimulation.SimInspiralChooseFDWaveform(**pars2)
87 return hp_amp_diff, hp_phase_diff, hc_amp_diff, hc_phase_diff
95 This test checks that IMRPhenomPv3HM hasn't changed.
96 It does this by generating two PhenomPv3HM waveforms and computing
97 their difference (according to their amplitude
and phases)
98 and compares them to pre-computed values.
100 these pre-computed values were computed using the following line:
106 expected_result = np.array([1533.69290062, 324.65008927, 1541.09248084, 323.69338373])
110 np.testing.assert_almost_equal(new_result, expected_result, 7, "IMRPhenomPv3HM test failed")
116if __name__ ==
'__main__':
117 args = sys.argv[1:]
or [
"-v",
"-rs",
"--junit-xml=junit-phenomPv3HM.xml"]
118 sys.exit(pytest.main(args=[__file__] + args))
def test_IMRPhenomPv3HM()
This test checks that IMRPhenomPv3HM hasn't changed.
def gen_test_data()
compute the difference between two waveforms and compare to expected value