Skip to content

Commit

Permalink
place interleaved and muons files in a subdirector
Browse files Browse the repository at this point in the history
  • Loading branch information
marialainez committed Sep 18, 2023
1 parent 150da74 commit d99b1c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
14 changes: 9 additions & 5 deletions osa/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def destination_dir(concept: str, create_dir: bool = True) -> Path:
Parameters
----------
concept : str
Expected: MUON, DL1AB, DATACHECK, DL2, PEDESTAL, CALIB, TIMECALIB
Expected: MUON, DL1AB, DATACHECK, INTERLEAVED, DL2, PEDESTAL, CALIB, TIMECALIB
create_dir : bool
Set it to True (default) if you want to create the directory.
Otherwise, it just returns the path
Expand All @@ -231,11 +231,15 @@ def destination_dir(concept: str, create_dir: bool = True) -> Path:
"""
nightdir = utils.date_to_dir(options.date)

if concept in {"MUON", "INTERLEAVED"}:
directory = Path(cfg.get(options.tel_id, concept + "_DIR")) / nightdir / options.prod_id
elif concept in {"DL1AB", "DATACHECK"}:
if concept == "MUON":
directory = Path(cfg.get(options.tel_id, "DL1_DIR")) / nightdir / options.prod_id / "muons"
elif concept == "INTERLEAVED":
directory = Path(cfg.get(options.tel_id, "DL1_DIR")) / nightdir / options.prod_id / "interleaved"
elif concept == "DATACHECK":
directory = Path(cfg.get(options.tel_id, "DL1_DIR")) / nightdir / options.prod_id / "datacheck"
elif concept == "DL1AB":
directory = (
Path(cfg.get(options.tel_id, concept + "_DIR"))
Path(cfg.get(options.tel_id, "DL1_DIR"))
/ nightdir
/ options.prod_id
/ options.dl1_prod_id
Expand Down
11 changes: 10 additions & 1 deletion osa/utils/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,18 @@ def register_run_concept_files(run_string, concept):
if concept == "DL2":
initial_dir = initial_dir / options.dl2_prod_id

elif concept in ["DL1AB", "DATACHECK"]:
elif concept == "DL1AB":
initial_dir = initial_dir / options.dl1_prod_id

elif concept == "DATACHECK":
initial_dir = initial_dir / "datacheck"

elif concept == "MUON":
initial_dir = initial_dir / "muons"

elif concept == "INTERLEAVED":
initial_dir = initial_dir / "interleaved"

output_dir = destination_dir(concept, create_dir=False)
data_level = cfg.get("PATTERN", f"{concept}TYPE")
prefix = cfg.get("PATTERN", f"{concept}PREFIX")
Expand Down

0 comments on commit d99b1c0

Please sign in to comment.