lstosa 0.11.1__py3-none-any.whl → 0.11.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lstosa
3
- Version: 0.11.1
3
+ Version: 0.11.3
4
4
  Summary: Onsite analysis pipeline for the CTA LST-1
5
5
  Author: María Láinez, José Enrique Ruiz, Lab Saha, Andrés Baquero, José Luis Contreras, Maximilian Linhoff
6
6
  Author-email: Daniel Morcuende <dmorcuen@ucm.es>
@@ -1,7 +1,7 @@
1
1
  osa/__init__.py,sha256=crotf1NMTfNdZuCua_5T_jk3kvZrAAwVw4FPrfxv994,193
2
- osa/_version.py,sha256=g-BRN5ntacVPfcVOcNVRBE1Tq9w5RF-9CzVCMjwnu8w,513
2
+ osa/_version.py,sha256=3HI3wVakaLT6OqNDadrX8IIIRO-nmIN4eu3bFgy5iM8,513
3
3
  osa/conftest.py,sha256=AdSHdWqjeMTgIeZEF8fdw6eSliySouivMWCPIqUV2os,24667
4
- osa/job.py,sha256=gLf-e7QRIvNhjGRINDTR5-k2PyYQqbEvPnUcg0DaVdw,27791
4
+ osa/job.py,sha256=-W3t4_aP5dKRVy2BtyPE1eL4RRBfxIWYT_Ue88GrKXk,27866
5
5
  osa/osadb.py,sha256=pkCuYbEG-moHG0uQHxwB7giQAv2XTld4HJ5gdn1F1hA,2422
6
6
  osa/paths.py,sha256=_3-avNABr7I2koiOo4MMDymi98l7JdIj1zUVbTjHdYg,18011
7
7
  osa/raw.py,sha256=ZNIsuqfx5ljoz_hwhSuafdKf-wr8-cxRJmel-A2endg,1337
@@ -34,18 +34,18 @@ osa/provenance/config/definition.yaml,sha256=6USKM92kjLpF8cy0TFl2d1WRjowjOmtCclN
34
34
  osa/provenance/config/environment.yaml,sha256=kPM6ucPyLZLDFzkwFWoY0C6vmAArG98U-P1UAl89bgE,246
35
35
  osa/provenance/config/logger.yaml,sha256=hy_lH3DfbRFh2VM_iawI-c-3wE0cjTRHy465C2eFfnQ,510
36
36
  osa/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- osa/scripts/autocloser.py,sha256=_NGhk_ehJUu1BaC-rkGziTgCeb_B8Eb_fqLccOEmznw,14386
37
+ osa/scripts/autocloser.py,sha256=yjROBHDMbKHu0HAb0UW_3pZ-K9R20gQJTlMzKCA9dvU,14401
38
38
  osa/scripts/calibration_pipeline.py,sha256=oWX2L9WIofVHp5qYsX3YMfwoslfiUgnXtWA2EI8KuG4,6056
39
39
  osa/scripts/closer.py,sha256=vhoe9wkvPvMc5O_kXqAiBuWeqm_KrBpYzgb9zs9ZORw,21718
40
40
  osa/scripts/copy_datacheck.py,sha256=rAJu5-5oJxspynjYqVWLDKnXTF7Ib9xtzSf3_DiIHsk,3212
41
- osa/scripts/datasequence.py,sha256=VKeZnA2OTl3PgtiTpYdw4GiB6gpbfWiqLdZSaBCmNyw,8592
41
+ osa/scripts/datasequence.py,sha256=0EZYlkX7ouaD66Ia2a5SWKbL0Fhlk8p4knKh0TG-2Gw,8592
42
42
  osa/scripts/gain_selection.py,sha256=PUG1J2V2SIboVKXJ-u4-h_XJyOGzfurazPu37M7lmhA,23238
43
43
  osa/scripts/gainsel_webmaker.py,sha256=40_DX7RUmImX-31iqRTFPEUvdVXXPSKp0xMEJWuAu80,5006
44
44
  osa/scripts/provprocess.py,sha256=Zv8sHTOgGNuEzu1QPUF142VQbHyfOsrxO073-xA6KG8,19107
45
45
  osa/scripts/reprocess_longterm.py,sha256=wMfc3UVwickkGFiviIhOlB9ebMIqQPWoUrgg8hQ78Lg,2138
46
- osa/scripts/reprocessing.py,sha256=A97kqX7QtD7ewoUvFhmSaQVVIfplViGhzTtOenTx37w,3630
46
+ osa/scripts/reprocessing.py,sha256=IL30e2McFA0EGbzvkTXdzmKJGBTbafYlCA-PsafyzyY,4571
47
47
  osa/scripts/sequencer.py,sha256=2t-fcD1pTvYV54vFSxxKID-L7pkRg7geXo-E43cnL6M,11927
48
- osa/scripts/sequencer_catB_tailcuts.py,sha256=umsru9KyUAE5OrbB5OOGZs2WYM_1O8283Eap25wYwQg,9988
48
+ osa/scripts/sequencer_catB_tailcuts.py,sha256=zVBuCBiiIoO3HKHbJ0zqaDtuwxkxcziR4T5i-2WyDX8,10476
49
49
  osa/scripts/sequencer_webmaker.py,sha256=a9okC-l9UMJHELTLLM2Q933-JELFOhXEbbH1Kbp1E8g,4936
50
50
  osa/scripts/show_run_summary.py,sha256=ofznLdoFHKQB-TELD6g5zMqD_TE9M9BuJR12zHvNdXE,2518
51
51
  osa/scripts/simulate_processing.py,sha256=D3b0kjyUS6Lm7pkQNJ-tJzQMveTwoPabfBBW80RMqN0,6828
@@ -76,9 +76,9 @@ osa/workflow/dl3.py,sha256=ZMXPrdJA0WOxDiHEW9sdM2vmYix8R3eSMTGc6o42yxg,9860
76
76
  osa/workflow/stages.py,sha256=ILg91VyNXcy--si7CpDa1UFRiugqIH6nKl10Ru2zZVc,7422
77
77
  osa/workflow/tests/test_dl3.py,sha256=81Vt4lNxNjdKi_ehzymqfFWFjncw7GuQcix9S0Yigaw,384
78
78
  osa/workflow/tests/test_stages.py,sha256=aslfOIjf-rvf3r9N7NtimaOKkVB6K1M3bidgHOzRkMs,3985
79
- lstosa-0.11.1.dist-info/LICENSE,sha256=h6iWot11EtMvaDaS_AvCHKLTNByO5wEbMyNj1c90y1c,1519
80
- lstosa-0.11.1.dist-info/METADATA,sha256=9PMpH8_HdRSOSCGYetsCvEJRuzIbgrNHQKFkhPiW--0,7302
81
- lstosa-0.11.1.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
82
- lstosa-0.11.1.dist-info/entry_points.txt,sha256=CzDKpLjZZQm8jJBxOVpMR8Czpgg_Yh-k6IPETp30VZE,1048
83
- lstosa-0.11.1.dist-info/top_level.txt,sha256=_Tj8zVHdrOoWZuuWTHbDpNofxW0imUmKdlXhnxsXJek,4
84
- lstosa-0.11.1.dist-info/RECORD,,
79
+ lstosa-0.11.3.dist-info/LICENSE,sha256=h6iWot11EtMvaDaS_AvCHKLTNByO5wEbMyNj1c90y1c,1519
80
+ lstosa-0.11.3.dist-info/METADATA,sha256=8E9rqpM04-dAuH_l9y14_F_n3FojBSeIwQ8oJLk3xTA,7302
81
+ lstosa-0.11.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
82
+ lstosa-0.11.3.dist-info/entry_points.txt,sha256=CzDKpLjZZQm8jJBxOVpMR8Czpgg_Yh-k6IPETp30VZE,1048
83
+ lstosa-0.11.3.dist-info/top_level.txt,sha256=_Tj8zVHdrOoWZuuWTHbDpNofxW0imUmKdlXhnxsXJek,4
84
+ lstosa-0.11.3.dist-info/RECORD,,
osa/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.11.1'
21
- __version_tuple__ = version_tuple = (0, 11, 1)
20
+ __version__ = version = '0.11.3'
21
+ __version_tuple__ = version_tuple = (0, 11, 3)
osa/job.py CHANGED
@@ -99,7 +99,10 @@ def are_all_jobs_correctly_finished(sequence_list):
99
99
  flag = True
100
100
  analysis_directory = Path(options.directory)
101
101
  for sequence in sequence_list:
102
- history_files_list = analysis_directory.rglob(f"*{sequence.run}*.history")
102
+ if sequence.type != "DATA":
103
+ continue
104
+ else:
105
+ history_files_list = analysis_directory.rglob(f"*{sequence.run}*.history")
103
106
 
104
107
  if not options.test:
105
108
  try:
osa/scripts/autocloser.py CHANGED
@@ -73,16 +73,16 @@ class Telescope:
73
73
 
74
74
  if self.is_closed():
75
75
  log.info(f"{self.telescope} is already closed! Ignoring {self.telescope}")
76
- return
76
+ sys.exit(0)
77
77
  if not analysis_path(self.telescope).exists():
78
78
  log.warning(
79
79
  f"Analysis directory does not exist for {self.telescope}! "
80
80
  f"Ignoring {self.telescope}"
81
81
  )
82
- return
82
+ sys.exit(0)
83
83
  if not self.lock_automatic_sequencer() and not ignore_cronlock:
84
84
  log.warning(f"{self.telescope} already locked! Ignoring {self.telescope}")
85
- return
85
+ sys.exit(0)
86
86
  if not self.simulate_sequencer(date, config_file, test, no_gainsel):
87
87
  log.warning(
88
88
  f"Simulation of the sequencer failed "
@@ -207,7 +207,7 @@ def dl1ab(run_str: str, dl1b_config: Path, dl1_prod_id: str) -> int:
207
207
  f"Cat-B calibration did not finish yet for run {run_str[:5]}. "
208
208
  "Please try again later."
209
209
  )
210
- sys.exit(1)
210
+ sys.exit(0)
211
211
 
212
212
  if options.simulate:
213
213
  return 0
@@ -22,7 +22,17 @@ def number_of_pending_jobs():
22
22
 
23
23
 
24
24
  def run_script(
25
- script: str, date, config: Path, no_dl2: bool, no_gainsel: bool, no_calib: bool, simulate: bool, force: bool
25
+ script: str,
26
+ date,
27
+ config: Path,
28
+ no_dl2: bool,
29
+ no_gainsel: bool,
30
+ no_calib: bool,
31
+ no_dl1ab: bool,
32
+ simulate: bool,
33
+ force: bool,
34
+ overwrite_tailcuts: bool,
35
+ overwrite_catb: bool,
26
36
  ):
27
37
  """Run the sequencer for a given date."""
28
38
  osa_config = Path(config).resolve()
@@ -38,12 +48,21 @@ def run_script(
38
48
  if no_calib:
39
49
  cmd.append("--no-calib")
40
50
 
51
+ if no_dl1ab:
52
+ cmd.append("--no-dl1ab")
53
+
41
54
  if simulate:
42
55
  cmd.append("--simulate")
43
56
 
44
57
  if force:
45
58
  cmd.append("--force")
46
59
 
60
+ if overwrite_tailcuts:
61
+ cmd.append("--overwrite-tailcuts")
62
+
63
+ if overwrite_catb:
64
+ cmd.append("--overwrite-catB")
65
+
47
66
  # Append the telescope to the command in the last place
48
67
  cmd.append("LST1")
49
68
 
@@ -69,8 +88,11 @@ def get_list_of_dates(dates_file):
69
88
  @click.option("--no-dl2", is_flag=True, help="Do not run the DL2 step.")
70
89
  @click.option("--no-gainsel", is_flag=True, help="Do not require gain selection to be finished.")
71
90
  @click.option("--no-calib", is_flag=True, help="Do not run the calibration step.")
91
+ @click.option("--no-dl1ab", is_flag=True, help="Do not run the DL1AB step.")
72
92
  @click.option("-s", "--simulate", is_flag=True, help="Activate simulation mode.")
73
93
  @click.option("-f", "--force", is_flag=True, help="Force the autocloser to close the day.")
94
+ @click.option("--overwrite-tailcuts", is_flag=True, help="Overwrite the tailcuts config file if it already exists.")
95
+ @click.option("--overwrite-catB", is_flag=True, help="Overwrite the Cat-B calibration files if they already exist.")
74
96
  @click.option(
75
97
  "-c",
76
98
  "--config",
@@ -79,7 +101,7 @@ def get_list_of_dates(dates_file):
79
101
  help="Path to the OSA config file.",
80
102
  )
81
103
  @click.argument(
82
- "script", type=click.Choice(["sequencer", "closer", "copy_datacheck", "autocloser"])
104
+ "script", type=click.Choice(["sequencer", "closer", "copy_datacheck", "autocloser", "sequencer_catB_tailcuts"])
83
105
  )
84
106
  @click.argument("dates-file", type=click.Path(exists=True))
85
107
  def main(
@@ -89,9 +111,12 @@ def main(
89
111
  no_dl2: bool = False,
90
112
  no_gainsel: bool = False,
91
113
  no_calib: bool = False,
114
+ no_dl1ab: bool = False,
92
115
  simulate: bool = False,
93
116
  force: bool = False,
94
- ):
117
+ overwrite_tailcuts: bool = False,
118
+ overwrite_catb: bool = False,
119
+ ):
95
120
  """
96
121
  Loop over the dates listed in the input file and launch the script for each of them.
97
122
  The input file should list the dates in the format YYYY-MM-DD one date per line.
@@ -107,7 +132,19 @@ def main(
107
132
  # Avoid running jobs while it is still night time
108
133
  wait_for_daytime()
109
134
 
110
- run_script(script, date, config, no_dl2, no_gainsel, no_calib, simulate, force)
135
+ run_script(
136
+ script,
137
+ date,
138
+ config,
139
+ no_dl2,
140
+ no_gainsel,
141
+ no_calib,
142
+ no_dl1ab,
143
+ simulate,
144
+ force,
145
+ overwrite_tailcuts,
146
+ overwrite_catb,
147
+ )
111
148
  log.info("Waiting 1 minute to launch the process for the next date...\n")
112
149
  time.sleep(60)
113
150
 
@@ -56,6 +56,12 @@ parser.add_argument(
56
56
  default=False,
57
57
  help="Overwrite the tailcuts config file if it already exists.",
58
58
  )
59
+ parser.add_argument(
60
+ "--overwrite-catB",
61
+ action="store_true",
62
+ default=False,
63
+ help="Overwrite the Cat-B calibration files if they already exist.",
64
+ )
59
65
  parser.add_argument(
60
66
  "tel_id",
61
67
  choices=["ST", "LST1", "LST2", "all"],
@@ -111,7 +117,7 @@ def launch_catB_calibration(run_id: int):
111
117
  before and it finished successfully, it creates a catB_{run}.closed file.
112
118
  """
113
119
  job_id = get_catB_last_job_id(run_id)
114
- if job_id:
120
+ if job_id and not options.overwrite_catB:
115
121
  job_status = get_sacct_output(run_sacct(job_id=job_id))["State"]
116
122
  if job_status.item() in ["RUNNING", "PENDING"]:
117
123
  log.debug(f"Job {job_id} (corresponding to run {run_id:05d}) is still running.")
@@ -129,8 +135,11 @@ def launch_catB_calibration(run_id: int):
129
135
 
130
136
  else:
131
137
  if catB_calibration_file_exists(run_id):
132
- log.info(f"Cat-B calibration file already produced for run {run_id:05d}.")
133
- return
138
+ if not options.overwrite_catB:
139
+ log.info(f"Cat-B calibration file already produced for run {run_id:05d}.")
140
+ return
141
+ else:
142
+ log.info(f"Cat-B calibration file already produced for run {run_id:05d}. Overwriting it.")
134
143
 
135
144
  command = cfg.get("lstchain", "catB_calibration")
136
145
  if cfg.getboolean("lstchain", "use_lstcam_env_for_CatB_calib"):
@@ -162,6 +171,9 @@ def launch_catB_calibration(run_id: int):
162
171
  cmd.append(f"--dl1-dir={analysis_dir}")
163
172
  cmd.append(f"--lstchain-version={lstchain_version[1:]}")
164
173
 
174
+ if options.overwrite_catB:
175
+ cmd.append("--yes")
176
+
165
177
  if not options.simulate:
166
178
  job = sp.run(cmd, encoding="utf-8", capture_output=True, text=True, check=True)
167
179
  job_id = job.stdout.strip()
@@ -217,6 +229,7 @@ def main():
217
229
  options.tel_id = opts.tel_id
218
230
  options.simulate = opts.simulate
219
231
  options.overwrite_tailcuts = opts.overwrite_tailcuts
232
+ options.overwrite_catB = opts.overwrite_catB
220
233
  options.date = opts.date
221
234
  options.date = set_default_date_if_needed()
222
235
  options.configfile = opts.config.resolve()