lstosa 0.11.4__tar.gz → 0.11.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.
- {lstosa-0.11.4 → lstosa-0.11.6}/.mailmap +2 -1
- {lstosa-0.11.4 → lstosa-0.11.6}/PKG-INFO +1 -1
- {lstosa-0.11.4 → lstosa-0.11.6}/src/lstosa.egg-info/PKG-INFO +1 -1
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/_version.py +3 -3
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/nightsummary/database.py +36 -44
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/nightsummary/extract.py +9 -8
- lstosa-0.11.6/src/osa/nightsummary/tests/test_database.py +8 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/sequencer.py +33 -3
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/sequencer_webmaker.py +1 -1
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/tests/test_osa_scripts.py +4 -4
- lstosa-0.11.4/src/osa/nightsummary/tests/test_database.py +0 -9
- {lstosa-0.11.4 → lstosa-0.11.6}/.coveragerc +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/.gitignore +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/.pre-commit-config.yaml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/.readthedocs.yml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/LICENSE +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/MANIFEST.in +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/README.md +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/codemeta.json +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/crontab/crontab-orig.txt +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/crontab/crontab.txt +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/dev/mysql.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/Makefile +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/_static/logo_lstosa.png +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/authors.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/components/index.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/conf.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/configuration.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/contribute.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/documents/index.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/howto/index.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/index.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/introduction/index.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/introduction/reduction_steps_lstchain.png +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/jobs.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/make.bat +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/nightsummary.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/provenance.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/references.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/reports.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/scripts/index.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/troubleshooting/index.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/utils.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/veto.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/workflow/LSTOSA_flow.png +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/docs/workflow/index.rst +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/environment-lstcam.yml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/environment.yml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/extra/example_sequencer.txt +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/extra/history_files/sequence_LST1_04183.history +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/extra/history_files/sequence_LST1_04183_failed.history +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/extra/history_files/sequence_LST1_04183_oneline.history +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/extra/history_files/sequence_LST1_04185.0001.history +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/extra/history_files/sequence_LST1_04185.0010.history +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/extra/sacct_output.csv +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/extra/squeue_output.csv +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/pyproject.toml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/setup.cfg +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/lstosa.egg-info/SOURCES.txt +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/lstosa.egg-info/dependency_links.txt +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/lstosa.egg-info/entry_points.txt +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/lstosa.egg-info/requires.txt +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/lstosa.egg-info/top_level.txt +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/configs/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/configs/config.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/configs/datamodel.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/configs/options.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/configs/sequencer.cfg +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/conftest.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/high_level/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/high_level/selection_cuts.toml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/high_level/significance.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/high_level/tests/test_significance.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/job.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/nightsummary/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/nightsummary/nightsummary.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/nightsummary/set_source_coordinates.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/nightsummary/tests/test_extract.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/nightsummary/tests/test_nightsummary.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/nightsummary/tests/test_source_coordinates.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/osadb.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/paths.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/provenance/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/provenance/capture.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/provenance/config/definition.yaml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/provenance/config/environment.yaml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/provenance/config/logger.yaml +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/provenance/io.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/provenance/utils.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/raw.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/report.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/autocloser.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/calibration_pipeline.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/closer.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/copy_datacheck.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/datasequence.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/gain_selection.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/gainsel_webmaker.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/provprocess.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/reprocess_longterm.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/reprocessing.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/sequencer_catB_tailcuts.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/show_run_summary.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/simulate_processing.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/tests/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/scripts/update_source_catalog.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/tests/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/tests/test_jobs.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/tests/test_osa.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/tests/test_osadb.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/tests/test_paths.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/tests/test_raw.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/tests/test_report.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/tests/test_veto.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/cliopts.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/iofile.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/logging.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/mail.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/register.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/tests/test_iofile.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/tests/test_utils.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/utils/utils.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/version.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/veto.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/webserver/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/webserver/utils.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/workflow/__init__.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/workflow/dl3.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/workflow/stages.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/workflow/tests/test_dl3.py +0 -0
- {lstosa-0.11.4 → lstosa-0.11.6}/src/osa/workflow/tests/test_stages.py +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Andres Baquero <obaquero@ucm.es> andres-baquero <obaquero@ucm.es>
|
|
2
2
|
|
|
3
|
-
Daniel Morcuende <
|
|
3
|
+
Daniel Morcuende <daniel.morcuende@cta-observatory.org> morcuended <dmorcuen@ucm.es>
|
|
4
|
+
Daniel Morcuende <daniel.morcuende@cta-observatory.org> morcuended <dmorcuende@iaa.es>
|
|
4
5
|
|
|
5
6
|
Jose Luis Contreras <jlcontreras@fis.ucm.es> Jose Contreras <jose.contreras@cp02.ctan.cta-observatory.org>
|
|
6
7
|
Jose Luis Contreras <jlcontreras@fis.ucm.es> Jose Luis Contreras <pda.jl.contreras@gmail.com>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lstosa
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.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>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lstosa
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.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>
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.11.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 11,
|
|
31
|
+
__version__ = version = '0.11.6'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 11, 6)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g934050aad'
|
|
@@ -14,27 +14,21 @@ __all__ = ["query", "db_available", "get_run_info_from_TCU"]
|
|
|
14
14
|
|
|
15
15
|
log = myLogger(logging.getLogger(__name__))
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
CACO_DB = cfg.get("database", "caco_db")
|
|
19
17
|
TCU_DB = cfg.get("database", "tcu_db")
|
|
20
18
|
|
|
21
|
-
|
|
22
19
|
def db_available():
|
|
23
20
|
"""Check the connection to the TCU database."""
|
|
24
|
-
caco_client = MongoClient(CACO_DB, serverSelectionTimeoutMS=3000)
|
|
25
21
|
tcu_client = MongoClient(TCU_DB, serverSelectionTimeoutMS=3000)
|
|
26
22
|
try:
|
|
27
|
-
caco_client.server_info()
|
|
28
23
|
tcu_client.server_info()
|
|
29
24
|
except ConnectionFailure:
|
|
30
|
-
log.warning("TCU
|
|
25
|
+
log.warning("TCU database not available. No source info will be added.")
|
|
31
26
|
return False
|
|
32
27
|
else:
|
|
33
|
-
log.debug("TCU
|
|
28
|
+
log.debug("TCU database is available. Source info will be added.")
|
|
34
29
|
return True
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
def query(obs_id: int, property_name: str):
|
|
31
|
+
def query(obs_id: int):
|
|
38
32
|
"""
|
|
39
33
|
Query the source name and coordinates from TCU database.
|
|
40
34
|
|
|
@@ -42,13 +36,11 @@ def query(obs_id: int, property_name: str):
|
|
|
42
36
|
----------
|
|
43
37
|
obs_id : int
|
|
44
38
|
Run number
|
|
45
|
-
|
|
46
|
-
Properties from drive information e.g. `DriveControl_SourceName`,
|
|
47
|
-
`DriveControl_RA_Target`, `DriveControl_Dec_Target`
|
|
39
|
+
|
|
48
40
|
|
|
49
41
|
Returns
|
|
50
42
|
-------
|
|
51
|
-
query_result :
|
|
43
|
+
query_result : Dict
|
|
52
44
|
Query result from database. It can be either the source name or its coordinates.
|
|
53
45
|
|
|
54
46
|
Raises
|
|
@@ -60,47 +52,47 @@ def query(obs_id: int, property_name: str):
|
|
|
60
52
|
if not isinstance(obs_id, int):
|
|
61
53
|
obs_id = int(obs_id)
|
|
62
54
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
run_info = caco_client["CACO"]["RUN_INFORMATION"]
|
|
68
|
-
run = run_info.find_one({"run_number": obs_id})
|
|
55
|
+
try:
|
|
56
|
+
tcu_client = MongoClient(TCU_DB, serverSelectionTimeoutMS=3000)
|
|
57
|
+
db = tcu_client["lst1_obs_summary"]
|
|
58
|
+
camera_col = db["camera"]
|
|
69
59
|
|
|
70
|
-
|
|
71
|
-
start = datetime.fromisoformat(run["start_time"].replace("Z", ""))
|
|
72
|
-
end = datetime.fromisoformat(run["stop_time"].replace("Z", ""))
|
|
73
|
-
except TypeError:
|
|
74
|
-
return None
|
|
60
|
+
run_info = camera_col.find_one({"run_number": obs_id})
|
|
75
61
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
descriptors = property_collection.find(
|
|
80
|
-
{"property_name": property_name},
|
|
81
|
-
)
|
|
62
|
+
if not run_info:
|
|
63
|
+
log.info(f"Run {obs_id} not found 'lst1_obs_summary.camera'")
|
|
64
|
+
else:
|
|
82
65
|
|
|
83
|
-
|
|
66
|
+
tstart = run_info.get("tstart")
|
|
67
|
+
tstop = run_info.get("tstop")
|
|
68
|
+
run_type = run_info.get("kind")
|
|
84
69
|
|
|
85
|
-
|
|
86
|
-
query_property = {"pid": descriptor["_id"]}
|
|
70
|
+
tstart_iso = datetime.fromtimestamp(tstart).isoformat(sep=" ", timespec="seconds")
|
|
87
71
|
|
|
88
|
-
|
|
89
|
-
|
|
72
|
+
log.info(f"Run {obs_id} ({run_type}) found.")
|
|
73
|
+
log.info(f"Time: {tstart_iso} (Timestamp: {tstart})")
|
|
90
74
|
|
|
91
|
-
|
|
92
|
-
|
|
75
|
+
telescope_col = db["telescope"]
|
|
76
|
+
query = {
|
|
77
|
+
"tstart": {"$lte": tstop},
|
|
78
|
+
"tstop": {"$gte": tstart}
|
|
79
|
+
}
|
|
93
80
|
|
|
94
|
-
|
|
81
|
+
tel_doc = telescope_col.find_one(query, sort=[("tstart", -1)])
|
|
95
82
|
|
|
96
|
-
|
|
97
|
-
for value in chunk["values"]:
|
|
98
|
-
entries["time"].append(value["t"])
|
|
99
|
-
entries["value"].append(value["val"])
|
|
83
|
+
if tel_doc:
|
|
100
84
|
|
|
101
|
-
|
|
102
|
-
|
|
85
|
+
config = tel_doc.get("data", {}).get("structure", [])[0]
|
|
86
|
+
target = config.get("target", {})
|
|
87
|
+
source_name = target.get("name", "Desconocido")
|
|
88
|
+
ra = target.get("source_ra", "N/A")
|
|
89
|
+
dec = target.get("source_dec", "N/A")
|
|
90
|
+
return {"source_name": source_name, "ra": ra, "dec": dec}
|
|
91
|
+
else:
|
|
92
|
+
log.info("\nNo information found for that time range in 'lst1_obs_summary.telescope'.")
|
|
103
93
|
|
|
94
|
+
except Exception as e:
|
|
95
|
+
log.info(f"ERROR: {e}")
|
|
104
96
|
|
|
105
97
|
def get_run_info_from_TCU(run_id: int, tcu_server: str) -> Tuple:
|
|
106
98
|
"""
|
|
@@ -173,15 +173,16 @@ def extract_runs(summary_table):
|
|
|
173
173
|
# Make sure we are looking at actual data runs. Avoid test runs.
|
|
174
174
|
if run.run > 0 and run.type == "DATA":
|
|
175
175
|
log.debug(f"Looking info in TCU DB for run {run.run}")
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
|
|
177
|
+
tcu_result = database.query(
|
|
178
|
+
obs_id=run.run
|
|
178
179
|
)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
|
|
181
|
+
if tcu_result is not None:
|
|
182
|
+
run.source_name = tcu_result.get("source_name")
|
|
183
|
+
run.source_ra = tcu_result.get("ra")
|
|
184
|
+
run.source_dec = tcu_result.get("dec")
|
|
185
|
+
|
|
185
186
|
# Store this source information (run_id, source_name, source_ra, source_dec)
|
|
186
187
|
# into an astropy Table and save to disk in RunCatalog files. In this way, the
|
|
187
188
|
# information can be dumped anytime later more easily than accessing the
|
|
@@ -11,7 +11,7 @@ import os
|
|
|
11
11
|
import sys
|
|
12
12
|
from decimal import Decimal
|
|
13
13
|
import datetime
|
|
14
|
-
|
|
14
|
+
import re
|
|
15
15
|
from osa import osadb
|
|
16
16
|
from osa.configs import options
|
|
17
17
|
from osa.configs.config import cfg
|
|
@@ -50,6 +50,7 @@ __all__ = [
|
|
|
50
50
|
"update_sequence_status",
|
|
51
51
|
"get_status_for_sequence",
|
|
52
52
|
"output_matrix",
|
|
53
|
+
"check_catB_status",
|
|
53
54
|
"report_sequences",
|
|
54
55
|
"update_job_info",
|
|
55
56
|
]
|
|
@@ -205,6 +206,34 @@ def update_sequence_status(seq_list):
|
|
|
205
206
|
)
|
|
206
207
|
seq.muonstatus = int(Decimal(get_status_for_sequence(seq, "MUON") * 100) / seq.subruns)
|
|
207
208
|
seq.dl2status = int(Decimal(get_status_for_sequence(seq, "DL2") * 100))
|
|
209
|
+
seq.catbstatus = check_catB_status(seq)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def check_catB_status(seq):
|
|
213
|
+
catbstatus = "None"
|
|
214
|
+
|
|
215
|
+
if seq.type == "DATA":
|
|
216
|
+
directory = options.directory
|
|
217
|
+
|
|
218
|
+
closed_files = list(directory.glob(f"catB*{seq.run}*.closed"))
|
|
219
|
+
if closed_files:
|
|
220
|
+
catbstatus = "CLOSED"
|
|
221
|
+
else:
|
|
222
|
+
log_files = list(options.log_directory.glob(f"catB_calibration_{seq.run}_*.err"))
|
|
223
|
+
if log_files:
|
|
224
|
+
filename = sorted(log_files)[-1].name
|
|
225
|
+
match = re.search(f"catB_calibration_{seq.run}_(\d+).err", filename)
|
|
226
|
+
if match:
|
|
227
|
+
job_id = match.group(1)
|
|
228
|
+
|
|
229
|
+
sacct_output = run_sacct(job_id)
|
|
230
|
+
sacct_info = get_sacct_output(sacct_output)
|
|
231
|
+
|
|
232
|
+
if not sacct_info.empty:
|
|
233
|
+
catbstatus = sacct_info.iloc[0]["State"]
|
|
234
|
+
|
|
235
|
+
return catbstatus
|
|
236
|
+
|
|
208
237
|
|
|
209
238
|
|
|
210
239
|
def get_status_for_sequence(sequence, data_level) -> int:
|
|
@@ -278,7 +307,7 @@ def report_sequences(sequence_list):
|
|
|
278
307
|
"Exit",
|
|
279
308
|
]
|
|
280
309
|
if options.tel_id in ["LST1", "LST2"]:
|
|
281
|
-
header.extend(("DL1%", "MUONS%", "DL1AB%", "DATACHECK%", "DL2%"))
|
|
310
|
+
header.extend(("DL1%", "MUONS%", "CAT-B","DL1AB%", "DATACHECK%", "DL2%"))
|
|
282
311
|
matrix = [header]
|
|
283
312
|
for sequence in sequence_list:
|
|
284
313
|
row_list = [
|
|
@@ -297,12 +326,13 @@ def report_sequences(sequence_list):
|
|
|
297
326
|
sequence.exit,
|
|
298
327
|
]
|
|
299
328
|
if sequence.type in ["DRS4", "PEDCALIB"]:
|
|
300
|
-
row_list.extend((None, None, None, None, None))
|
|
329
|
+
row_list.extend((None, None, None, None, None, None))
|
|
301
330
|
elif sequence.type == "DATA":
|
|
302
331
|
row_list.extend(
|
|
303
332
|
(
|
|
304
333
|
sequence.dl1status,
|
|
305
334
|
sequence.muonstatus,
|
|
335
|
+
sequence.catbstatus,
|
|
306
336
|
sequence.dl1abstatus,
|
|
307
337
|
sequence.datacheckstatus,
|
|
308
338
|
sequence.dl2status,
|
|
@@ -163,10 +163,10 @@ def test_simulated_sequencer(
|
|
|
163
163
|
assert rc.stdout == dedent(
|
|
164
164
|
f"""\
|
|
165
165
|
=================================== Starting sequencer.py at {now} UTC for LST, Telescope: LST1, Date: 2020-01-17 ===================================
|
|
166
|
-
Tel Seq Parent Type Run Subruns Source Action Tries JobID State CPU_time Exit DL1% MUONS% DL1AB% DATACHECK% DL2%
|
|
167
|
-
LST1 1 None PEDCALIB 1809 5 None None None None None None None None None None None None
|
|
168
|
-
LST1 2 1 DATA 1807 11 Crab None None None None None None 0 0
|
|
169
|
-
LST1 3 1 DATA 1808 9 MadeUpSource None None None None None None 0 0
|
|
166
|
+
Tel Seq Parent Type Run Subruns Source Action Tries JobID State CPU_time Exit DL1% MUONS% CAT-B DL1AB% DATACHECK% DL2%
|
|
167
|
+
LST1 1 None PEDCALIB 1809 5 None None None None None None None None None None None None None
|
|
168
|
+
LST1 2 1 DATA 1807 11 Crab None None None None None None 0 0 None 0 0 100
|
|
169
|
+
LST1 3 1 DATA 1808 9 MadeUpSource None None None None None None 0 0 None 0 0 100
|
|
170
170
|
""" # noqa: E501
|
|
171
171
|
)
|
|
172
172
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|