gammasimtools 0.6.1__py3-none-any.whl → 0.8.2__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 (355) hide show
  1. gammasimtools-0.8.2.dist-info/METADATA +173 -0
  2. gammasimtools-0.8.2.dist-info/RECORD +345 -0
  3. {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.2.dist-info}/WHEEL +1 -1
  4. gammasimtools-0.8.2.dist-info/entry_points.txt +31 -0
  5. simtools/_dev_version/__init__.py +9 -0
  6. simtools/_version.py +2 -2
  7. simtools/applications/calculate_trigger_rate.py +210 -0
  8. simtools/applications/convert_all_model_parameters_from_simtel.py +372 -0
  9. simtools/applications/{print_array_elements.py → convert_geo_coordinates_of_array_elements.py} +58 -63
  10. simtools/applications/convert_model_parameter_from_simtel.py +119 -0
  11. simtools/applications/{add_file_to_db.py → db_add_file_to_db.py} +70 -60
  12. simtools/applications/db_add_model_parameters_from_repository_to_db.py +184 -0
  13. simtools/applications/db_add_value_from_json_to_db.py +105 -0
  14. simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +180 -0
  15. simtools/applications/db_get_array_layouts_from_db.py +162 -0
  16. simtools/applications/{get_file_from_db.py → db_get_file_from_db.py} +30 -34
  17. simtools/applications/db_get_parameter_from_db.py +131 -0
  18. simtools/applications/db_inspect_databases.py +52 -0
  19. simtools/applications/derive_mirror_rnda.py +39 -255
  20. simtools/applications/derive_psf_parameters.py +441 -0
  21. simtools/applications/generate_array_config.py +82 -0
  22. simtools/applications/generate_corsika_histograms.py +52 -52
  23. simtools/applications/generate_default_metadata.py +5 -8
  24. simtools/applications/generate_regular_arrays.py +117 -0
  25. simtools/applications/generate_simtel_array_histograms.py +97 -56
  26. simtools/applications/plot_array_layout.py +345 -115
  27. simtools/applications/production_generate_simulation_config.py +158 -0
  28. simtools/applications/production_scale_events.py +168 -0
  29. simtools/applications/simulate_light_emission.py +478 -0
  30. simtools/applications/simulate_prod.py +97 -175
  31. simtools/applications/submit_data_from_external.py +9 -12
  32. simtools/applications/submit_model_parameter_from_external.py +122 -0
  33. simtools/applications/validate_camera_efficiency.py +35 -102
  34. simtools/applications/validate_camera_fov.py +20 -19
  35. simtools/applications/{compare_cumulative_psf.py → validate_cumulative_psf.py} +45 -44
  36. simtools/applications/validate_file_using_schema.py +111 -47
  37. simtools/applications/validate_optics.py +17 -22
  38. simtools/camera_efficiency.py +193 -202
  39. simtools/configuration/commandline_parser.py +384 -96
  40. simtools/configuration/configurator.py +55 -71
  41. simtools/constants.py +5 -5
  42. simtools/corsika/corsika_config.py +482 -342
  43. simtools/corsika/corsika_histograms.py +226 -204
  44. simtools/corsika/corsika_histograms_visualize.py +23 -24
  45. simtools/corsika/primary_particle.py +159 -0
  46. simtools/data_model/data_reader.py +25 -20
  47. simtools/data_model/format_checkers.py +52 -0
  48. simtools/data_model/metadata_collector.py +211 -185
  49. simtools/data_model/metadata_model.py +115 -37
  50. simtools/data_model/model_data_writer.py +335 -26
  51. simtools/data_model/validate_data.py +366 -154
  52. simtools/db/db_array_elements.py +130 -0
  53. simtools/db/db_from_repo_handler.py +106 -0
  54. simtools/db/db_handler.py +1246 -0
  55. simtools/io_operations/hdf5_handler.py +3 -1
  56. simtools/io_operations/io_handler.py +32 -57
  57. simtools/job_execution/job_manager.py +82 -69
  58. simtools/layout/array_layout.py +325 -537
  59. simtools/layout/geo_coordinates.py +8 -11
  60. simtools/layout/telescope_position.py +163 -86
  61. simtools/model/array_model.py +312 -259
  62. simtools/model/calibration_model.py +50 -0
  63. simtools/model/camera.py +277 -523
  64. simtools/model/mirrors.py +68 -49
  65. simtools/model/model_parameter.py +602 -0
  66. simtools/model/model_utils.py +11 -39
  67. simtools/model/site_model.py +161 -0
  68. simtools/model/telescope_model.py +143 -633
  69. simtools/production_configuration/calculate_statistical_errors_grid_point.py +454 -0
  70. simtools/production_configuration/event_scaler.py +146 -0
  71. simtools/production_configuration/generate_simulation_config.py +193 -0
  72. simtools/production_configuration/interpolation_handler.py +197 -0
  73. simtools/ray_tracing/__init__.py +0 -0
  74. simtools/ray_tracing/mirror_panel_psf.py +280 -0
  75. simtools/{psf_analysis.py → ray_tracing/psf_analysis.py} +133 -47
  76. simtools/ray_tracing/ray_tracing.py +646 -0
  77. simtools/runners/__init__.py +0 -0
  78. simtools/runners/corsika_runner.py +240 -0
  79. simtools/runners/corsika_simtel_runner.py +225 -0
  80. simtools/runners/runner_services.py +307 -0
  81. simtools/runners/simtel_runner.py +224 -0
  82. simtools/schemas/array_elements.yml +137 -0
  83. simtools/schemas/integration_tests_config.metaschema.yml +93 -0
  84. simtools/schemas/metadata.metaschema.yml +6 -0
  85. simtools/schemas/model_parameter.metaschema.yml +78 -0
  86. simtools/schemas/{data.metaschema.yml → model_parameter_and_data_schema.metaschema.yml} +27 -44
  87. simtools/schemas/model_parameters/adjust_gain.schema.yml +37 -0
  88. simtools/schemas/model_parameters/altitude.schema.yml +37 -0
  89. simtools/schemas/model_parameters/array_coordinates.schema.yml +33 -0
  90. simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +77 -0
  91. simtools/schemas/model_parameters/array_element_position_ground.schema.yml +39 -0
  92. simtools/schemas/model_parameters/array_element_position_utm.schema.yml +39 -0
  93. simtools/schemas/model_parameters/array_layouts.schema.yml +48 -0
  94. simtools/schemas/model_parameters/array_triggers.schema.yml +93 -0
  95. simtools/schemas/model_parameters/asum_clipping.schema.yml +38 -0
  96. simtools/schemas/model_parameters/asum_offset.schema.yml +35 -0
  97. simtools/schemas/model_parameters/asum_shaping.schema.yml +35 -0
  98. simtools/schemas/model_parameters/asum_threshold.schema.yml +38 -0
  99. simtools/schemas/model_parameters/atmospheric_profile.schema.yml +32 -0
  100. simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +35 -0
  101. simtools/schemas/model_parameters/axes_offsets.schema.yml +53 -0
  102. simtools/schemas/model_parameters/camera_body_diameter.schema.yml +40 -0
  103. simtools/schemas/model_parameters/camera_body_shape.schema.yml +45 -0
  104. simtools/schemas/model_parameters/camera_config_file.schema.yml +40 -0
  105. simtools/schemas/model_parameters/camera_config_rotate.schema.yml +36 -0
  106. simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +43 -0
  107. simtools/schemas/model_parameters/camera_degraded_map.schema.yml +42 -0
  108. simtools/schemas/model_parameters/camera_depth.schema.yml +42 -0
  109. simtools/schemas/model_parameters/camera_filter.schema.yml +45 -0
  110. simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +29 -0
  111. simtools/schemas/model_parameters/camera_pixels.schema.yml +36 -0
  112. simtools/schemas/model_parameters/camera_transmission.schema.yml +41 -0
  113. simtools/schemas/model_parameters/channels_per_chip.schema.yml +36 -0
  114. simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +35 -0
  115. simtools/schemas/model_parameters/corsika_cherenkov_photon_bunch_size.schema.yml +27 -0
  116. simtools/schemas/model_parameters/corsika_cherenkov_photon_wavelength_range.schema.yml +38 -0
  117. simtools/schemas/model_parameters/corsika_first_interaction_height.schema.yml +28 -0
  118. simtools/schemas/model_parameters/corsika_iact_io_buffer.schema.yml +23 -0
  119. simtools/schemas/model_parameters/corsika_iact_max_bunches.schema.yml +27 -0
  120. simtools/schemas/model_parameters/corsika_iact_split_auto.schema.yml +28 -0
  121. simtools/schemas/model_parameters/corsika_longitudinal_shower_development.schema.yml +27 -0
  122. simtools/schemas/model_parameters/corsika_observation_level.schema.yml +38 -0
  123. simtools/schemas/model_parameters/corsika_particle_kinetic_energy_cutoff.schema.yml +52 -0
  124. simtools/schemas/model_parameters/corsika_starting_grammage.schema.yml +27 -0
  125. simtools/schemas/model_parameters/dark_events.schema.yml +32 -0
  126. simtools/schemas/model_parameters/default_trigger.schema.yml +35 -0
  127. simtools/schemas/model_parameters/design_model.schema.yml +31 -0
  128. simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +32 -0
  129. simtools/schemas/model_parameters/disc_bins.schema.yml +39 -0
  130. simtools/schemas/model_parameters/disc_start.schema.yml +41 -0
  131. simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +42 -0
  132. simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +41 -0
  133. simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +41 -0
  134. simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +39 -0
  135. simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +40 -0
  136. simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +41 -0
  137. simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +33 -0
  138. simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +42 -0
  139. simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +37 -0
  140. simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +44 -0
  141. simtools/schemas/model_parameters/discriminator_threshold.schema.yml +36 -0
  142. simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +45 -0
  143. simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +40 -0
  144. simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +41 -0
  145. simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +38 -0
  146. simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +38 -0
  147. simtools/schemas/model_parameters/dish_shape_length.schema.yml +41 -0
  148. simtools/schemas/model_parameters/dsum_clipping.schema.yml +38 -0
  149. simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +38 -0
  150. simtools/schemas/model_parameters/dsum_offset.schema.yml +37 -0
  151. simtools/schemas/model_parameters/dsum_pedsub.schema.yml +33 -0
  152. simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +39 -0
  153. simtools/schemas/model_parameters/dsum_prescale.schema.yml +44 -0
  154. simtools/schemas/model_parameters/dsum_presum_max.schema.yml +38 -0
  155. simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +45 -0
  156. simtools/schemas/model_parameters/dsum_shaping.schema.yml +44 -0
  157. simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +32 -0
  158. simtools/schemas/model_parameters/dsum_threshold.schema.yml +43 -0
  159. simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +42 -0
  160. simtools/schemas/model_parameters/effective_focal_length.schema.yml +61 -0
  161. simtools/schemas/model_parameters/epsg_code.schema.yml +37 -0
  162. simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +35 -0
  163. simtools/schemas/model_parameters/fadc_amplitude.schema.yml +46 -0
  164. simtools/schemas/model_parameters/fadc_bins.schema.yml +40 -0
  165. simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +50 -0
  166. simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +38 -0
  167. simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +42 -0
  168. simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +49 -0
  169. simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +47 -0
  170. simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +51 -0
  171. simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +37 -0
  172. simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +43 -0
  173. simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +49 -0
  174. simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +43 -0
  175. simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +39 -0
  176. simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +42 -0
  177. simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +40 -0
  178. simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +50 -0
  179. simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +42 -0
  180. simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +41 -0
  181. simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +42 -0
  182. simtools/schemas/model_parameters/fadc_max_signal.schema.yml +43 -0
  183. simtools/schemas/model_parameters/fadc_max_sum.schema.yml +39 -0
  184. simtools/schemas/model_parameters/fadc_mhz.schema.yml +31 -0
  185. simtools/schemas/model_parameters/fadc_noise.schema.yml +41 -0
  186. simtools/schemas/model_parameters/fadc_pedestal.schema.yml +40 -0
  187. simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +39 -0
  188. simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +50 -0
  189. simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +43 -0
  190. simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +43 -0
  191. simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +42 -0
  192. simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +41 -0
  193. simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +42 -0
  194. simtools/schemas/model_parameters/flatfielding.schema.yml +37 -0
  195. simtools/schemas/model_parameters/focal_length.schema.yml +45 -0
  196. simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +158 -0
  197. simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +29 -0
  198. simtools/schemas/model_parameters/focus_offset.schema.yml +66 -0
  199. simtools/schemas/model_parameters/gain_variation.schema.yml +43 -0
  200. simtools/schemas/model_parameters/geomag_horizontal.schema.yml +34 -0
  201. simtools/schemas/model_parameters/geomag_rotation.schema.yml +37 -0
  202. simtools/schemas/model_parameters/geomag_vertical.schema.yml +34 -0
  203. simtools/schemas/model_parameters/hg_lg_variation.schema.yml +36 -0
  204. simtools/schemas/model_parameters/iobuf_maximum.schema.yml +34 -0
  205. simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +34 -0
  206. simtools/schemas/model_parameters/laser_events.schema.yml +36 -0
  207. simtools/schemas/model_parameters/laser_external_trigger.schema.yml +35 -0
  208. simtools/schemas/model_parameters/laser_photons.schema.yml +32 -0
  209. simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +34 -0
  210. simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +34 -0
  211. simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +33 -0
  212. simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +33 -0
  213. simtools/schemas/model_parameters/laser_var_photons.schema.yml +33 -0
  214. simtools/schemas/model_parameters/laser_wavelength.schema.yml +33 -0
  215. simtools/schemas/model_parameters/led_events.schema.yml +34 -0
  216. simtools/schemas/model_parameters/led_photons.schema.yml +34 -0
  217. simtools/schemas/model_parameters/led_pulse_offset.schema.yml +32 -0
  218. simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +33 -0
  219. simtools/schemas/model_parameters/led_var_photons.schema.yml +34 -0
  220. simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +41 -0
  221. simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +43 -0
  222. simtools/schemas/model_parameters/min_photoelectrons.schema.yml +35 -0
  223. simtools/schemas/model_parameters/min_photons.schema.yml +32 -0
  224. simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +36 -0
  225. simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +64 -0
  226. simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +64 -0
  227. simtools/schemas/model_parameters/mirror_class.schema.yml +41 -0
  228. simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +51 -0
  229. simtools/schemas/model_parameters/mirror_focal_length.schema.yml +42 -0
  230. simtools/schemas/model_parameters/mirror_list.schema.yml +38 -0
  231. simtools/schemas/model_parameters/mirror_offset.schema.yml +41 -0
  232. simtools/schemas/model_parameters/mirror_panel_2f_measurements.schema.yml +39 -0
  233. simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +61 -0
  234. simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +40 -0
  235. simtools/schemas/model_parameters/multiplicity_offset.schema.yml +46 -0
  236. simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +51 -0
  237. simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +37 -0
  238. simtools/schemas/model_parameters/nsb_offaxis.schema.yml +79 -0
  239. simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +47 -0
  240. simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +34 -0
  241. simtools/schemas/model_parameters/nsb_reference_value.schema.yml +33 -0
  242. simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +35 -0
  243. simtools/schemas/model_parameters/nsb_skymap.schema.yml +39 -0
  244. simtools/schemas/model_parameters/nsb_spectrum.schema.yml +50 -0
  245. simtools/schemas/model_parameters/num_gains.schema.yml +34 -0
  246. simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +33 -0
  247. simtools/schemas/model_parameters/optics_properties.schema.yml +31 -0
  248. simtools/schemas/model_parameters/parabolic_dish.schema.yml +32 -0
  249. simtools/schemas/model_parameters/pedestal_events.schema.yml +32 -0
  250. simtools/schemas/model_parameters/photon_delay.schema.yml +38 -0
  251. simtools/schemas/model_parameters/photons_per_run.schema.yml +33 -0
  252. simtools/schemas/model_parameters/pixel_cells.schema.yml +35 -0
  253. simtools/schemas/model_parameters/pixels_parallel.schema.yml +54 -0
  254. simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +40 -0
  255. simtools/schemas/model_parameters/pm_average_gain.schema.yml +34 -0
  256. simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +40 -0
  257. simtools/schemas/model_parameters/pm_gain_index.schema.yml +36 -0
  258. simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +41 -0
  259. simtools/schemas/model_parameters/pm_transit_time.schema.yml +63 -0
  260. simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +39 -0
  261. simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +42 -0
  262. simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +33 -0
  263. simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +33 -0
  264. simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +29 -0
  265. simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +168 -0
  266. simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +36 -0
  267. simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +34 -0
  268. simtools/schemas/model_parameters/qe_variation.schema.yml +43 -0
  269. simtools/schemas/model_parameters/quantum_efficiency.schema.yml +42 -0
  270. simtools/schemas/model_parameters/random_focal_length.schema.yml +45 -0
  271. simtools/schemas/model_parameters/random_generator.schema.yml +36 -0
  272. simtools/schemas/model_parameters/reference_point_altitude.schema.yml +35 -0
  273. simtools/schemas/model_parameters/reference_point_latitude.schema.yml +36 -0
  274. simtools/schemas/model_parameters/reference_point_longitude.schema.yml +36 -0
  275. simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +34 -0
  276. simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +34 -0
  277. simtools/schemas/model_parameters/sampled_output.schema.yml +31 -0
  278. simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +34 -0
  279. simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +79 -0
  280. simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +42 -0
  281. simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +41 -0
  282. simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +33 -0
  283. simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +36 -0
  284. simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +29 -0
  285. simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +168 -0
  286. simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +36 -0
  287. simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +35 -0
  288. simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +37 -0
  289. simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +40 -0
  290. simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +40 -0
  291. simtools/schemas/model_parameters/store_photoelectrons.schema.yml +41 -0
  292. simtools/schemas/model_parameters/tailcut_scale.schema.yml +40 -0
  293. simtools/schemas/model_parameters/telescope_axis_height.schema.yml +31 -0
  294. simtools/schemas/model_parameters/telescope_random_angle.schema.yml +35 -0
  295. simtools/schemas/model_parameters/telescope_random_error.schema.yml +34 -0
  296. simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +37 -0
  297. simtools/schemas/model_parameters/telescope_transmission.schema.yml +113 -0
  298. simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +41 -0
  299. simtools/schemas/model_parameters/teltrig_min_time.schema.yml +36 -0
  300. simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +36 -0
  301. simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +37 -0
  302. simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +38 -0
  303. simtools/schemas/model_parameters/transit_time_error.schema.yml +45 -0
  304. simtools/schemas/model_parameters/transit_time_jitter.schema.yml +36 -0
  305. simtools/schemas/model_parameters/trigger_current_limit.schema.yml +32 -0
  306. simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +53 -0
  307. simtools/schemas/model_parameters/trigger_pixels.schema.yml +40 -0
  308. simtools/simtel/simtel_config_reader.py +353 -0
  309. simtools/simtel/simtel_config_writer.py +244 -63
  310. simtools/simtel/{simtel_events.py → simtel_io_events.py} +26 -25
  311. simtools/simtel/simtel_io_histogram.py +661 -0
  312. simtools/simtel/simtel_io_histograms.py +569 -0
  313. simtools/simtel/simulator_array.py +145 -0
  314. simtools/simtel/{simtel_runner_camera_efficiency.py → simulator_camera_efficiency.py} +76 -52
  315. simtools/simtel/simulator_light_emission.py +473 -0
  316. simtools/simtel/simulator_ray_tracing.py +262 -0
  317. simtools/simulator.py +220 -446
  318. simtools/testing/__init__.py +0 -0
  319. simtools/testing/assertions.py +151 -0
  320. simtools/testing/configuration.py +226 -0
  321. simtools/testing/helpers.py +42 -0
  322. simtools/testing/validate_output.py +240 -0
  323. simtools/utils/general.py +340 -437
  324. simtools/utils/geometry.py +12 -12
  325. simtools/utils/names.py +257 -644
  326. simtools/utils/value_conversion.py +176 -0
  327. simtools/version.py +3 -1
  328. simtools/visualization/legend_handlers.py +135 -152
  329. simtools/visualization/plot_camera.py +379 -0
  330. simtools/visualization/visualize.py +346 -167
  331. gammasimtools-0.6.1.dist-info/METADATA +0 -180
  332. gammasimtools-0.6.1.dist-info/RECORD +0 -91
  333. gammasimtools-0.6.1.dist-info/entry_points.txt +0 -23
  334. simtools/_dev_version/scm_version.py +0 -10
  335. simtools/applications/db_development_tools/add_new_parameter_to_db.py +0 -81
  336. simtools/applications/db_development_tools/add_unit_to_parameter_in_db.py +0 -59
  337. simtools/applications/db_development_tools/mark_non_optics_parameters_non_applicable.py +0 -102
  338. simtools/applications/get_parameter.py +0 -92
  339. simtools/applications/make_regular_arrays.py +0 -160
  340. simtools/applications/produce_array_config.py +0 -136
  341. simtools/applications/production.py +0 -313
  342. simtools/applications/sim_showers_for_trigger_rates.py +0 -187
  343. simtools/applications/tune_psf.py +0 -334
  344. simtools/corsika/corsika_default_config.py +0 -282
  345. simtools/corsika/corsika_runner.py +0 -450
  346. simtools/corsika_simtel/corsika_simtel_runner.py +0 -197
  347. simtools/db_handler.py +0 -1480
  348. simtools/ray_tracing.py +0 -525
  349. simtools/simtel/simtel_histograms.py +0 -414
  350. simtools/simtel/simtel_runner.py +0 -244
  351. simtools/simtel/simtel_runner_array.py +0 -293
  352. simtools/simtel/simtel_runner_ray_tracing.py +0 -277
  353. {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.2.dist-info}/LICENSE +0 -0
  354. {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.2.dist-info}/top_level.txt +0 -0
  355. /simtools/{corsika_simtel → db}/__init__.py +0 -0
@@ -1,3 +1,5 @@
1
+ """Extract Cherenkov photons information from a CORSIKA IACT file."""
2
+
1
3
  import functools
2
4
  import logging
3
5
  import operator
@@ -17,18 +19,22 @@ from eventio import IACTFile
17
19
  from simtools import version
18
20
  from simtools.io_operations import io_handler
19
21
  from simtools.io_operations.hdf5_handler import fill_hdf5_table
20
- from simtools.utils.general import collect_data_from_file_or_dict
22
+ from simtools.utils.general import collect_data_from_file
21
23
  from simtools.utils.geometry import convert_2d_to_radial_distr, rotate
22
24
  from simtools.utils.names import sanitize_name
23
25
 
26
+ X_AXIS_STRING = "x axis"
27
+ Y_AXIS_STRING = "y axis"
28
+ Z_AXIS_STRING = "z axis"
29
+
24
30
 
25
- class HistogramNotCreated(Exception):
31
+ class HistogramNotCreatedError(Exception):
26
32
  """Exception for histogram not created."""
27
33
 
28
34
 
29
35
  class CorsikaHistograms:
30
- """CorsikaHistograms extracts the Cherenkov photons information from a CORSIKA IACT file
31
- using pyeventio.
36
+ """
37
+ Extracts the Cherenkov photons information from a CORSIKA IACT file.
32
38
 
33
39
  Parameters
34
40
  ----------
@@ -109,15 +115,16 @@ class CorsikaHistograms:
109
115
  def hdf5_file_name(self):
110
116
  """
111
117
  Property for the hdf5 file name.
118
+
112
119
  The idea of this property is to allow setting (or changing) the name of the hdf5 file
113
- even after creating the class instance.
120
+ even after creating the class instance.
114
121
  """
115
122
  return self._hdf5_file_name
116
123
 
117
124
  @hdf5_file_name.setter
118
125
  def hdf5_file_name(self, hdf5_file_name):
119
126
  """
120
- Sets the hdf5_file_name to the argument passed.
127
+ Set the hdf5_file_name to the argument passed.
121
128
 
122
129
  Parameters
123
130
  ----------
@@ -134,9 +141,8 @@ class CorsikaHistograms:
134
141
  Returns
135
142
  -------
136
143
  float:
137
- The version of CORSIKA used to produce the CORSIKA IACT file given by `self.input_file`.
144
+ The version of CORSIKA used to produce the CORSIKA IACT file given by self.input_file.
138
145
  """
139
-
140
146
  if self._corsika_version is None:
141
147
  all_corsika_versions = list(run_header.run_header_types.keys())
142
148
  header = list(self.iact_file.header)
@@ -158,9 +164,7 @@ class CorsikaHistograms:
158
164
  return self._corsika_version
159
165
 
160
166
  def _initialize_header(self):
161
- """
162
- Initialize the header.
163
- """
167
+ """Initialize the header."""
164
168
  self.all_run_keys = list(
165
169
  run_header.run_header_types[np.around(self.corsika_version, 1)].names
166
170
  )
@@ -192,11 +196,11 @@ class CorsikaHistograms:
192
196
  def read_event_information(self):
193
197
  """
194
198
  Read the information about the events from their headers and save as a class instance.
199
+
195
200
  The main information can also be fetched individually through the functions below.
196
201
  For the remaining information (such as px, py, pz), use this function.
197
202
 
198
203
  """
199
-
200
204
  if self.event_information is None:
201
205
  with IACTFile(self.input_file) as self.iact_file:
202
206
  self.telescope_positions = np.array(self.iact_file.telescope_positions)
@@ -246,7 +250,6 @@ class CorsikaHistograms:
246
250
  dict:
247
251
  A dictionary with the astropy units.
248
252
  """
249
-
250
253
  # Build a dictionary with astropy units for the unit of the event's (header's) parameters.
251
254
  all_event_astropy_units = {}
252
255
  for key in parameters[1:]: # starting at the second
@@ -277,6 +280,7 @@ class CorsikaHistograms:
277
280
  def telescope_indices(self, telescope_new_indices):
278
281
  """
279
282
  Set the telescope index (or indices).
283
+
280
284
  If self.individual_telescopes is True, the indices of the telescopes passed are analyzed
281
285
  individually (different histograms for each telescope) even if all telescopes are listed.
282
286
 
@@ -292,14 +296,13 @@ class CorsikaHistograms:
292
296
  TypeError:
293
297
  if the indices passed through telescope_index are not of type int.
294
298
  """
295
-
296
299
  if telescope_new_indices is None:
297
300
  self._telescope_indices = np.arange(self.num_telescopes)
298
301
  else:
299
- if not isinstance(telescope_new_indices, (list, np.ndarray)):
302
+ if not isinstance(telescope_new_indices, list | np.ndarray):
300
303
  telescope_new_indices = np.array([telescope_new_indices])
301
304
  for i_telescope in telescope_new_indices:
302
- if not isinstance(i_telescope, (int, np.integer)):
305
+ if not isinstance(i_telescope, int | np.integer):
303
306
  msg = "The index or indices given are not of type int."
304
307
  self._logger.error(msg)
305
308
  raise TypeError
@@ -328,6 +331,7 @@ class CorsikaHistograms:
328
331
  def hist_config(self, input_config):
329
332
  """
330
333
  Set the configuration for the histograms (e.g., bin size, min and max values, etc).
334
+
331
335
  The input is allowed either through a yaml file or a dictionary. If nothing is given,
332
336
  the dictionary is created with default values.
333
337
 
@@ -335,16 +339,14 @@ class CorsikaHistograms:
335
339
  ----------
336
340
  input_config: str, Path, dict or NoneType
337
341
  yaml file with the configuration parameters to create the histograms. For the correct
338
- format, please look at the docstring at `_create_histogram_default_config`.
342
+ format, please look at the docstring at _create_histogram_default_config.
339
343
  Alternatively, it can be a dictionary with the configuration parameters to create
340
344
  the histograms.
341
345
  """
342
- input_dict, input_yaml = None, None
343
346
  if isinstance(input_config, dict):
344
- input_dict = input_config
347
+ self._hist_config = input_config
345
348
  else:
346
- input_yaml = input_config
347
- self._hist_config = collect_data_from_file_or_dict(input_yaml, input_dict, allow_empty=True)
349
+ self._hist_config = collect_data_from_file(input_config) if input_config else None
348
350
 
349
351
  def hist_config_to_yaml(self, file_name=None):
350
352
  """
@@ -356,7 +358,6 @@ class CorsikaHistograms:
356
358
  Name of the output file, in which to save the histogram configuration.
357
359
 
358
360
  """
359
-
360
361
  if file_name is None:
361
362
  file_name = "hist_config"
362
363
  file_name = Path(file_name).with_suffix(".yml")
@@ -366,8 +367,9 @@ class CorsikaHistograms:
366
367
 
367
368
  def _create_histogram_default_config(self):
368
369
  """
369
- Create a dictionary with the configuration necessary to create the histograms. It is used
370
- only in case the configuration is not provided in a yaml file or dict.
370
+ Create a dictionary with the configuration necessary to create the histograms.
371
+
372
+ It is used only in case the configuration is not provided in a yaml file or dict.
371
373
 
372
374
  Three histograms are created: hist_position with 3 dimensions (x, y positions and the
373
375
  wavelength), hist_direction with 2 dimensions (direction cosines in x and y directions),
@@ -387,7 +389,6 @@ class CorsikaHistograms:
387
389
  dict:
388
390
  Dictionary with the configuration parameters to create the histograms.
389
391
  """
390
-
391
392
  if self.individual_telescopes is False:
392
393
  xy_maximum = 1000 * u.m
393
394
  xy_bin = 100
@@ -395,22 +396,21 @@ class CorsikaHistograms:
395
396
  else:
396
397
  xy_maximum = 16 * u.m
397
398
  xy_bin = 64
398
-
399
- histogram_config = {
399
+ return {
400
400
  "hist_position": {
401
- "x axis": {
401
+ X_AXIS_STRING: {
402
402
  "bins": xy_bin,
403
403
  "start": -xy_maximum,
404
404
  "stop": xy_maximum,
405
405
  "scale": "linear",
406
406
  },
407
- "y axis": {
407
+ Y_AXIS_STRING: {
408
408
  "bins": xy_bin,
409
409
  "start": -xy_maximum,
410
410
  "stop": xy_maximum,
411
411
  "scale": "linear",
412
412
  },
413
- "z axis": {
413
+ Z_AXIS_STRING: {
414
414
  "bins": 80,
415
415
  "start": 200 * u.nm,
416
416
  "stop": 1000 * u.nm,
@@ -418,13 +418,13 @@ class CorsikaHistograms:
418
418
  },
419
419
  },
420
420
  "hist_direction": {
421
- "x axis": {
421
+ X_AXIS_STRING: {
422
422
  "bins": 100,
423
423
  "start": -1,
424
424
  "stop": 1,
425
425
  "scale": "linear",
426
426
  },
427
- "y axis": {
427
+ Y_AXIS_STRING: {
428
428
  "bins": 100,
429
429
  "start": -1,
430
430
  "stop": 1,
@@ -432,20 +432,24 @@ class CorsikaHistograms:
432
432
  },
433
433
  },
434
434
  "hist_time_altitude": {
435
- "x axis": {
435
+ X_AXIS_STRING: {
436
436
  "bins": 100,
437
437
  "start": -2000 * u.ns,
438
438
  "stop": 2000 * u.ns,
439
439
  "scale": "linear",
440
440
  },
441
- "y axis": {"bins": 100, "start": 120 * u.km, "stop": 0 * u.km, "scale": "linear"},
441
+ Y_AXIS_STRING: {
442
+ "bins": 100,
443
+ "start": 120 * u.km,
444
+ "stop": 0 * u.km,
445
+ "scale": "linear",
446
+ },
442
447
  },
443
448
  }
444
- return histogram_config
445
449
 
446
450
  def _create_regular_axes(self, label):
447
451
  """
448
- Helper function to _create_histograms.
452
+ Create regular axis for histograms.
449
453
 
450
454
  Parameters
451
455
  ----------
@@ -462,11 +466,11 @@ class CorsikaHistograms:
462
466
  if label not in self._allowed_histograms:
463
467
  msg = f"allowed labels must be one of the following: {self._allowed_histograms}"
464
468
  self._logger.error(msg)
465
- raise ValueError
469
+ raise ValueError(msg)
466
470
 
467
- all_axes = ["x axis", "y axis"]
471
+ all_axes = [X_AXIS_STRING, Y_AXIS_STRING]
468
472
  if label == "hist_position":
469
- all_axes.append("z axis")
473
+ all_axes.append(Z_AXIS_STRING)
470
474
 
471
475
  boost_axes = []
472
476
  for axis in all_axes:
@@ -527,10 +531,11 @@ class CorsikaHistograms:
527
531
  )
528
532
 
529
533
  def _fill_histograms(self, photons, rotation_around_z_axis=None, rotation_around_y_axis=None):
530
- """Fill all the histograms created by self._create_histogram with the information of the
531
- photons on the ground.
532
- If the azimuth and zenith angles are provided, the Cherenkov photon's coordinates are
533
- filled in the plane perpendicular to the incoming direction of the particle.
534
+ """
535
+ Fill histograms with the information of the photons on the ground.
536
+
537
+ if the azimuth and zenith angles are provided, the Cherenkov photon's coordinates are
538
+ filled in the plane perpendicular to the incoming direction of the particle.
534
539
 
535
540
  Parameters
536
541
  ----------
@@ -545,7 +550,7 @@ class CorsikaHistograms:
545
550
  cy: direction cosine in the y direction, i.e., the cosine of the angle between the
546
551
  incoming direction and the y axis,
547
552
  time: time of arrival of the photon in ns. The clock starts when the particle crosses
548
- the top of the atmosphere (CORSIKA-defined) if `self.event_first_interaction_heights`
553
+ the top of the atmosphere (CORSIKA-defined) if self.event_first_interaction_heights
549
554
  is positive or at first interaction if otherwise.
550
555
  zem: altitude where the photon was generated in cm,
551
556
  photons: number of photons associated to this bunch,
@@ -567,7 +572,6 @@ class CorsikaHistograms:
567
572
  IndexError:
568
573
  If the index or indices passed though telescope_index are out of range.
569
574
  """
570
-
571
575
  hist_num = 0
572
576
  for i_tel_info, photons_info in np.array(
573
577
  list(zip(self.telescope_positions, photons)), dtype=object
@@ -603,8 +607,7 @@ class CorsikaHistograms:
603
607
 
604
608
  def set_histograms(self, telescope_indices=None, individual_telescopes=None, hist_config=None):
605
609
  """
606
- Extract the information of the Cherenkov photons from a CORSIKA output IACT file, create
607
- and fill the histograms
610
+ Create and fill Cherenkov photons histograms using information from the CORSIKA IACT file.
608
611
 
609
612
  Parameters
610
613
  ----------
@@ -615,7 +618,7 @@ class CorsikaHistograms:
615
618
  if True, one histogram is set for each telescope separately.
616
619
  hist_config:
617
620
  yaml file with the configuration parameters to create the histograms. For the correct
618
- format, please look at the docstring of `_create_histogram_default_config`.
621
+ format, please look at the docstring of _create_histogram_default_config.
619
622
  Alternatively, it can be a dictionary with the configuration parameters to create
620
623
  the histograms.
621
624
 
@@ -663,16 +666,13 @@ class CorsikaHistograms:
663
666
 
664
667
  @property
665
668
  def individual_telescopes(self):
666
- """
667
- Return the individual telescopes as property.
668
- """
669
+ """Return the individual telescopes as property."""
669
670
  return self._individual_telescopes
670
671
 
671
672
  @individual_telescopes.setter
672
673
  def individual_telescopes(self, new_individual_telescopes: bool):
673
674
  """
674
- The following lines allow `individual_telescopes` to be defined before using this function
675
- but if any parameter is passed in this function, it overwrites the class attribute.
675
+ Define individual telescopes.
676
676
 
677
677
  Parameters
678
678
  ----------
@@ -680,7 +680,6 @@ class CorsikaHistograms:
680
680
  if False, the histograms are supposed to be filled for all telescopes.
681
681
  if True, one histogram is set for each telescope sepparately.
682
682
  """
683
-
684
683
  if new_individual_telescopes is None:
685
684
  self._individual_telescopes = False
686
685
  else:
@@ -692,22 +691,21 @@ class CorsikaHistograms:
692
691
 
693
692
  Raises
694
693
  ------
695
- HistogramNotCreated:
694
+ HistogramNotCreatedError:
696
695
  if the histogram was not previously created.
697
696
  """
698
-
699
697
  for histogram in self._allowed_histograms:
700
698
  if not hasattr(self, histogram) or getattr(self, histogram) is None:
701
699
  msg = (
702
- "The histograms were not created. Please, use `create_histograms` to create "
700
+ "The histograms were not created. Please, use create_histograms to create "
703
701
  "histograms from the CORSIKA output file."
704
702
  )
705
703
  self._logger.error(msg)
706
- raise HistogramNotCreated
704
+ raise HistogramNotCreatedError
707
705
 
708
706
  def _get_hist_2d_projection(self, label):
709
707
  """
710
- Helper function to get 2D distributions.
708
+ Get 2D distributions.
711
709
 
712
710
  Parameters
713
711
  ----------
@@ -728,11 +726,10 @@ class CorsikaHistograms:
728
726
  ValueError:
729
727
  if label is not valid.
730
728
  """
731
-
732
729
  if label not in self._allowed_2d_labels:
733
730
  msg = f"label is not valid. Valid entries are {self._allowed_2d_labels}"
734
731
  self._logger.error(msg)
735
- raise ValueError
732
+ raise ValueError(msg)
736
733
  self._raise_if_no_histogram()
737
734
 
738
735
  num_telescopes_to_fill = (
@@ -741,6 +738,7 @@ class CorsikaHistograms:
741
738
 
742
739
  x_bin_edges, y_bin_edges, hist_values = [], [], []
743
740
  for i_telescope in range(num_telescopes_to_fill):
741
+ mini_hist = None
744
742
  if label == "counts":
745
743
  mini_hist = self.hist_position[i_telescope][:, :, sum]
746
744
  hist_values.append(mini_hist.view().T)
@@ -776,8 +774,9 @@ class CorsikaHistograms:
776
774
 
777
775
  def get_2d_photon_density_distr(self):
778
776
  """
779
- Get 2D histograms of position of the Cherenkov photons on the ground. It returns the photon
780
- density per square meter.
777
+ Get 2D histograms of position of the Cherenkov photons on the ground.
778
+
779
+ It returns the photon density per square meter.
781
780
 
782
781
  Returns
783
782
  -------
@@ -822,8 +821,10 @@ class CorsikaHistograms:
822
821
 
823
822
  def get_2d_num_photons_distr(self):
824
823
  """
825
- Get the distribution of Cherenkov photons per event per telescope. It returns the 2D array
826
- accounting for the events from the telescopes given by `self.telescope_indices`.
824
+ Get the distribution of Cherenkov photons per event per telescope.
825
+
826
+ It returns the 2D array accounting for the events from the telescopes given
827
+ by self.telescope_indices.
827
828
 
828
829
  Returns
829
830
  -------
@@ -846,7 +847,7 @@ class CorsikaHistograms:
846
847
 
847
848
  def _get_hist_1d_projection(self, label):
848
849
  """
849
- Helper function to get 1D distributions.
850
+ Get 1D distributions.
850
851
 
851
852
  Parameters
852
853
  ----------
@@ -865,15 +866,15 @@ class CorsikaHistograms:
865
866
  ValueError:
866
867
  if label is not valid.
867
868
  """
868
-
869
869
  if label not in self._allowed_1d_labels:
870
870
  msg = f"{label} is not valid. Valid entries are {self._allowed_1d_labels}"
871
871
  self._logger.error(msg)
872
- raise ValueError
872
+ raise ValueError(msg)
873
873
  self._raise_if_no_histogram()
874
874
 
875
875
  x_bin_edges_list, hist_1d_list = [], []
876
876
  for i_hist, _ in enumerate(self.hist_position):
877
+ mini_hist = None
877
878
  if label == "wavelength":
878
879
  mini_hist = self.hist_position[i_hist][sum, sum, :]
879
880
  elif label == "time":
@@ -886,8 +887,8 @@ class CorsikaHistograms:
886
887
  return np.array(hist_1d_list), np.array(x_bin_edges_list)
887
888
 
888
889
  def _get_bins_max_dist(self, bins=None, max_dist=None):
889
- """Auxiliary function to get the number of bins and the max distance to generate the
890
- radial and the density histograms
890
+ """
891
+ Get the number of bins and the max distance to generate the radial and density histograms.
891
892
 
892
893
  Parameters
893
894
  ----------
@@ -896,21 +897,22 @@ class CorsikaHistograms:
896
897
  max_dist: float
897
898
  Maximum distance to consider in the 1D histogram (in meters).
898
899
  """
900
+ hist_position = "hist_position"
899
901
  if max_dist is None:
900
902
  max_dist = np.amax(
901
903
  [
902
- self.hist_config["hist_position"]["x axis"]["start"].to(u.m).value,
903
- self.hist_config["hist_position"]["x axis"]["stop"].to(u.m).value,
904
- self.hist_config["hist_position"]["y axis"]["start"].to(u.m).value,
905
- self.hist_config["hist_position"]["y axis"]["stop"].to(u.m).value,
904
+ self.hist_config[hist_position][X_AXIS_STRING]["start"].to(u.m).value,
905
+ self.hist_config[hist_position][X_AXIS_STRING]["stop"].to(u.m).value,
906
+ self.hist_config[hist_position][Y_AXIS_STRING]["start"].to(u.m).value,
907
+ self.hist_config[hist_position][Y_AXIS_STRING]["stop"].to(u.m).value,
906
908
  ]
907
909
  )
908
910
  if bins is None:
909
911
  bins = (
910
912
  np.amax(
911
913
  [
912
- self.hist_config["hist_position"]["x axis"]["bins"],
913
- self.hist_config["hist_position"]["y axis"]["bins"],
914
+ self.hist_config[hist_position][X_AXIS_STRING]["bins"],
915
+ self.hist_config[hist_position][Y_AXIS_STRING]["bins"],
914
916
  ]
915
917
  )
916
918
  // 2
@@ -920,8 +922,7 @@ class CorsikaHistograms:
920
922
 
921
923
  def get_photon_radial_distr(self, bins=None, max_dist=None):
922
924
  """
923
- Get the radial distribution of the photons on the ground in relation to the center of the
924
- array.
925
+ Get the phton radial distribution on the ground in relation to the center of the array.
925
926
 
926
927
  Parameters
927
928
  ----------
@@ -938,7 +939,6 @@ class CorsikaHistograms:
938
939
  The bin edges of the 1D histogram in meters with size = int(max_dist/bin_size) + 1,
939
940
  usually in meter.
940
941
  """
941
-
942
942
  bins, max_dist = self._get_bins_max_dist(bins=bins, max_dist=max_dist)
943
943
  bin_edges_1d_list, hist_1d_list = [], []
944
944
 
@@ -958,8 +958,7 @@ class CorsikaHistograms:
958
958
 
959
959
  def get_photon_density_distr(self, bins=None, max_dist=None):
960
960
  """
961
- Get the density distribution of the photons on the ground in relation to the center of the
962
- array.
961
+ Get the photon density distribution on the ground in relation to the center of the array.
963
962
 
964
963
  Parameters
965
964
  ----------
@@ -1010,9 +1009,10 @@ class CorsikaHistograms:
1010
1009
 
1011
1010
  def get_photon_time_of_emission_distr(self):
1012
1011
  """
1013
- Get the distribution of the emitted time of the Cherenkov photons. The clock starts when the
1014
- particle crosses the top of the atmosphere (CORSIKA-defined) if
1015
- `self.event_first_interaction_heights` is positive or at first interaction if otherwise.
1012
+ Get the distribution of the emitted time of the Cherenkov photons.
1013
+
1014
+ The clock starts when the particle crosses the top of the atmosphere (CORSIKA-defined) if
1015
+ self.event_first_interaction_heights is positive or at first interaction if otherwise.
1016
1016
 
1017
1017
  Returns
1018
1018
  -------
@@ -1040,16 +1040,12 @@ class CorsikaHistograms:
1040
1040
 
1041
1041
  @property
1042
1042
  def num_photons_per_event_per_telescope(self):
1043
- """
1044
- The number of photons per event per telescope.
1045
- """
1043
+ """The number of photons per event per telescope."""
1046
1044
  return self._num_photons_per_event_per_telescope
1047
1045
 
1048
1046
  @num_photons_per_event_per_telescope.setter
1049
1047
  def num_photons_per_event_per_telescope(self, num_photons_per_event_per_telescope_to_set):
1050
- """
1051
- Set the number of photons per event per telescope.
1052
- """
1048
+ """Set the number of photons per event per telescope."""
1053
1049
  self._num_photons_per_event_per_telescope = (
1054
1050
  np.array(num_photons_per_event_per_telescope_to_set)
1055
1051
  .reshape(self.num_events, len(self.telescope_indices))
@@ -1059,8 +1055,9 @@ class CorsikaHistograms:
1059
1055
  @property
1060
1056
  def num_photons_per_event(self):
1061
1057
  """
1062
- Get the distribution of the number of photons amongst the events,
1063
- including the telescopes indicated by `self.telescope_indices`.
1058
+ Get the the number of photons per events.
1059
+
1060
+ Includes the telescopes indicated by self.telescope_indices.
1064
1061
 
1065
1062
  Returns
1066
1063
  -------
@@ -1109,7 +1106,6 @@ class CorsikaHistograms:
1109
1106
  numpy.array
1110
1107
  Number of photons per telescope.
1111
1108
  """
1112
-
1113
1109
  hist, bin_edges = np.histogram(self.num_photons_per_telescope, bins=bins, range=hist_range)
1114
1110
  return hist.reshape(1, bins), bin_edges.reshape(1, bins + 1)
1115
1111
 
@@ -1135,7 +1131,6 @@ class CorsikaHistograms:
1135
1131
  dict
1136
1132
  Meta dictionary for the hdf5 files with the histograms.
1137
1133
  """
1138
-
1139
1134
  if self.__meta_dict is None:
1140
1135
  self.__meta_dict = {
1141
1136
  "corsika_version": self.corsika_version,
@@ -1157,55 +1152,60 @@ class CorsikaHistograms:
1157
1152
  dict:
1158
1153
  The dictionary with information about the 1D distributions.
1159
1154
  """
1155
+ fn_key = "function"
1156
+ file_name = "file name"
1157
+ title = "title"
1158
+ bin_edges = "bin edges"
1159
+ axis_unit = "axis unit"
1160
1160
  self._dict_1d_distributions = {
1161
1161
  "wavelength": {
1162
- "function": "get_photon_wavelength_distr",
1163
- "file name": "hist_1d_photon_wavelength_distr",
1164
- "title": "Photon wavelength distribution",
1165
- "bin edges": "wavelength",
1166
- "axis unit": self.hist_config["hist_position"]["z axis"]["start"].unit,
1162
+ fn_key: "get_photon_wavelength_distr",
1163
+ file_name: "hist_1d_photon_wavelength_distr",
1164
+ title: "Photon wavelength distribution",
1165
+ bin_edges: "wavelength",
1166
+ axis_unit: self.hist_config["hist_position"][Z_AXIS_STRING]["start"].unit,
1167
1167
  },
1168
1168
  "counts": {
1169
- "function": "get_photon_radial_distr",
1170
- "file name": "hist_1d_photon_radial_distr",
1171
- "title": "Radial photon distribution on the ground",
1172
- "bin edges": "Distance to center",
1173
- "axis unit": self.hist_config["hist_position"]["x axis"]["start"].unit,
1169
+ fn_key: "get_photon_radial_distr",
1170
+ file_name: "hist_1d_photon_radial_distr",
1171
+ title: "Radial photon distribution on the ground",
1172
+ bin_edges: "Distance to center",
1173
+ axis_unit: self.hist_config["hist_position"][X_AXIS_STRING]["start"].unit,
1174
1174
  },
1175
1175
  "density": {
1176
- "function": "get_photon_density_distr",
1177
- "file name": "hist_1d_photon_density_distr",
1178
- "title": "Photon density distribution on the ground",
1179
- "bin edges": "Distance to center",
1180
- "axis unit": self.hist_config["hist_position"]["x axis"]["start"].unit,
1176
+ fn_key: "get_photon_density_distr",
1177
+ file_name: "hist_1d_photon_density_distr",
1178
+ title: "Photon density distribution on the ground",
1179
+ bin_edges: "Distance to center",
1180
+ axis_unit: self.hist_config["hist_position"][X_AXIS_STRING]["start"].unit,
1181
1181
  },
1182
1182
  "time": {
1183
- "function": "get_photon_time_of_emission_distr",
1184
- "file name": "hist_1d_photon_time_distr",
1185
- "title": "Photon time of arrival distribution",
1186
- "bin edges": "Time of arrival",
1187
- "axis unit": self.hist_config["hist_time_altitude"]["x axis"]["start"].unit,
1183
+ fn_key: "get_photon_time_of_emission_distr",
1184
+ file_name: "hist_1d_photon_time_distr",
1185
+ title: "Photon time of arrival distribution",
1186
+ bin_edges: "Time of arrival",
1187
+ axis_unit: self.hist_config["hist_time_altitude"][X_AXIS_STRING]["start"].unit,
1188
1188
  },
1189
1189
  "altitude": {
1190
- "function": "get_photon_altitude_distr",
1191
- "file name": "hist_1d_photon_altitude_distr",
1192
- "title": "Photon altitude of emission distribution",
1193
- "bin edges": "Altitude of emission",
1194
- "axis unit": self.hist_config["hist_time_altitude"]["y axis"]["start"].unit,
1190
+ fn_key: "get_photon_altitude_distr",
1191
+ file_name: "hist_1d_photon_altitude_distr",
1192
+ title: "Photon altitude of emission distribution",
1193
+ bin_edges: "Altitude of emission",
1194
+ axis_unit: self.hist_config["hist_time_altitude"][Y_AXIS_STRING]["start"].unit,
1195
1195
  },
1196
1196
  "num_photons_per_event": {
1197
- "function": "get_num_photons_per_event_distr",
1198
- "file name": "hist_1d_photon_per_event_distr",
1199
- "title": "Photons per event distribution",
1200
- "bin edges": "Event counter",
1201
- "axis unit": u.dimensionless_unscaled,
1197
+ fn_key: "get_num_photons_per_event_distr",
1198
+ file_name: "hist_1d_photon_per_event_distr",
1199
+ title: "Photons per event distribution",
1200
+ bin_edges: "Event counter",
1201
+ axis_unit: u.dimensionless_unscaled,
1202
1202
  },
1203
1203
  "num_photons_per_telescope": {
1204
- "function": "get_num_photons_per_telescope_distr",
1205
- "file name": "hist_1d_photon_per_telescope_distr",
1206
- "title": "Photons per telescope distribution",
1207
- "bin edges": "Telescope counter",
1208
- "axis unit": u.dimensionless_unscaled,
1204
+ fn_key: "get_num_photons_per_telescope_distr",
1205
+ file_name: "hist_1d_photon_per_telescope_distr",
1206
+ title: "Photons per telescope distribution",
1207
+ bin_edges: "Telescope counter",
1208
+ axis_unit: u.dimensionless_unscaled,
1209
1209
  },
1210
1210
  }
1211
1211
  return self._dict_1d_distributions
@@ -1219,14 +1219,14 @@ class CorsikaHistograms:
1219
1219
  overwrite: bool
1220
1220
  If True overwrites the histograms already saved in the hdf5 file.
1221
1221
  """
1222
-
1222
+ axis_unit = "axis unit"
1223
1223
  for _, function_dict in self.dict_1d_distributions.items():
1224
1224
  self._meta_dict["Title"] = sanitize_name(function_dict["title"])
1225
- function = getattr(self, function_dict["function"])
1226
- hist_1d_list, x_bin_edges_list = function()
1227
- x_bin_edges_list = x_bin_edges_list * function_dict["axis unit"]
1225
+ histogram_function = getattr(self, function_dict["function"])
1226
+ hist_1d_list, x_bin_edges_list = histogram_function()
1227
+ x_bin_edges_list = x_bin_edges_list * function_dict[axis_unit]
1228
1228
  if function_dict["function"] == "get_photon_density_distr":
1229
- histogram_value_unit = 1 / (function_dict["axis unit"] ** 2)
1229
+ histogram_value_unit = 1 / (function_dict[axis_unit] ** 2)
1230
1230
  else:
1231
1231
  histogram_value_unit = u.dimensionless_unscaled
1232
1232
  hist_1d_list = hist_1d_list * histogram_value_unit
@@ -1270,52 +1270,63 @@ class CorsikaHistograms:
1270
1270
  dict:
1271
1271
  The dictionary with information about the 2D distributions.
1272
1272
  """
1273
+ fn_key = "function"
1274
+ file_name = "file name"
1275
+ title = "title"
1276
+ x_bin_edges = "x bin edges"
1277
+ x_axis_unit = "x axis unit"
1278
+ y_bin_edges = "y bin edges"
1279
+ y_axis_unit = "y axis unit"
1273
1280
  if self._dict_2d_distributions is None:
1274
1281
  self._dict_2d_distributions = {
1275
1282
  "counts": {
1276
- "function": "get_2d_photon_position_distr",
1277
- "file name": "hist_2d_photon_count_distr",
1278
- "title": "Photon count distribution on the ground",
1279
- "x bin edges": "x position on the ground",
1280
- "x axis unit": self.hist_config["hist_position"]["x axis"]["start"].unit,
1281
- "y bin edges": "y position on the ground",
1282
- "y axis unit": self.hist_config["hist_position"]["y axis"]["start"].unit,
1283
+ fn_key: "get_2d_photon_position_distr",
1284
+ file_name: "hist_2d_photon_count_distr",
1285
+ title: "Photon count distribution on the ground",
1286
+ x_bin_edges: "x position on the ground",
1287
+ x_axis_unit: self.hist_config["hist_position"][X_AXIS_STRING]["start"].unit,
1288
+ y_bin_edges: "y position on the ground",
1289
+ y_axis_unit: self.hist_config["hist_position"][Y_AXIS_STRING]["start"].unit,
1283
1290
  },
1284
1291
  "density": {
1285
- "function": "get_2d_photon_density_distr",
1286
- "file name": "hist_2d_photon_density_distr",
1287
- "title": "Photon density distribution on the ground",
1288
- "x bin edges": "x position on the ground",
1289
- "x axis unit": self.hist_config["hist_position"]["x axis"]["start"].unit,
1290
- "y bin edges": "y position on the ground",
1291
- "y axis unit": self.hist_config["hist_position"]["y axis"]["start"].unit,
1292
+ fn_key: "get_2d_photon_density_distr",
1293
+ file_name: "hist_2d_photon_density_distr",
1294
+ title: "Photon density distribution on the ground",
1295
+ x_bin_edges: "x position on the ground",
1296
+ x_axis_unit: self.hist_config["hist_position"][X_AXIS_STRING]["start"].unit,
1297
+ y_bin_edges: "y position on the ground",
1298
+ y_axis_unit: self.hist_config["hist_position"][Y_AXIS_STRING]["start"].unit,
1292
1299
  },
1293
1300
  "direction": {
1294
- "function": "get_2d_photon_direction_distr",
1295
- "file name": "hist_2d_photon_direction_distr",
1296
- "title": "Photon arrival direction",
1297
- "x bin edges": "x direction cosine",
1298
- "x axis unit": u.dimensionless_unscaled,
1299
- "y bin edges": "y direction cosine",
1300
- "y axis unit": u.dimensionless_unscaled,
1301
+ fn_key: "get_2d_photon_direction_distr",
1302
+ file_name: "hist_2d_photon_direction_distr",
1303
+ title: "Photon arrival direction",
1304
+ x_bin_edges: "x direction cosine",
1305
+ x_axis_unit: u.dimensionless_unscaled,
1306
+ y_bin_edges: "y direction cosine",
1307
+ y_axis_unit: u.dimensionless_unscaled,
1301
1308
  },
1302
1309
  "time_altitude": {
1303
- "function": "get_2d_photon_time_altitude_distr",
1304
- "file name": "hist_2d_photon_time_altitude_distr",
1305
- "title": "Time of arrival vs altitude of emission",
1306
- "x bin edges": "Time of arrival",
1307
- "x axis unit": self.hist_config["hist_time_altitude"]["x axis"]["start"].unit,
1308
- "y bin edges": "Altitude of emission",
1309
- "y axis unit": self.hist_config["hist_time_altitude"]["y axis"]["start"].unit,
1310
+ fn_key: "get_2d_photon_time_altitude_distr",
1311
+ file_name: "hist_2d_photon_time_altitude_distr",
1312
+ title: "Time of arrival vs altitude of emission",
1313
+ x_bin_edges: "Time of arrival",
1314
+ x_axis_unit: self.hist_config["hist_time_altitude"][X_AXIS_STRING][
1315
+ "start"
1316
+ ].unit,
1317
+ y_bin_edges: "Altitude of emission",
1318
+ y_axis_unit: self.hist_config["hist_time_altitude"][Y_AXIS_STRING][
1319
+ "start"
1320
+ ].unit,
1310
1321
  },
1311
1322
  "num_photons_per_telescope": {
1312
- "function": "get_2d_num_photons_distr",
1313
- "file name": "hist_2d_photon_telescope_event_distr",
1314
- "title": "Number of photons per telescope and per event",
1315
- "x bin edges": "Telescope counter",
1316
- "x axis unit": u.dimensionless_unscaled,
1317
- "y bin edges": "Event counter",
1318
- "y axis unit": u.dimensionless_unscaled,
1323
+ fn_key: "get_2d_num_photons_distr",
1324
+ file_name: "hist_2d_photon_telescope_event_distr",
1325
+ title: "Number of photons per telescope and per event",
1326
+ x_bin_edges: "Telescope counter",
1327
+ x_axis_unit: u.dimensionless_unscaled,
1328
+ y_bin_edges: "Event counter",
1329
+ y_axis_unit: u.dimensionless_unscaled,
1319
1330
  },
1320
1331
  }
1321
1332
  return self._dict_2d_distributions
@@ -1329,23 +1340,26 @@ class CorsikaHistograms:
1329
1340
  overwrite: bool
1330
1341
  If True overwrites the histograms already saved in the hdf5 file.
1331
1342
  """
1343
+ x_axis_unit = "x axis unit"
1344
+ y_axis_unit = "y axis unit"
1345
+
1332
1346
  for property_name, function_dict in self.dict_2d_distributions.items():
1333
1347
  self._meta_dict["Title"] = sanitize_name(function_dict["title"])
1334
- function = getattr(self, function_dict["function"])
1348
+ histogram_function = getattr(self, function_dict["function"])
1335
1349
 
1336
- hist_2d_list, x_bin_edges_list, y_bin_edges_list = function()
1350
+ hist_2d_list, x_bin_edges_list, y_bin_edges_list = histogram_function()
1337
1351
  if function_dict["function"] == "get_2d_photon_density_distr":
1338
1352
  histogram_value_unit = 1 / (
1339
- self.dict_2d_distributions[property_name]["x axis unit"]
1340
- * self.dict_2d_distributions[property_name]["y axis unit"]
1353
+ self.dict_2d_distributions[property_name][x_axis_unit]
1354
+ * self.dict_2d_distributions[property_name][y_axis_unit]
1341
1355
  )
1342
1356
  else:
1343
1357
  histogram_value_unit = u.dimensionless_unscaled
1344
1358
 
1345
1359
  hist_2d_list, x_bin_edges_list, y_bin_edges_list = (
1346
1360
  hist_2d_list * histogram_value_unit,
1347
- x_bin_edges_list * self.dict_2d_distributions[property_name]["x axis unit"],
1348
- y_bin_edges_list * self.dict_2d_distributions[property_name]["y axis unit"],
1361
+ x_bin_edges_list * self.dict_2d_distributions[property_name][x_axis_unit],
1362
+ y_bin_edges_list * self.dict_2d_distributions[property_name][y_axis_unit],
1349
1363
  )
1350
1364
 
1351
1365
  for i_histogram, _ in enumerate(x_bin_edges_list):
@@ -1356,7 +1370,7 @@ class CorsikaHistograms:
1356
1370
  )
1357
1371
  else:
1358
1372
  hdf5_table_name = (
1359
- f"/{self.dict_2d_distributions[property_name]['file name']}" f"_all_tels"
1373
+ f"/{self.dict_2d_distributions[property_name]['file name']}_all_tels"
1360
1374
  )
1361
1375
  table = fill_hdf5_table(
1362
1376
  hist=hist_2d_list[i_histogram],
@@ -1381,14 +1395,13 @@ class CorsikaHistograms:
1381
1395
  self, event_header_element, bins=50, hist_range=None, overwrite=False
1382
1396
  ):
1383
1397
  """
1384
- Export to a hdf5 file the 1D histogram for the key `event_header_element` from the CORSIKA
1385
- event header.
1398
+ Export 'event_header_element' from CORSIKA to hd5 for a 1D histogram.
1386
1399
 
1387
1400
  Parameters
1388
1401
  ----------
1389
1402
  event_header_element: str
1390
1403
  The key to the CORSIKA event header element.
1391
- Possible choices are stored in `self.all_event_keys`.
1404
+ Possible choices are stored in 'self.all_event_keys'.
1392
1405
  bins: float
1393
1406
  Number of bins for the histogram.
1394
1407
  hist_range: 2-tuple
@@ -1396,7 +1409,6 @@ class CorsikaHistograms:
1396
1409
  overwrite: bool
1397
1410
  If True overwrites the histograms already saved in the hdf5 file.
1398
1411
  """
1399
-
1400
1412
  hist, bin_edges = self.event_1d_histogram(
1401
1413
  event_header_element, bins=bins, hist_range=hist_range
1402
1414
  )
@@ -1430,8 +1442,10 @@ class CorsikaHistograms:
1430
1442
  overwrite=False,
1431
1443
  ):
1432
1444
  """
1433
- Export to a hdf5 file the 2D histogram for the key `event_header_element_1` and
1434
- `event_header_element_2`from the CORSIKA event header.
1445
+ Export event_header of a 2D histogram to a hdf5 file.
1446
+
1447
+ Searches the 2D histogram for the key 'event_header_element_1' and
1448
+ 'event_header_element_2'from the CORSIKA event header.
1435
1449
 
1436
1450
  Parameters
1437
1451
  ----------
@@ -1439,14 +1453,15 @@ class CorsikaHistograms:
1439
1453
  The key to the CORSIKA event header element.
1440
1454
  event_header_element_2: str
1441
1455
  The key to the CORSIKA event header element.
1442
- Possible choices for `event_header_element_1` and `event_header_element_2` are stored
1443
- in `self.all_event_keys`.
1456
+ Possible choices for 'event_header_element_1' and 'event_header_element_2' are stored
1457
+ in 'self.all_event_keys'.
1444
1458
  bins: float
1445
1459
  Number of bins for the histogram.
1446
1460
  hist_range: 2-tuple
1447
1461
  Tuple to define the range of the histogram.
1448
1462
  overwrite: bool
1449
1463
  If True overwrites the histograms already saved in the hdf5 file.
1464
+
1450
1465
  """
1451
1466
  hist, x_bin_edges, y_bin_edges = self.event_2d_histogram(
1452
1467
  event_header_element_1, event_header_element_2, bins=bins, hist_range=hist_range
@@ -1478,8 +1493,7 @@ class CorsikaHistograms:
1478
1493
  @property
1479
1494
  def num_photons_per_telescope(self):
1480
1495
  """
1481
- The number of photons per event, considering the telescopes given by
1482
- self.telescope_indices.
1496
+ The number of photons per event, considering the telescopes given by self.telescope_indices.
1483
1497
 
1484
1498
  Returns
1485
1499
  -------
@@ -1508,7 +1522,8 @@ class CorsikaHistograms:
1508
1522
  def telescope_positions(self):
1509
1523
  """
1510
1524
  The telescope positions found in the CORSIKA output file.
1511
- It does not depend on the `telescope_indices` attribute.
1525
+
1526
+ It does not depend on the telescope_indices attribute.
1512
1527
 
1513
1528
  Returns
1514
1529
  -------
@@ -1533,7 +1548,7 @@ class CorsikaHistograms:
1533
1548
 
1534
1549
  # In the next five functions, we provide dedicated functions to retrieve specific information
1535
1550
  # about the runs, i.e. zenith, azimuth, total energy, interaction height and Earth magnetic
1536
- # field defined for the run. For other information, please use the `get_event_parameter_info`
1551
+ # field defined for the run. For other information, please use the get_event_parameter_info
1537
1552
  # function.
1538
1553
  @property
1539
1554
  def event_zenith_angles(self):
@@ -1590,8 +1605,9 @@ class CorsikaHistograms:
1590
1605
  def event_first_interaction_heights(self):
1591
1606
  """
1592
1607
  Get the height of the first interaction in astropy units of km.
1593
- If negative, tracking starts at margin of atmosphere, see TSTART in the CORSIKA 7 user guide
1594
- .
1608
+
1609
+ If negative, tracking starts at margin of atmosphere,
1610
+ see TSTART in the CORSIKA 7 user guide.
1595
1611
 
1596
1612
  Returns
1597
1613
  -------
@@ -1609,6 +1625,7 @@ class CorsikaHistograms:
1609
1625
  def magnetic_field(self):
1610
1626
  """
1611
1627
  Get the Earth magnetic field from the events header in astropy units of microT.
1628
+
1612
1629
  A tuple with Earth's magnetic field in the x and z directions are returned.
1613
1630
 
1614
1631
  Returns
@@ -1626,8 +1643,10 @@ class CorsikaHistograms:
1626
1643
 
1627
1644
  def get_event_parameter_info(self, parameter):
1628
1645
  """
1629
- Get specific information (i.e. any parameter) of the events. The parameter is passed through
1630
- the key word `parameter`. Available options are to be found under `self.all_event_keys`.
1646
+ Get specific information (i.e. any parameter) of the events.
1647
+
1648
+ The parameter is passed through the key word parameter.
1649
+ Available options are to be found under self.all_event_keys.
1631
1650
  The unit of the parameter, if any, is given according to the CORSIKA version
1632
1651
  (please see user guide in this case).
1633
1652
 
@@ -1635,7 +1654,7 @@ class CorsikaHistograms:
1635
1654
  ----------
1636
1655
  parameter: str
1637
1656
  The parameter of interest. Available options are to be found under
1638
- `self.all_event_keys`.
1657
+ self.all_event_keys.
1639
1658
 
1640
1659
  Returns
1641
1660
  -------
@@ -1647,17 +1666,18 @@ class CorsikaHistograms:
1647
1666
  KeyError:
1648
1667
  If parameter is not valid.
1649
1668
  """
1650
-
1651
1669
  if parameter not in self.all_event_keys:
1652
- msg = f"`key` is not valid. Valid entries are {self.all_event_keys}"
1670
+ msg = f"key is not valid. Valid entries are {self.all_event_keys}"
1653
1671
  self._logger.error(msg)
1654
1672
  raise KeyError
1655
1673
  return self.event_information[parameter]
1656
1674
 
1657
1675
  def get_run_info(self, parameter):
1658
1676
  """
1659
- Get specific information (i.e. any parameter) of the run. The parameter is passed through
1660
- the key word `parameter`. Available options are to be found under `self.all_run_keys`.
1677
+ Get specific information (i.e. any parameter) of the run.
1678
+
1679
+ The parameter is passed through the key word parameter.
1680
+ Available options are to be found under self.all_run_keys.
1661
1681
  The unit of the parameter, if any, is given according to the CORSIKA version
1662
1682
  (please see user guide in this case).
1663
1683
 
@@ -1665,7 +1685,7 @@ class CorsikaHistograms:
1665
1685
  ----------
1666
1686
  parameter: str
1667
1687
  The parameter of interest. Available options are to be found under
1668
- `self.all_run_keys`.
1688
+ self.all_run_keys.
1669
1689
 
1670
1690
  Raises
1671
1691
  ------
@@ -1673,15 +1693,16 @@ class CorsikaHistograms:
1673
1693
  If parameter is not valid.
1674
1694
  """
1675
1695
  if parameter not in self.all_run_keys:
1676
- msg = f"`key` is not valid. Valid entries are {self.all_run_keys}"
1696
+ msg = f"key is not valid. Valid entries are {self.all_run_keys}"
1677
1697
  self._logger.error(msg)
1678
1698
  raise KeyError
1679
1699
  return self.header[parameter]
1680
1700
 
1681
1701
  def event_1d_histogram(self, key, bins=50, hist_range=None):
1682
1702
  """
1683
- Create a histogram for the all events using `key` as parameter.
1684
- Valid keys are stored in `self.all_event_keys` (CORSIKA defined).
1703
+ Create a histogram for the all events using key as parameter.
1704
+
1705
+ Valid keys are stored in self.all_event_keys (CORSIKA defined).
1685
1706
 
1686
1707
  Parameters
1687
1708
  ----------
@@ -1707,7 +1728,7 @@ class CorsikaHistograms:
1707
1728
  If key is not valid.
1708
1729
  """
1709
1730
  if key not in self.all_event_keys:
1710
- msg = f"`key` is not valid. Valid entries are {self.all_event_keys}"
1731
+ msg = f"key is not valid. Valid entries are {self.all_event_keys}"
1711
1732
  self._logger.error(msg)
1712
1733
  raise KeyError
1713
1734
  hist, bin_edges = np.histogram(
@@ -1719,8 +1740,9 @@ class CorsikaHistograms:
1719
1740
 
1720
1741
  def event_2d_histogram(self, key_1, key_2, bins=50, hist_range=None):
1721
1742
  """
1722
- Create a 2D histogram for the all events using `key_1` and `key_2` as parameters.
1723
- Valid keys are stored in `self.all_event_keys` (CORSIKA defined).
1743
+ Create a 2D histogram for the all events using key_1 and key_2 as parameters.
1744
+
1745
+ Valid keys are stored in self.all_event_keys (CORSIKA defined).
1724
1746
 
1725
1747
  Parameters
1726
1748
  ----------