cta-observatory/lstosa

Improve retries when no filter wheel is known and flatfield heuristic identification has to be used

Opened this issue · 0 comments

When both special treatments have to be used (flatfield heuristic identification and passing through the command line the filter wheels 52), osa tries the first 3 times adding to the command the --flatfield-heuristic but without using the filters 52 via command line. It is only on the 4th try when both arguments are passed and the command runs without problems. In the process, the sequence is vetoed because of the many trials.

This should be fixed to avoid so many unsuccessful repetitions.

try:
analysis_step.execute()
return analysis_step.rc
except Exception:
log.info(f"Failed. Return code {analysis_step.rc}")
cmd.append("--filters=52")
log.info("Trying again by setting filters 52")
analysis_step = ChargeCalibrationStage(run=f"{pedcal_run_id:05d}", command_args=cmd)
analysis_step.execute()
return analysis_step.rc

I think we tried not using the bare Except here, but somehow it was the easiest thing given the Exception in lstchain onsite calibration script (?). To be revised.