From 150da74ea78bee6240fa0aa073471e0012ace60e Mon Sep 17 00:00:00 2001 From: Maria Lainez <98marialainez@gmail.com> Date: Thu, 7 Sep 2023 12:38:59 +0200 Subject: [PATCH] Move also interleaved files to the final directory --- osa/configs/sequencer.cfg | 4 ++++ osa/paths.py | 2 +- osa/scripts/closer.py | 2 ++ osa/utils/register.py | 5 ++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/osa/configs/sequencer.cfg b/osa/configs/sequencer.cfg index 6cbcc017..f836d53a 100644 --- a/osa/configs/sequencer.cfg +++ b/osa/configs/sequencer.cfg @@ -21,6 +21,7 @@ PEDESTAL_DIR: %(CALIB_BASE_DIR)s/drs4_baseline DL1_DIR: %(BASE)s/DL1 DL1AB_DIR: %(BASE)s/DL1 MUON_DIR: %(BASE)s/DL1 +INTERLEAVED_DIR: %(BASE)s/DL1 DATACHECK_DIR: %(BASE)s/DL1 DL2_DIR: %(BASE)s/DL2 DL3_DIR: %(BASE)s/DL3 @@ -110,6 +111,7 @@ DL1ABPREFIX: dl1_LST-1 DATACHECKPREFIX: datacheck_dl1_LST-1 MUONPREFIX: muons_LST-1 DL2PREFIX: dl2_LST-1 +INTERLEAVEDPREFIX: interleaved_LST-1 # Suffixes R0SUFFIX: .fits.fz @@ -121,6 +123,7 @@ DL1ABSUFFIX: .h5 DATACHECKSUFFIX: .h5 MUONSUFFIX: .fits DL2SUFFIX: .h5 +INTERLEAVEDSUFFIX: .h5 # File type pattern for DB CALIBTYPE = Calibration @@ -131,6 +134,7 @@ DL1ABTYPE = DL1 DL2TYPE = DL2 MUONTYPE = Muons DATACHECKTYPE = Datacheck +INTERLEAVEDTYPE = Interleaved [LSTOSA] GRAPH: dot diff --git a/osa/paths.py b/osa/paths.py index 79d8abbf..da9f02b9 100644 --- a/osa/paths.py +++ b/osa/paths.py @@ -231,7 +231,7 @@ def destination_dir(concept: str, create_dir: bool = True) -> Path: """ nightdir = utils.date_to_dir(options.date) - if concept == "MUON": + if concept in {"MUON", "INTERLEAVED"}: directory = Path(cfg.get(options.tel_id, concept + "_DIR")) / nightdir / options.prod_id elif concept in {"DL1AB", "DATACHECK"}: directory = ( diff --git a/osa/scripts/closer.py b/osa/scripts/closer.py index c6645d16..74828898 100644 --- a/osa/scripts/closer.py +++ b/osa/scripts/closer.py @@ -196,6 +196,7 @@ def post_process_files(seq_list: list): DL2_RE = re.compile(f"{options.dl2_prod_id}/dl2.*.(?:h5|hdf5|hdf)") MUONS_RE = re.compile(r"muons.*.fits") DATACHECK_RE = re.compile(r"datacheck_dl1.*.(?:h5|hdf5|hdf)") + INTERLEAVED_RE = re.compile(r"interleaved.*.(?:h5|hdf5|hdf)") pattern_files = dict( [ @@ -203,6 +204,7 @@ def post_process_files(seq_list: list): ("DL2", DL2_RE), ("MUON", MUONS_RE), ("DATACHECK", DATACHECK_RE), + ("INTERLEAVED", INTERLEAVED_RE), ] ) diff --git a/osa/utils/register.py b/osa/utils/register.py index c532dfd9..56a3ab7d 100644 --- a/osa/utils/register.py +++ b/osa/utils/register.py @@ -78,6 +78,9 @@ def create_symlinks(input_file, output_file, prefix, suffix): if prefix == "muons_LST-1" and suffix == ".fits": input_file.symlink_to(output_file.resolve()) + if prefix == "interleaved_LST-1" and suffix == ".h5": + input_file.symlink_to(output_file.resolve()) + def register_run_concept_files(run_string, concept): """ @@ -104,7 +107,7 @@ def register_run_concept_files(run_string, concept): suffix = cfg.get("PATTERN", f"{concept}SUFFIX") log.debug(f"Registering {data_level} file for {prefix}*{run_string}*{suffix}") - if concept in ["DL1AB", "DATACHECK", "PEDESTAL", "CALIB", "TIMECALIB", "MUON", "DL2"]: + if concept in ["DL1AB", "DATACHECK", "PEDESTAL", "CALIB", "TIMECALIB", "MUON", "DL2", "INTERLEAVED"]: register_files(run_string, initial_dir, prefix, suffix, output_dir) else: log.warning(f"Concept {concept} not known")