22from numpy.testing
import assert_allclose
27import lalinference
as li
31LHO = lal.CachedDetectors[lal.LALDetectorIndexLHODIFF]
32LLO = lal.CachedDetectors[lal.LALDetectorIndexLLODIFF]
34RAS = np.random.uniform(low=0, high=lal.TWOPI, size=NTEST)
35DECS = np.random.uniform(low=-lal.PI/2.0, high=lal.PI/2.0, size=NTEST)
36TIMES = np.random.uniform(low=0, high=lal.DAYSID_SI, size=NTEST)
40 res = np.empty((3, NTEST))
41 for i, (ra, dec, time)
in enumerate(zip(RAS, DECS, TIMES)):
42 forward = li.EquatorialToDetFrame(LHO, LLO, time, ra, dec)
43 res[:, i] = li.DetFrameToEquatorial(LHO, LLO, *forward)
44 for a, b, tol
in zip((TIMES, RAS, DECS), res, (1e-6, 1e-5, 1e-5)):
45 assert_allclose(a, b, atol=tol)
48if __name__ ==
'__main__':
49 args = sys.argv[1:]
or [
"-v",
"-rs",
"--junit-xml=junit-detframe.xml"]
50 sys.exit(pytest.main(args=[__file__] + args))