16"""Simple test to see if the LIV parameters can be read and inserted correctly
32 logLeff = lalsimulation.SimInspiralWaveformParamsLookupNonGRLIVLogLambdaEff(LALparams)
33 signOfA = lalsimulation.SimInspiralWaveformParamsLookupNonGRLIVASign(LALparams)
34 alpha = lalsimulation.SimInspiralWaveformParamsLookupNonGRLIVAlpha(LALparams)
35 return logLeff, signOfA, alpha
39 Sets LIV parameters according to input values.
41 - logLeff: LIV wavelength-like parameter log10lambda_eff to be set.
42 - Asign: LIV sign in dispersion relation, +1.0
or -1.0.
43 - alpha: Exponent of momentum
in dispersion relation, between 0
and 4.
46 lalsimulation.SimInspiralWaveformParamsInsertNonGRLIVLogLambdaEff(LALparams, logLeff)
47 lalsimulation.SimInspiralWaveformParamsInsertNonGRLIVASign(LALparams, Asign)
48 lalsimulation.SimInspiralWaveformParamsInsertNonGRLIVAlpha(LALparams, alpha)
53 This checks if LIV flag
is disabled by default.
56 return lalsimulation.SimInspiralWaveformParamsLookupEnableLIV(LALparams)
60 This enables the LIV flag, by enabling it,
61 the LIV parameters will be sampled upon.
64 lalsimulation.SimInspiralWaveformParamsInsertEnableLIV(LALparams, 1)
65 return lalsimulation.SimInspiralWaveformParamsLookupEnableLIV(LALparams)
71 This tests if the default LIV parameters are correct.
72 Additionally it tests LIV parameters are being inserted correctly.
74 `expected_result = np.array([100.0,1.0,0.0])` are the default values of log10lambda_eff,
75 A_sign
and alpha respectively
77 LALpars = lal.CreateDict()
78 expected_result = np.array([100.0, 1.0, 0.0])
80 np.testing.assert_almost_equal(actual_result, expected_result, 7, "Default LIV values are not set correctly")
83 expected_result = np.array([44., -1., 1.5])
85 np.testing.assert_almost_equal(actual_result, expected_result, 7,
"LIV values are not inserted correctly")
89 This tests that the liv flag is disabled by default.
90 Additionally it checks the flag may be enabled properly.
92 `expected_result = 0`
is the default value of the LIV flag
94 LALpars = lal.CreateDict()
97 np.testing.assert_approx_equal(actual_result, expected_result, 7, "Incorrect setting of LIV flag by default")
101 np.testing.assert_approx_equal(actual_result, expected_result, 7,
"LIV flag not inserted correctly")
105if __name__ ==
'__main__':
106 args = sys.argv[1:]
or [
"-v",
"-rs",
"--junit-xml=junit-liv.xml"]
107 sys.exit(pytest.main(args=[__file__] + args))
def enable_liv(LALparams)
This enables the LIV flag, by enabling it, the LIV parameters will be sampled upon.
def test_liv_flag_disabled_by_default()
This tests that the liv flag is disabled by default.
def set_liv_pars(LALparams, logLeff, Asign, alpha)
Sets LIV parameters according to input values.
def read_liv_params(LALparams)
Reads LIV parameters.
def test_correct_liv_pars()
This tests if the default LIV parameters are correct.
def is_liv_enabled_by_default(LALparams)
This checks if LIV flag is disabled by default.