Skip to content

Commit

Permalink
Move also interleaved files to the final directory
Browse files Browse the repository at this point in the history
  • Loading branch information
marialainez committed Sep 7, 2023
1 parent 1157100 commit 150da74
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions osa/configs/sequencer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -121,6 +123,7 @@ DL1ABSUFFIX: .h5
DATACHECKSUFFIX: .h5
MUONSUFFIX: .fits
DL2SUFFIX: .h5
INTERLEAVEDSUFFIX: .h5

# File type pattern for DB
CALIBTYPE = Calibration
Expand All @@ -131,6 +134,7 @@ DL1ABTYPE = DL1
DL2TYPE = DL2
MUONTYPE = Muons
DATACHECKTYPE = Datacheck
INTERLEAVEDTYPE = Interleaved

[LSTOSA]
GRAPH: dot
Expand Down
2 changes: 1 addition & 1 deletion osa/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
2 changes: 2 additions & 0 deletions osa/scripts/closer.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,15 @@ 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(
[
("DL1AB", DL1AB_RE),
("DL2", DL2_RE),
("MUON", MUONS_RE),
("DATACHECK", DATACHECK_RE),
("INTERLEAVED", INTERLEAVED_RE),
]
)

Expand Down
5 changes: 4 additions & 1 deletion osa/utils/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Check warning on line 82 in osa/utils/register.py

View check run for this annotation

Codecov / codecov/patch

osa/utils/register.py#L82

Added line #L82 was not covered by tests


def register_run_concept_files(run_string, concept):
"""
Expand All @@ -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")
Expand Down

0 comments on commit 150da74

Please sign in to comment.