Skip to content

Commit

Permalink
Merge pull request #291 from cta-observatory/nogainsel_option
Browse files Browse the repository at this point in the history
Add no-gainsel option to reprocessing.py
  • Loading branch information
marialainez authored May 16, 2024
2 parents c3cdc35 + 8926b36 commit e148c8c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/osa/scripts/reprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def number_of_pending_jobs():


def run_script(
script: str, date, config: Path, no_dl2: bool, no_calib: bool, simulate: bool, force: bool
script: str, date, config: Path, no_dl2: bool, no_gainsel: bool, no_calib: bool, simulate: bool, force: bool
):
"""Run the sequencer for a given date."""
osa_config = Path(config).resolve()
Expand All @@ -32,6 +32,9 @@ def run_script(
if no_dl2:
cmd.append("--no-dl2")

if no_gainsel:
cmd.append("--no-gainsel")

if no_calib:
cmd.append("--no-calib")

Expand Down Expand Up @@ -64,6 +67,7 @@ def get_list_of_dates(dates_file):

@click.command()
@click.option("--no-dl2", is_flag=True, help="Do not run the DL2 step.")
@click.option("--no-gainsel", is_flag=True, help="Do not require gain selection to be finished.")
@click.option("--no-calib", is_flag=True, help="Do not run the calibration step.")
@click.option("-s", "--simulate", is_flag=True, help="Activate simulation mode.")
@click.option("-f", "--force", is_flag=True, help="Force the autocloser to close the day.")
Expand All @@ -83,6 +87,7 @@ def main(
dates_file: Path = None,
config: Path = DEFAULT_CFG,
no_dl2: bool = False,
no_gainsel: bool = False,
no_calib: bool = False,
simulate: bool = False,
force: bool = False,
Expand All @@ -102,7 +107,7 @@ def main(
# Avoid running jobs while it is still night time
wait_for_daytime()

run_script(script, date, config, no_dl2, no_calib, simulate, force)
run_script(script, date, config, no_dl2, no_gainsel, no_calib, simulate, force)
log.info("Waiting 1 minute to launch the process for the next date...\n")
time.sleep(60)

Expand Down

0 comments on commit e148c8c

Please sign in to comment.