lstosa 0.10.4__tar.gz → 0.10.6__tar.gz

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 (129) hide show
  1. {lstosa-0.10.4 → lstosa-0.10.6}/PKG-INFO +6 -6
  2. {lstosa-0.10.4 → lstosa-0.10.6}/README.md +5 -5
  3. {lstosa-0.10.4 → lstosa-0.10.6}/src/lstosa.egg-info/PKG-INFO +6 -6
  4. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/_version.py +2 -2
  5. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/configs/options.py +0 -1
  6. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/configs/sequencer.cfg +0 -1
  7. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/conftest.py +12 -2
  8. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/paths.py +97 -38
  9. lstosa-0.10.6/src/osa/provenance/utils.py +201 -0
  10. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/calibration_pipeline.py +4 -3
  11. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/closer.py +7 -2
  12. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/gain_selection.py +13 -5
  13. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/provprocess.py +8 -6
  14. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/tests/test_osa_scripts.py +5 -2
  15. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/tests/test_paths.py +6 -6
  16. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/cliopts.py +8 -6
  17. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/tests/test_utils.py +0 -7
  18. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/utils.py +0 -19
  19. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/workflow/stages.py +41 -30
  20. lstosa-0.10.4/src/osa/provenance/utils.py +0 -193
  21. {lstosa-0.10.4 → lstosa-0.10.6}/.coveragerc +0 -0
  22. {lstosa-0.10.4 → lstosa-0.10.6}/.gitignore +0 -0
  23. {lstosa-0.10.4 → lstosa-0.10.6}/.mailmap +0 -0
  24. {lstosa-0.10.4 → lstosa-0.10.6}/.pre-commit-config.yaml +0 -0
  25. {lstosa-0.10.4 → lstosa-0.10.6}/.readthedocs.yml +0 -0
  26. {lstosa-0.10.4 → lstosa-0.10.6}/LICENSE +0 -0
  27. {lstosa-0.10.4 → lstosa-0.10.6}/MANIFEST.in +0 -0
  28. {lstosa-0.10.4 → lstosa-0.10.6}/codemeta.json +0 -0
  29. {lstosa-0.10.4 → lstosa-0.10.6}/dev/mysql.py +0 -0
  30. {lstosa-0.10.4 → lstosa-0.10.6}/docs/Makefile +0 -0
  31. {lstosa-0.10.4 → lstosa-0.10.6}/docs/_static/logo_lstosa.png +0 -0
  32. {lstosa-0.10.4 → lstosa-0.10.6}/docs/authors.rst +0 -0
  33. {lstosa-0.10.4 → lstosa-0.10.6}/docs/components/index.rst +0 -0
  34. {lstosa-0.10.4 → lstosa-0.10.6}/docs/conf.py +0 -0
  35. {lstosa-0.10.4 → lstosa-0.10.6}/docs/configuration.rst +0 -0
  36. {lstosa-0.10.4 → lstosa-0.10.6}/docs/contribute.rst +0 -0
  37. {lstosa-0.10.4 → lstosa-0.10.6}/docs/documents/index.rst +0 -0
  38. {lstosa-0.10.4 → lstosa-0.10.6}/docs/howto/index.rst +0 -0
  39. {lstosa-0.10.4 → lstosa-0.10.6}/docs/index.rst +0 -0
  40. {lstosa-0.10.4 → lstosa-0.10.6}/docs/introduction/index.rst +0 -0
  41. {lstosa-0.10.4 → lstosa-0.10.6}/docs/introduction/reduction_steps_lstchain.png +0 -0
  42. {lstosa-0.10.4 → lstosa-0.10.6}/docs/jobs.rst +0 -0
  43. {lstosa-0.10.4 → lstosa-0.10.6}/docs/make.bat +0 -0
  44. {lstosa-0.10.4 → lstosa-0.10.6}/docs/nightsummary.rst +0 -0
  45. {lstosa-0.10.4 → lstosa-0.10.6}/docs/provenance.rst +0 -0
  46. {lstosa-0.10.4 → lstosa-0.10.6}/docs/references.rst +0 -0
  47. {lstosa-0.10.4 → lstosa-0.10.6}/docs/reports.rst +0 -0
  48. {lstosa-0.10.4 → lstosa-0.10.6}/docs/scripts/index.rst +0 -0
  49. {lstosa-0.10.4 → lstosa-0.10.6}/docs/troubleshooting/index.rst +0 -0
  50. {lstosa-0.10.4 → lstosa-0.10.6}/docs/utils.rst +0 -0
  51. {lstosa-0.10.4 → lstosa-0.10.6}/docs/veto.rst +0 -0
  52. {lstosa-0.10.4 → lstosa-0.10.6}/docs/workflow/LSTOSA_flow.png +0 -0
  53. {lstosa-0.10.4 → lstosa-0.10.6}/docs/workflow/index.rst +0 -0
  54. {lstosa-0.10.4 → lstosa-0.10.6}/environment.yml +0 -0
  55. {lstosa-0.10.4 → lstosa-0.10.6}/extra/example_sequencer.txt +0 -0
  56. {lstosa-0.10.4 → lstosa-0.10.6}/extra/history_files/sequence_LST1_04183.history +0 -0
  57. {lstosa-0.10.4 → lstosa-0.10.6}/extra/history_files/sequence_LST1_04183_failed.history +0 -0
  58. {lstosa-0.10.4 → lstosa-0.10.6}/extra/history_files/sequence_LST1_04183_oneline.history +0 -0
  59. {lstosa-0.10.4 → lstosa-0.10.6}/extra/history_files/sequence_LST1_04185.0010.history +0 -0
  60. {lstosa-0.10.4 → lstosa-0.10.6}/extra/sacct_output.csv +0 -0
  61. {lstosa-0.10.4 → lstosa-0.10.6}/extra/squeue_output.csv +0 -0
  62. {lstosa-0.10.4 → lstosa-0.10.6}/pyproject.toml +0 -0
  63. {lstosa-0.10.4 → lstosa-0.10.6}/setup.cfg +0 -0
  64. {lstosa-0.10.4 → lstosa-0.10.6}/src/lstosa.egg-info/SOURCES.txt +0 -0
  65. {lstosa-0.10.4 → lstosa-0.10.6}/src/lstosa.egg-info/dependency_links.txt +0 -0
  66. {lstosa-0.10.4 → lstosa-0.10.6}/src/lstosa.egg-info/entry_points.txt +0 -0
  67. {lstosa-0.10.4 → lstosa-0.10.6}/src/lstosa.egg-info/requires.txt +0 -0
  68. {lstosa-0.10.4 → lstosa-0.10.6}/src/lstosa.egg-info/top_level.txt +0 -0
  69. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/__init__.py +0 -0
  70. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/configs/__init__.py +0 -0
  71. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/configs/config.py +0 -0
  72. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/configs/datamodel.py +0 -0
  73. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/high_level/__init__.py +0 -0
  74. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/high_level/selection_cuts.toml +0 -0
  75. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/high_level/significance.py +0 -0
  76. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/high_level/tests/test_significance.py +0 -0
  77. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/job.py +0 -0
  78. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/__init__.py +0 -0
  79. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/database.py +0 -0
  80. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/extract.py +0 -0
  81. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/nightsummary.py +0 -0
  82. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/set_source_coordinates.py +0 -0
  83. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/tests/test_database.py +0 -0
  84. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/tests/test_extract.py +0 -0
  85. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/tests/test_nightsummary.py +0 -0
  86. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/nightsummary/tests/test_source_coordinates.py +0 -0
  87. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/osadb.py +0 -0
  88. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/provenance/__init__.py +0 -0
  89. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/provenance/capture.py +0 -0
  90. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/provenance/config/definition.yaml +0 -0
  91. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/provenance/config/environment.yaml +0 -0
  92. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/provenance/config/logger.yaml +0 -0
  93. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/provenance/io.py +0 -0
  94. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/raw.py +0 -0
  95. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/report.py +0 -0
  96. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/__init__.py +0 -0
  97. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/autocloser.py +0 -0
  98. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/copy_datacheck.py +0 -0
  99. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/datasequence.py +0 -0
  100. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/reprocess_longterm.py +0 -0
  101. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/reprocessing.py +0 -0
  102. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/sequencer.py +0 -0
  103. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/sequencer_webmaker.py +0 -0
  104. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/show_run_summary.py +0 -0
  105. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/show_run_summary_tcu.py +0 -0
  106. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/simulate_processing.py +0 -0
  107. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/tests/__init__.py +0 -0
  108. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/scripts/update_source_catalog.py +0 -0
  109. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/tests/__init__.py +0 -0
  110. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/tests/test_jobs.py +0 -0
  111. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/tests/test_osa.py +0 -0
  112. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/tests/test_osadb.py +0 -0
  113. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/tests/test_raw.py +0 -0
  114. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/tests/test_report.py +0 -0
  115. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/tests/test_veto.py +0 -0
  116. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/__init__.py +0 -0
  117. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/iofile.py +0 -0
  118. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/logging.py +0 -0
  119. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/mail.py +0 -0
  120. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/register.py +0 -0
  121. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/utils/tests/test_iofile.py +0 -0
  122. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/version.py +0 -0
  123. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/veto.py +0 -0
  124. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/webserver/__init__.py +0 -0
  125. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/webserver/utils.py +0 -0
  126. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/workflow/__init__.py +0 -0
  127. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/workflow/dl3.py +0 -0
  128. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/workflow/tests/test_dl3.py +0 -0
  129. {lstosa-0.10.4 → lstosa-0.10.6}/src/osa/workflow/tests/test_stages.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lstosa
3
- Version: 0.10.4
3
+ Version: 0.10.6
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>
@@ -54,20 +54,20 @@ Requires-Dist: lstosa[dev,doc,test]; extra == "all"
54
54
  [![ci](https://github.com/cta-observatory/lstosa/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/cta-observatory/lstosa/actions/workflows/ci.yml)
55
55
  [![Documentation Status](https://readthedocs.org/projects/lstosa/badge/?version=latest)](https://lstosa.readthedocs.io/en/latest/?badge=latest)
56
56
  [![coverage](https://codecov.io/gh/cta-observatory/lstosa/branch/main/graph/badge.svg?token=Zjk1U1ytaG)](https://codecov.io/gh/cta-observatory/lstosa)
57
- [![quality](https://app.codacy.com/project/badge/Grade/a8743a706e7c45fc989d5ebc4d61d54f)](https://www.codacy.com/gh/cta-observatory/lstosa/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cta-observatory/lstosa&amp;utm_campaign=Badge_Grade)
57
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/a8743a706e7c45fc989d5ebc4d61d54f)](https://app.codacy.com/gh/cta-observatory/lstosa/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
58
58
  [![pypi](https://img.shields.io/pypi/v/lstosa)](https://pypi.org/project/lstosa/)
59
59
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6567234.svg)](https://doi.org/10.5281/zenodo.6567234)
60
60
 
61
61
 
62
- Prototype onsite processing pipeline for the Large Size Telescope prototype (LST-1) of [CTA](https://www.cta-observatory.org/) (Cherenkov Telescope Array) based on [cta-lstchain](https://github.com/cta-observatory/cta-lstchain) running on the LST-1 IT onsite center at ORM (La Palma, Spain). It automatically carries out the next-day analysis of observed data using cron jobs, parallelizing the processing using the job scheduler SLURM. It provides data quality monitoring and tracking of analysis products' provenance.
63
- Moreover, it also massively reprocesses the entire LST-1 dataset with each cta-lstchain major release:
62
+ Onsite processing pipeline for the Large-Sized Telescope prototype (LST-1) of [CTAO](https://www.cta-observatory.org/) (Cherenkov Telescope Array Observatory) based on [cta-lstchain](https://github.com/cta-observatory/cta-lstchain) running on the LST-1 IT onsite data center at Observatorio Roque de los Muchachos (La Palma, Spain). It automatically carries out the next-day analysis of observed data using cron jobs, parallelizing the processing using the job scheduler SLURM. It provides data quality monitoring and tracking of analysis products' provenance. Moreover, it also massively reprocesses the entire LST-1 dataset with each cta-lstchain major release.
63
+
64
64
  - Code: <https://github.com/cta-observatory/lstosa>
65
65
  - Docs: <https://lstosa.readthedocs.io/>
66
66
  - License: [BSD-3-Clause](https://github.com/cta-observatory/lstosa/blob/main/LICENSE)
67
67
 
68
68
  ## Install
69
69
  We recommend using an isolated conda environment.
70
- - Install miniconda first.
70
+ - Install mamba/miniconda first.
71
71
  - Clone the repository, create and activate the conda environment using the `environment.yml` file:
72
72
 
73
73
  ```bash
@@ -77,7 +77,7 @@ We recommend using an isolated conda environment.
77
77
  conda activate osa
78
78
  ```
79
79
 
80
- Then install `lstosa` as a **user** with: `pip install lstosa`, or as a **developer** with: `pip install -e .`.
80
+ Then install `lstosa` as a **user** with: `pip install lstosa`, or as a **developer** with: `pip install -e .`. To install test, docs dependencies use `pip install -e .[test]`, `pip install -e .[doc]` or simply `pip install -e .[all]`
81
81
 
82
82
  In case you want to install the lstchain development version instead of a fixed tag, you can run inside the `osa` environment:
83
83
 
@@ -3,20 +3,20 @@
3
3
  [![ci](https://github.com/cta-observatory/lstosa/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/cta-observatory/lstosa/actions/workflows/ci.yml)
4
4
  [![Documentation Status](https://readthedocs.org/projects/lstosa/badge/?version=latest)](https://lstosa.readthedocs.io/en/latest/?badge=latest)
5
5
  [![coverage](https://codecov.io/gh/cta-observatory/lstosa/branch/main/graph/badge.svg?token=Zjk1U1ytaG)](https://codecov.io/gh/cta-observatory/lstosa)
6
- [![quality](https://app.codacy.com/project/badge/Grade/a8743a706e7c45fc989d5ebc4d61d54f)](https://www.codacy.com/gh/cta-observatory/lstosa/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cta-observatory/lstosa&amp;utm_campaign=Badge_Grade)
6
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/a8743a706e7c45fc989d5ebc4d61d54f)](https://app.codacy.com/gh/cta-observatory/lstosa/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
7
7
  [![pypi](https://img.shields.io/pypi/v/lstosa)](https://pypi.org/project/lstosa/)
8
8
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6567234.svg)](https://doi.org/10.5281/zenodo.6567234)
9
9
 
10
10
 
11
- Prototype onsite processing pipeline for the Large Size Telescope prototype (LST-1) of [CTA](https://www.cta-observatory.org/) (Cherenkov Telescope Array) based on [cta-lstchain](https://github.com/cta-observatory/cta-lstchain) running on the LST-1 IT onsite center at ORM (La Palma, Spain). It automatically carries out the next-day analysis of observed data using cron jobs, parallelizing the processing using the job scheduler SLURM. It provides data quality monitoring and tracking of analysis products' provenance.
12
- Moreover, it also massively reprocesses the entire LST-1 dataset with each cta-lstchain major release:
11
+ Onsite processing pipeline for the Large-Sized Telescope prototype (LST-1) of [CTAO](https://www.cta-observatory.org/) (Cherenkov Telescope Array Observatory) based on [cta-lstchain](https://github.com/cta-observatory/cta-lstchain) running on the LST-1 IT onsite data center at Observatorio Roque de los Muchachos (La Palma, Spain). It automatically carries out the next-day analysis of observed data using cron jobs, parallelizing the processing using the job scheduler SLURM. It provides data quality monitoring and tracking of analysis products' provenance. Moreover, it also massively reprocesses the entire LST-1 dataset with each cta-lstchain major release.
12
+
13
13
  - Code: <https://github.com/cta-observatory/lstosa>
14
14
  - Docs: <https://lstosa.readthedocs.io/>
15
15
  - License: [BSD-3-Clause](https://github.com/cta-observatory/lstosa/blob/main/LICENSE)
16
16
 
17
17
  ## Install
18
18
  We recommend using an isolated conda environment.
19
- - Install miniconda first.
19
+ - Install mamba/miniconda first.
20
20
  - Clone the repository, create and activate the conda environment using the `environment.yml` file:
21
21
 
22
22
  ```bash
@@ -26,7 +26,7 @@ We recommend using an isolated conda environment.
26
26
  conda activate osa
27
27
  ```
28
28
 
29
- Then install `lstosa` as a **user** with: `pip install lstosa`, or as a **developer** with: `pip install -e .`.
29
+ Then install `lstosa` as a **user** with: `pip install lstosa`, or as a **developer** with: `pip install -e .`. To install test, docs dependencies use `pip install -e .[test]`, `pip install -e .[doc]` or simply `pip install -e .[all]`
30
30
 
31
31
  In case you want to install the lstchain development version instead of a fixed tag, you can run inside the `osa` environment:
32
32
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lstosa
3
- Version: 0.10.4
3
+ Version: 0.10.6
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>
@@ -54,20 +54,20 @@ Requires-Dist: lstosa[dev,doc,test]; extra == "all"
54
54
  [![ci](https://github.com/cta-observatory/lstosa/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/cta-observatory/lstosa/actions/workflows/ci.yml)
55
55
  [![Documentation Status](https://readthedocs.org/projects/lstosa/badge/?version=latest)](https://lstosa.readthedocs.io/en/latest/?badge=latest)
56
56
  [![coverage](https://codecov.io/gh/cta-observatory/lstosa/branch/main/graph/badge.svg?token=Zjk1U1ytaG)](https://codecov.io/gh/cta-observatory/lstosa)
57
- [![quality](https://app.codacy.com/project/badge/Grade/a8743a706e7c45fc989d5ebc4d61d54f)](https://www.codacy.com/gh/cta-observatory/lstosa/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cta-observatory/lstosa&amp;utm_campaign=Badge_Grade)
57
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/a8743a706e7c45fc989d5ebc4d61d54f)](https://app.codacy.com/gh/cta-observatory/lstosa/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
58
58
  [![pypi](https://img.shields.io/pypi/v/lstosa)](https://pypi.org/project/lstosa/)
59
59
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6567234.svg)](https://doi.org/10.5281/zenodo.6567234)
60
60
 
61
61
 
62
- Prototype onsite processing pipeline for the Large Size Telescope prototype (LST-1) of [CTA](https://www.cta-observatory.org/) (Cherenkov Telescope Array) based on [cta-lstchain](https://github.com/cta-observatory/cta-lstchain) running on the LST-1 IT onsite center at ORM (La Palma, Spain). It automatically carries out the next-day analysis of observed data using cron jobs, parallelizing the processing using the job scheduler SLURM. It provides data quality monitoring and tracking of analysis products' provenance.
63
- Moreover, it also massively reprocesses the entire LST-1 dataset with each cta-lstchain major release:
62
+ Onsite processing pipeline for the Large-Sized Telescope prototype (LST-1) of [CTAO](https://www.cta-observatory.org/) (Cherenkov Telescope Array Observatory) based on [cta-lstchain](https://github.com/cta-observatory/cta-lstchain) running on the LST-1 IT onsite data center at Observatorio Roque de los Muchachos (La Palma, Spain). It automatically carries out the next-day analysis of observed data using cron jobs, parallelizing the processing using the job scheduler SLURM. It provides data quality monitoring and tracking of analysis products' provenance. Moreover, it also massively reprocesses the entire LST-1 dataset with each cta-lstchain major release.
63
+
64
64
  - Code: <https://github.com/cta-observatory/lstosa>
65
65
  - Docs: <https://lstosa.readthedocs.io/>
66
66
  - License: [BSD-3-Clause](https://github.com/cta-observatory/lstosa/blob/main/LICENSE)
67
67
 
68
68
  ## Install
69
69
  We recommend using an isolated conda environment.
70
- - Install miniconda first.
70
+ - Install mamba/miniconda first.
71
71
  - Clone the repository, create and activate the conda environment using the `environment.yml` file:
72
72
 
73
73
  ```bash
@@ -77,7 +77,7 @@ We recommend using an isolated conda environment.
77
77
  conda activate osa
78
78
  ```
79
79
 
80
- Then install `lstosa` as a **user** with: `pip install lstosa`, or as a **developer** with: `pip install -e .`.
80
+ Then install `lstosa` as a **user** with: `pip install lstosa`, or as a **developer** with: `pip install -e .`. To install test, docs dependencies use `pip install -e .[test]`, `pip install -e .[doc]` or simply `pip install -e .[all]`
81
81
 
82
82
  In case you want to install the lstchain development version instead of a fixed tag, you can run inside the `osa` environment:
83
83
 
@@ -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.4'
16
- __version_tuple__ = version_tuple = (0, 10, 4)
15
+ __version__ = version = '0.10.6'
16
+ __version_tuple__ = version_tuple = (0, 10, 6)
@@ -16,7 +16,6 @@ warning = None
16
16
  nocheck = None
17
17
  no_dl2 = None
18
18
  prod_id = None
19
- calib_prod_id = None
20
19
  dl1_prod_id = None
21
20
  dl2_prod_id = None
22
21
  append = None
@@ -32,7 +32,6 @@ SEQUENCER_WEB_DIR: %(OSA_DIR)s/SequencerWeb
32
32
  # To be set by the user. Using PROD-ID will overcome the automatic
33
33
  # fetching of lstchain version. Otherwise leave it empty (and without the colon symbol).
34
34
  PROD_ID: v0.1.0
35
- CALIB_PROD_ID: v01
36
35
  # Change this to produce a different DL1b or DL2 sub-productions.
37
36
  # Otherwise, keep it empty to use the common PROD-ID
38
37
  DL1_PROD_ID: tailcut84
@@ -26,6 +26,7 @@ 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
29
30
 
30
31
  date = datetime.fromisoformat("2020-01-17")
31
32
  nightdir = date_to_dir(date)
@@ -68,16 +69,25 @@ def calibration_base_dir(monitoring_dir):
68
69
  return base_dir
69
70
 
70
71
 
72
+ @pytest.fixture(scope="session")
73
+ def drive_log(monitoring_dir):
74
+ drive_dir = monitoring_dir / "DrivePositioning"
75
+ drive_file = drive_dir / "DrivePosition_log_20200117.txt"
76
+ drive_dir.mkdir(parents=True, exist_ok=True)
77
+ drive_file.touch()
78
+ return drive_file
79
+
80
+
71
81
  @pytest.fixture(scope="session")
72
82
  def calibration_dir(calibration_base_dir):
73
- directory = calibration_base_dir / "calibration" / nightdir / "pro"
83
+ directory = calibration_base_dir / "calibration" / nightdir / f"v{lstchain.__version__}"
74
84
  directory.mkdir(parents=True, exist_ok=True)
75
85
  return directory
76
86
 
77
87
 
78
88
  @pytest.fixture(scope="session")
79
89
  def drs4_baseline_dir(calibration_base_dir):
80
- directory = calibration_base_dir / "drs4_baseline" / nightdir / "pro"
90
+ directory = calibration_base_dir / "drs4_baseline" / nightdir / f"v{lstchain.__version__}"
81
91
  directory.mkdir(parents=True, exist_ok=True)
82
92
  return directory
83
93
 
@@ -1,17 +1,19 @@
1
1
  """Handle the paths of the analysis products."""
2
2
 
3
3
  import logging
4
+ import re
5
+ from datetime import datetime
4
6
  from pathlib import Path
5
7
  from typing import List
6
- from datetime import datetime
7
8
 
9
+ import lstchain
8
10
  from astropy.table import Table
9
- from lstchain.onsite import find_systematics_correction_file, find_time_calibration_file
10
- from lstchain.scripts.onsite.onsite_create_calibration_file import search_filter
11
+ from lstchain.onsite import (find_systematics_correction_file,
12
+ find_time_calibration_file,
13
+ find_filter_wheels)
11
14
 
12
15
  from osa.configs import options
13
- from osa.configs.config import DEFAULT_CFG
14
- from osa.configs.config import cfg
16
+ from osa.configs.config import DEFAULT_CFG, cfg
15
17
  from osa.configs.datamodel import Sequence
16
18
  from osa.utils import utils
17
19
  from osa.utils.logging import myLogger
@@ -19,8 +21,8 @@ from osa.utils.logging import myLogger
19
21
  log = myLogger(logging.getLogger(__name__))
20
22
 
21
23
  __all__ = [
22
- "get_calibration_file",
23
- "get_drs4_pedestal_file",
24
+ "get_calibration_filename",
25
+ "get_drs4_pedestal_filename",
24
26
  "pedestal_ids_file_exists",
25
27
  "get_run_date",
26
28
  "drs4_pedestal_exists",
@@ -40,6 +42,8 @@ __all__ = [
40
42
 
41
43
 
42
44
  DATACHECK_WEB_BASEDIR = Path(cfg.get("WEBSERVER", "DATACHECK"))
45
+ CALIB_BASEDIR = Path(cfg.get("LST1", "CALIB_DIR"))
46
+ DRS4_PEDESTAL_BASEDIR = Path(cfg.get("LST1", "PEDESTAL_DIR"))
43
47
 
44
48
 
45
49
  def analysis_path(tel) -> Path:
@@ -86,18 +90,25 @@ def get_run_date(run_id: int) -> datetime:
86
90
  return datetime.strptime(date_string, "%Y-%m-%d")
87
91
 
88
92
 
89
- def get_drs4_pedestal_file(run_id: int) -> Path:
93
+ def get_drs4_pedestal_filename(run_id: int, prod_id: str) -> Path:
90
94
  """
91
95
  Return the drs4 pedestal file corresponding to a given run id
92
96
  regardless of the date when the run was taken.
93
97
  """
94
- drs4_pedestal_dir = Path(cfg.get("LST1", "PEDESTAL_DIR"))
98
+ if drs4_pedestal_exists(run_id, prod_id):
99
+ files = search_drs4_files(run_id, prod_id)
100
+ return files[-1] # Get the latest production among the major lstchain version
101
+
95
102
  date = utils.date_to_dir(get_run_date(run_id))
96
- file = drs4_pedestal_dir / date / f"pro/drs4_pedestal.Run{run_id:05d}.0000.h5"
97
- return file.resolve()
103
+ return (
104
+ DRS4_PEDESTAL_BASEDIR
105
+ / date
106
+ / f"v{lstchain.__version__}/drs4_pedestal.Run{run_id:05d}.0000.h5"
107
+ ).resolve()
98
108
 
99
109
 
100
- def get_calibration_file(run_id: int) -> Path:
110
+ def get_calibration_filename(run_id: int, prod_id: str) -> Path:
111
+ # sourcery skip: remove-unnecessary-cast
101
112
  """
102
113
  Return the calibration file corresponding to a given run_id.
103
114
 
@@ -109,14 +120,18 @@ def get_calibration_file(run_id: int) -> Path:
109
120
  Notes
110
121
  -----
111
122
  The file path will be built regardless of the date when the run was taken.
112
- We follow the naming convention of the calibration files produced by the lstchain script
113
- which depends on the filter wheels position. Therefore, we need to try to fetch the filter
114
- position from the CaCo database. If the filter position is not found, we assume the default
115
- filter position 5-2. Filter information is not available in the database for runs taken before
123
+ We follow the naming convention of the calibration files produced by the
124
+ lstchain script which depends on the filter wheels position. Therefore, we
125
+ need to try to fetch the filter position from the CaCo database. If the
126
+ filter position is not found, we assume the default filter position 5-2.
127
+ Filter information is not available in the database for runs taken before
116
128
  mid 2021 approx.
117
129
  """
118
130
 
119
- calib_dir = Path(cfg.get("LST1", "CALIB_DIR"))
131
+ if calibration_file_exists(run_id, prod_id):
132
+ files = search_calibration_files(run_id, prod_id)
133
+ return files[-1] # Get the latest production among the major lstchain version
134
+
120
135
  date = utils.date_to_dir(get_run_date(run_id))
121
136
 
122
137
  if options.test: # Run tests avoiding the access to the database
@@ -126,13 +141,16 @@ def get_calibration_file(run_id: int) -> Path:
126
141
  mongodb = cfg.get("database", "caco_db")
127
142
  try:
128
143
  # Cast run_id to int to avoid problems with numpy int64 encoding in MongoDB
129
- options.filters = search_filter(int(run_id), mongodb)
144
+ options.filters = find_filter_wheels(int(run_id), mongodb)
130
145
  except IOError:
131
146
  log.warning("No filter information found in database. Assuming positions 52.")
132
147
  options.filters = 52
133
148
 
134
- file = calib_dir / date / f"pro/calibration_filters_{options.filters}.Run{run_id:05d}.0000.h5"
135
- return file.resolve()
149
+ return (
150
+ CALIB_BASEDIR
151
+ / date
152
+ / f"v{lstchain.__version__}/calibration_filters_{options.filters}.Run{run_id:05d}.0000.h5"
153
+ ).resolve()
136
154
 
137
155
 
138
156
  def pedestal_ids_file_exists(run_id: int) -> bool:
@@ -142,16 +160,51 @@ def pedestal_ids_file_exists(run_id: int) -> bool:
142
160
  return bool(file_list)
143
161
 
144
162
 
145
- def drs4_pedestal_exists(run_id: int) -> bool:
163
+ def drs4_pedestal_exists(run_id: int, prod_id: str) -> bool:
146
164
  """Return true if drs4 pedestal file was already produced."""
147
- file = get_drs4_pedestal_file(run_id)
148
- return file.exists()
165
+ files = search_drs4_files(run_id, prod_id)
166
+
167
+ return len(files) != 0
149
168
 
150
169
 
151
- def calibration_file_exists(run_id: int) -> bool:
170
+ def calibration_file_exists(run_id: int, prod_id: str) -> bool:
152
171
  """Return true if calibration file was already produced."""
153
- file = get_calibration_file(run_id)
154
- return file.exists()
172
+ files = search_calibration_files(run_id, prod_id)
173
+
174
+ return len(files) != 0
175
+
176
+
177
+ def search_drs4_files(run_id: int, prod_id: str) -> list:
178
+ """
179
+ Find DRS4 baseline correction files corresponding to a run ID
180
+ and major lstchain production version
181
+ """
182
+ date = utils.date_to_dir(get_run_date(run_id))
183
+ version = get_major_version(prod_id)
184
+ drs4_dir = DRS4_PEDESTAL_BASEDIR / date
185
+ return sorted(
186
+ drs4_dir.glob(f"{version}*/drs4_pedestal.Run{run_id:05d}.0000.h5")
187
+ )
188
+
189
+
190
+ def get_major_version(prod_id):
191
+ """Given a version as vX.Y.Z return vX.Y"""
192
+ # First check that the given version is in the correct format
193
+ if prod_id.startswith("v") and len(prod_id.split(".")) >= 2:
194
+ return re.search(r"\D\d+\.\d+", prod_id)[0]
195
+
196
+ raise ValueError("Format of the version is not in the form vW.X.Y.Z")
197
+
198
+
199
+ def search_calibration_files(run_id: int, prod_id: str) -> list:
200
+ """
201
+ Search charge calibration files corresponding to a run ID and major lstchain production version
202
+ """
203
+ date = utils.date_to_dir(get_run_date(run_id))
204
+ version = get_major_version(prod_id)
205
+ return sorted(
206
+ (CALIB_BASEDIR / date).glob(f"{version}*/calibration_filters_*.Run{run_id:05d}.0000.h5")
207
+ )
155
208
 
156
209
 
157
210
  def get_drive_file(date: str) -> Path:
@@ -180,11 +233,16 @@ def sequence_calibration_files(sequence_list: List[Sequence]) -> None:
180
233
  """Build names of the calibration files for each sequence in the list."""
181
234
  flat_date = utils.date_to_dir(options.date)
182
235
  base_dir = Path(cfg.get("LST1", "BASE"))
236
+ prod_id = options.prod_id
183
237
 
184
238
  for sequence in sequence_list:
185
239
  # Assign the calibration files to the sequence object
186
- sequence.drs4_file = get_drs4_pedestal_file(sequence.drs4_run)
187
- sequence.calibration_file = get_calibration_file(sequence.pedcal_run)
240
+ sequence.drs4_file = get_drs4_pedestal_filename(
241
+ sequence.drs4_run, prod_id
242
+ )
243
+ sequence.calibration_file = get_calibration_filename(
244
+ sequence.pedcal_run, prod_id
245
+ )
188
246
  sequence.time_calibration_file = find_time_calibration_file(
189
247
  "pro", sequence.pedcal_run, base_dir=base_dir
190
248
  )
@@ -235,10 +293,7 @@ def destination_dir(concept: str, create_dir: bool = True) -> Path:
235
293
  directory = Path(cfg.get(options.tel_id, "DL1_DIR")) / nightdir / options.prod_id / "muons"
236
294
  elif concept == "INTERLEAVED":
237
295
  directory = (
238
- Path(cfg.get(options.tel_id, "DL1_DIR"))
239
- / nightdir
240
- / options.prod_id
241
- / "interleaved"
296
+ Path(cfg.get(options.tel_id, "DL1_DIR")) / nightdir / options.prod_id / "interleaved"
242
297
  )
243
298
  elif concept == "DATACHECK":
244
299
  directory = (
@@ -257,17 +312,21 @@ def destination_dir(concept: str, create_dir: bool = True) -> Path:
257
312
  )
258
313
  elif concept in {"DL2", "DL3"}:
259
314
  directory = (
260
- Path(cfg.get(options.tel_id, concept + "_DIR"))
261
- / nightdir
315
+ (Path(cfg.get(options.tel_id, f"{concept}_DIR")) / nightdir)
262
316
  / options.prod_id
263
- / options.dl2_prod_id
264
- )
317
+ ) / options.dl2_prod_id
265
318
  elif concept in {"PEDESTAL", "CALIB", "TIMECALIB"}:
266
319
  directory = (
267
- Path(cfg.get(options.tel_id, concept + "_DIR")) / nightdir / options.calib_prod_id
320
+ Path(cfg.get(options.tel_id, f"{concept}_DIR"))
321
+ / nightdir
322
+ / options.prod_id
268
323
  )
269
324
  elif concept == "HIGH_LEVEL":
270
- directory = Path(cfg.get(options.tel_id, concept + "_DIR")) / nightdir / options.prod_id
325
+ directory = (
326
+ Path(cfg.get(options.tel_id, f"{concept}_DIR"))
327
+ / nightdir
328
+ / options.prod_id
329
+ )
271
330
  else:
272
331
  log.warning(f"Concept {concept} not known")
273
332
  directory = None
@@ -0,0 +1,201 @@
1
+ """Utility functions for OSA pipeline provenance."""
2
+
3
+
4
+ from importlib.resources import files
5
+ from pathlib import Path
6
+
7
+ from osa.configs import options
8
+ from osa.configs.config import cfg
9
+ from osa.utils.utils import date_to_dir, get_lstchain_version
10
+
11
+ __all__ = ["parse_variables", "get_log_config"]
12
+
13
+ REDUCTION_TASKS = ["r0_to_dl1", "dl1ab", "dl1_datacheck", "dl1_to_dl2"]
14
+
15
+
16
+ def parse_variables(class_instance):
17
+ """Parse variables needed in model"""
18
+
19
+ # calibration_pipeline.py
20
+ # -c sequencer.cfg
21
+ # -d 2020_02_18
22
+ # --drs4-pedestal-run 01804
23
+ # --pedcal-run 01805
24
+ # LST1
25
+
26
+ # datasequence.py
27
+ # -c sequencer.cfg
28
+ # -d 2020_02_18
29
+ # --prod-id v0.4
30
+ # --pedcal-file .../20200218/v0.4.3/calibration_filters_52.Run02006.0000.h5
31
+ # --drs4-pedestal-file .../20200218/v0.4.3/drs4_pedestal.Run02005.0000.h5
32
+ # --time-calib-file .../20191124/pro/time_calibration.Run01625.0000.h5
33
+ # --systematic_correction_file .../20200725/pro/ffactor_systematics_20200725.h5
34
+ # --drive-file .../DrivePositioning/DrivePosition_20200218.txt
35
+ # --run-summary .../monitoring/RunSummary/RunSummary_20200101.ecsv
36
+ # 02006.0000
37
+ # LST1
38
+
39
+ flat_date = date_to_dir(options.date)
40
+ configfile_dl1b = cfg.get("lstchain", "dl1b_config")
41
+ configfile_dl2 = cfg.get("lstchain", "dl2_config")
42
+ raw_dir = Path(cfg.get("LST1", "R0_DIR"))
43
+ rf_models_directory = Path(cfg.get("lstchain", "RF_MODELS"))
44
+ dl1_dir = Path(cfg.get("LST1", "DL1_DIR"))
45
+ dl2_dir = Path(cfg.get("LST1", "DL2_DIR"))
46
+ calib_dir = Path(cfg.get("LST1", "CALIB_DIR"))
47
+ pedestal_dir = Path(cfg.get("LST1", "PEDESTAL_DIR"))
48
+
49
+ class_instance.SoftwareVersion = get_lstchain_version()
50
+ class_instance.ProcessingConfigFile = str(options.configfile)
51
+ class_instance.ObservationDate = flat_date
52
+ if class_instance.__name__ in REDUCTION_TASKS:
53
+ muon_dir = dl1_dir / flat_date / options.prod_id / "muons"
54
+ outdir_dl1 = dl1_dir / flat_date / options.prod_id / options.dl1_prod_id
55
+ outdir_dl2 = dl2_dir / flat_date / options.prod_id / options.dl2_prod_id
56
+
57
+ if class_instance.__name__ in ["drs4_pedestal", "calibrate_charge"]:
58
+ # drs4_pedestal_run_id [0] 1804
59
+ # pedcal_run_id [1] 1805
60
+ # history_file [2] .../20210913/v0.7.5/sequence_LST1_01805.0000.history
61
+ class_instance.PedestalRun = f"{class_instance.args[0]:05d}"
62
+ class_instance.CalibrationRun = f"{class_instance.args[1]:05d}"
63
+
64
+ version = get_lstchain_version()
65
+
66
+ # according to code in onsite scripts in lstchain
67
+ class_instance.RawObservationFilePedestal = str((
68
+ raw_dir / flat_date / f"LST-1.1.Run{class_instance.args[0]:05d}.fits.fz"
69
+ ).resolve())
70
+ class_instance.RawObservationFileCalibration = str((
71
+ raw_dir / flat_date / f"LST-1.1.Run{class_instance.args[1]:05d}.fits.fz"
72
+ ).resolve())
73
+ class_instance.PedestalCheckPlot = str((
74
+ pedestal_dir
75
+ / flat_date
76
+ / version
77
+ / f"log/drs4_pedestal.Run{class_instance.args[0]:05d}.0000.pdf"
78
+ ).resolve())
79
+ class_instance.CalibrationCheckPlot = str((
80
+ calib_dir
81
+ / flat_date
82
+ / version
83
+ / f"log/calibration_filters_52.Run{class_instance.args[1]:05d}.0000.pdf"
84
+ ).resolve())
85
+
86
+ # according to code in sequence_calibration_files from paths.py
87
+ class_instance.PedestalFile = str((
88
+ pedestal_dir
89
+ / flat_date
90
+ / version
91
+ / f"drs4_pedestal.Run{class_instance.args[0]:05d}.0000.h5"
92
+ ).resolve())
93
+ class_instance.CoefficientsCalibrationFile = str((
94
+ calib_dir
95
+ / flat_date
96
+ / version
97
+ / f"calibration_filters_52.Run{class_instance.args[1]:05d}.0000.h5"
98
+ ).resolve())
99
+
100
+ if class_instance.__name__ == "r0_to_dl1":
101
+ # calibration_file [0] .../20200218/v0.4.3/calibration_filters_52.Run02006.0000.h5
102
+ # drs4_pedestal_file [1] .../20200218/v0.4.3/drs4_pedestal.Run02005.0000.h5
103
+ # time_calib_file [2] .../20191124/v0.4.3/time_calibration.Run01625.0000.h5
104
+ # systematic_corr [3] .../20200101/v0.4.3/no_sys_corrected_calib_20210514.0000.h5
105
+ # drive_file [4] .../DrivePositioning/DrivePosition_20200218.txt
106
+ # run_summary_file [5] .../RunSummary/RunSummary_20200101.ecsv
107
+ # pedestal_ids_file [6] .../path/to/interleaved/pedestal/events.h5
108
+ # run_str [7] 02006.0000
109
+
110
+ run_subrun = class_instance.args[7]
111
+ run = run_subrun.split(".")[0]
112
+ class_instance.ObservationRun = run
113
+
114
+ calibration_file = Path(class_instance.args[0]).resolve()
115
+ pedestal_file = Path(class_instance.args[1]).resolve()
116
+ timecalibration_file = Path(class_instance.args[2]).resolve()
117
+ systematic_correction_file = Path(class_instance.args[3]).resolve()
118
+ class_instance.R0SubrunDataset = str((
119
+ raw_dir / flat_date / f"LST-1.1.Run{run_subrun}.fits.fz"
120
+ ).resolve())
121
+ class_instance.CoefficientsCalibrationFile = str(calibration_file)
122
+ class_instance.PedestalFile = str(pedestal_file)
123
+ class_instance.TimeCalibrationFile = str(timecalibration_file)
124
+ class_instance.SystematicCorrectionFile = str(systematic_correction_file)
125
+ class_instance.PointingFile = str(Path(class_instance.args[4]).resolve())
126
+ class_instance.RunSummaryFile = str(Path(class_instance.args[5]).resolve())
127
+ class_instance.DL1SubrunDataset = str(
128
+ (outdir_dl1 / f"dl1_LST-1.Run{run_subrun}.h5").resolve()
129
+ )
130
+ class_instance.MuonsSubrunDataset = str((
131
+ muon_dir / f"muons_LST-1.Run{run_subrun}.fits"
132
+ ).resolve())
133
+ class_instance.InterleavedPedestalEventsFile = None
134
+ if class_instance.args[6] is not None:
135
+ class_instance.InterleavedPedestalEventsFile = str(Path(class_instance.args[6]))
136
+
137
+ if class_instance.__name__ == "dl1ab":
138
+ # run_str [0] 02006.0000
139
+
140
+ class_instance.Analysisconfigfile_dl1 = str(Path(configfile_dl1b))
141
+ class_instance.ObservationRun = class_instance.args[0].split(".")[0]
142
+ class_instance.StoreImage = cfg.getboolean("lstchain", "store_image_dl1ab")
143
+ class_instance.DL1SubrunDataset = str((
144
+ outdir_dl1 / f"dl1_LST-1.Run{class_instance.args[0]}.h5"
145
+ ).resolve())
146
+
147
+ if class_instance.__name__ == "dl1_datacheck":
148
+ # run_str [0] 02006.0000
149
+ run_subrun = class_instance.args[0]
150
+ run = run_subrun.split(".")[0]
151
+
152
+ class_instance.ObservationRun = run
153
+ class_instance.DL1SubrunDataset = str(
154
+ (outdir_dl1 / f"dl1_LST-1.Run{run_subrun}.h5").resolve()
155
+ )
156
+ class_instance.MuonsSubrunDataset = str((
157
+ muon_dir / f"muons_LST-1.Run{run_subrun}.fits"
158
+ ).resolve())
159
+ class_instance.DL1CheckSubrunDataset = str((
160
+ outdir_dl1 / f"datacheck_dl1_LST-1.Run{run_subrun}.h5"
161
+ ).resolve())
162
+ class_instance.DL1CheckHDF5File = str((
163
+ outdir_dl1 / f"datacheck_dl1_LST-1.Run{run}.h5"
164
+ ).resolve())
165
+ class_instance.DL1CheckPDFFile = str((
166
+ outdir_dl1 / f"datacheck_dl1_LST-1.Run{run}.pdf"
167
+ ).resolve())
168
+
169
+ if class_instance.__name__ == "dl1_to_dl2":
170
+ # run_str [0] 02006.0000
171
+ run_subrun = class_instance.args[0]
172
+ run = run_subrun.split(".")[0]
173
+
174
+ class_instance.Analysisconfigfile_dl2 = configfile_dl2
175
+ class_instance.ObservationRun = run
176
+ class_instance.RFModelEnergyFile = str((rf_models_directory / "reg_energy.sav").resolve())
177
+ class_instance.RFModelDispNormFile = str(
178
+ (rf_models_directory / "reg_disp_norm.sav").resolve()
179
+ )
180
+ class_instance.RFModelDispSignFile = str(
181
+ (rf_models_directory / "reg_disp_sign.sav").resolve()
182
+ )
183
+ class_instance.RFModelGammanessFile = str((rf_models_directory / "cls_gh.sav").resolve())
184
+ class_instance.DL1SubrunDataset = str(
185
+ (outdir_dl1 / f"dl1_LST-1.Run{run_subrun}.h5").resolve()
186
+ )
187
+ class_instance.DL2SubrunDataset = str(
188
+ (outdir_dl2 / f"dl2_LST-1.Run{run_subrun}.h5").resolve()
189
+ )
190
+ class_instance.DL2MergedFile = str((outdir_dl2 / f"dl2_LST-1.Run{run}.h5").resolve())
191
+
192
+ if class_instance.__name__ in REDUCTION_TASKS:
193
+ class_instance.session_name = class_instance.ObservationRun
194
+
195
+ return class_instance
196
+
197
+
198
+ def get_log_config():
199
+ """Get logging configuration from provenance logger config file."""
200
+ std_logger_file = files("osa.provenance") / "config/logger.yaml"
201
+ return std_logger_file.read_text()
@@ -37,7 +37,8 @@ def is_calibration_produced(drs4_pedestal_run_id: int, pedcal_run_id: int) -> bo
37
37
  Check if both daily calibration (DRS4 baseline and
38
38
  charge calibration) files are already produced.
39
39
  """
40
- return drs4_pedestal_exists(drs4_pedestal_run_id) and calibration_file_exists(pedcal_run_id)
40
+ return drs4_pedestal_exists(drs4_pedestal_run_id, options.prod_id) \
41
+ and calibration_file_exists(pedcal_run_id, options.prod_id)
41
42
 
42
43
 
43
44
  def drs4_pedestal_command(drs4_pedestal_run_id: int) -> list:
@@ -122,7 +123,7 @@ def drs4_pedestal(
122
123
  rc : int
123
124
  Return code
124
125
  """
125
- if options.simulate or drs4_pedestal_exists(drs4_pedestal_run_id):
126
+ if options.simulate or drs4_pedestal_exists(drs4_pedestal_run_id, options.prod_id):
126
127
  return 0
127
128
 
128
129
  cmd = drs4_pedestal_command(drs4_pedestal_run_id)
@@ -154,7 +155,7 @@ def calibrate_charge(
154
155
  rc: int
155
156
  Return code
156
157
  """
157
- if options.simulate or calibration_file_exists(pedcal_run_id):
158
+ if options.simulate or calibration_file_exists(pedcal_run_id, options.prod_id):
158
159
  return 0
159
160
 
160
161
  cmd = calibration_file_command(