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-v4"
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 += f
"_NARROWBAND-{D5}"
70 G_million =
int(G) // 1000000
71 SFT_base_directory += f
"_BROADBAND-{G_million}"
73 return SFT_base_directory
78 path = os.path.dirname(os.path.realpath(__file__))
79 with open(os.path.join(path,
"public_sft_directory_README.md"))
as f:
def public_sft_directory_readme_md()
def public_sft_directory(filename)