ctao-calibpipe 0.3.0rc2__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.
- calibpipe/__init__.py +5 -0
- calibpipe/_dev_version/__init__.py +9 -0
- calibpipe/_version.py +34 -0
- calibpipe/atmosphere/__init__.py +1 -0
- calibpipe/atmosphere/atmosphere_containers.py +109 -0
- calibpipe/atmosphere/meteo_data_handlers.py +485 -0
- calibpipe/atmosphere/models/README.md +14 -0
- calibpipe/atmosphere/models/__init__.py +1 -0
- calibpipe/atmosphere/models/macobac.ecsv +23 -0
- calibpipe/atmosphere/models/reference_MDPs/__init__.py +1 -0
- calibpipe/atmosphere/models/reference_MDPs/ref_density_at_15km_ctao-north_intermediate.ecsv +8 -0
- calibpipe/atmosphere/models/reference_MDPs/ref_density_at_15km_ctao-north_summer.ecsv +8 -0
- calibpipe/atmosphere/models/reference_MDPs/ref_density_at_15km_ctao-north_winter.ecsv +8 -0
- calibpipe/atmosphere/models/reference_MDPs/ref_density_at_15km_ctao-south_summer.ecsv +8 -0
- calibpipe/atmosphere/models/reference_MDPs/ref_density_at_15km_ctao-south_winter.ecsv +8 -0
- calibpipe/atmosphere/models/reference_atmospheres/__init__.py +1 -0
- calibpipe/atmosphere/models/reference_atmospheres/reference_atmo_model_v0_ctao-north_intermediate.ecsv +73 -0
- calibpipe/atmosphere/models/reference_atmospheres/reference_atmo_model_v0_ctao-north_summer.ecsv +73 -0
- calibpipe/atmosphere/models/reference_atmospheres/reference_atmo_model_v0_ctao-north_winter.ecsv +73 -0
- calibpipe/atmosphere/models/reference_atmospheres/reference_atmo_model_v0_ctao-south_summer.ecsv +73 -0
- calibpipe/atmosphere/models/reference_atmospheres/reference_atmo_model_v0_ctao-south_winter.ecsv +73 -0
- calibpipe/atmosphere/models/reference_rayleigh_scattering_profiles/__init__.py +1 -0
- calibpipe/atmosphere/models/reference_rayleigh_scattering_profiles/reference_rayleigh_extinction_profile_v0_ctao-north_intermediate.ecsv +857 -0
- calibpipe/atmosphere/models/reference_rayleigh_scattering_profiles/reference_rayleigh_extinction_profile_v0_ctao-north_summer.ecsv +857 -0
- calibpipe/atmosphere/models/reference_rayleigh_scattering_profiles/reference_rayleigh_extinction_profile_v0_ctao-north_winter.ecsv +857 -0
- calibpipe/atmosphere/models/reference_rayleigh_scattering_profiles/reference_rayleigh_extinction_profile_v0_ctao-south_summer.ecsv +857 -0
- calibpipe/atmosphere/models/reference_rayleigh_scattering_profiles/reference_rayleigh_extinction_profile_v0_ctao-south_winter.ecsv +857 -0
- calibpipe/atmosphere/templates/request_templates/__init__.py +1 -0
- calibpipe/atmosphere/templates/request_templates/copernicus.json +11 -0
- calibpipe/atmosphere/templates/request_templates/gdas.json +12 -0
- calibpipe/core/__init__.py +39 -0
- calibpipe/core/common_metadata_containers.py +198 -0
- calibpipe/core/exceptions.py +87 -0
- calibpipe/database/__init__.py +24 -0
- calibpipe/database/adapter/__init__.py +23 -0
- calibpipe/database/adapter/adapter.py +80 -0
- calibpipe/database/adapter/database_containers/__init__.py +63 -0
- calibpipe/database/adapter/database_containers/atmosphere.py +199 -0
- calibpipe/database/adapter/database_containers/common_metadata.py +150 -0
- calibpipe/database/adapter/database_containers/container_map.py +59 -0
- calibpipe/database/adapter/database_containers/observatory.py +61 -0
- calibpipe/database/adapter/database_containers/table_version_manager.py +39 -0
- calibpipe/database/adapter/database_containers/throughput.py +30 -0
- calibpipe/database/adapter/database_containers/version_control.py +17 -0
- calibpipe/database/connections/__init__.py +28 -0
- calibpipe/database/connections/calibpipe_database.py +60 -0
- calibpipe/database/connections/postgres_utils.py +97 -0
- calibpipe/database/connections/sql_connection.py +103 -0
- calibpipe/database/connections/user_confirmation.py +19 -0
- calibpipe/database/interfaces/__init__.py +71 -0
- calibpipe/database/interfaces/hashable_row_data.py +54 -0
- calibpipe/database/interfaces/queries.py +180 -0
- calibpipe/database/interfaces/sql_column_info.py +67 -0
- calibpipe/database/interfaces/sql_metadata.py +6 -0
- calibpipe/database/interfaces/sql_table_info.py +131 -0
- calibpipe/database/interfaces/table_handler.py +333 -0
- calibpipe/database/interfaces/types.py +96 -0
- calibpipe/telescope/throughput/containers.py +66 -0
- calibpipe/tests/conftest.py +274 -0
- calibpipe/tests/data/atmosphere/molecular_atmosphere/__init__.py +0 -0
- calibpipe/tests/data/atmosphere/molecular_atmosphere/contemporary_MDP.ecsv +34 -0
- calibpipe/tests/data/atmosphere/molecular_atmosphere/macobac.csv +852 -0
- calibpipe/tests/data/atmosphere/molecular_atmosphere/macobac.ecsv +23 -0
- calibpipe/tests/data/atmosphere/molecular_atmosphere/merged_file.ecsv +1082 -0
- calibpipe/tests/data/atmosphere/molecular_atmosphere/meteo_data_copernicus.ecsv +1082 -0
- calibpipe/tests/data/atmosphere/molecular_atmosphere/meteo_data_gdas.ecsv +66 -0
- calibpipe/tests/data/atmosphere/molecular_atmosphere/observatory_configurations.json +71 -0
- calibpipe/tests/data/utils/__init__.py +0 -0
- calibpipe/tests/data/utils/meteo_data_winter_and_summer.ecsv +12992 -0
- calibpipe/tests/test_conftest_data.py +200 -0
- calibpipe/tests/unittests/array/test_cross_calibration.py +412 -0
- calibpipe/tests/unittests/atmosphere/astral_testing.py +107 -0
- calibpipe/tests/unittests/atmosphere/test_meteo_data_handler.py +775 -0
- calibpipe/tests/unittests/atmosphere/test_molecular_atmosphere.py +327 -0
- calibpipe/tests/unittests/database/test_table_handler.py +163 -0
- calibpipe/tests/unittests/database/test_types.py +38 -0
- calibpipe/tests/unittests/telescope/camera/test_calculate_camcalib_coefficients.py +456 -0
- calibpipe/tests/unittests/telescope/camera/test_produce_camcalib_test_data.py +37 -0
- calibpipe/tests/unittests/telescope/throughput/test_muon_throughput_calibrator.py +693 -0
- calibpipe/tests/unittests/test_bootstrap_db.py +79 -0
- calibpipe/tests/unittests/utils/test_observatory.py +309 -0
- calibpipe/tools/atmospheric_base_tool.py +78 -0
- calibpipe/tools/atmospheric_model_db_loader.py +181 -0
- calibpipe/tools/basic_tool_with_db.py +38 -0
- calibpipe/tools/camcalib_test_data.py +374 -0
- calibpipe/tools/camera_calibrator.py +462 -0
- calibpipe/tools/contemporary_mdp_producer.py +87 -0
- calibpipe/tools/init_db.py +37 -0
- calibpipe/tools/macobac_calculator.py +82 -0
- calibpipe/tools/molecular_atmospheric_model_producer.py +197 -0
- calibpipe/tools/muon_throughput_calculator.py +219 -0
- calibpipe/tools/observatory_data_db_loader.py +71 -0
- calibpipe/tools/reference_atmospheric_model_selector.py +201 -0
- calibpipe/tools/telescope_cross_calibration_calculator.py +721 -0
- calibpipe/utils/__init__.py +10 -0
- calibpipe/utils/observatory.py +486 -0
- calibpipe/utils/observatory_containers.py +26 -0
- calibpipe/version.py +24 -0
- ctao_calibpipe-0.3.0rc2.dist-info/METADATA +92 -0
- ctao_calibpipe-0.3.0rc2.dist-info/RECORD +105 -0
- ctao_calibpipe-0.3.0rc2.dist-info/WHEEL +5 -0
- ctao_calibpipe-0.3.0rc2.dist-info/entry_points.txt +12 -0
- ctao_calibpipe-0.3.0rc2.dist-info/licenses/AUTHORS.md +13 -0
- ctao_calibpipe-0.3.0rc2.dist-info/licenses/LICENSE +21 -0
- ctao_calibpipe-0.3.0rc2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Test configuration and fixtures for CalibPipe tests.
|
|
3
|
+
|
|
4
|
+
This module provides fixtures for managing test data from the DPPS test data repository,
|
|
5
|
+
using ctapipe's get_dataset_path utility with CalibPipe-specific defaults.
|
|
6
|
+
|
|
7
|
+
Set the CALIBPIPE_DATASET_URL environment variable to override the default URL:
|
|
8
|
+
https://minio-cta.zeuthen.desy.de/dpps-testdata-public/data/calibpipe-test-data/
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import shutil
|
|
12
|
+
import tempfile
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
import pytest
|
|
16
|
+
from ctapipe.utils.datasets import get_dataset_path
|
|
17
|
+
|
|
18
|
+
# Default URL for CalibPipe test data
|
|
19
|
+
DEFAULT_CALIBPIPE_URL = (
|
|
20
|
+
"https://minio-cta.zeuthen.desy.de/dpps-testdata-public/data/calibpipe-test-data/"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Mapping from local file paths to server file paths (for historical compatibility)
|
|
24
|
+
FILE_PATH_MAPPING = {
|
|
25
|
+
# Local path -> Server path
|
|
26
|
+
"array/cross_calibration_test_dl2.h5": "cross_calibration_test_dl2.h5",
|
|
27
|
+
"telescope/throughput/lst_muon_table.h5": "dl1_lst_muon_simulation.h5",
|
|
28
|
+
"telescope/throughput/empty_muon_table.h5": "empty_muon_table.h5",
|
|
29
|
+
"telescope/camera/flatfield_LST_dark.simtel.gz": "camera-calibration-test-data/flasher_LST_dark.simtel.gz",
|
|
30
|
+
"telescope/camera/pedestal_LST_dark.simtel.gz": "camera-calibration-test-data/pedestals_LST_dark.simtel.gz",
|
|
31
|
+
"telescope/camera/high_statsagg_v1_single_chunk.dl1.h5": "camera-calibration-test-data/high_statsagg_v1_single_chunk.dl1.h5",
|
|
32
|
+
"telescope/camera/high_statsagg_v1_same_chunks.dl1.h5": "camera-calibration-test-data/high_statsagg_v1_same_chunks.dl1.h5",
|
|
33
|
+
"telescope/camera/high_statsagg_v1_different_chunks.dl1.h5": "camera-calibration-test-data/high_statsagg_v1_different_chunks.dl1.h5",
|
|
34
|
+
# Muon test data files - lst LaPalma
|
|
35
|
+
"telescope/throughput/muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8.h5": "muon-test-data/muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8.h5",
|
|
36
|
+
"telescope/throughput/muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.81.h5": "muon-test-data/muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.81.h5",
|
|
37
|
+
"telescope/throughput/muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.83.h5": "muon-test-data/muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.83.h5",
|
|
38
|
+
"telescope/throughput/muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8.h5": "muon-test-data/muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8.h5",
|
|
39
|
+
"telescope/throughput/muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.81.h5": "muon-test-data/muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.81.h5",
|
|
40
|
+
"telescope/throughput/muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.83.h5": "muon-test-data/muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.83.h5",
|
|
41
|
+
# Muon test data files - mst LaPalma (NC)
|
|
42
|
+
"telescope/throughput/muon+_0deg_0deg_run000006___cta-prod6-2156m-LaPalma-mst-nc-dark-ref-degraded-0.83.h5": "muon-test-data/muon+_0deg_0deg_run000006___cta-prod6-2156m-LaPalma-mst-nc-dark-ref-degraded-0.83.h5",
|
|
43
|
+
# Muon test data files - mst Paranal (FC)
|
|
44
|
+
"telescope/throughput/muon+_0deg_0deg_run000002___cta-prod6-2147m-Paranal-mst-fc-dark-ref-degraded-0.83.h5": "muon-test-data/muon+_0deg_0deg_run000002___cta-prod6-2147m-Paranal-mst-fc-dark-ref-degraded-0.83.h5",
|
|
45
|
+
# DL0 muon test data files
|
|
46
|
+
"telescope/throughput/muon-_37.35deg_0deg_run000004___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8_summer.simtel.zst": "muon-test-data/muon-_37.35deg_0deg_run000004___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8_summer.simtel.zst",
|
|
47
|
+
"telescope/throughput/muon+_37.35deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8_summer.simtel.zst": "muon-test-data/muon+_37.35deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8_summer.simtel.zst",
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# Test data files available in the CalibPipe test data repository (local paths)
|
|
51
|
+
TEST_FILES = list(FILE_PATH_MAPPING.keys())
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@pytest.fixture(scope="session")
|
|
55
|
+
def calibpipe_test_data_dir():
|
|
56
|
+
"""
|
|
57
|
+
Fixture providing the base test data directory.
|
|
58
|
+
|
|
59
|
+
This creates a temporary directory structure for test data
|
|
60
|
+
and ensures all required test files are downloaded using ctapipe's get_dataset_path
|
|
61
|
+
with CalibPipe-specific URL defaults.
|
|
62
|
+
|
|
63
|
+
Uses CALIBPIPE_DATASET_URL environment variable if set, otherwise defaults to:
|
|
64
|
+
https://minio-cta.zeuthen.desy.de/dpps-testdata-public/data/calibpipe-test-data/
|
|
65
|
+
"""
|
|
66
|
+
test_data_dir = Path(tempfile.mkdtemp(prefix="calibpipe_test_data_"))
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
# Create directory structure
|
|
70
|
+
(test_data_dir / "array").mkdir()
|
|
71
|
+
(test_data_dir / "telescope" / "throughput").mkdir(parents=True)
|
|
72
|
+
(test_data_dir / "telescope" / "camera").mkdir(parents=True)
|
|
73
|
+
|
|
74
|
+
# Download and copy required files
|
|
75
|
+
for local_path, server_path in FILE_PATH_MAPPING.items():
|
|
76
|
+
# Download using the server path
|
|
77
|
+
cached_file = get_dataset_path(server_path, url=DEFAULT_CALIBPIPE_URL)
|
|
78
|
+
# Place in the local directory structure
|
|
79
|
+
target_file = test_data_dir / local_path
|
|
80
|
+
shutil.copy2(cached_file, target_file)
|
|
81
|
+
|
|
82
|
+
yield test_data_dir
|
|
83
|
+
|
|
84
|
+
finally:
|
|
85
|
+
# Clean up
|
|
86
|
+
shutil.rmtree(test_data_dir, ignore_errors=True)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@pytest.fixture(scope="session")
|
|
90
|
+
def cross_calibration_dl2_file(calibpipe_test_data_dir):
|
|
91
|
+
"""Fixture providing the cross-calibration DL2 test file."""
|
|
92
|
+
return calibpipe_test_data_dir / "array" / "cross_calibration_test_dl2.h5"
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
@pytest.fixture(scope="session")
|
|
96
|
+
def lst_muon_table_file(calibpipe_test_data_dir):
|
|
97
|
+
"""Fixture providing the LST muon table test file."""
|
|
98
|
+
return calibpipe_test_data_dir / "telescope" / "throughput" / "lst_muon_table.h5"
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@pytest.fixture(scope="session")
|
|
102
|
+
def empty_muon_table_file(calibpipe_test_data_dir):
|
|
103
|
+
"""Fixture providing the empty muon table test file."""
|
|
104
|
+
return calibpipe_test_data_dir / "telescope" / "throughput" / "empty_muon_table.h5"
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# lst
|
|
108
|
+
@pytest.fixture(scope="session")
|
|
109
|
+
def muon_minus_r80_file(calibpipe_test_data_dir):
|
|
110
|
+
"""Fixture providing the μ- muon test file with reflectivity 0.8."""
|
|
111
|
+
return (
|
|
112
|
+
calibpipe_test_data_dir
|
|
113
|
+
/ "telescope"
|
|
114
|
+
/ "throughput"
|
|
115
|
+
/ "muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8.h5"
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
@pytest.fixture(scope="session")
|
|
120
|
+
def muon_minus_r81_file(calibpipe_test_data_dir):
|
|
121
|
+
"""Fixture providing the μ- muon test file with reflectivity 0.81."""
|
|
122
|
+
return (
|
|
123
|
+
calibpipe_test_data_dir
|
|
124
|
+
/ "telescope"
|
|
125
|
+
/ "throughput"
|
|
126
|
+
/ "muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.81.h5"
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
@pytest.fixture(scope="session")
|
|
131
|
+
def muon_minus_r83_file(calibpipe_test_data_dir):
|
|
132
|
+
"""Fixture providing the μ- muon test file with reflectivity 0.83."""
|
|
133
|
+
return (
|
|
134
|
+
calibpipe_test_data_dir
|
|
135
|
+
/ "telescope"
|
|
136
|
+
/ "throughput"
|
|
137
|
+
/ "muon-_0deg_0deg_run000008___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.83.h5"
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@pytest.fixture(scope="session")
|
|
142
|
+
def muon_plus_r80_file(calibpipe_test_data_dir):
|
|
143
|
+
"""Fixture providing the μ+ muon test file with reflectivity 0.8."""
|
|
144
|
+
return (
|
|
145
|
+
calibpipe_test_data_dir
|
|
146
|
+
/ "telescope"
|
|
147
|
+
/ "throughput"
|
|
148
|
+
/ "muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8.h5"
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
@pytest.fixture(scope="session")
|
|
153
|
+
def muon_plus_r81_file(calibpipe_test_data_dir):
|
|
154
|
+
"""Fixture providing the μ+ muon test file with reflectivity 0.81."""
|
|
155
|
+
return (
|
|
156
|
+
calibpipe_test_data_dir
|
|
157
|
+
/ "telescope"
|
|
158
|
+
/ "throughput"
|
|
159
|
+
/ "muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.81.h5"
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@pytest.fixture(scope="session")
|
|
164
|
+
def muon_plus_r83_file(calibpipe_test_data_dir):
|
|
165
|
+
"""Fixture providing the μ+ muon test file with reflectivity 0.83."""
|
|
166
|
+
return (
|
|
167
|
+
calibpipe_test_data_dir
|
|
168
|
+
/ "telescope"
|
|
169
|
+
/ "throughput"
|
|
170
|
+
/ "muon+_0deg_0deg_run000012___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.83.h5"
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
# mst nc
|
|
175
|
+
@pytest.fixture(scope="session")
|
|
176
|
+
def muon_mst_nc_file(calibpipe_test_data_dir):
|
|
177
|
+
"""Fixture providing the μ+ muon test file with reflectivity 0.83. (MST-NC)"""
|
|
178
|
+
return (
|
|
179
|
+
calibpipe_test_data_dir
|
|
180
|
+
/ "telescope"
|
|
181
|
+
/ "throughput"
|
|
182
|
+
/ "muon+_0deg_0deg_run000006___cta-prod6-2156m-LaPalma-mst-nc-dark-ref-degraded-0.83.h5"
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
# mst fc
|
|
187
|
+
@pytest.fixture(scope="session")
|
|
188
|
+
def muon_mst_fc_file(calibpipe_test_data_dir):
|
|
189
|
+
"""Fixture providing the μ+ muon test file with reflectivity 0.83. (MST-FC)"""
|
|
190
|
+
return (
|
|
191
|
+
calibpipe_test_data_dir
|
|
192
|
+
/ "telescope"
|
|
193
|
+
/ "throughput"
|
|
194
|
+
/ "muon+_0deg_0deg_run000002___cta-prod6-2147m-Paranal-mst-fc-dark-ref-degraded-0.83.h5"
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
@pytest.fixture(scope="session")
|
|
199
|
+
def muon_test_files(
|
|
200
|
+
muon_minus_r80_file,
|
|
201
|
+
muon_minus_r81_file,
|
|
202
|
+
muon_minus_r83_file,
|
|
203
|
+
muon_plus_r80_file,
|
|
204
|
+
muon_plus_r81_file,
|
|
205
|
+
muon_plus_r83_file,
|
|
206
|
+
):
|
|
207
|
+
"""Fixture providing a dictionary of all muon test files organized by particle type and reflectivity (lst)."""
|
|
208
|
+
return {
|
|
209
|
+
"μ-": {
|
|
210
|
+
"0.80": muon_minus_r80_file,
|
|
211
|
+
"0.81": muon_minus_r81_file,
|
|
212
|
+
"0.83": muon_minus_r83_file,
|
|
213
|
+
},
|
|
214
|
+
"μ+": {
|
|
215
|
+
"0.80": muon_plus_r80_file,
|
|
216
|
+
"0.81": muon_plus_r81_file,
|
|
217
|
+
"0.83": muon_plus_r83_file,
|
|
218
|
+
},
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
@pytest.fixture(scope="session")
|
|
223
|
+
def flatfield_file(calibpipe_test_data_dir):
|
|
224
|
+
"""Fixture providing the flatfield calibration test file."""
|
|
225
|
+
return (
|
|
226
|
+
calibpipe_test_data_dir
|
|
227
|
+
/ "telescope"
|
|
228
|
+
/ "camera"
|
|
229
|
+
/ "flatfield_LST_dark.simtel.gz"
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
@pytest.fixture(scope="session")
|
|
234
|
+
def pedestal_file(calibpipe_test_data_dir):
|
|
235
|
+
"""Fixture providing the pedestal calibration test file."""
|
|
236
|
+
return (
|
|
237
|
+
calibpipe_test_data_dir / "telescope" / "camera" / "pedestal_LST_dark.simtel.gz"
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
@pytest.fixture(scope="session")
|
|
242
|
+
def muon_simtel_file(calibpipe_test_data_dir):
|
|
243
|
+
"""Fixture providing the pedestal calibration test file."""
|
|
244
|
+
return (
|
|
245
|
+
calibpipe_test_data_dir
|
|
246
|
+
/ "telescope"
|
|
247
|
+
/ "throughput"
|
|
248
|
+
/ "muon-_37.35deg_0deg_run000004___cta-prod6-2156m-LaPalma-lst-dark-ref-degraded-0.8_summer.simtel.zst"
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
@pytest.fixture(
|
|
253
|
+
scope="session", params=["single_chunk", "same_chunks", "different_chunks"]
|
|
254
|
+
)
|
|
255
|
+
def calibpipe_dl1_file(request, calibpipe_test_data_dir):
|
|
256
|
+
"""Fixture providing calibpipe DL1 test files with different chunking modes."""
|
|
257
|
+
mode = request.param
|
|
258
|
+
filename = f"high_statsagg_v1_{mode}.dl1.h5"
|
|
259
|
+
return calibpipe_test_data_dir / "telescope" / "camera" / filename
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
@pytest.fixture()
|
|
263
|
+
def tmp_test_data_dir():
|
|
264
|
+
"""
|
|
265
|
+
Fixture providing a temporary directory for test data.
|
|
266
|
+
|
|
267
|
+
This is useful for tests that need to create temporary files
|
|
268
|
+
or modify test data without affecting the cached versions.
|
|
269
|
+
"""
|
|
270
|
+
tmp_dir = Path(tempfile.mkdtemp(prefix="calibpipe_tmp_test_"))
|
|
271
|
+
try:
|
|
272
|
+
yield tmp_dir
|
|
273
|
+
finally:
|
|
274
|
+
shutil.rmtree(tmp_dir, ignore_errors=True)
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# %ECSV 1.0
|
|
2
|
+
# ---
|
|
3
|
+
# datatype:
|
|
4
|
+
# - {name: height, unit: m, datatype: float64}
|
|
5
|
+
# - {name: number density, unit: 1 / cm3, datatype: float64}
|
|
6
|
+
# schema: astropy-2.0
|
|
7
|
+
height "number density"
|
|
8
|
+
0.0 2.5226221253975482e+19
|
|
9
|
+
1000.0 2.2612248701943214e+19
|
|
10
|
+
2000.0 2.0188159791161926e+19
|
|
11
|
+
3000.0 1.821777495861036e+19
|
|
12
|
+
4000.0 1.6455659215053523e+19
|
|
13
|
+
5000.0 1.4943555611850443e+19
|
|
14
|
+
6000.0 1.3555512867555471e+19
|
|
15
|
+
7000.0 1.2239497020511496e+19
|
|
16
|
+
8000.0 1.1015931343575489e+19
|
|
17
|
+
9000.0 9.89813592093043e+18
|
|
18
|
+
10000.0 8.860096921932773e+18
|
|
19
|
+
11000.0 7.904336449894107e+18
|
|
20
|
+
12000.0 6.990997567438649e+18
|
|
21
|
+
13000.0 6.139328580924725e+18
|
|
22
|
+
14000.0 5.360396027080355e+18
|
|
23
|
+
15000.0 4.644145761612367e+18
|
|
24
|
+
16000.0 3.989701117077186e+18
|
|
25
|
+
17000.0 3.4018252254753705e+18
|
|
26
|
+
18000.0 2.88252588630463e+18
|
|
27
|
+
19000.0 2.428328176278362e+18
|
|
28
|
+
20000.0 2.035126555710463e+18
|
|
29
|
+
21000.0 1.6988154849148237e+18
|
|
30
|
+
22000.0 1.4152894242053386e+18
|
|
31
|
+
23000.0 1.1804428338959007e+18
|
|
32
|
+
24000.0 9.901701743004028e+17
|
|
33
|
+
25000.0 8.403659057327388e+17
|
|
34
|
+
26000.0 7.269244885068019e+17
|