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.
- gammasimtools-0.8.2.dist-info/METADATA +173 -0
- gammasimtools-0.8.2.dist-info/RECORD +345 -0
- {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.2.dist-info}/WHEEL +1 -1
- gammasimtools-0.8.2.dist-info/entry_points.txt +31 -0
- simtools/_dev_version/__init__.py +9 -0
- simtools/_version.py +2 -2
- simtools/applications/calculate_trigger_rate.py +210 -0
- simtools/applications/convert_all_model_parameters_from_simtel.py +372 -0
- simtools/applications/{print_array_elements.py → convert_geo_coordinates_of_array_elements.py} +58 -63
- simtools/applications/convert_model_parameter_from_simtel.py +119 -0
- simtools/applications/{add_file_to_db.py → db_add_file_to_db.py} +70 -60
- simtools/applications/db_add_model_parameters_from_repository_to_db.py +184 -0
- simtools/applications/db_add_value_from_json_to_db.py +105 -0
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +180 -0
- simtools/applications/db_get_array_layouts_from_db.py +162 -0
- simtools/applications/{get_file_from_db.py → db_get_file_from_db.py} +30 -34
- simtools/applications/db_get_parameter_from_db.py +131 -0
- simtools/applications/db_inspect_databases.py +52 -0
- simtools/applications/derive_mirror_rnda.py +39 -255
- simtools/applications/derive_psf_parameters.py +441 -0
- simtools/applications/generate_array_config.py +82 -0
- simtools/applications/generate_corsika_histograms.py +52 -52
- simtools/applications/generate_default_metadata.py +5 -8
- simtools/applications/generate_regular_arrays.py +117 -0
- simtools/applications/generate_simtel_array_histograms.py +97 -56
- simtools/applications/plot_array_layout.py +345 -115
- simtools/applications/production_generate_simulation_config.py +158 -0
- simtools/applications/production_scale_events.py +168 -0
- simtools/applications/simulate_light_emission.py +478 -0
- simtools/applications/simulate_prod.py +97 -175
- simtools/applications/submit_data_from_external.py +9 -12
- simtools/applications/submit_model_parameter_from_external.py +122 -0
- simtools/applications/validate_camera_efficiency.py +35 -102
- simtools/applications/validate_camera_fov.py +20 -19
- simtools/applications/{compare_cumulative_psf.py → validate_cumulative_psf.py} +45 -44
- simtools/applications/validate_file_using_schema.py +111 -47
- simtools/applications/validate_optics.py +17 -22
- simtools/camera_efficiency.py +193 -202
- simtools/configuration/commandline_parser.py +384 -96
- simtools/configuration/configurator.py +55 -71
- simtools/constants.py +5 -5
- simtools/corsika/corsika_config.py +482 -342
- simtools/corsika/corsika_histograms.py +226 -204
- simtools/corsika/corsika_histograms_visualize.py +23 -24
- simtools/corsika/primary_particle.py +159 -0
- simtools/data_model/data_reader.py +25 -20
- simtools/data_model/format_checkers.py +52 -0
- simtools/data_model/metadata_collector.py +211 -185
- simtools/data_model/metadata_model.py +115 -37
- simtools/data_model/model_data_writer.py +335 -26
- simtools/data_model/validate_data.py +366 -154
- simtools/db/db_array_elements.py +130 -0
- simtools/db/db_from_repo_handler.py +106 -0
- simtools/db/db_handler.py +1246 -0
- simtools/io_operations/hdf5_handler.py +3 -1
- simtools/io_operations/io_handler.py +32 -57
- simtools/job_execution/job_manager.py +82 -69
- simtools/layout/array_layout.py +325 -537
- simtools/layout/geo_coordinates.py +8 -11
- simtools/layout/telescope_position.py +163 -86
- simtools/model/array_model.py +312 -259
- simtools/model/calibration_model.py +50 -0
- simtools/model/camera.py +277 -523
- simtools/model/mirrors.py +68 -49
- simtools/model/model_parameter.py +602 -0
- simtools/model/model_utils.py +11 -39
- simtools/model/site_model.py +161 -0
- simtools/model/telescope_model.py +143 -633
- simtools/production_configuration/calculate_statistical_errors_grid_point.py +454 -0
- simtools/production_configuration/event_scaler.py +146 -0
- simtools/production_configuration/generate_simulation_config.py +193 -0
- simtools/production_configuration/interpolation_handler.py +197 -0
- simtools/ray_tracing/__init__.py +0 -0
- simtools/ray_tracing/mirror_panel_psf.py +280 -0
- simtools/{psf_analysis.py → ray_tracing/psf_analysis.py} +133 -47
- simtools/ray_tracing/ray_tracing.py +646 -0
- simtools/runners/__init__.py +0 -0
- simtools/runners/corsika_runner.py +240 -0
- simtools/runners/corsika_simtel_runner.py +225 -0
- simtools/runners/runner_services.py +307 -0
- simtools/runners/simtel_runner.py +224 -0
- simtools/schemas/array_elements.yml +137 -0
- simtools/schemas/integration_tests_config.metaschema.yml +93 -0
- simtools/schemas/metadata.metaschema.yml +6 -0
- simtools/schemas/model_parameter.metaschema.yml +78 -0
- simtools/schemas/{data.metaschema.yml → model_parameter_and_data_schema.metaschema.yml} +27 -44
- simtools/schemas/model_parameters/adjust_gain.schema.yml +37 -0
- simtools/schemas/model_parameters/altitude.schema.yml +37 -0
- simtools/schemas/model_parameters/array_coordinates.schema.yml +33 -0
- simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +77 -0
- simtools/schemas/model_parameters/array_element_position_ground.schema.yml +39 -0
- simtools/schemas/model_parameters/array_element_position_utm.schema.yml +39 -0
- simtools/schemas/model_parameters/array_layouts.schema.yml +48 -0
- simtools/schemas/model_parameters/array_triggers.schema.yml +93 -0
- simtools/schemas/model_parameters/asum_clipping.schema.yml +38 -0
- simtools/schemas/model_parameters/asum_offset.schema.yml +35 -0
- simtools/schemas/model_parameters/asum_shaping.schema.yml +35 -0
- simtools/schemas/model_parameters/asum_threshold.schema.yml +38 -0
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +32 -0
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +35 -0
- simtools/schemas/model_parameters/axes_offsets.schema.yml +53 -0
- simtools/schemas/model_parameters/camera_body_diameter.schema.yml +40 -0
- simtools/schemas/model_parameters/camera_body_shape.schema.yml +45 -0
- simtools/schemas/model_parameters/camera_config_file.schema.yml +40 -0
- simtools/schemas/model_parameters/camera_config_rotate.schema.yml +36 -0
- simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +43 -0
- simtools/schemas/model_parameters/camera_degraded_map.schema.yml +42 -0
- simtools/schemas/model_parameters/camera_depth.schema.yml +42 -0
- simtools/schemas/model_parameters/camera_filter.schema.yml +45 -0
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +29 -0
- simtools/schemas/model_parameters/camera_pixels.schema.yml +36 -0
- simtools/schemas/model_parameters/camera_transmission.schema.yml +41 -0
- simtools/schemas/model_parameters/channels_per_chip.schema.yml +36 -0
- simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +35 -0
- simtools/schemas/model_parameters/corsika_cherenkov_photon_bunch_size.schema.yml +27 -0
- simtools/schemas/model_parameters/corsika_cherenkov_photon_wavelength_range.schema.yml +38 -0
- simtools/schemas/model_parameters/corsika_first_interaction_height.schema.yml +28 -0
- simtools/schemas/model_parameters/corsika_iact_io_buffer.schema.yml +23 -0
- simtools/schemas/model_parameters/corsika_iact_max_bunches.schema.yml +27 -0
- simtools/schemas/model_parameters/corsika_iact_split_auto.schema.yml +28 -0
- simtools/schemas/model_parameters/corsika_longitudinal_shower_development.schema.yml +27 -0
- simtools/schemas/model_parameters/corsika_observation_level.schema.yml +38 -0
- simtools/schemas/model_parameters/corsika_particle_kinetic_energy_cutoff.schema.yml +52 -0
- simtools/schemas/model_parameters/corsika_starting_grammage.schema.yml +27 -0
- simtools/schemas/model_parameters/dark_events.schema.yml +32 -0
- simtools/schemas/model_parameters/default_trigger.schema.yml +35 -0
- simtools/schemas/model_parameters/design_model.schema.yml +31 -0
- simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +32 -0
- simtools/schemas/model_parameters/disc_bins.schema.yml +39 -0
- simtools/schemas/model_parameters/disc_start.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +42 -0
- simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +39 -0
- simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +40 -0
- simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +33 -0
- simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +42 -0
- simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +37 -0
- simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +44 -0
- simtools/schemas/model_parameters/discriminator_threshold.schema.yml +36 -0
- simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +45 -0
- simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +40 -0
- simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +38 -0
- simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +38 -0
- simtools/schemas/model_parameters/dish_shape_length.schema.yml +41 -0
- simtools/schemas/model_parameters/dsum_clipping.schema.yml +38 -0
- simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +38 -0
- simtools/schemas/model_parameters/dsum_offset.schema.yml +37 -0
- simtools/schemas/model_parameters/dsum_pedsub.schema.yml +33 -0
- simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +39 -0
- simtools/schemas/model_parameters/dsum_prescale.schema.yml +44 -0
- simtools/schemas/model_parameters/dsum_presum_max.schema.yml +38 -0
- simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +45 -0
- simtools/schemas/model_parameters/dsum_shaping.schema.yml +44 -0
- simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +32 -0
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +43 -0
- simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +42 -0
- simtools/schemas/model_parameters/effective_focal_length.schema.yml +61 -0
- simtools/schemas/model_parameters/epsg_code.schema.yml +37 -0
- simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +35 -0
- simtools/schemas/model_parameters/fadc_amplitude.schema.yml +46 -0
- simtools/schemas/model_parameters/fadc_bins.schema.yml +40 -0
- simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +50 -0
- simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +38 -0
- simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +49 -0
- simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +47 -0
- simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +51 -0
- simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +37 -0
- simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +49 -0
- simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +39 -0
- simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +40 -0
- simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +50 -0
- simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_max_signal.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_max_sum.schema.yml +39 -0
- simtools/schemas/model_parameters/fadc_mhz.schema.yml +31 -0
- simtools/schemas/model_parameters/fadc_noise.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_pedestal.schema.yml +40 -0
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +39 -0
- simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +50 -0
- simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +42 -0
- simtools/schemas/model_parameters/flatfielding.schema.yml +37 -0
- simtools/schemas/model_parameters/focal_length.schema.yml +45 -0
- simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +158 -0
- simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +29 -0
- simtools/schemas/model_parameters/focus_offset.schema.yml +66 -0
- simtools/schemas/model_parameters/gain_variation.schema.yml +43 -0
- simtools/schemas/model_parameters/geomag_horizontal.schema.yml +34 -0
- simtools/schemas/model_parameters/geomag_rotation.schema.yml +37 -0
- simtools/schemas/model_parameters/geomag_vertical.schema.yml +34 -0
- simtools/schemas/model_parameters/hg_lg_variation.schema.yml +36 -0
- simtools/schemas/model_parameters/iobuf_maximum.schema.yml +34 -0
- simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +34 -0
- simtools/schemas/model_parameters/laser_events.schema.yml +36 -0
- simtools/schemas/model_parameters/laser_external_trigger.schema.yml +35 -0
- simtools/schemas/model_parameters/laser_photons.schema.yml +32 -0
- simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +34 -0
- simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +34 -0
- simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +33 -0
- simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +33 -0
- simtools/schemas/model_parameters/laser_var_photons.schema.yml +33 -0
- simtools/schemas/model_parameters/laser_wavelength.schema.yml +33 -0
- simtools/schemas/model_parameters/led_events.schema.yml +34 -0
- simtools/schemas/model_parameters/led_photons.schema.yml +34 -0
- simtools/schemas/model_parameters/led_pulse_offset.schema.yml +32 -0
- simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +33 -0
- simtools/schemas/model_parameters/led_var_photons.schema.yml +34 -0
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +41 -0
- simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +43 -0
- simtools/schemas/model_parameters/min_photoelectrons.schema.yml +35 -0
- simtools/schemas/model_parameters/min_photons.schema.yml +32 -0
- simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +36 -0
- simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +64 -0
- simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +64 -0
- simtools/schemas/model_parameters/mirror_class.schema.yml +41 -0
- simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +51 -0
- simtools/schemas/model_parameters/mirror_focal_length.schema.yml +42 -0
- simtools/schemas/model_parameters/mirror_list.schema.yml +38 -0
- simtools/schemas/model_parameters/mirror_offset.schema.yml +41 -0
- simtools/schemas/model_parameters/mirror_panel_2f_measurements.schema.yml +39 -0
- simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +61 -0
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +40 -0
- simtools/schemas/model_parameters/multiplicity_offset.schema.yml +46 -0
- simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +51 -0
- simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +37 -0
- simtools/schemas/model_parameters/nsb_offaxis.schema.yml +79 -0
- simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +47 -0
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +34 -0
- simtools/schemas/model_parameters/nsb_reference_value.schema.yml +33 -0
- simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +35 -0
- simtools/schemas/model_parameters/nsb_skymap.schema.yml +39 -0
- simtools/schemas/model_parameters/nsb_spectrum.schema.yml +50 -0
- simtools/schemas/model_parameters/num_gains.schema.yml +34 -0
- simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +33 -0
- simtools/schemas/model_parameters/optics_properties.schema.yml +31 -0
- simtools/schemas/model_parameters/parabolic_dish.schema.yml +32 -0
- simtools/schemas/model_parameters/pedestal_events.schema.yml +32 -0
- simtools/schemas/model_parameters/photon_delay.schema.yml +38 -0
- simtools/schemas/model_parameters/photons_per_run.schema.yml +33 -0
- simtools/schemas/model_parameters/pixel_cells.schema.yml +35 -0
- simtools/schemas/model_parameters/pixels_parallel.schema.yml +54 -0
- simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +40 -0
- simtools/schemas/model_parameters/pm_average_gain.schema.yml +34 -0
- simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +40 -0
- simtools/schemas/model_parameters/pm_gain_index.schema.yml +36 -0
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +41 -0
- simtools/schemas/model_parameters/pm_transit_time.schema.yml +63 -0
- simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +39 -0
- simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +42 -0
- simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +33 -0
- simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +33 -0
- simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +29 -0
- simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +168 -0
- simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +36 -0
- simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +34 -0
- simtools/schemas/model_parameters/qe_variation.schema.yml +43 -0
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +42 -0
- simtools/schemas/model_parameters/random_focal_length.schema.yml +45 -0
- simtools/schemas/model_parameters/random_generator.schema.yml +36 -0
- simtools/schemas/model_parameters/reference_point_altitude.schema.yml +35 -0
- simtools/schemas/model_parameters/reference_point_latitude.schema.yml +36 -0
- simtools/schemas/model_parameters/reference_point_longitude.schema.yml +36 -0
- simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +34 -0
- simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +34 -0
- simtools/schemas/model_parameters/sampled_output.schema.yml +31 -0
- simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +34 -0
- simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +79 -0
- simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +42 -0
- simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +41 -0
- simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +33 -0
- simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +36 -0
- simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +29 -0
- simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +168 -0
- simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +36 -0
- simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +35 -0
- simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +37 -0
- simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +40 -0
- simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +40 -0
- simtools/schemas/model_parameters/store_photoelectrons.schema.yml +41 -0
- simtools/schemas/model_parameters/tailcut_scale.schema.yml +40 -0
- simtools/schemas/model_parameters/telescope_axis_height.schema.yml +31 -0
- simtools/schemas/model_parameters/telescope_random_angle.schema.yml +35 -0
- simtools/schemas/model_parameters/telescope_random_error.schema.yml +34 -0
- simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +37 -0
- simtools/schemas/model_parameters/telescope_transmission.schema.yml +113 -0
- simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +41 -0
- simtools/schemas/model_parameters/teltrig_min_time.schema.yml +36 -0
- simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +36 -0
- simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +37 -0
- simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +38 -0
- simtools/schemas/model_parameters/transit_time_error.schema.yml +45 -0
- simtools/schemas/model_parameters/transit_time_jitter.schema.yml +36 -0
- simtools/schemas/model_parameters/trigger_current_limit.schema.yml +32 -0
- simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +53 -0
- simtools/schemas/model_parameters/trigger_pixels.schema.yml +40 -0
- simtools/simtel/simtel_config_reader.py +353 -0
- simtools/simtel/simtel_config_writer.py +244 -63
- simtools/simtel/{simtel_events.py → simtel_io_events.py} +26 -25
- simtools/simtel/simtel_io_histogram.py +661 -0
- simtools/simtel/simtel_io_histograms.py +569 -0
- simtools/simtel/simulator_array.py +145 -0
- simtools/simtel/{simtel_runner_camera_efficiency.py → simulator_camera_efficiency.py} +76 -52
- simtools/simtel/simulator_light_emission.py +473 -0
- simtools/simtel/simulator_ray_tracing.py +262 -0
- simtools/simulator.py +220 -446
- simtools/testing/__init__.py +0 -0
- simtools/testing/assertions.py +151 -0
- simtools/testing/configuration.py +226 -0
- simtools/testing/helpers.py +42 -0
- simtools/testing/validate_output.py +240 -0
- simtools/utils/general.py +340 -437
- simtools/utils/geometry.py +12 -12
- simtools/utils/names.py +257 -644
- simtools/utils/value_conversion.py +176 -0
- simtools/version.py +3 -1
- simtools/visualization/legend_handlers.py +135 -152
- simtools/visualization/plot_camera.py +379 -0
- simtools/visualization/visualize.py +346 -167
- gammasimtools-0.6.1.dist-info/METADATA +0 -180
- gammasimtools-0.6.1.dist-info/RECORD +0 -91
- gammasimtools-0.6.1.dist-info/entry_points.txt +0 -23
- simtools/_dev_version/scm_version.py +0 -10
- simtools/applications/db_development_tools/add_new_parameter_to_db.py +0 -81
- simtools/applications/db_development_tools/add_unit_to_parameter_in_db.py +0 -59
- simtools/applications/db_development_tools/mark_non_optics_parameters_non_applicable.py +0 -102
- simtools/applications/get_parameter.py +0 -92
- simtools/applications/make_regular_arrays.py +0 -160
- simtools/applications/produce_array_config.py +0 -136
- simtools/applications/production.py +0 -313
- simtools/applications/sim_showers_for_trigger_rates.py +0 -187
- simtools/applications/tune_psf.py +0 -334
- simtools/corsika/corsika_default_config.py +0 -282
- simtools/corsika/corsika_runner.py +0 -450
- simtools/corsika_simtel/corsika_simtel_runner.py +0 -197
- simtools/db_handler.py +0 -1480
- simtools/ray_tracing.py +0 -525
- simtools/simtel/simtel_histograms.py +0 -414
- simtools/simtel/simtel_runner.py +0 -244
- simtools/simtel/simtel_runner_array.py +0 -293
- simtools/simtel/simtel_runner_ray_tracing.py +0 -277
- {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.2.dist-info}/LICENSE +0 -0
- {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.2.dist-info}/top_level.txt +0 -0
- /simtools/{corsika_simtel → db}/__init__.py +0 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Module to analyse psf images (e.g. results from ray tracing simulations).
|
|
3
|
-
Main functionalities are: computing centroids, psf containers etc.
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
Main functionalities are: computing centroids, psf containers etc.
|
|
6
5
|
|
|
7
6
|
"""
|
|
8
7
|
|
|
8
|
+
import gzip
|
|
9
9
|
import logging
|
|
10
|
+
import shlex
|
|
11
|
+
import shutil
|
|
12
|
+
import subprocess
|
|
10
13
|
from math import fabs, pi, sqrt
|
|
11
14
|
from pathlib import Path
|
|
12
15
|
|
|
@@ -29,18 +32,29 @@ class PSFImage:
|
|
|
29
32
|
|
|
30
33
|
Parameters
|
|
31
34
|
----------
|
|
32
|
-
focal_length: float
|
|
35
|
+
focal_length: float
|
|
33
36
|
Focal length of the system in cm. If not given, PSF can only be computed in cm.
|
|
34
|
-
total_scattered_area: float
|
|
37
|
+
total_scattered_area: float
|
|
35
38
|
Scatter area of all photons in cm^2. If not given, effective area cannot be computed.
|
|
39
|
+
containment_fraction: float
|
|
40
|
+
Containment fraction for PSF calculation.
|
|
41
|
+
simtel_path: str
|
|
42
|
+
Path to sim_telarray installation.
|
|
36
43
|
"""
|
|
37
44
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
__PSF_RADIUS = "Radius [cm]"
|
|
46
|
+
__PSF_CUMULATIVE = "Cumulative PSF"
|
|
47
|
+
|
|
48
|
+
def __init__(
|
|
49
|
+
self,
|
|
50
|
+
focal_length=None,
|
|
51
|
+
total_scattered_area=None,
|
|
52
|
+
containment_fraction=None,
|
|
53
|
+
simtel_path=None,
|
|
54
|
+
):
|
|
55
|
+
"""Initialize PSFImage class."""
|
|
43
56
|
self._logger = logging.getLogger(__name__)
|
|
57
|
+
self.simtel_path = simtel_path
|
|
44
58
|
|
|
45
59
|
self._total_photons = None
|
|
46
60
|
self._number_of_detected_photons = None
|
|
@@ -52,11 +66,65 @@ class PSFImage:
|
|
|
52
66
|
self.centroid_y = None
|
|
53
67
|
self._total_area = total_scattered_area
|
|
54
68
|
self._stored_psf = {}
|
|
55
|
-
|
|
56
|
-
self._cm_to_deg = 180.0 / pi / focal_length
|
|
57
|
-
|
|
69
|
+
try:
|
|
70
|
+
self._cm_to_deg = 180.0 / pi / focal_length if focal_length is not None else None
|
|
71
|
+
except ZeroDivisionError:
|
|
72
|
+
self._cm_to_deg = None
|
|
73
|
+
self._logger.warning("Focal length is zero; no conversion from cm to deg possible.")
|
|
74
|
+
self._containment_fraction = containment_fraction
|
|
75
|
+
|
|
76
|
+
def process_photon_list(self, photon_file, use_rx):
|
|
77
|
+
"""
|
|
78
|
+
Read and process a photon list file generated by sim_telarray.
|
|
79
|
+
|
|
80
|
+
Parameters
|
|
81
|
+
----------
|
|
82
|
+
photons_file: str
|
|
83
|
+
Name of sim_telarray file with photon list.
|
|
84
|
+
use_rx: bool
|
|
85
|
+
Use the RX method for analysis.
|
|
86
|
+
"""
|
|
87
|
+
if use_rx:
|
|
88
|
+
self._process_simtel_file_using_rx(photon_file)
|
|
58
89
|
else:
|
|
59
|
-
self.
|
|
90
|
+
self.read_photon_list_from_simtel_file(photon_file)
|
|
91
|
+
|
|
92
|
+
def _process_simtel_file_using_rx(self, photon_file):
|
|
93
|
+
"""
|
|
94
|
+
Process a simtel file with photon lists using the RX method.
|
|
95
|
+
|
|
96
|
+
Parameters
|
|
97
|
+
----------
|
|
98
|
+
photons_file: str
|
|
99
|
+
Name of sim_telarray file with photon list.
|
|
100
|
+
"""
|
|
101
|
+
try:
|
|
102
|
+
rx_output = subprocess.Popen( # pylint: disable=consider-using-with
|
|
103
|
+
shlex.split(
|
|
104
|
+
f"{self.simtel_path}/sim_telarray/bin/rx -f {self._containment_fraction:.2f} -v"
|
|
105
|
+
),
|
|
106
|
+
stdin=subprocess.PIPE,
|
|
107
|
+
stdout=subprocess.PIPE,
|
|
108
|
+
)
|
|
109
|
+
with gzip.open(photon_file, "rb") as _stdin:
|
|
110
|
+
with rx_output.stdin:
|
|
111
|
+
shutil.copyfileobj(_stdin, rx_output.stdin)
|
|
112
|
+
try:
|
|
113
|
+
rx_output = rx_output.communicate()[0].splitlines()[-1:][0].split()
|
|
114
|
+
except IndexError as e:
|
|
115
|
+
raise IndexError(f"Unexpected output format from rx: {rx_output}") from e
|
|
116
|
+
except FileNotFoundError as e:
|
|
117
|
+
raise FileNotFoundError(f"Photon list file not found: {photon_file}") from e
|
|
118
|
+
|
|
119
|
+
try:
|
|
120
|
+
self.set_psf(2 * float(rx_output[0]), fraction=self._containment_fraction, unit="cm")
|
|
121
|
+
self.centroid_x = float(rx_output[1])
|
|
122
|
+
self.centroid_y = float(rx_output[2])
|
|
123
|
+
self._effective_area = float(rx_output[5])
|
|
124
|
+
except IndexError as e:
|
|
125
|
+
raise IndexError(f"Unexpected output format from rx: {rx_output}") from e
|
|
126
|
+
except ValueError as e:
|
|
127
|
+
raise ValueError(f"Invalid output format from rx: {rx_output}") from e
|
|
60
128
|
|
|
61
129
|
def read_photon_list_from_simtel_file(self, photons_file):
|
|
62
130
|
"""
|
|
@@ -76,8 +144,6 @@ class PSFImage:
|
|
|
76
144
|
self._logger.info(f"Reading sim_telarray file {photons_file}")
|
|
77
145
|
self._total_photons = 0
|
|
78
146
|
if Path(photons_file).suffix == ".gz":
|
|
79
|
-
import gzip # pylint: disable=import-outside-toplevel
|
|
80
|
-
|
|
81
147
|
file_open_function = gzip.open
|
|
82
148
|
else:
|
|
83
149
|
file_open_function = open
|
|
@@ -138,9 +204,6 @@ class PSFImage:
|
|
|
138
204
|
f" {self._total_area} != {total_area_in_file}"
|
|
139
205
|
" - Keeping the original value"
|
|
140
206
|
)
|
|
141
|
-
else:
|
|
142
|
-
# Do nothing - Keep the original value of _total_area
|
|
143
|
-
pass
|
|
144
207
|
elif b"#" in line or len(words) == 0:
|
|
145
208
|
# Skipping comments
|
|
146
209
|
pass
|
|
@@ -149,9 +212,14 @@ class PSFImage:
|
|
|
149
212
|
self.photon_pos_x.append(float(words[2]))
|
|
150
213
|
self.photon_pos_y.append(float(words[3]))
|
|
151
214
|
|
|
152
|
-
def get_effective_area(self):
|
|
215
|
+
def get_effective_area(self, tel_transmission=1.0):
|
|
153
216
|
"""
|
|
154
|
-
Return effective area pre calculated
|
|
217
|
+
Return effective area pre calculated.
|
|
218
|
+
|
|
219
|
+
Parameters
|
|
220
|
+
----------
|
|
221
|
+
telescope_transmission : float
|
|
222
|
+
Telescope transmission parameter.
|
|
155
223
|
|
|
156
224
|
Returns
|
|
157
225
|
-------
|
|
@@ -160,14 +228,14 @@ class PSFImage:
|
|
|
160
228
|
scattering area was not set).
|
|
161
229
|
"""
|
|
162
230
|
if "_effective_area" in self.__dict__ and self._effective_area is not None:
|
|
163
|
-
return self._effective_area
|
|
231
|
+
return self._effective_area * tel_transmission
|
|
164
232
|
|
|
165
233
|
self._logger.error("Effective Area could not be calculated")
|
|
166
234
|
return None
|
|
167
235
|
|
|
168
236
|
def set_effective_area(self, value):
|
|
169
237
|
"""
|
|
170
|
-
Set effective area
|
|
238
|
+
Set effective area.
|
|
171
239
|
|
|
172
240
|
Parameters
|
|
173
241
|
----------
|
|
@@ -179,7 +247,7 @@ class PSFImage:
|
|
|
179
247
|
|
|
180
248
|
def get_psf(self, fraction=0.8, unit="cm"):
|
|
181
249
|
"""
|
|
182
|
-
Return PSF
|
|
250
|
+
Return PSF.
|
|
183
251
|
|
|
184
252
|
Parameters
|
|
185
253
|
----------
|
|
@@ -194,7 +262,7 @@ class PSFImage:
|
|
|
194
262
|
Containing diameter for a certain intensity fraction (PSF).
|
|
195
263
|
|
|
196
264
|
"""
|
|
197
|
-
if unit == "deg" and
|
|
265
|
+
if unit == "deg" and self._cm_to_deg is None:
|
|
198
266
|
self._logger.error("PSF cannot be computed in deg because focal length is not set")
|
|
199
267
|
return None
|
|
200
268
|
if fraction not in self._stored_psf:
|
|
@@ -215,7 +283,7 @@ class PSFImage:
|
|
|
215
283
|
unit: str
|
|
216
284
|
'cm' or 'deg'. 'deg' will not work if focal length was not set.
|
|
217
285
|
"""
|
|
218
|
-
if unit == "deg" and
|
|
286
|
+
if unit == "deg" and self._cm_to_deg is None:
|
|
219
287
|
self._logger.error("PSF cannot be set in deg because focal length is not set")
|
|
220
288
|
return
|
|
221
289
|
unit_factor = 1 if unit == "cm" else 1.0 / self._cm_to_deg
|
|
@@ -235,6 +303,7 @@ class PSFImage:
|
|
|
235
303
|
def _find_psf(self, fraction):
|
|
236
304
|
"""
|
|
237
305
|
Try to find PSF by a smart algorithm first.
|
|
306
|
+
|
|
238
307
|
If it fails, _find_radius_by_scanning is called and do it by brute force.
|
|
239
308
|
|
|
240
309
|
Parameters
|
|
@@ -262,7 +331,7 @@ class PSFImage:
|
|
|
262
331
|
scale = 0.5 * sqrt(current_radius * current_radius / start_number)
|
|
263
332
|
delta_number = start_number - target_number
|
|
264
333
|
n_iter = 0
|
|
265
|
-
max_iter =
|
|
334
|
+
max_iter = 1000
|
|
266
335
|
tolerance = self._number_of_detected_photons / 1000.0
|
|
267
336
|
found_radius = False
|
|
268
337
|
while not found_radius and n_iter < max_iter:
|
|
@@ -276,7 +345,6 @@ class PSFImage:
|
|
|
276
345
|
found_radius = fabs(delta_number) < tolerance
|
|
277
346
|
|
|
278
347
|
if found_radius:
|
|
279
|
-
# Diameter = 2 * radius
|
|
280
348
|
return 2 * current_radius
|
|
281
349
|
|
|
282
350
|
self._logger.warning("Could not find PSF efficiently - trying by scanning")
|
|
@@ -302,8 +370,9 @@ class PSFImage:
|
|
|
302
370
|
|
|
303
371
|
def scan(dr, rad_min, rad_max):
|
|
304
372
|
"""
|
|
305
|
-
Scan the image from rad_min to rad_max
|
|
306
|
-
|
|
373
|
+
Scan the image from rad_min to rad_max until it finds target_number photons inside.
|
|
374
|
+
|
|
375
|
+
Scanning is done in steps of dr.
|
|
307
376
|
|
|
308
377
|
Returns
|
|
309
378
|
-------
|
|
@@ -321,7 +390,7 @@ class PSFImage:
|
|
|
321
390
|
found_radius = False
|
|
322
391
|
while not found_radius:
|
|
323
392
|
s0, s1 = self._sum_photons_in_radius(r0), self._sum_photons_in_radius(r1)
|
|
324
|
-
if s0 < target_number
|
|
393
|
+
if s0 < target_number <= s1:
|
|
325
394
|
found_radius = True
|
|
326
395
|
break
|
|
327
396
|
if r1 > rad_max:
|
|
@@ -342,9 +411,7 @@ class PSFImage:
|
|
|
342
411
|
return radius
|
|
343
412
|
|
|
344
413
|
def _sum_photons_in_radius(self, radius):
|
|
345
|
-
"""
|
|
346
|
-
Return the number of photons inside a certain radius.
|
|
347
|
-
"""
|
|
414
|
+
"""Return the number of photons inside a certain radius."""
|
|
348
415
|
return np.searchsorted(self.photon_r, radius)
|
|
349
416
|
|
|
350
417
|
def get_image_data(self, centralized=True):
|
|
@@ -367,9 +434,12 @@ class PSFImage:
|
|
|
367
434
|
x_pos_data = np.array(self.photon_pos_x)
|
|
368
435
|
y_pos_data = np.array(self.photon_pos_y)
|
|
369
436
|
d_type = {"names": ("X", "Y"), "formats": ("f8", "f8")}
|
|
370
|
-
|
|
437
|
+
result = np.recarray((len(x_pos_data),), dtype=d_type)
|
|
438
|
+
result.X = x_pos_data
|
|
439
|
+
result.Y = y_pos_data
|
|
440
|
+
return result
|
|
371
441
|
|
|
372
|
-
def plot_image(self, centralized=True, **kwargs):
|
|
442
|
+
def plot_image(self, centralized=True, file_name=None, **kwargs):
|
|
373
443
|
"""
|
|
374
444
|
Plot 2D image as histogram (in cm).
|
|
375
445
|
|
|
@@ -395,11 +465,12 @@ class PSFImage:
|
|
|
395
465
|
kwargs_for_psf = collect_kwargs("psf", kwargs)
|
|
396
466
|
|
|
397
467
|
ax = plt.gca()
|
|
398
|
-
|
|
468
|
+
ax.set_xlabel("X Position (cm)")
|
|
469
|
+
ax.set_ylabel("Y Position (cm)")
|
|
399
470
|
ax.hist2d(data["X"], data["Y"], **kwargs_for_image)
|
|
400
471
|
ax.set_aspect("equal", "datalim")
|
|
401
472
|
|
|
402
|
-
# PSF circle
|
|
473
|
+
# PSF circle (80%)
|
|
403
474
|
center = (0, 0) if centralized else (self.centroid_x, self.centroid_y)
|
|
404
475
|
circle = plt.Circle(center, self.get_psf(0.8) / 2, **kwargs_for_psf)
|
|
405
476
|
ax.add_artist(circle)
|
|
@@ -407,6 +478,10 @@ class PSFImage:
|
|
|
407
478
|
ax.axhline(0, color="k", linestyle="--", zorder=3, linewidth=0.5)
|
|
408
479
|
ax.axvline(0, color="k", linestyle="--", zorder=3, linewidth=0.5)
|
|
409
480
|
|
|
481
|
+
if file_name is not None:
|
|
482
|
+
plt.savefig(file_name)
|
|
483
|
+
plt.close()
|
|
484
|
+
|
|
410
485
|
def get_cumulative_data(self, radius=None):
|
|
411
486
|
"""
|
|
412
487
|
Provide cumulative data (intensity vs radius).
|
|
@@ -420,9 +495,8 @@ class PSFImage:
|
|
|
420
495
|
-------
|
|
421
496
|
(radius, intensity)
|
|
422
497
|
"""
|
|
423
|
-
|
|
424
498
|
if radius is not None:
|
|
425
|
-
radius_all = radius.to(u.cm).value
|
|
499
|
+
radius_all = radius.to(u.cm).value if isinstance(radius, u.Quantity) else radius
|
|
426
500
|
else:
|
|
427
501
|
radius_all = list(np.linspace(0, 1.6 * self.get_psf(0.8), 30))
|
|
428
502
|
|
|
@@ -430,20 +504,32 @@ class PSFImage:
|
|
|
430
504
|
for rad in radius_all:
|
|
431
505
|
intensity.append(self._sum_photons_in_radius(rad) / self._number_of_detected_photons)
|
|
432
506
|
d_type = {
|
|
433
|
-
"names": (
|
|
507
|
+
"names": (self.__PSF_RADIUS, self.__PSF_CUMULATIVE),
|
|
434
508
|
"formats": ("f8", "f8"),
|
|
435
509
|
}
|
|
436
|
-
|
|
510
|
+
result = np.recarray((len(radius_all),), dtype=d_type)
|
|
511
|
+
result[self.__PSF_RADIUS] = radius_all
|
|
512
|
+
result[self.__PSF_CUMULATIVE] = intensity
|
|
437
513
|
|
|
438
|
-
|
|
514
|
+
return result
|
|
515
|
+
|
|
516
|
+
def plot_cumulative(self, file_name=None, d80=None, **kwargs):
|
|
439
517
|
"""Plot cumulative data (intensity vs radius).
|
|
440
518
|
|
|
441
519
|
Parameters
|
|
442
520
|
----------
|
|
443
521
|
**kwargs:
|
|
444
|
-
image_* for the histogram plot and psf_* for the psf circle.
|
|
522
|
+
image_* for the histogram plot and psf_* for the psf circle.
|
|
523
|
+
"""
|
|
445
524
|
data = self.get_cumulative_data()
|
|
446
|
-
plt.
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
525
|
+
ax = plt.gca()
|
|
526
|
+
plt.tight_layout(pad=1.5)
|
|
527
|
+
ax.set_xlabel("Radius (cm)")
|
|
528
|
+
ax.set_ylabel("Contained light %")
|
|
529
|
+
plt.plot(data[self.__PSF_RADIUS], data[self.__PSF_CUMULATIVE], **kwargs)
|
|
530
|
+
plt.axvline(x=self.get_psf(0.8) / 2, color="b", linestyle="--", linewidth=1)
|
|
531
|
+
if d80 is not None:
|
|
532
|
+
plt.axvline(x=d80 / 2.0, color="r", linestyle="--", linewidth=1)
|
|
533
|
+
if file_name is not None:
|
|
534
|
+
plt.savefig(file_name)
|
|
535
|
+
plt.close()
|