Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
test_ssbtodetector.py
Go to the documentation of this file.
1import sys
2import subprocess as sp
3
4import numpy as np
5
6import pytest
7
8# from LALConstants.h
9LAL_C_SI = 299792458e0
10LAL_REARTH_SI = 6378136.6
11LAL_AU_SI = 149597870700e0
12MAX_DT_DETS_SSB = (LAL_AU_SI + LAL_REARTH_SI) / LAL_C_SI
13
14# compute times for a variety of telescopes and sky positions
15GPS_SSB = 1100000000.0
16TELESCOPES = (
17 "H1",
18 "L1",
19 "V1",
20 "G1",
21 "T1",
22 "GBT",
23 "PKS",
24 "JBO",
25 "AO",
26 "EFF",
27 "NRT",
28 "HOB",
29 "HART",
30 "VLA",
31 "WSRT",
32)
33
34
35@pytest.mark.parametrize("telescope", TELESCOPES)
36@pytest.mark.parametrize("ra", np.arange(0, 24, 8))
37def test_ssb(telescope, ra):
38 cmd = [
39 "lalpulsar_ssbtodetector",
40 "--gps",
41 str(GPS_SSB),
42 "--ra",
43 f"{ra}:21:34.76",
44 "--dec",
45 "-1:53:12.36",
46 "-t",
47 str(telescope),
48 ]
49 out = sp.check_output(cmd)
50 gps_det = float(out)
51 assert abs(gps_det - GPS_SSB) < MAX_DT_DETS_SSB
52
53
54if __name__ == "__main__":
55 args = sys.argv[1:] or ["-v", "-rs", "--junit-xml=junit-ssbtodetector.xml"]
56 sys.exit(pytest.main(args=[__file__] + args))
def test_ssb(telescope, ra)