LALPulsar 7.1.1.1-eeff03c
test_public_sft_directory.py
Go to the documentation of this file.
1# Copyright (C) 2022 Karl Wette
2#
3# This program is free software; you can redistribute it and/or modify it
4# under the terms of the GNU General Public License as published by the
5# Free Software Foundation; either version 2 of the License, or (at your
6# option) any later version.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11# Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along
14# with this program; if not, write to the Free Software Foundation, Inc.,
15# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
17import sys
18import pytest
19from os.path import join
20
21from lalpulsar.public_sft_directory import public_sft_directory
22
23
24SFT_FILENAME_TO_DIRECTORY = (
25 (
26 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1257800000-1800.sft",
27 join("H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND", "GPS1257M"),
28 ),
29 (
30 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1257901800-1800.sft",
31 join("H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND", "GPS1257M"),
32 ),
33 (
34 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1258003600-1800.sft",
35 join("H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND", "GPS1258M"),
36 ),
37 (
38 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1258105400-1800.sft",
39 join("H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND", "GPS1258M"),
40 ),
41 (
42 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1258207200-1800.sft",
43 join("H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND", "GPS1258M"),
44 ),
45 (
46 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0010Hz0W0008Hz0-1257800000-9000.sft",
47 join("H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND", "NBF0010Hz0W0008Hz0"),
48 ),
49 (
50 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0018Hz0W0008Hz0-1257900000-9000.sft",
51 join("H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND", "NBF0018Hz0W0008Hz0"),
52 ),
53 (
54 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0026Hz0W0008Hz0-1258000000-9000.sft",
55 join("H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND", "NBF0026Hz0W0008Hz0"),
56 ),
57 (
58 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0034Hz0W0008Hz0-1258100000-9000.sft",
59 join("H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND", "NBF0034Hz0W0008Hz0"),
60 ),
61 (
62 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0042Hz0W0008Hz0-1258200000-9000.sft",
63 join("H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND", "NBF0042Hz0W0008Hz0"),
64 ),
65)
66
67
68@pytest.mark.parametrize("filename,directory", SFT_FILENAME_TO_DIRECTORY)
69def test_public_sft_directory(filename, directory):
70 assert public_sft_directory(filename) == directory
71
72
73if __name__ == "__main__":
74 args = sys.argv[1:] or ["-v", "-rs", "--junit-xml=junit-public_sft_directory.xml"]
75 sys.exit(pytest.main(args=[__file__] + args))
def test_public_sft_directory(filename, directory)