Skip to content
Snippets Groups Projects
Commit 4966dc2c authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Minor fixes to the running

- Addresses incorrecelt named attributes and prevents error if
  sftfilepath is not specified
parent 8ffae7e2
No related branches found
No related tags found
No related merge requests found
......@@ -292,7 +292,7 @@ class ComputeFstat(object):
FstatOAs.prevInput = lalpulsar.FstatOptionalArgsDefaults.prevInput
FstatOAs.collectTiming = lalpulsar.FstatOptionalArgsDefaults.collectTiming
if hasattr(self, 'injectSource') and type(self.injectSources) == dict:
if hasattr(self, 'injectSources') and type(self.injectSources) == dict:
logging.info('Injecting source with params: {}'.format(
self.injectSources))
PPV = lalpulsar.CreatePulsarParamsVector(1)
......@@ -308,7 +308,7 @@ class ComputeFstat(object):
if 't0' not in self.injectSources:
PP.Transient.type = lalpulsar.TRANSIENT_NONE
FstatOAs.injectSources = PPV
if hasattr(self, 'injectSources') and type(self.injectSources) == str:
elif hasattr(self, 'injectSources') and type(self.injectSources) == str:
logging.info('Injecting source from param file: {}'.format(
self.injectSources))
PPV = lalpulsar.PulsarParamsFromFile(self.injectSources, self.tref)
......
......@@ -23,8 +23,8 @@ import helper_functions
class MCMCSearch(BaseSearchClass):
""" MCMC search using ComputeFstat"""
@helper_functions.initializer
def __init__(self, label, outdir, sftfilepath, theta_prior, tref,
minStartTime, maxStartTime, nsteps=[100, 100],
def __init__(self, label, outdir, theta_prior, tref, minStartTime,
maxStartTime, sftfilepath=None, nsteps=[100, 100],
nwalkers=100, ntemps=1, log10temperature_min=-5,
theta_initial=None, scatter_val=1e-10,
binary=False, BSGL=False, minCoverFreq=None,
......@@ -748,6 +748,7 @@ class MCMCSearch(BaseSearchClass):
logging.info('No pickled data found')
return False
if self.sftfilepath is not None:
oldest_sft = min([os.path.getmtime(f) for f in
self.get_list_of_matching_sfts()])
if os.path.getmtime(self.pickle_path) < oldest_sft:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment