lstosa 0.10.13__py3-none-any.whl → 0.10.14__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.10.13
3
+ Version: 0.10.14
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,5 +1,5 @@
1
1
  osa/__init__.py,sha256=crotf1NMTfNdZuCua_5T_jk3kvZrAAwVw4FPrfxv994,193
2
- osa/_version.py,sha256=c5Lgl5D7jKlT_lWX9E4XMtEyMNdztYHiVhsN32Kvd8g,415
2
+ osa/_version.py,sha256=76UZ8OAmh_iNsrP-vbUrVEfcRxo13WrlquAZql0gVVg,415
3
3
  osa/conftest.py,sha256=NBeGqTUBRqCPirDSDPny4bf1e_OJXbiePazHwaoQPY4,20072
4
4
  osa/job.py,sha256=OnjF88kTVdURcrIR9iPenATNx2HteDFlAKtOX4fD144,26603
5
5
  osa/osadb.py,sha256=pkCuYbEG-moHG0uQHxwB7giQAv2XTld4HJ5gdn1F1hA,2422
@@ -39,10 +39,10 @@ osa/scripts/calibration_pipeline.py,sha256=g9o1chqCRRSo7GNuQZRABjGnJYjZyfhkPgRLP
39
39
  osa/scripts/closer.py,sha256=p11tq2YJLwsRK_CBWXU1465ArzLJ0qWlUCnubGqLPUo,18277
40
40
  osa/scripts/copy_datacheck.py,sha256=tfDs6oTdPbii4BOXp6bTHuED0xNJeqaPFrv6Ed7ZnWc,3104
41
41
  osa/scripts/datasequence.py,sha256=gXAp8arbLPEK-sca9VnME6-2XfUzBFIoEFchlUZYrXI,9260
42
- osa/scripts/gain_selection.py,sha256=w9ymJrADcp5G6YTBYSwPy_3ZFdenYv2KChv3s_GMnAc,13809
42
+ osa/scripts/gain_selection.py,sha256=2aYmvKSW2ELHvf-4eW_AwiynvrbUeFCsvG2A2qmqvTQ,14775
43
43
  osa/scripts/provprocess.py,sha256=mufkZe6_qwH3DGqTFxINIc01hciF5RMpw3n_Mp7vwXU,18629
44
44
  osa/scripts/reprocess_longterm.py,sha256=wMfc3UVwickkGFiviIhOlB9ebMIqQPWoUrgg8hQ78Lg,2138
45
- osa/scripts/reprocessing.py,sha256=D-J8Rl3GrkWpxYkk6ci79oJOMewgGdxLkQgaHCAZuqs,3417
45
+ osa/scripts/reprocessing.py,sha256=A97kqX7QtD7ewoUvFhmSaQVVIfplViGhzTtOenTx37w,3630
46
46
  osa/scripts/sequencer.py,sha256=GM6B17YQNJfBOosWx0gpXBy4fIwga3DC4T2nGapGQEU,8763
47
47
  osa/scripts/sequencer_webmaker.py,sha256=YticifQRicxCp5YMeOaP4L8ZRWl7KF2raceVrCf2Ras,4765
48
48
  osa/scripts/show_run_summary.py,sha256=SoDLVKdQHOJkfenFguBOfXf10Gyv7heXSQAFnDVZqMs,2468
@@ -74,9 +74,9 @@ osa/workflow/dl3.py,sha256=kz7L5jcKHFJ--UdQ8HQKLzWO6nxc2LLOTz42ExcqzTk,9921
74
74
  osa/workflow/stages.py,sha256=WYgUM2XDIaUjCc4_Zs_VSGW6gk73EaKcHk6ZMnPds74,6692
75
75
  osa/workflow/tests/test_dl3.py,sha256=aY5bb-8OcZGAXG3JPCZihChzkA_GsWjRIa31BHZn3Dg,299
76
76
  osa/workflow/tests/test_stages.py,sha256=TmC00XFACWZp740TQeFaokWi3C50ovj_XGiySWrrdZk,3944
77
- lstosa-0.10.13.dist-info/LICENSE,sha256=h6iWot11EtMvaDaS_AvCHKLTNByO5wEbMyNj1c90y1c,1519
78
- lstosa-0.10.13.dist-info/METADATA,sha256=_1DEBMLyudnTjOHqjqJXNun16SP7dmLWWzZfm28B7Z0,7349
79
- lstosa-0.10.13.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
80
- lstosa-0.10.13.dist-info/entry_points.txt,sha256=e5x7xddaqZhfdZPsErhHInqR4UGHsxXIlylEbTie0_8,928
81
- lstosa-0.10.13.dist-info/top_level.txt,sha256=_Tj8zVHdrOoWZuuWTHbDpNofxW0imUmKdlXhnxsXJek,4
82
- lstosa-0.10.13.dist-info/RECORD,,
77
+ lstosa-0.10.14.dist-info/LICENSE,sha256=h6iWot11EtMvaDaS_AvCHKLTNByO5wEbMyNj1c90y1c,1519
78
+ lstosa-0.10.14.dist-info/METADATA,sha256=qy3G8stmx7C9eAbLAECr6VgWqDn7wKEuSw4kklsmdPU,7349
79
+ lstosa-0.10.14.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
80
+ lstosa-0.10.14.dist-info/entry_points.txt,sha256=e5x7xddaqZhfdZPsErhHInqR4UGHsxXIlylEbTie0_8,928
81
+ lstosa-0.10.14.dist-info/top_level.txt,sha256=_Tj8zVHdrOoWZuuWTHbDpNofxW0imUmKdlXhnxsXJek,4
82
+ lstosa-0.10.14.dist-info/RECORD,,
osa/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.10.13'
16
- __version_tuple__ = version_tuple = (0, 10, 13)
15
+ __version__ = version = '0.10.14'
16
+ __version_tuple__ = version_tuple = (0, 10, 14)
@@ -24,7 +24,7 @@ log = myLogger(logging.getLogger(__name__))
24
24
 
25
25
  PATH = "PATH=/fefs/aswg/software/offline_dvr/bin:$PATH"
26
26
 
27
- parser = argparse.ArgumentParser(add_help=False)
27
+ parser = argparse.ArgumentParser()
28
28
  parser.add_argument(
29
29
  "--check",
30
30
  action="store_true",
@@ -50,13 +50,14 @@ parser.add_argument(
50
50
  "--date",
51
51
  default=None,
52
52
  type=str,
53
- help="Night to apply the gain selection",
53
+ help="Night to apply the gain selection in YYYYMMDD format",
54
54
  )
55
55
  parser.add_argument(
56
56
  "-l",
57
57
  "--dates-file",
58
58
  default=None,
59
- help="List of dates to apply the gain selection",
59
+ help="List of dates to apply the gain selection. The input file should list"
60
+ "the dates in the format YYYYMMDD, one date per line.",
60
61
  )
61
62
  parser.add_argument(
62
63
  "-o",
@@ -79,12 +80,20 @@ parser.add_argument(
79
80
  default=18,
80
81
  help="Time to stop gain selection in HH format. Default is 18.",
81
82
  )
83
+ parser.add_argument(
84
+ "-t",
85
+ "--tool",
86
+ type=str,
87
+ default=None,
88
+ help="Choose tool to apply the gain selection regardless the date. Possible options are: lst_dvr (by default used for dates "
89
+ "previous to 20231205) and lstchain_r0_to_r0g (by default used for dates later than 20231205).",
90
+ )
82
91
 
83
92
  def get_sbatch_script(
84
- run_id, subrun, input_file, output_dir, log_dir, log_file, ref_time, ref_counter, module, ref_source, script
93
+ run_id, subrun, input_file, output_dir, log_dir, log_file, ref_time, ref_counter, module, ref_source, tool
85
94
  ):
86
95
  """Build the sbatch job pilot script for running the gain selection."""
87
- if script=="old":
96
+ if tool == "lst_dvr":
88
97
  return dedent(
89
98
  f"""\
90
99
  #!/bin/bash
@@ -98,7 +107,7 @@ def get_sbatch_script(
98
107
  lst_dvr {input_file} {output_dir} {ref_time} {ref_counter} {module} {ref_source}
99
108
  """
100
109
  )
101
- elif script=="new":
110
+ elif tool == "lstchain_r0_to_r0g":
102
111
  return dedent(
103
112
  f"""\
104
113
  #!/bin/bash
@@ -113,16 +122,17 @@ def get_sbatch_script(
113
122
  """
114
123
  )
115
124
 
116
- def apply_gain_selection(date: str, start: int, end: int, output_basedir: Path = None, no_queue_check: bool = False):
125
+ def apply_gain_selection(date: str, start: int, end: int, output_basedir: Path = None, tool: str = None, no_queue_check: bool = False):
117
126
  """
118
127
  Submit the jobs to apply the gain selection to the data for a given date
119
128
  on a subrun-by-subrun basis.
120
129
  """
121
130
 
122
- if date < "20231205":
123
- script = "old"
124
- else:
125
- script = "new"
131
+ if not tool:
132
+ if date < "20231205":
133
+ tool = "lst_dvr"
134
+ else:
135
+ tool = "lstchain_r0_to_r0g"
126
136
 
127
137
  run_summary_dir = Path("/fefs/aswg/data/real/monitoring/RunSummary")
128
138
  run_summary_file = run_summary_dir / f"RunSummary_{date}.ecsv"
@@ -156,7 +166,7 @@ def apply_gain_selection(date: str, start: int, end: int, output_basedir: Path =
156
166
  subrun_numbers = [int(file[-12:-8]) for file in files]
157
167
  input_files = []
158
168
 
159
- if date < "20231205" and ref_source not in ["UCTS", "TIB"]:
169
+ if tool == "lst_dvr" and ref_source not in ["UCTS", "TIB"]:
160
170
  input_files = r0_dir.glob(f"LST-1.?.Run{run_id:05d}.????.fits.fz")
161
171
  log.info(
162
172
  f"Run {run_id} does not have UCTS or TIB info, so gain selection cannot"
@@ -199,7 +209,7 @@ def apply_gain_selection(date: str, start: int, end: int, output_basedir: Path =
199
209
  ref_counter,
200
210
  module,
201
211
  ref_source,
202
- script,
212
+ tool,
203
213
  )
204
214
  )
205
215
  sp.run(["sbatch", job_file], check=True)
@@ -328,7 +338,14 @@ def main():
328
338
  check_failed_jobs(args.date, args.output_basedir)
329
339
  else:
330
340
  log.info(f"Applying gain selection to date {args.date}")
331
- apply_gain_selection(args.date, args.start_time, args.end_time, args.output_basedir, no_queue_check=args.no_queue_check)
341
+ apply_gain_selection(
342
+ args.date,
343
+ args.start_time,
344
+ args.end_time,
345
+ args.output_basedir,
346
+ args.tool,
347
+ no_queue_check=args.no_queue_check,
348
+ )
332
349
 
333
350
 
334
351
  elif args.dates_file:
@@ -342,7 +359,14 @@ def main():
342
359
  else:
343
360
  for date in list_of_dates:
344
361
  log.info(f"Applying gain selection to date {date}")
345
- apply_gain_selection(date, args.start_time, args.end_time, args.output_basedir, no_queue_check=args.no_queue_check)
362
+ apply_gain_selection(
363
+ date,
364
+ args.start_time,
365
+ args.end_time,
366
+ args.output_basedir,
367
+ args.tool,
368
+ no_queue_check=args.no_queue_check,
369
+ )
346
370
  log.info("Done! No more dates to process.")
347
371
 
348
372
 
@@ -22,7 +22,7 @@ def number_of_pending_jobs():
22
22
 
23
23
 
24
24
  def run_script(
25
- script: str, date, config: Path, no_dl2: bool, no_calib: bool, simulate: bool, force: bool
25
+ script: str, date, config: Path, no_dl2: bool, no_gainsel: bool, no_calib: bool, simulate: bool, force: bool
26
26
  ):
27
27
  """Run the sequencer for a given date."""
28
28
  osa_config = Path(config).resolve()
@@ -32,6 +32,9 @@ def run_script(
32
32
  if no_dl2:
33
33
  cmd.append("--no-dl2")
34
34
 
35
+ if no_gainsel:
36
+ cmd.append("--no-gainsel")
37
+
35
38
  if no_calib:
36
39
  cmd.append("--no-calib")
37
40
 
@@ -64,6 +67,7 @@ def get_list_of_dates(dates_file):
64
67
 
65
68
  @click.command()
66
69
  @click.option("--no-dl2", is_flag=True, help="Do not run the DL2 step.")
70
+ @click.option("--no-gainsel", is_flag=True, help="Do not require gain selection to be finished.")
67
71
  @click.option("--no-calib", is_flag=True, help="Do not run the calibration step.")
68
72
  @click.option("-s", "--simulate", is_flag=True, help="Activate simulation mode.")
69
73
  @click.option("-f", "--force", is_flag=True, help="Force the autocloser to close the day.")
@@ -83,6 +87,7 @@ def main(
83
87
  dates_file: Path = None,
84
88
  config: Path = DEFAULT_CFG,
85
89
  no_dl2: bool = False,
90
+ no_gainsel: bool = False,
86
91
  no_calib: bool = False,
87
92
  simulate: bool = False,
88
93
  force: bool = False,
@@ -102,7 +107,7 @@ def main(
102
107
  # Avoid running jobs while it is still night time
103
108
  wait_for_daytime()
104
109
 
105
- run_script(script, date, config, no_dl2, no_calib, simulate, force)
110
+ run_script(script, date, config, no_dl2, no_gainsel, no_calib, simulate, force)
106
111
  log.info("Waiting 1 minute to launch the process for the next date...\n")
107
112
  time.sleep(60)
108
113