20Implements the public SFT directory naming convention detailed in the SFT spec (T040164)
25__author__ =
"Karl Wette <karl.wette@ligo.org>"
26__version__ =
"Consistent with SFT spec LIGO-T040164-v2"
32 _, filename = os.path.split(filename)
35 lvl1 = filename.split(
"-")
37 S, D, G, T_extn = lvl1
39 raise ValueError(f
'"{filename}" does not contain 4 tokens separated by "-"')
44 D1, D2, D3, D4, D5 = lvl2
45 if not D5.startswith(
"NBF"):
47 f
'"{filename}" token "{D5}" does not match the narrow-band SFT filename spec'
54 f
'"{filename}" token "{D}" does not contain 4 or 5 tokens separated by "_"'
58 f
'"{filename}" token "{D4}" does not match the public SFT filename spec'
62 SFT_base_directory = f
"{D2}_{D3}_{D4}"
66 SFT_base_directory +=
"_NARROWBAND"
71 SFT_base_directory +=
"_BROADBAND"
72 G_million =
int(G) // 1000000
73 SFT_subdirectory = f
"GPS{G_million}M"
75 return os.path.join(SFT_base_directory, SFT_subdirectory)
80 path = os.path.dirname(os.path.realpath(__file__))
81 with open(os.path.join(path,
"public_sft_directory_README.md"))
as f:
def public_sft_directory_readme_md()
def public_sft_directory(filename)