Skip to content
Snippets Groups Projects
Commit 35afba73 authored by Prathamesh Joshi's avatar Prathamesh Joshi Committed by Amanda Baylor
Browse files

Correctly save the backup zerolag PDF in the backup dir within the analysis...

Correctly save the backup zerolag PDF in the backup dir within the analysis dir; Also save the backup diststat PDF there
parent 1a30bc00
No related branches found
No related tags found
Loading
......@@ -60,7 +60,7 @@ import shutil
import itertools
from gstlal import inspiral
from gstlal import events
from gstlal.datafind import DataCache, DataType
from gstlal.datafind import DataCache, DataType, T050017_filename
from collections import deque
from urllib.error import URLError, HTTPError
......@@ -317,6 +317,17 @@ def main():
far.gen_likelihood_control_doc(xmldoc, None, data)
process.set_end_time_now()
ligolw_utils.write_filename(xmldoc, options.output, verbose = options.verbose)
# save the same file to the backup dir as a precaution
now = int(inspiral.now())
f = CacheEntry.from_T050017(options.output)
backup_dir = os.path.join("backup", os.path.dirname(options.output))
if not os.path.exists(backup_dir):
os.makedirs(backup_dir)
backup_fname = T050017_filename(f.observatory, f.description, (now, now), "xml.gz")
backup_fname = os.path.join(backup_dir, backup_fname)
ligolw_utils.write_filename(xmldoc, backup_fname, verbose = options.verbose)
logger.info(f"Done marginalizing likelihoods.")
if kafka_processor:
......
......@@ -221,7 +221,7 @@ class ZeroLagCounts(events.EventProcessor):
with self.lock:
now = int(inspiral.now())
f = CacheEntry.from_T050017(self.fname)
backup_dir = os.path.join(os.path.dirname(self.fname), "backup")
backup_dir = os.path.join("backup", os.path.dirname(self.fname))
if not os.path.exists(backup_dir):
os.makedirs(backup_dir)
backup_fname = datafind.T050017_filename(f.observatory, f.description, (now, now), "xml.gz")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment