Skip to content

Commit

Permalink
add --no-dl1ab option to process data with catB (sequencer launched t…
Browse files Browse the repository at this point in the history
…wice)
  • Loading branch information
marialainez committed Oct 4, 2024
1 parent 37062cd commit d220c81
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/osa/configs/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
warning = None
nocheck = None
no_dl2 = None
no_dl1ab = None
no_gainsel = None
prod_id = None
dl1_prod_id = None
dl2_prod_id = None
Expand Down
8 changes: 8 additions & 0 deletions src/osa/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ def are_all_jobs_correctly_finished(sequence_list):
f"finished up to DL1ab, but --no-dl2 option selected"
)
continue
if out == 3 and options.no_dl1ab:
log.debug(
f"Job {sequence.seq} ({sequence.type}) correctly "
f"finished up to DL1A, but --no-dl1ab option selected"
)
continue

log.warning(
f"Job {sequence.seq} (run {sequence.run}) not correctly finished [level {out}]"
Expand Down Expand Up @@ -426,6 +432,8 @@ def data_sequence_job_template(sequence):
commandargs.extend(("--config", f"{Path(options.configfile).resolve()}"))
if sequence.type == "DATA" and options.no_dl2:
commandargs.append("--no-dl2")
if sequence.type == "DATA" and options.no_dl1ab:
commandargs.append("--no-dl1ab")

commandargs.extend(
(
Expand Down
16 changes: 10 additions & 6 deletions src/osa/scripts/datasequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ def data_sequence(
log.info(f"Going to level {level}")

if level == 3:
rc = dl1ab(run_str)
if cfg.getboolean("lstchain", "store_image_dl1ab"):
level -= 1
log.info(f"Going to level {level}")
if options.no_dl1ab:
level = 0
log.info(f"No DL1B are going to be produced. Going to level {level}")
else:
level -= 2
log.info(f"No images stored in dl1ab. Producing DL2. Going to level {level}")
rc = dl1ab(run_str)
if cfg.getboolean("lstchain", "store_image_dl1ab"):
level -= 1
log.info(f"Going to level {level}")
else:
level -= 2
log.info(f"No images stored in dl1ab. Producing DL2. Going to level {level}")

if level == 2:
rc = dl1_datacheck(run_str)
Expand Down
14 changes: 14 additions & 0 deletions src/osa/utils/cliopts.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ def data_sequence_argparser():
default=False,
help="Do not produce DL2 files (default False)",
)
parser.add_argument(
"--no-dl1ab",
action="store_true",
default=False,
help="Do not launch the script lstchain_dl1ab (default False)",
)
parser.add_argument("--pedcal-file", type=Path, help="Path of the calibration file")
parser.add_argument("--drs4-pedestal-file", type=Path, help="Path of the DRS4 pedestal file")
parser.add_argument("--time-calib-file", type=Path, help="Path of the time calibration file")
Expand Down Expand Up @@ -227,6 +233,7 @@ def data_sequence_cli_parsing():
options.simulate = opts.simulate
options.prod_id = opts.prod_id
options.no_dl2 = opts.no_dl2
options.no_dl1ab = opts.no_dl1ab
options.tel_id = opts.tel_id

log.debug(f"The options and arguments are {opts}")
Expand Down Expand Up @@ -274,6 +281,12 @@ def sequencer_argparser():
default=False,
help="Do not produce DL2 files (default False)",
)
parser.add_argument(
"--no-dl1ab",
action="store_true",
default=False,
help="Do not launch the script lstchain_dl1ab (default False)",
)
parser.add_argument(
"--no-gainsel",
action="store_true",
Expand All @@ -298,6 +311,7 @@ def sequencer_cli_parsing():
options.no_submit = opts.no_submit
options.no_calib = opts.no_calib
options.no_dl2 = opts.no_dl2
options.no_dl1ab = opts.no_dl1ab
options.no_gainsel = opts.no_gainsel

log.debug(f"the options are {opts}")
Expand Down

0 comments on commit d220c81

Please sign in to comment.