Commit c161d0eb authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Rename sftfile path for consistency, use Cairo temp.

parent f0b06a90
...@@ -13,7 +13,7 @@ from collections import OrderedDict ...@@ -13,7 +13,7 @@ from collections import OrderedDict
import numpy as np import numpy as np
import matplotlib import matplotlib
matplotlib.use('Agg') matplotlib.use('cairo')
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import emcee import emcee
import corner import corner
...@@ -1004,12 +1004,12 @@ class MCMCSearch(BaseSearchClass): ...@@ -1004,12 +1004,12 @@ class MCMCSearch(BaseSearchClass):
pickle.dump(d, File) pickle.dump(d, File)
def get_list_of_matching_sfts(self): def get_list_of_matching_sfts(self):
matches = glob.glob(self.sft_filepath) matches = glob.glob(self.sftfilepath)
if len(matches) > 0: if len(matches) > 0:
return matches return matches
else: else:
raise IOError('No sfts found matching {}'.format( raise IOError('No sfts found matching {}'.format(
self.sft_filepath)) self.sftfilepath))
def get_saved_data(self): def get_saved_data(self):
with open(self.pickle_path, "r") as File: with open(self.pickle_path, "r") as File:
...@@ -1597,10 +1597,10 @@ class Writer(BaseSearchClass): ...@@ -1597,10 +1597,10 @@ class Writer(BaseSearchClass):
np.array([delta_phi, delta_F0, delta_F1, delta_F2]).T) np.array([delta_phi, delta_F0, delta_F1, delta_F2]).T)
numSFTs = int(float(self.duration) / self.Tsft) numSFTs = int(float(self.duration) / self.Tsft)
self.sft_filename = lalpulsar.OfficialSFTFilename( self.sftfilename = lalpulsar.OfficialSFTFilename(
'H', '1', numSFTs, self.Tsft, self.tstart, self.duration, 'H', '1', numSFTs, self.Tsft, self.tstart, self.duration,
self.label) self.label)
self.sft_filepath = '{}/{}'.format(self.outdir, self.sft_filename) self.sftfilepath = '{}/{}'.format(self.outdir, self.sftfilename)
self.calculate_fmin_Band() self.calculate_fmin_Band()
def make_data(self): def make_data(self):
...@@ -1659,28 +1659,28 @@ transientTauDays={:1.3f}\n""") ...@@ -1659,28 +1659,28 @@ transientTauDays={:1.3f}\n""")
getmtime = os.path.getmtime getmtime = os.path.getmtime
if os.path.isfile(self.sft_filepath) is False: if os.path.isfile(self.sftfilepath) is False:
logging.info('No SFT file matching {} found'.format( logging.info('No SFT file matching {} found'.format(
self.sft_filepath)) self.sftfilepath))
return False return False
else: else:
logging.info('Matching SFT file found') logging.info('Matching SFT file found')
if getmtime(self.sft_filepath) < getmtime(self.config_file_name): if getmtime(self.sftfilepath) < getmtime(self.config_file_name):
logging.info( logging.info(
('The config file {} has been modified since the sft file {} ' ('The config file {} has been modified since the sft file {} '
+ 'was created').format( + 'was created').format(
self.config_file_name, self.sft_filepath)) self.config_file_name, self.sftfilepath))
return False return False
logging.info( logging.info(
'The config file {} is older than the sft file {}'.format( 'The config file {} is older than the sft file {}'.format(
self.config_file_name, self.sft_filepath)) self.config_file_name, self.sftfilepath))
logging.info('Checking contents of cff file') logging.info('Checking contents of cff file')
logging.info('Execute: {}'.format( logging.info('Execute: {}'.format(
'lalapps_SFTdumpheader {} | head -n 20'.format(self.sft_filepath))) 'lalapps_SFTdumpheader {} | head -n 20'.format(self.sftfilepath)))
output = subprocess.check_output( output = subprocess.check_output(
'lalapps_SFTdumpheader {} | head -n 20'.format(self.sft_filepath), 'lalapps_SFTdumpheader {} | head -n 20'.format(self.sftfilepath),
shell=True) shell=True)
calls = [line for line in output.split('\n') if line[:3] == 'lal'] calls = [line for line in output.split('\n') if line[:3] == 'lal']
if calls[0] == cl: if calls[0] == cl:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment