diff --git a/pyfstat/make_sfts.py b/pyfstat/make_sfts.py index 189ab7b24ef3ef614aff2a8ef6595d80a4975c6a..8ef6b1fa242303382a3483dc3ae34046b9170bdc 100644 --- a/pyfstat/make_sfts.py +++ b/pyfstat/make_sfts.py @@ -284,8 +284,8 @@ transientTau = {:10.0f}\n""" logging.info("Checking contents of cff file") cl_dump = "lalapps_SFTdumpheader {} | head -n 20".format(self.sftfilepath) output = helper_functions.run_commandline(cl_dump) - calls = [line for line in output.split("\n") if line[:3] == "lal"] - if calls[0] == cl_mfd: + found = [True for line in output.split("\n") if line[-len(cl_mfd) :] == cl_mfd] + if any(found): logging.info("Contents matched, use old sft file") return True else: diff --git a/tests.py b/tests.py index 26275f5bc03586e6c43571e2c71555cdda11533f..a793f04d7b125b715ae8f2fc794d1ac4343904a0 100644 --- a/tests.py +++ b/tests.py @@ -7,6 +7,7 @@ import lalpulsar import logging import time + class Test(unittest.TestCase): outdir = "TestData"