Skip to content

Commit

Permalink
adapt historylevel function
Browse files Browse the repository at this point in the history
  • Loading branch information
marialainez committed Sep 25, 2024
1 parent d8df805 commit 37062cd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/osa/configs/sequencer.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ DL2_PROD_ID: model2
# Calibration steps in calibration pipeline script
drs4_baseline: onsite_create_drs4_pedestal_file
charge_calibration: onsite_create_calibration_file
catB_calibration: onsite_create_cat_B_calibration_file
use_ff_heuristic_id: False

# Data processing steps in datasequence script
Expand Down
4 changes: 3 additions & 1 deletion src/osa/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def historylevel(history_file: Path, data_type: str):
# into account not only the last history line but also the others.

if data_type == "DATA":
level = 4
level = 5
elif data_type == "PEDCALIB":
level = 2
else:
Expand All @@ -214,6 +214,8 @@ def historylevel(history_file: Path, data_type: str):
level = 0 if exit_status == 0 else 1
# Data sequence
elif program == cfg.get("lstchain", "r0_to_dl1"):
level = 4 if exit_status == 0 else 5
elif program == cfg.get("lstchain", "catB_calibration"):
level = 3 if exit_status == 0 else 4
elif program == cfg.get("lstchain", "dl1ab"):
if (exit_status == 0) and (prod_id == options.dl1_prod_id):
Expand Down
2 changes: 1 addition & 1 deletion src/osa/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def get_catB_calibration_filename(run_id: int) -> Path:
"""Return the Category-B calibration filename of a given run."""
date = utils.date_to_dir(options.date)
calib_prod_id = utils.get_lstchain_version()
catB_calib_dir = Path(cfg.get("LST1", "CAT_B_CALIB_BASE")) / date / calib_prod_id
catB_calib_dir = Path(cfg.get("LST1", "CAT_B_CALIB_BASE")) / "calibration" / date / calib_prod_id
filters = utils.get_calib_filters(run_id)
return catB_calib_dir / f"cat_B_calibration_filters_{filters}.Run{run_id:05d}.h5"

Expand Down
3 changes: 2 additions & 1 deletion src/osa/scripts/datasequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@ def catB_calibration(run_str: str) -> int:
n += 1
return 0

command = cfg.get("lstchain", "catB_calibration")
options.filters = get_calib_filters(int(run_str[:5]))
base_dir = Path(cfg.get("LST1", "BASE")).resolve()
r0_dir = Path(cfg.get("LST1", "R0_DIR")).resolve()
catA_calib_run = get_last_pedcalib(options.date)
cmd = [
"onsite_create_cat_B_calibration_file",
command,
f"--run_number={run_str[:5]}",
f"--catA_calibration_run={catA_calib_run}",
f"--base_dir={base_dir}",
Expand Down

0 comments on commit 37062cd

Please sign in to comment.