lstosa 0.10.18__py3-none-any.whl → 0.11.0__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.
Files changed (46) hide show
  1. {lstosa-0.10.18.dist-info → lstosa-0.11.0.dist-info}/METADATA +4 -5
  2. lstosa-0.11.0.dist-info/RECORD +84 -0
  3. {lstosa-0.10.18.dist-info → lstosa-0.11.0.dist-info}/WHEEL +1 -1
  4. {lstosa-0.10.18.dist-info → lstosa-0.11.0.dist-info}/entry_points.txt +1 -0
  5. osa/_version.py +9 -4
  6. osa/configs/options.py +2 -0
  7. osa/configs/sequencer.cfg +21 -7
  8. osa/conftest.py +146 -6
  9. osa/high_level/significance.py +5 -3
  10. osa/high_level/tests/test_significance.py +3 -0
  11. osa/job.py +52 -26
  12. osa/nightsummary/extract.py +12 -3
  13. osa/nightsummary/tests/test_extract.py +5 -0
  14. osa/paths.py +111 -28
  15. osa/provenance/capture.py +1 -1
  16. osa/provenance/config/definition.yaml +7 -0
  17. osa/provenance/utils.py +22 -7
  18. osa/scripts/autocloser.py +0 -10
  19. osa/scripts/calibration_pipeline.py +9 -2
  20. osa/scripts/closer.py +136 -55
  21. osa/scripts/copy_datacheck.py +5 -3
  22. osa/scripts/datasequence.py +45 -71
  23. osa/scripts/gain_selection.py +14 -15
  24. osa/scripts/provprocess.py +16 -7
  25. osa/scripts/sequencer.py +49 -34
  26. osa/scripts/sequencer_catB_tailcuts.py +239 -0
  27. osa/scripts/sequencer_webmaker.py +4 -0
  28. osa/scripts/show_run_summary.py +2 -2
  29. osa/scripts/simulate_processing.py +4 -7
  30. osa/scripts/tests/test_osa_scripts.py +67 -22
  31. osa/scripts/update_source_catalog.py +45 -22
  32. osa/tests/test_jobs.py +28 -11
  33. osa/tests/test_paths.py +6 -6
  34. osa/tests/test_raw.py +4 -4
  35. osa/utils/cliopts.py +37 -32
  36. osa/utils/register.py +18 -13
  37. osa/utils/tests/test_utils.py +14 -0
  38. osa/utils/utils.py +186 -56
  39. osa/veto.py +1 -1
  40. osa/workflow/dl3.py +1 -2
  41. osa/workflow/stages.py +16 -11
  42. osa/workflow/tests/test_dl3.py +2 -1
  43. osa/workflow/tests/test_stages.py +7 -5
  44. lstosa-0.10.18.dist-info/RECORD +0 -83
  45. {lstosa-0.10.18.dist-info → lstosa-0.11.0.dist-info}/LICENSE +0 -0
  46. {lstosa-0.10.18.dist-info → lstosa-0.11.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lstosa
3
- Version: 0.10.18
3
+ Version: 0.11.0
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>
@@ -18,8 +18,8 @@ Classifier: Programming Language :: Python :: 3.11
18
18
  Requires-Python: >=3.10
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
- Requires-Dist: astropy ~=5.0
22
- Requires-Dist: lstchain >=0.10.13
21
+ Requires-Dist: astropy <8,>=6.1
22
+ Requires-Dist: lstchain >=0.11.0
23
23
  Requires-Dist: matplotlib
24
24
  Requires-Dist: numpy
25
25
  Requires-Dist: pandas
@@ -31,9 +31,8 @@ Requires-Dist: psutil
31
31
  Requires-Dist: click
32
32
  Requires-Dist: toml
33
33
  Requires-Dist: pymongo
34
- Requires-Dist: gammapy ~=1.1
34
+ Requires-Dist: gammapy ~=1.3
35
35
  Requires-Dist: tenacity
36
- Requires-Dist: lstcam-calib
37
36
  Provides-Extra: all
38
37
  Requires-Dist: lstosa[dev,doc,test] ; extra == 'all'
39
38
  Provides-Extra: dev
@@ -0,0 +1,84 @@
1
+ osa/__init__.py,sha256=crotf1NMTfNdZuCua_5T_jk3kvZrAAwVw4FPrfxv994,193
2
+ osa/_version.py,sha256=h33CazvO6X2vAgSb_I-BIOLNm7W5MVFnfSYRgLiRpMA,513
3
+ osa/conftest.py,sha256=AdSHdWqjeMTgIeZEF8fdw6eSliySouivMWCPIqUV2os,24667
4
+ osa/job.py,sha256=gLf-e7QRIvNhjGRINDTR5-k2PyYQqbEvPnUcg0DaVdw,27791
5
+ osa/osadb.py,sha256=pkCuYbEG-moHG0uQHxwB7giQAv2XTld4HJ5gdn1F1hA,2422
6
+ osa/paths.py,sha256=_3-avNABr7I2koiOo4MMDymi98l7JdIj1zUVbTjHdYg,18011
7
+ osa/raw.py,sha256=ZNIsuqfx5ljoz_hwhSuafdKf-wr8-cxRJmel-A2endg,1337
8
+ osa/report.py,sha256=sL2V7n8Y_UUaSDbWJY2o4UxDb4FU5AaFIRR8R25DB8o,4634
9
+ osa/version.py,sha256=9T2TtuGBQeOy5PJDxMCeGlqx5baxLaq47VmFTDc09z8,796
10
+ osa/veto.py,sha256=BTirpHLXbmkppJajFq6fxMuXtEKtIMv2NH-vYPScRSU,3099
11
+ osa/configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ osa/configs/config.py,sha256=cX0Vr4sorBVQ2KRqPIRSEGENKH_uC5lrgVHx1hp6YTk,1148
13
+ osa/configs/datamodel.py,sha256=L_WRM91PBlMrtuE30akh7YR-56P0g9D994qzKSfhNJc,1950
14
+ osa/configs/options.py,sha256=WbsyKhOs1Ud4Yt21O8KcISUvJYmhipa8vl_pxD_TZf4,558
15
+ osa/configs/sequencer.cfg,sha256=VALe3KDii6UPOkEjI2ZsjV4nhswR8h_t4UUu85jWU4s,5624
16
+ osa/high_level/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ osa/high_level/selection_cuts.toml,sha256=ReSmcKtOPZY5JsZ9ExnxYdz7OrJEB8gghCbzHmeOyFg,128
18
+ osa/high_level/significance.py,sha256=mMeG_y2wDnt0O2lSosYkSjaGZQl0V4GnuFrqKwSKSbE,9066
19
+ osa/high_level/tests/test_significance.py,sha256=nTHgwnL2zkQJduJuWXC4J4N8DlAghOidQki7njZmpSI,572
20
+ osa/nightsummary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
+ osa/nightsummary/database.py,sha256=6-1Y0Rw67QQtp0ekoynX9CVpImfECEUO64sA3fw24og,4276
22
+ osa/nightsummary/extract.py,sha256=vI_A_GrP6eQH8f2mr8OreUfrs5LwLNcH9KQLx_WikhQ,11498
23
+ osa/nightsummary/nightsummary.py,sha256=rPEN_J-rJSgsoCR_ONaW4PB9vjJzZvHgw0a7sYOA7wE,2666
24
+ osa/nightsummary/set_source_coordinates.py,sha256=e2UT_I_Epm8vte22TasIp28A3KRdcl4dgV4NjlIxwak,1579
25
+ osa/nightsummary/tests/test_database.py,sha256=w5Fts-H0eTi1KPV6Of0V2ZOD849Ie14KRe4wFhc9Hh0,242
26
+ osa/nightsummary/tests/test_extract.py,sha256=SJf0ld33UlK1d2jKweCQWNpGY9ZrIU1vFUdX4slnJps,1877
27
+ osa/nightsummary/tests/test_nightsummary.py,sha256=0bgGJtlXzwclO2ma9I3X315X0X1bDkjqCaYcp3fay1s,987
28
+ osa/nightsummary/tests/test_source_coordinates.py,sha256=doyF2e93RnFScPbG79aUmtHLCdGg-5oW8D5qqNDzivw,942
29
+ osa/provenance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
+ osa/provenance/capture.py,sha256=WATpVqHU3dIvxD64piqGd8PLlyN8syXn512omVNZrQs,22368
31
+ osa/provenance/io.py,sha256=8VAVKmE2S3YHcxwDC8PJ4hO6ogfz08EflAeprLGkp3Y,9471
32
+ osa/provenance/utils.py,sha256=7coX3-dM5xsJsYI2xXUSwIczBD9XdHZSyt8dcSRDoMM,9312
33
+ osa/provenance/config/definition.yaml,sha256=6USKM92kjLpF8cy0TFl2d1WRjowjOmtCclN4oPL6-sY,20705
34
+ osa/provenance/config/environment.yaml,sha256=kPM6ucPyLZLDFzkwFWoY0C6vmAArG98U-P1UAl89bgE,246
35
+ osa/provenance/config/logger.yaml,sha256=hy_lH3DfbRFh2VM_iawI-c-3wE0cjTRHy465C2eFfnQ,510
36
+ osa/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
+ osa/scripts/autocloser.py,sha256=_NGhk_ehJUu1BaC-rkGziTgCeb_B8Eb_fqLccOEmznw,14386
38
+ osa/scripts/calibration_pipeline.py,sha256=oWX2L9WIofVHp5qYsX3YMfwoslfiUgnXtWA2EI8KuG4,6056
39
+ osa/scripts/closer.py,sha256=vhoe9wkvPvMc5O_kXqAiBuWeqm_KrBpYzgb9zs9ZORw,21718
40
+ osa/scripts/copy_datacheck.py,sha256=rAJu5-5oJxspynjYqVWLDKnXTF7Ib9xtzSf3_DiIHsk,3212
41
+ osa/scripts/datasequence.py,sha256=VKeZnA2OTl3PgtiTpYdw4GiB6gpbfWiqLdZSaBCmNyw,8592
42
+ osa/scripts/gain_selection.py,sha256=PUG1J2V2SIboVKXJ-u4-h_XJyOGzfurazPu37M7lmhA,23238
43
+ osa/scripts/gainsel_webmaker.py,sha256=40_DX7RUmImX-31iqRTFPEUvdVXXPSKp0xMEJWuAu80,5006
44
+ osa/scripts/provprocess.py,sha256=Zv8sHTOgGNuEzu1QPUF142VQbHyfOsrxO073-xA6KG8,19107
45
+ osa/scripts/reprocess_longterm.py,sha256=wMfc3UVwickkGFiviIhOlB9ebMIqQPWoUrgg8hQ78Lg,2138
46
+ osa/scripts/reprocessing.py,sha256=A97kqX7QtD7ewoUvFhmSaQVVIfplViGhzTtOenTx37w,3630
47
+ osa/scripts/sequencer.py,sha256=2t-fcD1pTvYV54vFSxxKID-L7pkRg7geXo-E43cnL6M,11927
48
+ osa/scripts/sequencer_catB_tailcuts.py,sha256=x9iigitwHYe4ngsl5kyWjPkbYXenlmcfbPKHSxEFYuU,9514
49
+ osa/scripts/sequencer_webmaker.py,sha256=a9okC-l9UMJHELTLLM2Q933-JELFOhXEbbH1Kbp1E8g,4936
50
+ osa/scripts/show_run_summary.py,sha256=ofznLdoFHKQB-TELD6g5zMqD_TE9M9BuJR12zHvNdXE,2518
51
+ osa/scripts/simulate_processing.py,sha256=D3b0kjyUS6Lm7pkQNJ-tJzQMveTwoPabfBBW80RMqN0,6828
52
+ osa/scripts/update_source_catalog.py,sha256=Po4KSBOQCAT2Do1DUu5wnKV48Dq_pONfvtD47hh8fYI,8277
53
+ osa/scripts/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
+ osa/scripts/tests/test_osa_scripts.py,sha256=gyijYBzLQ19J1Az1mOdLm9bMxMwCkZryd78SfxCNtwg,15088
55
+ osa/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
+ osa/tests/test_jobs.py,sha256=ozrMBjHujDhEMzEvJE7WynChqjbBTcORHsHmFXozeWk,16112
57
+ osa/tests/test_osa.py,sha256=QCOsjUgPuNMHoef3Ym2sDXVjun2LaBrfKyroAIH-os8,415
58
+ osa/tests/test_osadb.py,sha256=pJHV1dxxblGH2sjS-JPDPTkMn-ew1MzbioCFyg7wbB8,1599
59
+ osa/tests/test_paths.py,sha256=jd3bc2T7bwaY25aCef7w5q-9bUhxKOR327Z4Ch4e7eY,3161
60
+ osa/tests/test_raw.py,sha256=XHe9al85Wwhuyk2a_6xrL9y7P11nr9MPs-t6VN328PY,1062
61
+ osa/tests/test_report.py,sha256=OY-EsrXytoS6esfjUeLnIAmCMIw9EzoGD-elySafyhE,1365
62
+ osa/tests/test_veto.py,sha256=UIsooji_5Z8TtAhc0UlD2VqheVd9DBufuMxinJ3e0w8,1066
63
+ osa/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
+ osa/utils/cliopts.py,sha256=KdGsezB8iqKxPn6s3K5-P1gxO-PRa_iM4ALl9qQgXcc,14805
65
+ osa/utils/iofile.py,sha256=kJ7KB1suynhS2cTf7EeHwhMXq3delC_ls2HFpCzvsZo,2021
66
+ osa/utils/logging.py,sha256=1WcNPjjslo3y25jcEY_fe0yXOeJ6frZrGLAy1GJpu_k,1491
67
+ osa/utils/mail.py,sha256=uQfqPQdiOVHTvEAXr9H15a7-g9DtYVNKjMEb9GnI0oY,554
68
+ osa/utils/register.py,sha256=h6JmCyRdL-6WaTVexq2ibS2rFN3j-bisHb-qZWz6g9s,6373
69
+ osa/utils/utils.py,sha256=a--RvA0P2JHVkuyG8uBy1BSFINLi33Ek-rNZ9jg3Fs8,13514
70
+ osa/utils/tests/test_iofile.py,sha256=e35_EqJerp-dEOrOqwXEUZCc5P_9llf2QfveltagfIk,399
71
+ osa/utils/tests/test_utils.py,sha256=ybngpeUyzHgr96Gcx8r2g5oHFTo3aDQIwkC5aE9Ztic,2357
72
+ osa/webserver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
+ osa/webserver/utils.py,sha256=ymB2wTzsFkPH4ebUcz_zK_zyolpnBzEbWGYwCvbaHf0,2155
74
+ osa/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
+ osa/workflow/dl3.py,sha256=ZMXPrdJA0WOxDiHEW9sdM2vmYix8R3eSMTGc6o42yxg,9860
76
+ osa/workflow/stages.py,sha256=ILg91VyNXcy--si7CpDa1UFRiugqIH6nKl10Ru2zZVc,7422
77
+ osa/workflow/tests/test_dl3.py,sha256=81Vt4lNxNjdKi_ehzymqfFWFjncw7GuQcix9S0Yigaw,384
78
+ osa/workflow/tests/test_stages.py,sha256=aslfOIjf-rvf3r9N7NtimaOKkVB6K1M3bidgHOzRkMs,3985
79
+ lstosa-0.11.0.dist-info/LICENSE,sha256=h6iWot11EtMvaDaS_AvCHKLTNByO5wEbMyNj1c90y1c,1519
80
+ lstosa-0.11.0.dist-info/METADATA,sha256=exZrcLYd0g_zvsij_tiLzKpmtKmiJ0ZIrkfpbjTWGkI,7302
81
+ lstosa-0.11.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
82
+ lstosa-0.11.0.dist-info/entry_points.txt,sha256=CzDKpLjZZQm8jJBxOVpMR8Czpgg_Yh-k6IPETp30VZE,1048
83
+ lstosa-0.11.0.dist-info/top_level.txt,sha256=_Tj8zVHdrOoWZuuWTHbDpNofxW0imUmKdlXhnxsXJek,4
84
+ lstosa-0.11.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.3.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -11,6 +11,7 @@ provprocess = osa.scripts.provprocess:main
11
11
  reprocess_longterm = osa.scripts.reprocess_longterm:main
12
12
  reprocessing = osa.scripts.reprocessing:main
13
13
  sequencer = osa.scripts.sequencer:main
14
+ sequencer_catB_tailcuts = osa.scripts.sequencer_catB_tailcuts:main
14
15
  sequencer_webmaker = osa.scripts.sequencer_webmaker:main
15
16
  show_run_summary = osa.scripts.show_run_summary:main
16
17
  show_run_summary_tcu = osa.scripts.show_run_summary_tcu:main
osa/_version.py CHANGED
@@ -1,8 +1,13 @@
1
- # file generated by setuptools_scm
1
+ # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
+
4
+ __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
+
3
6
  TYPE_CHECKING = False
4
7
  if TYPE_CHECKING:
5
- from typing import Tuple, Union
8
+ from typing import Tuple
9
+ from typing import Union
10
+
6
11
  VERSION_TUPLE = Tuple[Union[int, str], ...]
7
12
  else:
8
13
  VERSION_TUPLE = object
@@ -12,5 +17,5 @@ __version__: str
12
17
  __version_tuple__: VERSION_TUPLE
13
18
  version_tuple: VERSION_TUPLE
14
19
 
15
- __version__ = version = '0.10.18'
16
- __version_tuple__ = version_tuple = (0, 10, 18)
20
+ __version__ = version = '0.11.0'
21
+ __version_tuple__ = version_tuple = (0, 11, 0)
osa/configs/options.py CHANGED
@@ -15,6 +15,8 @@ verbose = None
15
15
  warning = None
16
16
  nocheck = None
17
17
  no_dl2 = None
18
+ no_dl1ab = None
19
+ no_gainsel = None
18
20
  prod_id = None
19
21
  dl1_prod_id = None
20
22
  dl2_prod_id = None
osa/configs/sequencer.cfg CHANGED
@@ -9,27 +9,34 @@
9
9
  BASE: test_osa/test_files0
10
10
  # The directories below can be left untouched.
11
11
  MONITORING: %(BASE)s/monitoring
12
- R0_DIR: %(BASE)s/R0
12
+ R0_DIR: %(BASE)s/R0G
13
+ RAW_R0_DIR: %(BASE)s/R0
13
14
  DRIVE_DIR: %(MONITORING)s/DrivePositioning
14
15
  RUN_SUMMARY_DIR: %(MONITORING)s/RunSummary
15
16
  RUN_CATALOG: %(MONITORING)s/RunCatalog
16
17
  PEDESTAL_FINDER_DIR: %(BASE)s/auxiliary/PedestalFinder
18
+ TAILCUTS_FINDER_DIR: %(BASE)s/auxiliary/TailCuts
17
19
  ANALYSIS_DIR: %(BASE)s/running_analysis
18
- CALIB_BASE_DIR: %(MONITORING)s/PixelCalibration/Cat-A
19
- CALIB_DIR: %(CALIB_BASE_DIR)s/calibration
20
- PEDESTAL_DIR: %(CALIB_BASE_DIR)s/drs4_baseline
20
+ CALIB_BASE_DIR: %(MONITORING)s/PixelCalibration
21
+ CAT_A_CALIB_BASE: %(CALIB_BASE_DIR)s/Cat-A
22
+ CAT_A_CALIB_DIR: %(CAT_A_CALIB_BASE)s/calibration
23
+ CAT_A_PEDESTAL_DIR: %(CAT_A_CALIB_BASE)s/drs4_baseline
24
+ CAT_B_CALIB_BASE: %(CALIB_BASE_DIR)s/Cat-B
21
25
  DL1_DIR: %(BASE)s/DL1
22
26
  DL1AB_DIR: %(BASE)s/DL1
23
27
  DL2_DIR: %(BASE)s/DL2
24
28
  DL3_DIR: %(BASE)s/DL3
29
+ RF_MODELS: %(BASE)s/models/AllSky
25
30
  OSA_DIR: %(BASE)s/OSA
26
31
  CLOSER_DIR: %(OSA_DIR)s/Closer
27
32
  HIGH_LEVEL_DIR: %(OSA_DIR)s/HighLevel
28
33
  LONGTERM_DIR: %(OSA_DIR)s/DL1DataCheck_LongTerm
29
34
  MERGED_SUMMARY: %(OSA_DIR)s/Catalog/merged_RunSummary.ecsv
35
+ SOURCE_CATALOG: %(OSA_DIR)s/Catalog
30
36
  SEQUENCER_WEB_DIR: %(OSA_DIR)s/SequencerWeb
31
37
  GAIN_SELECTION_FLAG_DIR: %(OSA_DIR)s/GainSel
32
38
  GAIN_SELECTION_WEB_DIR: %(OSA_DIR)s/GainSelWeb
39
+ CALIB_ENV: /fefs/aswg/software/conda/envs/lstcam-env
33
40
 
34
41
  # To be set by the user. Using PROD-ID will overcome the automatic
35
42
  # fetching of lstchain version. Otherwise leave it empty (and without the colon symbol).
@@ -43,8 +50,9 @@ DL2_PROD_ID: model2
43
50
  # Calibration steps in calibration pipeline script
44
51
  #drs4_baseline: onsite_create_drs4_pedestal_file
45
52
  #charge_calibration: onsite_create_calibration_file
46
- drs4_baseline: lstcam_calib_onsite_create_drs4_pedestal_file
47
- charge_calibration: lstcam_calib_onsite_create_calibration_file
53
+ drs4_baseline: onsite_create_drs4_pedestal_file
54
+ charge_calibration: onsite_create_calibration_file
55
+ catB_calibration: onsite_create_cat_B_calibration_file
48
56
  use_ff_heuristic_id: False
49
57
 
50
58
  # Data processing steps in datasequence script
@@ -52,17 +60,23 @@ r0_to_dl1: lstchain_data_r0_to_dl1
52
60
  dl1ab: lstchain_dl1ab
53
61
  check_dl1: lstchain_check_dl1
54
62
  dl1_to_dl2: lstchain_dl1_to_dl2
63
+ tailcuts_finder: lstchain_find_tailcuts
55
64
 
56
65
  # To be set by the user
57
66
  dl1a_config: /software/lstchain/data/lstchain_standard_config.json
58
67
  store_image_dl1ab: True
59
68
  merge_dl1_datacheck: True
69
+ apply_catB_calibration: False
70
+ apply_standard_dl1b_config: False
60
71
  use_ff_heuristic_gain_selection: False
72
+ create_longterm_symlink: True
61
73
  dl1b_config: /software/lstchain/data/lstchain_standard_config.json
62
74
  dl2_config: /software/lstchain/data/lstchain_standard_config.json
63
- rf_models: /data/models/prod5/zenith_20deg/20201023_v0.6.3
75
+ mc_prod: 20240918_v0.10.12_allsky_
64
76
  dl3_config: /software/lstchain/data/dl3_std_config.json
65
77
  max_tries: 3
78
+ use_lstcam_env_for_CatA_calib: False
79
+ use_lstcam_env_for_CatB_calib: False
66
80
 
67
81
  [MC]
68
82
  IRF_file: /path/to/irf.fits
osa/conftest.py CHANGED
@@ -26,13 +26,12 @@ from osa.nightsummary.nightsummary import run_summary_table
26
26
  from osa.scripts.tests.test_osa_scripts import run_program
27
27
  from osa.utils.utils import date_to_dir
28
28
  from datetime import datetime
29
- import lstchain
30
29
 
31
30
  date = datetime.fromisoformat("2020-01-17")
32
31
  nightdir = date_to_dir(date)
33
32
  prod_id = "v0.1.0"
34
- dl1_prod_id = cfg.get("LST1", "DL1_PROD_ID")
35
- dl2_prod_id = cfg.get("LST1", "DL2_PROD_ID")
33
+ dl1_prod_id = "tailcut84"
34
+ dl2_prod_id = "tailcut84/nsb_tuning_0.14"
36
35
 
37
36
 
38
37
  @pytest.fixture(scope="session")
@@ -87,14 +86,14 @@ def drive_log(monitoring_dir):
87
86
 
88
87
  @pytest.fixture(scope="session")
89
88
  def calibration_dir(calibration_base_dir):
90
- directory = calibration_base_dir / "calibration" / nightdir / f"v{lstchain.__version__}"
89
+ directory = calibration_base_dir / "calibration" / nightdir / "v0.1.1"
91
90
  directory.mkdir(parents=True, exist_ok=True)
92
91
  return directory
93
92
 
94
93
 
95
94
  @pytest.fixture(scope="session")
96
95
  def drs4_baseline_dir(calibration_base_dir):
97
- directory = calibration_base_dir / "drs4_baseline" / nightdir / f"v{lstchain.__version__}"
96
+ directory = calibration_base_dir / "drs4_baseline" / nightdir / "v0.1.1"
98
97
  directory.mkdir(parents=True, exist_ok=True)
99
98
  return directory
100
99
 
@@ -146,6 +145,13 @@ def r0_dir(base_test_dir):
146
145
  return r0_directory
147
146
 
148
147
 
148
+ @pytest.fixture(scope="session")
149
+ def r0g_dir(base_test_dir):
150
+ r0_directory = base_test_dir / "R0G" / nightdir
151
+ r0_directory.mkdir(parents=True, exist_ok=True)
152
+ return r0_directory
153
+
154
+
149
155
  @pytest.fixture(scope="session")
150
156
  def r0_data(r0_dir):
151
157
  r0_files = []
@@ -156,6 +162,16 @@ def r0_data(r0_dir):
156
162
  return r0_files
157
163
 
158
164
 
165
+ @pytest.fixture(scope="session")
166
+ def r0g_data(r0g_dir):
167
+ r0g_files = []
168
+ for i in range(4, 8):
169
+ r0g_file = r0g_dir / f"LST-1.1.Run0180{i}.0000.fits.fz"
170
+ r0g_file.touch()
171
+ r0g_files.append(r0g_file)
172
+ return r0g_files
173
+
174
+
159
175
  @pytest.fixture(scope="session")
160
176
  def dl1b_subdir(running_analysis_dir):
161
177
  dl1ab_directory = running_analysis_dir / dl1_prod_id
@@ -412,6 +428,9 @@ def sequence_list(
412
428
  r0_data,
413
429
  pedestal_ids_file,
414
430
  merged_run_summary,
431
+ dl1b_config_files,
432
+ tailcuts_log_files,
433
+ rf_models,
415
434
  ):
416
435
  """Creates a sequence list from a run summary file."""
417
436
  options.directory = running_analysis_dir
@@ -574,10 +593,131 @@ def database(osa_dir):
574
593
 
575
594
 
576
595
  @pytest.fixture(scope="session")
577
- def gain_selection_flag_file(osa_dir):
596
+ def rf_models_allsky_basedir(base_test_dir):
597
+ directory = base_test_dir / "models/AllSky"
598
+ directory.mkdir(parents=True, exist_ok=True)
599
+ return directory
600
+
578
601
 
602
+ @pytest.fixture(scope="session")
603
+ def rf_model_path(rf_models_allsky_basedir):
604
+ mc_prod = "20240131_allsky_v0.10.5_all_dec_base"
605
+ declination_str = "dec_2276"
606
+ rf_model_path = rf_models_allsky_basedir / mc_prod / declination_str
607
+ rf_model_path.mkdir(parents=True, exist_ok=True)
608
+ return rf_model_path
609
+
610
+
611
+ @pytest.fixture(scope="session")
612
+ def gain_selection_flag_file(osa_dir):
579
613
  GainSel_dir = osa_dir / "GainSel" / "20200117"
580
614
  GainSel_dir.mkdir(parents=True, exist_ok=True)
581
615
  file = GainSel_dir / "GainSelFinished.txt"
582
616
  file.touch()
583
617
  return file
618
+
619
+
620
+ @pytest.fixture(scope="session")
621
+ def catB_closed_file(running_analysis_dir):
622
+
623
+ catB_closed_file = running_analysis_dir / "catB_00003.closed"
624
+ catB_closed_file.touch()
625
+ return catB_closed_file
626
+
627
+
628
+ @pytest.fixture(scope="session")
629
+ def catB_calib_base_dir(monitoring_dir):
630
+
631
+ catB_calib_base_dir = monitoring_dir / "PixelCalibration" / "Cat-B"
632
+ catB_calib_base_dir.mkdir(parents=True, exist_ok=True)
633
+ return catB_calib_base_dir
634
+
635
+
636
+ @pytest.fixture(scope="session")
637
+ def catB_calibration_file(catB_calib_dir):
638
+
639
+ catB_calib_dir = catB_calib_base_dir / "calibration" / nightdir / prod_id
640
+ catB_calib_file = catB_calib_dir / "cat_B_calibration_filters_52.Run00003.h5"
641
+ catB_calib_file.touch()
642
+ return catB_calib_file
643
+
644
+
645
+ @pytest.fixture(scope="session")
646
+ def tailcuts_finder_dir(base_test_dir):
647
+ tailcuts_finder_dir = base_test_dir / "auxiliary" / "TailCuts"
648
+ tailcuts_finder_dir.mkdir(parents=True, exist_ok=True)
649
+ return tailcuts_finder_dir
650
+
651
+
652
+ @pytest.fixture(scope="session")
653
+ def dl1b_config_files(tailcuts_finder_dir):
654
+ config_information = dedent(
655
+ """\
656
+ {
657
+ "tailcuts_clean_with_pedestal_threshold": {
658
+ "picture_thresh": 8,
659
+ "boundary_thresh": 4,
660
+ "sigma": 2.5,
661
+ "keep_isolated_pixels": false,
662
+ "min_number_picture_neighbors": 2,
663
+ "use_only_main_island": false,
664
+ "delta_time": 2
665
+ },
666
+ "dynamic_cleaning": {
667
+ "apply": true,
668
+ "threshold": 267,
669
+ "fraction_cleaning_intensity": 0.03
670
+ }
671
+ }"""
672
+ )
673
+ config_file1 = tailcuts_finder_dir / "dl1ab_Run01807.json"
674
+ config_file1.touch()
675
+ config_file1.write_text(config_information)
676
+ config_file2 = tailcuts_finder_dir / "dl1ab_Run01808.json"
677
+ config_file2.touch()
678
+ config_file2.write_text(config_information)
679
+ config_file3 = tailcuts_finder_dir / "dl1ab_Run04185.json"
680
+ config_file3.touch()
681
+ config_file3.write_text(config_information)
682
+ return config_file1, config_file2, config_file3
683
+
684
+
685
+ @pytest.fixture(scope="session")
686
+ def tailcuts_log_files(tailcuts_finder_dir):
687
+ log_information = dedent(
688
+ """\
689
+ Median of 95% quantile of pedestal charge: 5.416 p.e.
690
+
691
+ Additional NSB rate (over dark MC): 0.2221 p.e./ns
692
+ lstchain_find_tailcuts finished successfully!
693
+ """
694
+ )
695
+ log_file1 = tailcuts_finder_dir / "log_find_tailcuts_Run01807.log"
696
+ log_file1.touch()
697
+ log_file1.write_text(log_information)
698
+ log_file2 = tailcuts_finder_dir / "log_find_tailcuts_Run01808.log"
699
+ log_file2.touch()
700
+ log_file2.write_text(log_information)
701
+ log_file3 = tailcuts_finder_dir / "log_find_tailcuts_Run04185.log"
702
+ log_file3.touch()
703
+ log_file3.write_text(log_information)
704
+ return log_file1, log_file2, log_file3
705
+
706
+
707
+ @pytest.fixture(scope="session")
708
+ def rf_models_base_dir(base_test_dir):
709
+ directory = base_test_dir / "models/AllSky"
710
+ directory.mkdir(parents=True, exist_ok=True)
711
+ return directory
712
+
713
+
714
+ @pytest.fixture(scope="session")
715
+ def rf_models(rf_models_base_dir):
716
+ rf_models_prefix = cfg.get("lstchain", "mc_prod")
717
+ rf_models_path1 = rf_models_base_dir / f"{rf_models_prefix}nsb_tuning_0.00"
718
+ rf_models_path1.mkdir(parents=True, exist_ok=True)
719
+ rf_models_path2 = rf_models_base_dir / f"{rf_models_prefix}nsb_tuning_0.14/dec_2276"
720
+ rf_models_path2.mkdir(parents=True, exist_ok=True)
721
+ rf_models_path3 = rf_models_base_dir / f"{rf_models_prefix}nsb_tuning_0.14/dec_4822"
722
+ rf_models_path3.mkdir(parents=True, exist_ok=True)
723
+ return rf_models_path1, rf_models_path2, rf_models_path3
@@ -26,7 +26,8 @@ from osa.configs import options
26
26
  from osa.configs.config import cfg
27
27
  from osa.nightsummary.extract import get_source_list
28
28
  from osa.paths import DEFAULT_CFG, destination_dir, analysis_path
29
- from osa.utils.cliopts import get_prod_id, get_dl2_prod_id
29
+ from osa.utils.cliopts import get_prod_id
30
+ from osa.paths import get_dl2_prod_id
30
31
  from osa.utils.logging import myLogger
31
32
  from osa.utils.utils import date_to_dir, YESTERDAY
32
33
 
@@ -205,11 +206,12 @@ def main(
205
206
  log.debug(f"Config: {config.resolve()}")
206
207
 
207
208
  # Initial setup of global parameters
209
+ if simulate:
210
+ options.simulate = True
208
211
  options.date = date
209
212
  flat_date = date_to_dir(date)
210
213
  options.tel_id = telescope
211
214
  options.prod_id = get_prod_id()
212
- options.dl2_prod_id = get_dl2_prod_id()
213
215
  options.directory = analysis_path(options.tel_id)
214
216
  dl2_directory = Path(cfg.get("LST1", "DL2_DIR"))
215
217
  highlevel_directory = destination_dir("HIGH_LEVEL", create_dir=True)
@@ -232,7 +234,7 @@ def main(
232
234
  dl2_directory
233
235
  / flat_date
234
236
  / options.prod_id
235
- / options.dl2_prod_id
237
+ / get_dl2_prod_id(run)
236
238
  / f"dl2_LST-1.Run{run:05d}.h5"
237
239
  )
238
240
  df = pd.concat([df, pd.read_hdf(input_file, key=dl2_params_lstcam_key)])
@@ -10,6 +10,9 @@ def test_significance(
10
10
  systematic_correction_files,
11
11
  pedestal_ids_file,
12
12
  merged_run_summary,
13
+ dl1b_config_files,
14
+ tailcuts_log_files,
15
+ rf_models,
13
16
  ):
14
17
  output = sp.run(
15
18
  ["theta2_significance", "-d", "2020-01-17", "-s", "LST1"],
osa/job.py CHANGED
@@ -5,6 +5,7 @@ import logging
5
5
  import shutil
6
6
  import subprocess as sp
7
7
  import time
8
+ import re
8
9
  from io import StringIO
9
10
  from pathlib import Path
10
11
  from textwrap import dedent
@@ -20,10 +21,16 @@ from osa.paths import (
20
21
  get_drive_file,
21
22
  get_summary_file,
22
23
  get_pedestal_ids_file,
24
+ get_dl1_prod_id_and_config,
23
25
  )
24
26
  from osa.utils.iofile import write_to_file
25
27
  from osa.utils.logging import myLogger
26
- from osa.utils.utils import date_to_dir, time_to_seconds, stringify, date_to_iso
28
+ from osa.utils.utils import (
29
+ date_to_dir,
30
+ time_to_seconds,
31
+ stringify,
32
+ date_to_iso,
33
+ )
27
34
 
28
35
  log = myLogger(logging.getLogger(__name__))
29
36
 
@@ -92,7 +99,15 @@ def are_all_jobs_correctly_finished(sequence_list):
92
99
  flag = True
93
100
  analysis_directory = Path(options.directory)
94
101
  for sequence in sequence_list:
95
- history_files_list = analysis_directory.rglob(f"*{sequence.seq}*.history")
102
+ history_files_list = analysis_directory.rglob(f"*{sequence.run}*.history")
103
+
104
+ if not options.test:
105
+ try:
106
+ next(history_files_list)
107
+ except StopIteration:
108
+ log.debug("No history files found.")
109
+ flag = False
110
+
96
111
  for history_file in history_files_list:
97
112
  # TODO: s.history should be SubRunObj attribute not RunObj
98
113
  # s.history only working for CALIBRATION sequence (run-wise), since it is
@@ -103,10 +118,11 @@ def are_all_jobs_correctly_finished(sequence_list):
103
118
  if out == 0:
104
119
  log.debug(f"Job {sequence.seq} ({sequence.type}) correctly finished")
105
120
  continue
106
- if out == 1 and options.no_dl2:
121
+
122
+ if out == 2 and options.no_dl1ab:
107
123
  log.debug(
108
124
  f"Job {sequence.seq} ({sequence.type}) correctly "
109
- f"finished up to DL1ab, but --no-dl2 option selected"
125
+ f"finished up to DL1A, but --no-dl1ab option selected"
110
126
  )
111
127
  continue
112
128
 
@@ -166,10 +182,9 @@ def historylevel(history_file: Path, data_type: str):
166
182
  - Sequence completed when reaching level 0
167
183
 
168
184
  Workflow for DATA sequences:
169
- - R0->DL1, level 4->3
170
- - DL1->DL1AB, level 3->2
171
- - DATACHECK, level 2->1
172
- - DL1->DL2, level 1->0
185
+ - R0->DL1, level 3->2
186
+ - DL1->DL1AB, level 2->1
187
+ - DATACHECK, level 1->0
173
188
  - Sequence completed when reaching level 0
174
189
 
175
190
  Parameters
@@ -188,7 +203,7 @@ def historylevel(history_file: Path, data_type: str):
188
203
  # into account not only the last history line but also the others.
189
204
 
190
205
  if data_type == "DATA":
191
- level = 4
206
+ level = 3
192
207
  elif data_type == "PEDCALIB":
193
208
  level = 2
194
209
  else:
@@ -197,6 +212,11 @@ def historylevel(history_file: Path, data_type: str):
197
212
  exit_status = 0
198
213
 
199
214
  if history_file.exists():
215
+ if data_type == "DATA":
216
+ match = re.search(r"sequence_LST1_(\d+)\.\d+", str(history_file))
217
+ elif data_type == "PEDCALIB":
218
+ match = re.search(r"sequence_LST1_(\d+)\.history", str(history_file))
219
+ run_id = int(match.group(1))
200
220
  for line in history_file.read_text().splitlines():
201
221
  words = line.split()
202
222
  try:
@@ -214,24 +234,18 @@ def historylevel(history_file: Path, data_type: str):
214
234
  level = 0 if exit_status == 0 else 1
215
235
  # Data sequence
216
236
  elif program == cfg.get("lstchain", "r0_to_dl1"):
217
- level = 3 if exit_status == 0 else 4
237
+ level = 2 if exit_status == 0 else 3
218
238
  elif program == cfg.get("lstchain", "dl1ab"):
219
- if (exit_status == 0) and (prod_id == options.dl1_prod_id):
220
- log.debug(f"DL1ab prod ID: {options.dl1_prod_id} already produced")
221
- level = 2
239
+ dl1_prod_id = get_dl1_prod_id_and_config(run_id)[0]
240
+ if (exit_status == 0) and (prod_id == dl1_prod_id):
241
+ log.debug(f"DL1ab prod ID: {dl1_prod_id} already produced")
242
+ level = 1
222
243
  else:
223
- level = 3
224
- log.debug(f"DL1ab prod ID: {options.dl1_prod_id} not produced yet")
244
+ level = 2
245
+ log.debug(f"DL1ab prod ID: {dl1_prod_id} not produced yet")
225
246
  break
226
247
  elif program == cfg.get("lstchain", "check_dl1"):
227
- level = 1 if exit_status == 0 else 2
228
- elif program == cfg.get("lstchain", "dl1_to_dl2"):
229
- if (exit_status == 0) and (prod_id == options.dl2_prod_id):
230
- log.debug(f"DL2 prod ID: {options.dl2_prod_id} already produced")
231
- level = 0
232
- else:
233
- level = 1
234
- log.debug(f"DL2 prod ID: {options.dl2_prod_id} not produced yet")
248
+ level = 0 if exit_status == 0 else 1
235
249
 
236
250
  else:
237
251
  log.warning(f"Program name not identified: {program}")
@@ -423,8 +437,8 @@ def data_sequence_job_template(sequence):
423
437
  commandargs.append("-s")
424
438
  if options.configfile:
425
439
  commandargs.extend(("--config", f"{Path(options.configfile).resolve()}"))
426
- if sequence.type == "DATA" and options.no_dl2:
427
- commandargs.append("--no-dl2")
440
+ if sequence.type == "DATA" and options.no_dl1ab:
441
+ commandargs.append("--no-dl1ab")
428
442
 
429
443
  commandargs.extend(
430
444
  (
@@ -439,6 +453,14 @@ def data_sequence_job_template(sequence):
439
453
  )
440
454
  )
441
455
 
456
+ if not options.no_dl1ab:
457
+ dl1_prod_id, dl1b_config = get_dl1_prod_id_and_config(sequence.run)
458
+ sequence.dl1_prod_id = dl1_prod_id
459
+ sequence.dl1b_config = dl1b_config
460
+
461
+ commandargs.append(f"--dl1b-config={sequence.dl1b_config}")
462
+ commandargs.append(f"--dl1-prod-id={sequence.dl1_prod_id}")
463
+
442
464
  content = job_header + "\n" + PYTHON_IMPORTS
443
465
 
444
466
  if not options.test:
@@ -493,7 +515,10 @@ def calibration_sequence_job_template(sequence):
493
515
  # Get the job header template.
494
516
  job_header = job_header_template(sequence)
495
517
 
496
- commandargs = ["calibration_pipeline"]
518
+ if cfg.getboolean("lstchain", "use_lstcam_env_for_CatA_calib"):
519
+ commandargs = ["conda", "run", "-n", "lstcam-env", "calibration_pipeline"]
520
+ else:
521
+ commandargs = ["calibration_pipeline"]
497
522
 
498
523
  if options.verbose:
499
524
  commandargs.append("-v")
@@ -727,6 +752,7 @@ def get_closer_sacct_output(sacct_output) -> pd.DataFrame:
727
752
  | (sacct_output["JobName"].str.contains("lstchain_longterm_dl1_check"))
728
753
  | (sacct_output["JobName"].str.contains("lstchain_cherenkov_transparency"))
729
754
  | (sacct_output["JobName"].str.contains("provproces"))
755
+ | (sacct_output["JobName"].str.contains("lstchain_dl1_to_dl2"))
730
756
  ]
731
757
 
732
758
  try: