gammasimtools 0.16.0__py3-none-any.whl → 0.17.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.
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.17.0.dist-info}/METADATA +4 -2
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.17.0.dist-info}/RECORD +60 -54
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.17.0.dist-info}/WHEEL +1 -1
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.17.0.dist-info}/entry_points.txt +3 -1
- simtools/_version.py +2 -2
- simtools/applications/derive_ctao_array_layouts.py +5 -5
- simtools/applications/generate_simtel_event_data.py +36 -46
- simtools/applications/merge_tables.py +104 -0
- simtools/applications/plot_array_layout.py +145 -258
- simtools/applications/production_derive_corsika_limits.py +35 -220
- simtools/applications/production_derive_statistics.py +77 -43
- simtools/applications/simulate_light_emission.py +1 -0
- simtools/applications/simulate_prod.py +30 -18
- simtools/applications/simulate_prod_htcondor_generator.py +0 -1
- simtools/applications/submit_array_layouts.py +93 -0
- simtools/applications/verify_simulation_model_production_tables.py +52 -0
- simtools/camera/camera_efficiency.py +3 -3
- simtools/configuration/commandline_parser.py +28 -34
- simtools/configuration/configurator.py +0 -4
- simtools/corsika/corsika_config.py +17 -12
- simtools/corsika/primary_particle.py +46 -13
- simtools/data_model/metadata_collector.py +7 -3
- simtools/db/db_handler.py +11 -11
- simtools/db/db_model_upload.py +2 -2
- simtools/io_operations/io_handler.py +2 -2
- simtools/io_operations/io_table_handler.py +345 -0
- simtools/job_execution/htcondor_script_generator.py +2 -2
- simtools/job_execution/job_manager.py +7 -121
- simtools/layout/array_layout_utils.py +385 -0
- simtools/model/array_model.py +5 -0
- simtools/model/model_repository.py +134 -0
- simtools/production_configuration/{calculate_statistical_errors_grid_point.py → calculate_statistical_uncertainties_grid_point.py} +101 -112
- simtools/production_configuration/derive_corsika_limits.py +239 -111
- simtools/production_configuration/derive_corsika_limits_grid.py +189 -0
- simtools/production_configuration/derive_production_statistics.py +57 -26
- simtools/production_configuration/derive_production_statistics_handler.py +70 -37
- simtools/production_configuration/interpolation_handler.py +296 -94
- simtools/ray_tracing/ray_tracing.py +7 -6
- simtools/reporting/docs_read_parameters.py +104 -62
- simtools/runners/corsika_simtel_runner.py +4 -1
- simtools/runners/runner_services.py +5 -4
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +41 -0
- simtools/schemas/production_configuration_metrics.schema.yml +2 -2
- simtools/simtel/simtel_config_writer.py +34 -14
- simtools/simtel/simtel_io_event_reader.py +301 -194
- simtools/simtel/simtel_io_event_writer.py +207 -227
- simtools/simtel/simtel_io_file_info.py +9 -4
- simtools/simtel/simtel_io_metadata.py +20 -5
- simtools/simtel/simulator_array.py +2 -2
- simtools/simtel/simulator_light_emission.py +79 -34
- simtools/simtel/simulator_ray_tracing.py +2 -2
- simtools/simulator.py +101 -68
- simtools/testing/validate_output.py +4 -1
- simtools/utils/general.py +1 -1
- simtools/utils/names.py +5 -5
- simtools/visualization/plot_array_layout.py +242 -0
- simtools/visualization/plot_pixels.py +681 -0
- simtools/visualization/visualize.py +3 -219
- simtools/applications/production_generate_simulation_config.py +0 -152
- simtools/layout/ctao_array_layouts.py +0 -172
- simtools/production_configuration/generate_simulation_config.py +0 -158
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.17.0.dist-info}/licenses/LICENSE +0 -0
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.17.0.dist-info}/top_level.txt +0 -0
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
"""Derives simulation configuration parameters for a grid point based on several metrics."""
|
|
2
|
-
|
|
3
|
-
from simtools.production_configuration.calculate_statistical_errors_grid_point import (
|
|
4
|
-
StatisticalErrorEvaluator,
|
|
5
|
-
)
|
|
6
|
-
from simtools.production_configuration.derive_production_statistics import (
|
|
7
|
-
ProductionStatisticsDerivator,
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
__all__ = ["SimulationConfig"]
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class SimulationConfig:
|
|
14
|
-
"""
|
|
15
|
-
Configures simulation parameters for a specific grid point.
|
|
16
|
-
|
|
17
|
-
Parameters
|
|
18
|
-
----------
|
|
19
|
-
grid_point : dict
|
|
20
|
-
Dictionary representing a grid point with azimuth, elevation, and night sky background.
|
|
21
|
-
file_path : str
|
|
22
|
-
Path to the DL2 MC event file for statistical uncertainty evaluation.
|
|
23
|
-
metrics : dict, optional
|
|
24
|
-
Dictionary of metrics to evaluate.
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
def __init__(
|
|
28
|
-
self,
|
|
29
|
-
grid_point: dict[str, float],
|
|
30
|
-
file_path: str,
|
|
31
|
-
metrics: dict[str, float] | None = None,
|
|
32
|
-
):
|
|
33
|
-
"""Initialize the simulation configuration for a grid point."""
|
|
34
|
-
self.grid_point = grid_point
|
|
35
|
-
self.file_path = file_path
|
|
36
|
-
self.metrics = metrics or {}
|
|
37
|
-
self.evaluator = StatisticalErrorEvaluator(file_path, metrics)
|
|
38
|
-
self.derive_production_statistics = ProductionStatisticsDerivator(
|
|
39
|
-
self.evaluator, self.metrics
|
|
40
|
-
)
|
|
41
|
-
self.simulation_params = {}
|
|
42
|
-
|
|
43
|
-
def configure_simulation(self) -> dict[str, float]:
|
|
44
|
-
"""
|
|
45
|
-
Configure the simulation parameters for the grid point.
|
|
46
|
-
|
|
47
|
-
Returns
|
|
48
|
-
-------
|
|
49
|
-
dict
|
|
50
|
-
A dictionary with simulation parameters such as core scatter area,
|
|
51
|
-
viewcone, and number of simulated events.
|
|
52
|
-
"""
|
|
53
|
-
self.simulation_params = {
|
|
54
|
-
"core_scatter_area": self._calculate_core_scatter_area(),
|
|
55
|
-
"viewcone": self._calculate_viewcone(),
|
|
56
|
-
"number_of_events": self.calculate_required_events(),
|
|
57
|
-
}
|
|
58
|
-
return self.simulation_params
|
|
59
|
-
|
|
60
|
-
def calculate_required_events(self) -> int:
|
|
61
|
-
"""
|
|
62
|
-
Calculate the required number of simulated events based on statistical error metrics.
|
|
63
|
-
|
|
64
|
-
Uses the ProductionStatisticsDerivator to scale the events.
|
|
65
|
-
|
|
66
|
-
Returns
|
|
67
|
-
-------
|
|
68
|
-
int
|
|
69
|
-
The number of simulated events required.
|
|
70
|
-
"""
|
|
71
|
-
return self.derive_production_statistics.derive_statistics()
|
|
72
|
-
|
|
73
|
-
def _calculate_core_scatter_area(self) -> float:
|
|
74
|
-
"""
|
|
75
|
-
Calculate the core scatter area based on the grid point.
|
|
76
|
-
|
|
77
|
-
Returns
|
|
78
|
-
-------
|
|
79
|
-
float
|
|
80
|
-
The core scatter area.
|
|
81
|
-
"""
|
|
82
|
-
base_area = self._fetch_simulated_core_scatter_area()
|
|
83
|
-
area_factor = self._get_area_factor_from_grid_point()
|
|
84
|
-
return base_area * area_factor
|
|
85
|
-
|
|
86
|
-
def _calculate_viewcone(self) -> float:
|
|
87
|
-
"""
|
|
88
|
-
Calculate the viewcone based on the grid point conditions.
|
|
89
|
-
|
|
90
|
-
Returns
|
|
91
|
-
-------
|
|
92
|
-
float
|
|
93
|
-
The viewcone value.
|
|
94
|
-
"""
|
|
95
|
-
base_viewcone = self._fetch_simulated_viewcone()
|
|
96
|
-
viewcone_factor = self._get_viewcone_factor_from_grid_point()
|
|
97
|
-
|
|
98
|
-
return base_viewcone * viewcone_factor
|
|
99
|
-
|
|
100
|
-
def _get_area_factor_from_grid_point(self) -> float:
|
|
101
|
-
"""
|
|
102
|
-
Determine the area factor.
|
|
103
|
-
|
|
104
|
-
The area factor is based on the grid point's azimuth,
|
|
105
|
-
elevation, and night sky background.
|
|
106
|
-
|
|
107
|
-
Returns
|
|
108
|
-
-------
|
|
109
|
-
float
|
|
110
|
-
The area factor.
|
|
111
|
-
"""
|
|
112
|
-
azimuth = self.grid_point.get("azimuth", 0)
|
|
113
|
-
elevation = self.grid_point.get("elevation", 0)
|
|
114
|
-
night_sky_background = self.grid_point.get("night_sky_background", 0)
|
|
115
|
-
|
|
116
|
-
# Implement reading of factor from LUT
|
|
117
|
-
return azimuth + elevation + night_sky_background
|
|
118
|
-
|
|
119
|
-
def _get_viewcone_factor_from_grid_point(self) -> float:
|
|
120
|
-
"""
|
|
121
|
-
Determine the viewcone factor.
|
|
122
|
-
|
|
123
|
-
The factor is based on the grid point's azimuth,
|
|
124
|
-
elevation, and night sky background.
|
|
125
|
-
|
|
126
|
-
Returns
|
|
127
|
-
-------
|
|
128
|
-
float
|
|
129
|
-
The viewcone factor.
|
|
130
|
-
"""
|
|
131
|
-
azimuth = self.grid_point.get("azimuth", 0)
|
|
132
|
-
elevation = self.grid_point.get("elevation", 0)
|
|
133
|
-
night_sky_background = self.grid_point.get("night_sky_background", 0)
|
|
134
|
-
|
|
135
|
-
# Implement reading of factor from LUT
|
|
136
|
-
return azimuth + elevation + night_sky_background
|
|
137
|
-
|
|
138
|
-
def _fetch_simulated_core_scatter_area(self) -> float:
|
|
139
|
-
"""
|
|
140
|
-
Fetch the core scatter area from existing simulated files based on grid point conditions.
|
|
141
|
-
|
|
142
|
-
Returns
|
|
143
|
-
-------
|
|
144
|
-
float
|
|
145
|
-
The fetched core scatter outer bound.
|
|
146
|
-
"""
|
|
147
|
-
return self.evaluator.data["core_range"]
|
|
148
|
-
|
|
149
|
-
def _fetch_simulated_viewcone(self) -> float:
|
|
150
|
-
"""
|
|
151
|
-
Fetch the viewcone from existing simulated files based on grid point conditions.
|
|
152
|
-
|
|
153
|
-
Returns
|
|
154
|
-
-------
|
|
155
|
-
float
|
|
156
|
-
The fetched viewcone outer bound.
|
|
157
|
-
"""
|
|
158
|
-
return self.evaluator.data["viewcone"]
|
|
File without changes
|
|
File without changes
|