gammasimtools 0.15.0__py3-none-any.whl → 0.16.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. {gammasimtools-0.15.0.dist-info → gammasimtools-0.16.0.dist-info}/METADATA +2 -32
  2. {gammasimtools-0.15.0.dist-info → gammasimtools-0.16.0.dist-info}/RECORD +222 -214
  3. {gammasimtools-0.15.0.dist-info → gammasimtools-0.16.0.dist-info}/WHEEL +1 -1
  4. {gammasimtools-0.15.0.dist-info → gammasimtools-0.16.0.dist-info}/entry_points.txt +5 -2
  5. simtools/_version.py +2 -2
  6. simtools/applications/calculate_trigger_rate.py +10 -10
  7. simtools/applications/convert_all_model_parameters_from_simtel.py +16 -16
  8. simtools/applications/convert_model_parameter_from_simtel.py +1 -1
  9. simtools/applications/derive_psf_parameters.py +12 -9
  10. simtools/applications/docs_produce_array_element_report.py +3 -3
  11. simtools/applications/docs_produce_calibration_reports.py +49 -0
  12. simtools/applications/docs_produce_simulation_configuration_report.py +50 -0
  13. simtools/applications/{generate_simtel_array_histograms.py → generate_sim_telarray_histograms.py} +2 -2
  14. simtools/applications/production_derive_corsika_limits.py +63 -10
  15. simtools/applications/production_derive_statistics.py +125 -0
  16. simtools/applications/production_generate_grid.py +197 -0
  17. simtools/applications/production_generate_simulation_config.py +0 -10
  18. simtools/applications/simulate_light_emission.py +5 -13
  19. simtools/applications/simulate_prod.py +16 -4
  20. simtools/applications/validate_cumulative_psf.py +6 -4
  21. simtools/applications/validate_file_using_schema.py +7 -3
  22. simtools/applications/validate_optics.py +5 -4
  23. simtools/camera/camera_efficiency.py +14 -39
  24. simtools/configuration/commandline_parser.py +4 -3
  25. simtools/configuration/configurator.py +10 -0
  26. simtools/corsika/corsika_config.py +103 -5
  27. simtools/data_model/format_checkers.py +9 -0
  28. simtools/data_model/model_data_writer.py +3 -0
  29. simtools/data_model/schema.py +27 -16
  30. simtools/data_model/validate_data.py +27 -7
  31. simtools/db/db_handler.py +10 -4
  32. simtools/layout/array_layout.py +1 -0
  33. simtools/model/array_model.py +63 -29
  34. simtools/model/model_parameter.py +76 -51
  35. simtools/model/model_utils.py +43 -1
  36. simtools/model/site_model.py +3 -2
  37. simtools/model/telescope_model.py +4 -4
  38. simtools/production_configuration/calculate_statistical_errors_grid_point.py +0 -4
  39. simtools/production_configuration/{event_scaler.py → derive_production_statistics.py} +24 -20
  40. simtools/production_configuration/derive_production_statistics_handler.py +119 -0
  41. simtools/production_configuration/generate_production_grid.py +364 -0
  42. simtools/production_configuration/generate_simulation_config.py +9 -9
  43. simtools/production_configuration/interpolation_handler.py +16 -11
  44. simtools/ray_tracing/mirror_panel_psf.py +16 -20
  45. simtools/ray_tracing/psf_analysis.py +2 -2
  46. simtools/ray_tracing/ray_tracing.py +5 -1
  47. simtools/reporting/docs_read_parameters.py +361 -58
  48. simtools/runners/corsika_runner.py +11 -1
  49. simtools/runners/corsika_simtel_runner.py +80 -89
  50. simtools/runners/runner_services.py +17 -4
  51. simtools/runners/simtel_runner.py +27 -10
  52. simtools/schemas/model_parameter.metaschema.yml +4 -0
  53. simtools/schemas/model_parameter_and_data_schema.metaschema.yml +1 -0
  54. simtools/schemas/model_parameters/adjust_gain.schema.yml +2 -2
  55. simtools/schemas/model_parameters/array_element_position_ground.schema.yml +2 -2
  56. simtools/schemas/model_parameters/array_element_position_utm.schema.yml +2 -2
  57. simtools/schemas/model_parameters/array_window.schema.yml +2 -2
  58. simtools/schemas/model_parameters/asum_offset.schema.yml +2 -2
  59. simtools/schemas/model_parameters/asum_shaping.schema.yml +2 -2
  60. simtools/schemas/model_parameters/asum_threshold.schema.yml +2 -2
  61. simtools/schemas/model_parameters/axes_offsets.schema.yml +2 -2
  62. simtools/schemas/model_parameters/camera_body_diameter.schema.yml +2 -2
  63. simtools/schemas/model_parameters/camera_body_shape.schema.yml +2 -2
  64. simtools/schemas/model_parameters/camera_config_file.schema.yml +2 -2
  65. simtools/schemas/model_parameters/camera_config_rotate.schema.yml +2 -2
  66. simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +2 -2
  67. simtools/schemas/model_parameters/camera_degraded_map.schema.yml +2 -2
  68. simtools/schemas/model_parameters/camera_depth.schema.yml +2 -2
  69. simtools/schemas/model_parameters/camera_filter.schema.yml +2 -2
  70. simtools/schemas/model_parameters/camera_pixels.schema.yml +2 -2
  71. simtools/schemas/model_parameters/camera_transmission.schema.yml +2 -2
  72. simtools/schemas/model_parameters/channels_per_chip.schema.yml +2 -2
  73. simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +2 -2
  74. simtools/schemas/model_parameters/corsika_starting_grammage.schema.yml +90 -1
  75. simtools/schemas/model_parameters/default_trigger.schema.yml +2 -2
  76. simtools/schemas/model_parameters/design_model.schema.yml +2 -2
  77. simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +2 -2
  78. simtools/schemas/model_parameters/disc_bins.schema.yml +2 -2
  79. simtools/schemas/model_parameters/disc_start.schema.yml +2 -2
  80. simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +2 -2
  81. simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +2 -2
  82. simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +2 -2
  83. simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +2 -2
  84. simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +2 -2
  85. simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +2 -2
  86. simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +2 -2
  87. simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +2 -2
  88. simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +2 -2
  89. simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +2 -2
  90. simtools/schemas/model_parameters/discriminator_threshold.schema.yml +2 -2
  91. simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +2 -2
  92. simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +2 -2
  93. simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +2 -2
  94. simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +2 -2
  95. simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +2 -2
  96. simtools/schemas/model_parameters/dish_shape_length.schema.yml +2 -2
  97. simtools/schemas/model_parameters/dsum_clipping.schema.yml +2 -2
  98. simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +2 -2
  99. simtools/schemas/model_parameters/dsum_offset.schema.yml +2 -2
  100. simtools/schemas/model_parameters/dsum_pedsub.schema.yml +2 -2
  101. simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +2 -2
  102. simtools/schemas/model_parameters/dsum_prescale.schema.yml +2 -2
  103. simtools/schemas/model_parameters/dsum_presum_max.schema.yml +2 -2
  104. simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +2 -2
  105. simtools/schemas/model_parameters/dsum_shaping.schema.yml +2 -2
  106. simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +2 -2
  107. simtools/schemas/model_parameters/dsum_threshold.schema.yml +3 -3
  108. simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +2 -2
  109. simtools/schemas/model_parameters/effective_focal_length.schema.yml +2 -2
  110. simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +2 -2
  111. simtools/schemas/model_parameters/fadc_amplitude.schema.yml +2 -2
  112. simtools/schemas/model_parameters/fadc_bins.schema.yml +2 -2
  113. simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +2 -2
  114. simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +2 -2
  115. simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +2 -2
  116. simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +2 -2
  117. simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +2 -2
  118. simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +2 -2
  119. simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +2 -2
  120. simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +2 -2
  121. simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +2 -2
  122. simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +2 -2
  123. simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +2 -2
  124. simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +2 -2
  125. simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +2 -2
  126. simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +2 -2
  127. simtools/schemas/model_parameters/fadc_max_signal.schema.yml +2 -2
  128. simtools/schemas/model_parameters/fadc_mhz.schema.yml +2 -2
  129. simtools/schemas/model_parameters/fadc_noise.schema.yml +2 -2
  130. simtools/schemas/model_parameters/fadc_pedestal.schema.yml +2 -2
  131. simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +2 -2
  132. simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +2 -2
  133. simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +2 -2
  134. simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +2 -2
  135. simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +2 -2
  136. simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +2 -2
  137. simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +2 -2
  138. simtools/schemas/model_parameters/fake_mirror_list.schema.yml +1 -1
  139. simtools/schemas/model_parameters/flatfielding.schema.yml +2 -2
  140. simtools/schemas/model_parameters/focal_length.schema.yml +2 -2
  141. simtools/schemas/model_parameters/focus_offset.schema.yml +2 -2
  142. simtools/schemas/model_parameters/gain_variation.schema.yml +2 -2
  143. simtools/schemas/model_parameters/hg_lg_variation.schema.yml +2 -2
  144. simtools/schemas/model_parameters/iobuf_maximum.schema.yml +2 -2
  145. simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +2 -2
  146. simtools/schemas/model_parameters/laser_events.schema.yml +1 -1
  147. simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +2 -2
  148. simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +2 -2
  149. simtools/schemas/model_parameters/min_photoelectrons.schema.yml +2 -2
  150. simtools/schemas/model_parameters/min_photons.schema.yml +2 -2
  151. simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +2 -2
  152. simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +2 -2
  153. simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +2 -2
  154. simtools/schemas/model_parameters/mirror_class.schema.yml +2 -2
  155. simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +2 -2
  156. simtools/schemas/model_parameters/mirror_focal_length.schema.yml +2 -2
  157. simtools/schemas/model_parameters/mirror_list.schema.yml +2 -2
  158. simtools/schemas/model_parameters/mirror_offset.schema.yml +2 -2
  159. simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +2 -2
  160. simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +2 -2
  161. simtools/schemas/model_parameters/multiplicity_offset.schema.yml +2 -2
  162. simtools/schemas/model_parameters/muon_mono_threshold.schema.yml +2 -2
  163. simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +2 -2
  164. simtools/schemas/model_parameters/nsb_offaxis.schema.yml +2 -2
  165. simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +2 -2
  166. simtools/schemas/model_parameters/num_gains.schema.yml +2 -2
  167. simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +2 -2
  168. simtools/schemas/model_parameters/optics_properties.schema.yml +2 -2
  169. simtools/schemas/model_parameters/pedestal_events.schema.yml +7 -3
  170. simtools/schemas/model_parameters/photon_delay.schema.yml +2 -2
  171. simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +2 -2
  172. simtools/schemas/model_parameters/pm_average_gain.schema.yml +2 -2
  173. simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +2 -2
  174. simtools/schemas/model_parameters/pm_gain_index.schema.yml +2 -2
  175. simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +2 -2
  176. simtools/schemas/model_parameters/pm_transit_time.schema.yml +2 -2
  177. simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +2 -2
  178. simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +2 -2
  179. simtools/schemas/model_parameters/qe_variation.schema.yml +2 -2
  180. simtools/schemas/model_parameters/quantum_efficiency.schema.yml +2 -2
  181. simtools/schemas/model_parameters/random_focal_length.schema.yml +2 -2
  182. simtools/schemas/model_parameters/random_generator.schema.yml +2 -2
  183. simtools/schemas/model_parameters/random_mono_probability.schema.yml +2 -2
  184. simtools/schemas/model_parameters/sampled_output.schema.yml +2 -2
  185. simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +2 -2
  186. simtools/schemas/model_parameters/store_photoelectrons.schema.yml +2 -2
  187. simtools/schemas/model_parameters/tailcut_scale.schema.yml +2 -2
  188. simtools/schemas/model_parameters/telescope_axis_height.schema.yml +2 -2
  189. simtools/schemas/model_parameters/telescope_random_angle.schema.yml +2 -2
  190. simtools/schemas/model_parameters/telescope_random_error.schema.yml +2 -2
  191. simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +2 -2
  192. simtools/schemas/model_parameters/telescope_transmission.schema.yml +2 -2
  193. simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +2 -2
  194. simtools/schemas/model_parameters/teltrig_min_time.schema.yml +2 -2
  195. simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +2 -2
  196. simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +2 -2
  197. simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +2 -2
  198. simtools/schemas/model_parameters/transit_time_error.schema.yml +2 -2
  199. simtools/schemas/model_parameters/transit_time_jitter.schema.yml +2 -2
  200. simtools/schemas/model_parameters/trigger_current_limit.schema.yml +2 -2
  201. simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +2 -2
  202. simtools/schemas/model_parameters/trigger_pixels.schema.yml +2 -2
  203. simtools/simtel/simtel_config_reader.py +21 -17
  204. simtools/simtel/simtel_config_writer.py +237 -65
  205. simtools/simtel/simtel_io_file_info.py +57 -0
  206. simtools/simtel/simtel_io_histogram.py +10 -14
  207. simtools/simtel/simtel_io_histograms.py +2 -2
  208. simtools/simtel/simtel_io_metadata.py +91 -0
  209. simtools/simtel/simulator_array.py +26 -12
  210. simtools/simtel/simulator_camera_efficiency.py +12 -6
  211. simtools/simtel/simulator_light_emission.py +6 -11
  212. simtools/simtel/simulator_ray_tracing.py +14 -4
  213. simtools/simulator.py +230 -66
  214. simtools/testing/configuration.py +5 -0
  215. simtools/testing/helpers.py +18 -0
  216. simtools/testing/sim_telarray_metadata.py +212 -0
  217. simtools/testing/validate_output.py +12 -5
  218. simtools/utils/general.py +18 -27
  219. simtools/utils/names.py +27 -5
  220. simtools/visualization/visualize.py +2 -2
  221. simtools/applications/production_scale_events.py +0 -185
  222. {gammasimtools-0.15.0.dist-info → gammasimtools-0.16.0.dist-info}/licenses/LICENSE +0 -0
  223. {gammasimtools-0.15.0.dist-info → gammasimtools-0.16.0.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -15,19 +15,22 @@ simtools-derive-mirror-rnda = simtools.applications.derive_mirror_rnda:main
15
15
  simtools-derive-photon-electron-spectrum = simtools.applications.derive_photon_electron_spectrum:main
16
16
  simtools-derive-psf-parameters = simtools.applications.derive_psf_parameters:main
17
17
  simtools-docs-produce-array-element-report = simtools.applications.docs_produce_array_element_report:main
18
+ simtools-docs-produce-calibration-reports = simtools.applications.docs_produce_calibration_reports:main
18
19
  simtools-docs-produce-model-parameter-reports = simtools.applications.docs_produce_model_parameter_reports:main
20
+ simtools-docs-produce-simulation-configuration-report = simtools.applications.docs_produce_simulation_configuration_report:main
19
21
  simtools-generate-array-config = simtools.applications.generate_array_config:main
20
22
  simtools-generate-corsika-histograms = simtools.applications.generate_corsika_histograms:main
21
23
  simtools-generate-default-metadata = simtools.applications.generate_default_metadata:main
22
24
  simtools-generate-regular-arrays = simtools.applications.generate_regular_arrays:main
23
- simtools-generate-simtel-array-histograms = simtools.applications.generate_simtel_array_histograms:main
25
+ simtools-generate-sim-telarray-histograms = simtools.applications.generate_sim_telarray_histograms:main
24
26
  simtools-generate-simtel-event-data = simtools.applications.generate_simtel_event_data:main
25
27
  simtools-plot-array-layout = simtools.applications.plot_array_layout:main
26
28
  simtools-plot-tabular-data = simtools.applications.plot_tabular_data:main
27
29
  simtools-print-version = simtools.applications.print_version:main
28
30
  simtools-production-derive-corsika-limits = simtools.applications.production_derive_corsika_limits:main
31
+ simtools-production-derive-statistics = simtools.applications.production_derive_statistics:main
32
+ simtools-production-generate-grid = simtools.applications.production_generate_grid:main
29
33
  simtools-production-generate-simulation-config = simtools.applications.production_generate_simulation_config:main
30
- simtools-production-scale-events = simtools.applications.production_scale_events:main
31
34
  simtools-run-application = simtools.applications.run_application:main
32
35
  simtools-simulate-light-emission = simtools.applications.simulate_light_emission:main
33
36
  simtools-simulate-prod = simtools.applications.simulate_prod:main
simtools/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.15.0'
21
- __version_tuple__ = version_tuple = (0, 15, 0)
20
+ __version__ = version = '0.16.0'
21
+ __version_tuple__ = version_tuple = (0, 16, 0)
@@ -3,14 +3,14 @@
3
3
  r"""
4
4
  Calculates array or single-telescope trigger rates.
5
5
 
6
- The applications reads from a simtel_array output file, a list of
7
- simtel_array output files ou from a file containing a list of simtel_array files.
6
+ The applications reads from a sim_telarray output file, a list of
7
+ sim_telarray output files ou from a file containing a list of sim_telarray files.
8
8
 
9
9
 
10
10
  Command line arguments
11
11
  ----------------------
12
12
  simtel_file_names (str or list):
13
- Path to the simtel_array file or a list of simtel_array output files.
13
+ Path to the sim_telarray file or a list of sim_telarray output files.
14
14
  Files can be generated in `simulate_prod` using the ``--save_file_lists`` option.
15
15
  save_tables (bool):
16
16
  If true, save the tables with the energy-dependent trigger rate to a ecsv file.
@@ -28,7 +28,7 @@ area_from_distribution (bool):
28
28
 
29
29
  Example
30
30
  -------
31
- Calculate trigger rate from simtel_array file
31
+ Calculate trigger rate from sim_telarray file
32
32
 
33
33
  .. code-block:: console
34
34
 
@@ -73,8 +73,8 @@ def _parse(label, description):
73
73
 
74
74
  config.parser.add_argument(
75
75
  "--simtel_file_names",
76
- help="Name of the simtel_array output files to be calculate the trigger rate from or the "
77
- "text file containing the list of simtel_array output files.",
76
+ help="Name of the sim_telarray output files to be calculate the trigger rate from or the "
77
+ "text file containing the list of sim_telarray output files.",
78
78
  nargs="+",
79
79
  required=True,
80
80
  type=str,
@@ -136,20 +136,20 @@ def _get_simulation_parameters(config_parser):
136
136
  def main(): # noqa: D103
137
137
  label = Path(__file__).stem
138
138
  description = (
139
- "Calculates the simulated and triggered event rate based on simtel_array output files."
139
+ "Calculates the simulated and triggered event rate based on sim_telarray output files."
140
140
  )
141
141
  config_parser = _parse(label, description)
142
142
 
143
143
  logger = logging.getLogger()
144
144
  logger.setLevel(gen.get_log_level_from_user(config_parser["log_level"]))
145
145
 
146
- simtel_array_files = gen.get_list_of_files_from_command_line(
146
+ sim_telarray_files = gen.get_list_of_files_from_command_line(
147
147
  config_parser["simtel_file_names"], [".zst", ".simtel", ".hdata"]
148
148
  )
149
149
  energy_range, view_cone = _get_simulation_parameters(config_parser)
150
150
 
151
151
  histograms = SimtelIOHistograms(
152
- simtel_array_files,
152
+ sim_telarray_files,
153
153
  area_from_distribution=config_parser["area_from_distribution"],
154
154
  energy_range=energy_range,
155
155
  view_cone=view_cone,
@@ -177,7 +177,7 @@ def main(): # noqa: D103
177
177
  output_path = io_handler_instance.get_output_directory(label, sub_dir="application-plots")
178
178
  for i_table, table in enumerate(trigger_rate_in_tables):
179
179
  output_file = (
180
- str(output_path.joinpath(Path(simtel_array_files[i_table]).stem)) + ".ecsv"
180
+ str(output_path.joinpath(Path(sim_telarray_files[i_table]).stem)) + ".ecsv"
181
181
  )
182
182
  logger.info(f"Writing table {i_table + 1} to {output_file}")
183
183
  table.write(output_file, overwrite=True)
@@ -4,7 +4,7 @@ r"""
4
4
 
5
5
  Check value, type, and range, convert units using schema files. Write json files
6
6
  ready to be submitted to the model database. Prints out parameters which are not found
7
- in simtel configuration file and parameters which are not found in simtools schema files.
7
+ in sim_telarray configuration file and parameters which are not found in simtools schema files.
8
8
 
9
9
  Note that all parameters are assigned the same parameter version.
10
10
 
@@ -44,7 +44,7 @@ r"""
44
44
  2>|/dev/null | grep '(@cfg)' | sed 's/^(@cfg) //' >| all_telescope_config_paranal.cfg
45
45
 
46
46
 
47
- Extract then model parameters from the simtel_array configuration file for LSTN-01
47
+ Extract then model parameters from the sim_telarray configuration file for LSTN-01
48
48
  (telescopes are named CT1, CT2, ..., in the sim_telarray configuration file and must be
49
49
  provided in the "simtel_telescope_name" command line argument)
50
50
  and write json files in the same format as the model parameter database:
@@ -94,7 +94,7 @@ def _parse(label=None, description=None):
94
94
 
95
95
  config.parser.add_argument(
96
96
  "--simtel_cfg_file",
97
- help="File name for simtel_array configuration",
97
+ help="File name for sim_telarray configuration",
98
98
  type=str,
99
99
  required=True,
100
100
  )
@@ -116,7 +116,7 @@ def _parse(label=None, description=None):
116
116
 
117
117
  def read_simtel_config_file(args_dict, schema_file, camera_pixels=None):
118
118
  """
119
- Read the simtel configuration file.
119
+ Read the sim_telarray configuration file.
120
120
 
121
121
  Parameters
122
122
  ----------
@@ -146,7 +146,7 @@ def read_simtel_config_file(args_dict, schema_file, camera_pixels=None):
146
146
 
147
147
  def get_number_of_camera_pixel(args_dict, logger):
148
148
  """
149
- Get the number of camera pixels from the simtel configuration file.
149
+ Get the number of camera pixels from the sim_telarray configuration file.
150
150
 
151
151
  Required to set the dimension some of the parameter correctly, as simtel
152
152
  in some cases does not provide the dimension ('all:' in the parameter files).
@@ -178,7 +178,7 @@ def get_number_of_camera_pixel(args_dict, logger):
178
178
 
179
179
  def read_and_export_parameters(args_dict, logger):
180
180
  """
181
- Read and export parameters from simtel configuration file to json files.
181
+ Read and export parameters from sim_telarray configuration file to json files.
182
182
 
183
183
  Provide extensive logging information on the parameters found in the simtel
184
184
  configuration file.
@@ -193,16 +193,16 @@ def read_and_export_parameters(args_dict, logger):
193
193
  Returns
194
194
  -------
195
195
  list
196
- List of simtel parameters not found in schema files.
196
+ List of sim_telarray parameters not found in schema files.
197
197
  list
198
- List of simtools parameter not found in simtel configuration file.
198
+ List of simtools parameter not found in sim_telarray configuration file.
199
199
 
200
200
  """
201
- _parameters, _schema_files = schema.get_get_model_parameter_schema_files()
201
+ _parameters, _schema_files = schema.get_model_parameter_schema_files()
202
202
  _simtel_parameters = simtel_config_reader.get_list_of_simtel_parameters(
203
203
  args_dict["simtel_cfg_file"]
204
204
  )
205
- logger.info(f"Found {len(_simtel_parameters)} parameters in simtel configuration file.")
205
+ logger.info(f"Found {len(_simtel_parameters)} parameters in sim_telarray configuration file.")
206
206
 
207
207
  io_handler = IOHandler()
208
208
  io_handler.set_paths(output_path=args_dict["output_path"])
@@ -223,7 +223,7 @@ def read_and_export_parameters(args_dict, logger):
223
223
  _parameters_not_in_simtel.append(_parameter)
224
224
  continue
225
225
 
226
- logger.info(f"Simtel parameter: {config_reader.parameter_dict}")
226
+ logger.info(f"sim_telarray parameter: {config_reader.parameter_dict}")
227
227
 
228
228
  _json_dict = writer.ModelDataWriter.dump_model_parameter(
229
229
  parameter_name=_parameter,
@@ -252,15 +252,15 @@ def print_parameters_not_found(_parameters_not_in_simtel, _simtel_parameters, ar
252
252
  """
253
253
  Print simtel/simtools parameter not found in schema and configuration files.
254
254
 
255
- For simtel parameters not found, check if the setting for the chose
255
+ For sim_telarray parameters not found, check if the setting for the chose
256
256
  telescope is different from the default values.
257
257
 
258
258
  Parameters
259
259
  ----------
260
260
  _parameters_not_in_simtel: list
261
- List of simtel parameters not found in schema files.
261
+ List of sim_telarray parameters not found in schema files.
262
262
  _simtel_parameters: list
263
- List of simtel parameters not found in simtools schema files.
263
+ List of sim_telarray parameters not found in simtools schema files.
264
264
  args_dict: dict
265
265
  Dictionary with command line arguments.
266
266
  logger: logging.Logger
@@ -273,9 +273,9 @@ def print_parameters_not_found(_parameters_not_in_simtel, _simtel_parameters, ar
273
273
  for para in sorted(_parameters_not_in_simtel):
274
274
  logger.info(f" {para}")
275
275
 
276
- logger.info(f"Simtel parameters not found in schema files ({len(_simtel_parameters)}):")
276
+ logger.info(f"sim_telarray parameters not found in schema files ({len(_simtel_parameters)}):")
277
277
  for para in sorted(_simtel_parameters):
278
- logger.info(f"Simtel parameter: {para}")
278
+ logger.info(f"sim_telarray parameter: {para}")
279
279
  config_reader = simtel_config_reader.SimtelConfigReader(
280
280
  schema_file=None,
281
281
  simtel_config_file=args_dict["simtel_cfg_file"],
@@ -68,7 +68,7 @@ def _parse(label=None, description=None):
68
68
  )
69
69
  config.parser.add_argument(
70
70
  "--simtel_cfg_file",
71
- help="File name for simtel_array configuration",
71
+ help="File name for sim_telarray configuration",
72
72
  type=str,
73
73
  required=True,
74
74
  )
@@ -93,7 +93,7 @@ from matplotlib.backends.backend_pdf import PdfPages
93
93
  import simtools.utils.general as gen
94
94
  from simtools.configuration import configurator
95
95
  from simtools.io_operations import io_handler
96
- from simtools.model.telescope_model import TelescopeModel
96
+ from simtools.model.model_utils import initialize_simulation_models
97
97
  from simtools.ray_tracing.ray_tracing import RayTracing
98
98
  from simtools.visualization import visualize
99
99
 
@@ -304,7 +304,7 @@ def calculate_rmsd(data, sim):
304
304
  return np.sqrt(np.mean((data - sim) ** 2))
305
305
 
306
306
 
307
- def run_pars(tel_model, args_dict, pars, data_to_plot, radius, pdf_pages):
307
+ def run_pars(tel_model, site_model, args_dict, pars, data_to_plot, radius, pdf_pages):
308
308
  """
309
309
  Run the tuning for one set of parameters, add a plot to the pdfPages and return RMSD and D80.
310
310
 
@@ -319,6 +319,7 @@ def run_pars(tel_model, args_dict, pars, data_to_plot, radius, pdf_pages):
319
319
 
320
320
  ray = RayTracing(
321
321
  telescope_model=tel_model,
322
+ site_model=site_model,
322
323
  simtel_path=args_dict["simtel_path"],
323
324
  zenith_angle=args_dict["zenith"] * u.deg,
324
325
  source_distance=args_dict["src_distance"] * u.km,
@@ -370,7 +371,9 @@ def run_pars(tel_model, args_dict, pars, data_to_plot, radius, pdf_pages):
370
371
  return d80, rmsd
371
372
 
372
373
 
373
- def find_best_parameters(all_parameters, tel_model, args_dict, data_to_plot, radius, pdf_pages):
374
+ def find_best_parameters(
375
+ all_parameters, tel_model, site_model, args_dict, data_to_plot, radius, pdf_pages
376
+ ):
374
377
  """
375
378
  Find the best parameters from all parameter sets.
376
379
 
@@ -382,7 +385,7 @@ def find_best_parameters(all_parameters, tel_model, args_dict, data_to_plot, rad
382
385
  best_pars = None
383
386
 
384
387
  for pars in all_parameters:
385
- _, rmsd = run_pars(tel_model, args_dict, pars, data_to_plot, radius, pdf_pages)
388
+ _, rmsd = run_pars(tel_model, site_model, args_dict, pars, data_to_plot, radius, pdf_pages)
386
389
  if rmsd < min_rmsd:
387
390
  min_rmsd = rmsd
388
391
  best_pars = pars
@@ -400,12 +403,12 @@ def main(): # noqa: D103
400
403
  # Output directory to save files related directly to this app
401
404
  _io_handler = io_handler.IOHandler()
402
405
  output_dir = _io_handler.get_output_directory(label, sub_dir="application-plots")
403
- tel_model = TelescopeModel(
406
+ tel_model, site_model = initialize_simulation_models(
407
+ label=label,
408
+ db_config=db_config,
404
409
  site=args_dict["site"],
405
410
  telescope_name=args_dict["telescope"],
406
- mongo_db_config=db_config,
407
411
  model_version=args_dict["model_version"],
408
- label=label,
409
412
  )
410
413
 
411
414
  all_parameters = []
@@ -424,11 +427,11 @@ def main(): # noqa: D103
424
427
  pdf_pages = PdfPages(plot_file)
425
428
 
426
429
  best_pars, _ = find_best_parameters(
427
- all_parameters, tel_model, args_dict, data_to_plot, radius, pdf_pages
430
+ all_parameters, tel_model, site_model, args_dict, data_to_plot, radius, pdf_pages
428
431
  )
429
432
 
430
433
  # Rerunning and plotting the best pars
431
- run_pars(tel_model, args_dict, best_pars, data_to_plot, radius, pdf_pages)
434
+ run_pars(tel_model, site_model, args_dict, best_pars, data_to_plot, radius, pdf_pages)
432
435
  plt.close()
433
436
  pdf_pages.close()
434
437
 
@@ -5,7 +5,6 @@ Produces a markdown file for a given array element, site, and model version.
5
5
 
6
6
  The report includes detailed information on each parameter,
7
7
  such as the parameter name, value, unit, description, and short description.
8
- Currently only implemented for telescopes.
9
8
  """
10
9
 
11
10
  import logging
@@ -70,15 +69,16 @@ def main(): # noqa: D103
70
69
  ).auto_generate_array_element_reports()
71
70
 
72
71
  else:
72
+ model_version = args["model_version"]
73
73
  ReadParameters(
74
74
  db_config,
75
75
  args,
76
- Path(output_path / f"{args['model_version']}"),
76
+ Path(output_path / f"{model_version}"),
77
77
  ).produce_array_element_report()
78
78
 
79
79
  logger.info(
80
80
  f"Markdown report generated for {args['site']}"
81
- f" Telescope {args['telescope']} (v{args['model_version']}):"
81
+ f" Telescope {args['telescope']} (v{model_version}):"
82
82
  f" {output_path}"
83
83
  )
84
84
 
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/python3
2
+
3
+ r"""Produces a markdown file for calibration reports."""
4
+
5
+ import logging
6
+
7
+ from simtools.configuration import configurator
8
+ from simtools.io_operations import io_handler
9
+ from simtools.reporting.docs_read_parameters import ReadParameters
10
+ from simtools.utils import general as gen
11
+
12
+
13
+ def _parse(label):
14
+ """Parse command line configuration."""
15
+ config = configurator.Configurator(
16
+ label=label,
17
+ description=("Produce a markdown report for calibration parameters."),
18
+ )
19
+
20
+ return config.initialize(
21
+ db_config=True,
22
+ simulation_model=["model_version"],
23
+ )
24
+
25
+
26
+ def main(): # noqa: D103
27
+ label_name = "reports"
28
+ args, db_config = _parse(label_name)
29
+
30
+ io_handler_instance = io_handler.IOHandler()
31
+ output_path = io_handler_instance.get_output_directory(label=label_name, sub_dir="productions")
32
+
33
+ logger = logging.getLogger()
34
+ logger.setLevel(gen.get_log_level_from_user(args["log_level"]))
35
+
36
+ read_parameters = ReadParameters(
37
+ db_config=db_config, args=args, output_path=output_path / f"{args.get('model_version')}"
38
+ )
39
+
40
+ read_parameters.produce_calibration_reports()
41
+
42
+ logger.info(
43
+ f"Calibation reports for model version {args.get('model_version')} produced successfully."
44
+ )
45
+ logger.info(f"Output path: {output_path}/{args.get('model_version')}/")
46
+
47
+
48
+ if __name__ == "__main__":
49
+ main()
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/python3
2
+
3
+ r"""Produces a markdown file for a given simulation configuration."""
4
+
5
+ import logging
6
+
7
+ from simtools.configuration import configurator
8
+ from simtools.io_operations import io_handler
9
+ from simtools.reporting.docs_read_parameters import ReadParameters
10
+ from simtools.utils import general as gen
11
+
12
+
13
+ def _parse(label):
14
+ """Parse command line configuration."""
15
+ config = configurator.Configurator(
16
+ label=label,
17
+ description=("Produce a markdown report for model parameters."),
18
+ )
19
+
20
+ return config.initialize(
21
+ db_config=True,
22
+ simulation_model=["model_version"],
23
+ simulation_configuration=["software"],
24
+ )
25
+
26
+
27
+ def main(): # noqa: D103
28
+ label_name = "reports"
29
+ args, db_config = _parse(label_name)
30
+
31
+ io_handler_instance = io_handler.IOHandler()
32
+ output_path = io_handler_instance.get_output_directory(label=label_name, sub_dir="productions")
33
+
34
+ logger = logging.getLogger()
35
+ logger.setLevel(gen.get_log_level_from_user(args["log_level"]))
36
+
37
+ read_parameters = ReadParameters(
38
+ db_config=db_config, args=args, output_path=output_path / f"{args.get('model_version')}"
39
+ )
40
+
41
+ read_parameters.produce_simulation_configuration_report()
42
+
43
+ logger.info(
44
+ f"Configuration reports for {args.get('simulation_software')} produced successfully."
45
+ )
46
+ logger.info(f"Output path: {output_path}/{args.get('model_version')}/")
47
+
48
+
49
+ if __name__ == "__main__":
50
+ main()
@@ -39,7 +39,7 @@ r"""
39
39
  -------
40
40
  .. code-block:: console
41
41
 
42
- simtools-generate-simtel-array-histograms --hist_file_names tests/resources/ \\
42
+ simtools-generate-sim-telarray-histograms --hist_file_names tests/resources/ \\
43
43
  run2_gamma_za20deg_azm0deg-North-Prod5_test-production-5.hdata.zst \\
44
44
  --output_file_name test_hist_hdata --hdf5 --pdf
45
45
 
@@ -167,7 +167,7 @@ def create_pdf(simtel_histograms, output_file_name, config_parser, logger):
167
167
 
168
168
  def main(): # noqa: D103
169
169
  label = Path(__file__).stem
170
- description = "Display simtel_array histograms and/or write them into hdf5 format."
170
+ description = "Display sim_telarray histograms and/or write them into hdf5 format."
171
171
  io_handler_instance = io_handler.IOHandler()
172
172
  config_parser = _parse(label, description)
173
173
  output_path = io_handler_instance.get_output_directory(label, sub_dir="application-plots")
@@ -34,7 +34,9 @@ Derive limits for a given file with a specified loss fraction.
34
34
 
35
35
  import datetime
36
36
  import logging
37
+ import re
37
38
 
39
+ import numpy as np
38
40
  from astropy.table import Table
39
41
 
40
42
  import simtools.utils.general as gen
@@ -122,8 +124,37 @@ def process_file(file_path, telescope_ids, loss_fraction, plot_histograms):
122
124
  Returns
123
125
  -------
124
126
  dict
125
- Dictionary containing the computed limits.
127
+ Dictionary containing the computed limits and metadata.
126
128
  """
129
+ # Extract zenith and azimuth from the file path
130
+ match = re.search(r"za(\d+)deg.*azm(\d+)deg", file_path)
131
+ if not match:
132
+ raise ValueError(f"Could not extract zenith and azimuth from file path: {file_path}")
133
+ zenith = int(match.group(1))
134
+ azimuth = int(match.group(2))
135
+
136
+ if "dark" in file_path:
137
+ nsb = 1
138
+ elif "halfmoon" in file_path:
139
+ nsb = 5
140
+ elif "moon" in file_path:
141
+ nsb = 19
142
+ else:
143
+ _logger.warning(f"Could not determine NSB from file path: {file_path}")
144
+ nsb = None
145
+
146
+ if "gamma-diffuse" in file_path:
147
+ particle_type = "gamma-diffuse"
148
+ elif "gamma" in file_path:
149
+ particle_type = "gamma"
150
+ elif "proton" in file_path:
151
+ particle_type = "proton"
152
+ elif "electron" in file_path:
153
+ particle_type = "electron"
154
+ else:
155
+ _logger.warning(f"Could not determine particle type from file path: {file_path}")
156
+ particle_type = "unknown"
157
+
127
158
  calculator = LimitCalculator(file_path, telescope_list=telescope_ids)
128
159
 
129
160
  lower_energy_limit = calculator.compute_lower_energy_limit(loss_fraction)
@@ -142,8 +173,11 @@ def process_file(file_path, telescope_ids, loss_fraction, plot_histograms):
142
173
  )
143
174
 
144
175
  return {
145
- "file_path": file_path,
176
+ "particle_type": particle_type,
146
177
  "telescope_ids": telescope_ids,
178
+ "zenith": zenith,
179
+ "azimuth": azimuth,
180
+ "nsb": nsb,
147
181
  "lower_energy_threshold": lower_energy_limit,
148
182
  "upper_radius_threshold": upper_radial_distance,
149
183
  "viewcone_radius": viewcone,
@@ -158,7 +192,7 @@ def create_results_table(results, loss_fraction):
158
192
  ----------
159
193
  results : list[dict]
160
194
  List of dictionaries containing the computed limits for each file
161
- and telescope configuration.
195
+ and telescope configuration.
162
196
  loss_fraction : float
163
197
  Fraction of events to be lost, added as metadata to the table.
164
198
 
@@ -167,33 +201,52 @@ def create_results_table(results, loss_fraction):
167
201
  astropy.table.Table
168
202
  An Astropy Table containing the results with appropriate units and metadata.
169
203
  """
204
+ print("results", results)
170
205
  table = Table(
171
206
  rows=[
172
207
  (
173
- res["file_path"],
208
+ res["particle_type"],
174
209
  res["telescope_ids"],
175
- res["lower_energy_threshold"],
176
- res["upper_radius_threshold"],
177
- res["viewcone_radius"],
210
+ res["zenith"],
211
+ res["azimuth"],
212
+ res["nsb"],
213
+ res["lower_energy_threshold"].value,
214
+ res["upper_radius_threshold"].value,
215
+ res["viewcone_radius"].value,
178
216
  )
179
217
  for res in results
180
218
  ],
181
219
  names=[
182
- "file_path",
220
+ "particle_type",
183
221
  "telescope_ids",
222
+ "zenith",
223
+ "azimuth",
224
+ "nsb",
184
225
  "lower_energy_threshold",
185
226
  "upper_radius_threshold",
186
227
  "viewcone_radius",
187
228
  ],
229
+ dtype=[
230
+ "S64",
231
+ object,
232
+ np.float64,
233
+ np.float64,
234
+ object,
235
+ np.float64,
236
+ np.float64,
237
+ np.float64,
238
+ ],
188
239
  )
189
-
240
+ table["zenith"].unit = "deg"
241
+ table["azimuth"].unit = "deg"
190
242
  table["lower_energy_threshold"].unit = "TeV"
191
243
  table["upper_radius_threshold"].unit = "m"
192
244
  table["viewcone_radius"].unit = "deg"
193
245
 
194
246
  table.meta["created"] = datetime.datetime.now().isoformat()
195
247
  table.meta["description"] = (
196
- "Lookup table for CORSIKA limits computed from gamma-ray shower simulations."
248
+ "Lookup table for CORSIKA limits computed from gamma-ray shower simulations "
249
+ "using simtool production_derive_corsika_limits"
197
250
  )
198
251
  table.meta["loss_fraction"] = loss_fraction
199
252