diff --git a/gstlal-burst/bin/gstlal_feature_hdf5_sink b/gstlal-burst/bin/gstlal_feature_hdf5_sink index 6cfb130c61afe4260909a288d7b4dd338b389941..4fc4a8bcae30cf326a0416ee20f9cbf5d7f336a1 100755 --- a/gstlal-burst/bin/gstlal_feature_hdf5_sink +++ b/gstlal-burst/bin/gstlal_feature_hdf5_sink @@ -141,11 +141,9 @@ class HDF5StreamSink(object): Also takes care of creating new directories as needed and removing any leftover temporary files. """ # set/update file names and directories with new gps time and duration - job_id = '0001' - subset_id = '0001' self.feature_name = os.path.splitext(utils.to_trigger_filename(self.basename, start_time, duration, 'h5'))[0] - self.feature_path = utils.to_trigger_path(os.path.abspath(self.rootdir), self.basename, start_time, job_id, subset_id) - self.tmp_path = utils.to_trigger_path(self.tmp_dir, self.basename, start_time, job_id, subset_id) + self.feature_path = utils.to_trigger_path(os.path.abspath(self.rootdir), self.basename, start_time) + self.tmp_path = utils.to_trigger_path(self.tmp_dir, self.basename, start_time) # create temp and output directories if they don't exist aggregator.makedir(self.feature_path) diff --git a/gstlal-burst/python/fxtools/feature_extractor.py b/gstlal-burst/python/fxtools/feature_extractor.py index 54e4d8f16549068db2c6ad52a287bc90038402f3..dd7718a48d87d0f48a1dc65cee016f6613fc6269 100644 --- a/gstlal-burst/python/fxtools/feature_extractor.py +++ b/gstlal-burst/python/fxtools/feature_extractor.py @@ -330,8 +330,8 @@ class MultiChannelHandler(simplehandler.Handler): # set/update file names and directories with new gps time and duration duration = min(duration, self.feature_end_time - start_time) self.fname = os.path.splitext(utils.to_trigger_filename(self.basename, start_time, duration, 'h5'))[0] - self.fpath = utils.to_trigger_path(os.path.abspath(self.out_path), self.basename, start_time, self.job_id, self.subset_id) - self.tmp_path = utils.to_trigger_path(self.tmp_dir, self.basename, start_time, self.job_id, self.subset_id) + self.fpath = utils.to_trigger_path(os.path.abspath(self.out_path), self.basename, start_time, job_id=self.job_id, subset_id=self.subset_id) + self.tmp_path = utils.to_trigger_path(self.tmp_dir, self.basename, start_time, job_id=self.job_id, subset_id=self.subset_id) # create temp and output directories if they don't exist aggregator.makedir(self.fpath) diff --git a/gstlal-burst/python/fxtools/utils.py b/gstlal-burst/python/fxtools/utils.py index d0db9f68092f9f68978211111a6ab8aa352f0c86..82802a8e8bd287adcc8b446764e3e8909b47fad3 100644 --- a/gstlal-burst/python/fxtools/utils.py +++ b/gstlal-burst/python/fxtools/utils.py @@ -139,15 +139,23 @@ def gps2latency(gps_time): #---------------------------------- ### pathname utilities -def to_trigger_path(rootdir, basename, start_time, job_id, subset_id): +def to_trigger_path(rootdir, basename, start_time, job_id=None, subset_id=None): """ - Given a basepath, instrument, description, start_time, job_id, will return a + Given a basepath, instrument, description, start_time, will return a path pointing to a directory structure in the form:: + ${rootdir}/${basename}/${basename}-${start_time_mod1e5}/ + + and if the optional job_id, subset_id kwargs are given, the path will be of the form:: + ${rootdir}/${basename}/${basename}-${start_time_mod1e5}/${basename}-${job_id}-${subset_id}/ """ start_time_mod1e5 = str(start_time).zfill(10)[:5] - return os.path.join(rootdir, basename, '-'.join([basename, start_time_mod1e5]), '-'.join([basename, job_id, subset_id])) + if job_id and subset_id: + trigger_path = os.path.join(rootdir, basename, '-'.join([basename, start_time_mod1e5]), '-'.join([basename, job_id, subset_id])) + else: + trigger_path = os.path.join(rootdir, basename, '-'.join([basename, start_time_mod1e5])) + return trigger_path def to_trigger_filename(basename, start_time, duration, suffix, tmp=False): """