Skip to content

Commit 86eaca1

Browse files
author
Daniel Morcuende
authored
Merge pull request #315 from cta-observatory/prod_id
Write the prod_id corresponding to each step in the history files
2 parents 5133503 + 5d7a647 commit 86eaca1

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/osa/workflow/stages.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ def _clean_up(self):
7575
reproduced in subsequent trials.
7676
"""
7777

78-
if self.command == "lstchain_data_r0_to_dl1":
78+
if self.command == cfg.get("lstchain", "r0_to_dl1"):
7979
self._remove_dl1a_output()
80-
elif self.command == "lstchain_dl1ab":
80+
elif self.command == cfg.get("lstchain", "dl1ab"):
8181
self._remove_dl1b_output('dl1_LST-1.Run')
82-
elif self.command == "lstchain_check_dl1":
82+
elif self.command == cfg.get("lstchain", "check_dl1"):
8383
self._remove_dl1b_output('datacheck_dl1_LST-1.Run')
84-
elif self.command == "onsite_create_calibration_file":
84+
elif self.command == cfg.get("lstchain", "charge_calibration"):
8585
self._remove_calibration()
86-
elif self.command == "onsite_create_drs4_pedestal_file":
86+
elif self.command == cfg.get("lstchain", "drs4_baseline"):
8787
self._remove_drs4_baseline()
8888

8989
def _remove_drs4_baseline(self):
@@ -121,9 +121,16 @@ def _remove_dl1b_output(self, file_prefix):
121121

122122
def _write_checkpoint(self):
123123
"""Write the checkpoint in the history file."""
124+
command_to_prod_id = {
125+
cfg.get("lstchain", "r0_to_dl1"): options.prod_id,
126+
cfg.get("lstchain", "dl1ab"): options.dl1_prod_id,
127+
cfg.get("lstchain", "check_dl1"): options.dl1_prod_id,
128+
cfg.get("lstchain", "dl1_to_dl2"): options.dl2_prod_id
129+
}
130+
prod_id = command_to_prod_id.get(self.command)
124131
history(
125132
run=self.run,
126-
prod_id=options.prod_id,
133+
prod_id=prod_id,
127134
stage=self.command,
128135
return_code=self.rc,
129136
history_file=self.history_file,

0 commit comments

Comments
 (0)