gammasimtools 0.21.0__py3-none-any.whl → 0.23.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/METADATA +3 -3
- gammasimtools-0.23.0.dist-info/RECORD +414 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/entry_points.txt +2 -1
- simtools/_version.py +2 -2
- simtools/application_control.py +118 -0
- simtools/applications/calculate_incident_angles.py +17 -25
- simtools/applications/convert_all_model_parameters_from_simtel.py +29 -45
- simtools/applications/convert_geo_coordinates_of_array_elements.py +26 -45
- simtools/applications/convert_model_parameter_from_simtel.py +21 -42
- simtools/applications/db_add_file_to_db.py +12 -13
- simtools/applications/db_add_simulation_model_from_repository_to_db.py +20 -33
- simtools/applications/db_add_value_from_json_to_db.py +28 -23
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +19 -34
- simtools/applications/db_generate_compound_indexes.py +12 -27
- simtools/applications/db_get_array_layouts_from_db.py +19 -39
- simtools/applications/db_get_file_from_db.py +15 -17
- simtools/applications/db_get_parameter_from_db.py +33 -35
- simtools/applications/db_inspect_databases.py +10 -11
- simtools/applications/db_upload_model_repository.py +104 -0
- simtools/applications/derive_ctao_array_layouts.py +16 -21
- simtools/applications/derive_mirror_rnda.py +9 -14
- simtools/applications/derive_photon_electron_spectrum.py +7 -10
- simtools/applications/derive_psf_parameters.py +24 -21
- simtools/applications/derive_trigger_rates.py +6 -9
- simtools/applications/docs_produce_array_element_report.py +22 -23
- simtools/applications/docs_produce_calibration_reports.py +26 -24
- simtools/applications/docs_produce_model_parameter_reports.py +15 -22
- simtools/applications/docs_produce_simulation_configuration_report.py +21 -22
- simtools/applications/generate_array_config.py +14 -33
- simtools/applications/generate_corsika_histograms.py +22 -43
- simtools/applications/generate_default_metadata.py +15 -36
- simtools/applications/generate_regular_arrays.py +11 -15
- simtools/applications/generate_simtel_event_data.py +23 -33
- simtools/applications/maintain_simulation_model_add_production.py +17 -48
- simtools/applications/maintain_simulation_model_compare_productions.py +10 -12
- simtools/applications/maintain_simulation_model_verify_production_tables.py +8 -11
- simtools/applications/merge_tables.py +15 -24
- simtools/applications/plot_array_layout.py +77 -55
- simtools/applications/plot_simtel_events.py +11 -13
- simtools/applications/plot_tabular_data.py +17 -38
- simtools/applications/plot_tabular_data_for_model_parameter.py +16 -23
- simtools/applications/print_version.py +14 -42
- simtools/applications/production_derive_corsika_limits.py +5 -9
- simtools/applications/production_derive_statistics.py +12 -26
- simtools/applications/production_generate_grid.py +20 -48
- simtools/applications/production_merge_corsika_limits.py +17 -21
- simtools/applications/run_application.py +12 -32
- simtools/applications/simulate_flasher.py +79 -81
- simtools/applications/simulate_illuminator.py +56 -197
- simtools/applications/{simulate_calibration_events.py → simulate_pedestals.py} +22 -68
- simtools/applications/simulate_prod.py +21 -33
- simtools/applications/simulate_prod_htcondor_generator.py +11 -25
- simtools/applications/submit_array_layouts.py +15 -18
- simtools/applications/submit_data_from_external.py +18 -34
- simtools/applications/submit_model_parameter_from_external.py +27 -41
- simtools/applications/validate_camera_efficiency.py +23 -22
- simtools/applications/validate_camera_fov.py +21 -27
- simtools/applications/validate_cumulative_psf.py +28 -37
- simtools/applications/validate_file_using_schema.py +35 -45
- simtools/applications/validate_optics.py +27 -33
- simtools/camera/camera_efficiency.py +8 -13
- simtools/configuration/commandline_parser.py +33 -11
- simtools/configuration/configurator.py +0 -7
- simtools/corsika/corsika_config.py +9 -16
- simtools/corsika/corsika_histograms.py +1 -1
- simtools/data_model/data_reader.py +0 -2
- simtools/data_model/metadata_collector.py +0 -2
- simtools/data_model/model_data_writer.py +87 -27
- simtools/data_model/schema.py +61 -2
- simtools/data_model/validate_data.py +1 -3
- simtools/db/db_handler.py +58 -39
- simtools/db/db_model_upload.py +210 -5
- simtools/io/hdf5_handler.py +0 -5
- simtools/io/io_handler.py +31 -83
- simtools/io/legacy_data_handler.py +0 -5
- simtools/job_execution/job_manager.py +43 -1
- simtools/layout/array_layout.py +0 -2
- simtools/layout/array_layout_utils.py +1 -5
- simtools/layout/telescope_position.py +0 -2
- simtools/model/array_model.py +95 -46
- simtools/model/calibration_model.py +0 -2
- simtools/model/camera.py +0 -2
- simtools/model/mirrors.py +0 -2
- simtools/model/model_parameter.py +50 -16
- simtools/model/model_repository.py +139 -106
- simtools/model/model_utils.py +21 -11
- simtools/model/site_model.py +0 -2
- simtools/model/telescope_model.py +20 -2
- simtools/production_configuration/calculate_statistical_uncertainties_grid_point.py +0 -2
- simtools/production_configuration/derive_corsika_limits.py +1 -1
- simtools/production_configuration/derive_production_statistics.py +0 -2
- simtools/production_configuration/interpolation_handler.py +0 -2
- simtools/ray_tracing/incident_angles.py +7 -7
- simtools/ray_tracing/mirror_panel_psf.py +1 -1
- simtools/ray_tracing/psf_analysis.py +0 -2
- simtools/ray_tracing/psf_parameter_optimisation.py +180 -73
- simtools/ray_tracing/ray_tracing.py +1 -5
- simtools/reporting/docs_auto_report_generator.py +108 -0
- simtools/reporting/docs_read_parameters.py +168 -104
- simtools/resources/array_elements.yml +26 -0
- simtools/runners/corsika_runner.py +0 -2
- simtools/runners/corsika_simtel_runner.py +11 -19
- simtools/runners/runner_services.py +5 -6
- simtools/runners/simtel_runner.py +0 -2
- simtools/runners/simtools_runner.py +0 -2
- simtools/schemas/application_workflow.metaschema.yml +1 -1
- simtools/schemas/common_definitions.schema.yml +39 -0
- simtools/schemas/model_parameter.metaschema.yml +19 -13
- simtools/schemas/model_parameter_and_data_schema.metaschema.yml +6 -12
- simtools/schemas/model_parameters/adjust_gain.schema.yml +0 -5
- simtools/schemas/model_parameters/altitude.schema.yml +0 -5
- simtools/schemas/model_parameters/array_coordinates.schema.yml +0 -5
- simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +0 -5
- simtools/schemas/model_parameters/array_element_position_ground.schema.yml +0 -7
- simtools/schemas/model_parameters/array_element_position_utm.schema.yml +0 -7
- simtools/schemas/model_parameters/array_layouts.schema.yml +0 -5
- simtools/schemas/model_parameters/array_triggers.schema.yml +0 -5
- simtools/schemas/model_parameters/array_window.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_clipping.schema.yml +0 -3
- simtools/schemas/model_parameters/asum_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_shaping.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +0 -5
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +0 -5
- simtools/schemas/model_parameters/axes_offsets.schema.yml +0 -7
- simtools/schemas/model_parameters/calibration_devices.schema.yml +30 -0
- simtools/schemas/model_parameters/camera_body_diameter.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_body_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_config_file.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_config_rotate.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_degraded_map.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_depth.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_filter.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/camera_pixels.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_transmission.schema.yml +0 -7
- simtools/schemas/model_parameters/channels_per_chip.schema.yml +0 -7
- simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +0 -7
- simtools/schemas/model_parameters/corsika_observation_level.schema.yml +0 -5
- simtools/schemas/model_parameters/dark_events.schema.yml +4 -3
- simtools/schemas/model_parameters/default_trigger.schema.yml +0 -7
- simtools/schemas/model_parameters/design_model.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_start.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +1 -9
- simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/dish_shape_length.schema.yml +0 -5
- simtools/schemas/model_parameters/dsum_clipping.schema.yml +1 -5
- simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_pedsub.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_prescale.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_presum_max.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_shaping.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +2 -12
- simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +0 -3
- simtools/schemas/model_parameters/effective_focal_length.schema.yml +0 -7
- simtools/schemas/model_parameters/epsg_code.schema.yml +0 -5
- simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_amplitude.schema.yml +2 -9
- simtools/schemas/model_parameters/fadc_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +2 -9
- simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_long_event_threshold.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_long_sum_bins.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_long_sum_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_max_signal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_max_sum.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_mhz.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_noise.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fake_mirror_list.schema.yml +0 -3
- simtools/schemas/model_parameters/flasher_angular_distribution.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_angular_distribution_width.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_bunch_size.schema.yml +28 -0
- simtools/schemas/model_parameters/flasher_external_trigger.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_photons.schema.yml +34 -0
- simtools/schemas/model_parameters/flasher_position.schema.yml +43 -0
- simtools/schemas/model_parameters/flasher_pulse_exp_decay.schema.yml +29 -0
- simtools/schemas/model_parameters/flasher_pulse_offset.schema.yml +35 -0
- simtools/schemas/model_parameters/flasher_pulse_shape.schema.yml +30 -0
- simtools/schemas/model_parameters/flasher_pulse_width.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_type.schema.yml +28 -0
- simtools/schemas/model_parameters/flasher_var_photons.schema.yml +31 -0
- simtools/schemas/model_parameters/flasher_wavelength.schema.yml +33 -0
- simtools/schemas/model_parameters/flatfielding.schema.yml +0 -7
- simtools/schemas/model_parameters/focal_length.schema.yml +0 -7
- simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/focus_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/gain_variation.schema.yml +0 -7
- simtools/schemas/model_parameters/geomag_horizontal.schema.yml +2 -7
- simtools/schemas/model_parameters/geomag_rotation.schema.yml +2 -7
- simtools/schemas/model_parameters/geomag_vertical.schema.yml +2 -7
- simtools/schemas/model_parameters/hg_lg_variation.schema.yml +0 -5
- simtools/schemas/model_parameters/iobuf_maximum.schema.yml +0 -7
- simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +0 -7
- simtools/schemas/model_parameters/laser_events.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_external_trigger.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_var_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_wavelength.schema.yml +4 -3
- simtools/schemas/model_parameters/led_events.schema.yml +4 -3
- simtools/schemas/model_parameters/led_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/led_pulse_offset.schema.yml +4 -3
- simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +4 -3
- simtools/schemas/model_parameters/led_var_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +0 -7
- simtools/schemas/model_parameters/min_photoelectrons.schema.yml +0 -7
- simtools/schemas/model_parameters/min_photons.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +0 -5
- simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_class.schema.yml +2 -9
- simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_focal_length.schema.yml +0 -5
- simtools/schemas/model_parameters/mirror_list.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +0 -7
- simtools/schemas/model_parameters/multiplicity_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/muon_mono_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +0 -3
- simtools/schemas/model_parameters/nsb_offaxis.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_reference_value.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_sky_map.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_spectrum.schema.yml +0 -5
- simtools/schemas/model_parameters/num_gains.schema.yml +0 -7
- simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +0 -7
- simtools/schemas/model_parameters/optics_properties.schema.yml +0 -7
- simtools/schemas/model_parameters/parabolic_dish.schema.yml +0 -3
- simtools/schemas/model_parameters/pedestal_events.schema.yml +4 -7
- simtools/schemas/model_parameters/photon_delay.schema.yml +0 -7
- simtools/schemas/model_parameters/photons_per_run.schema.yml +4 -4
- simtools/schemas/model_parameters/pixel_cells.schema.yml +0 -3
- simtools/schemas/model_parameters/pixels_parallel.schema.yml +0 -3
- simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +0 -7
- simtools/schemas/model_parameters/pm_average_gain.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_gain_index.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +0 -7
- simtools/schemas/model_parameters/pm_transit_time.schema.yml +4 -9
- simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +0 -5
- simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +0 -7
- simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +0 -3
- simtools/schemas/model_parameters/qe_variation.schema.yml +0 -7
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +0 -7
- simtools/schemas/model_parameters/random_focal_length.schema.yml +2 -7
- simtools/schemas/model_parameters/random_generator.schema.yml +0 -7
- simtools/schemas/model_parameters/random_mono_probability.schema.yml +0 -7
- simtools/schemas/model_parameters/reference_point_altitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_latitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_longitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +0 -5
- simtools/schemas/model_parameters/sampled_output.schema.yml +0 -7
- simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/stars.schema.yml +0 -5
- simtools/schemas/model_parameters/store_photoelectrons.schema.yml +0 -7
- simtools/schemas/model_parameters/tailcut_scale.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_axis_height.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_random_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_random_error.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_transmission.schema.yml +0 -7
- simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +0 -7
- simtools/schemas/model_parameters/teltrig_min_time.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_jitter.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_random.schema.yml +29 -0
- simtools/schemas/model_parameters/trigger_current_limit.schema.yml +0 -7
- simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +0 -7
- simtools/schemas/model_parameters/trigger_pixels.schema.yml +0 -7
- simtools/schemas/production_tables.schema.yml +8 -8
- simtools/schemas/simulation_models_info.schema.yml +78 -0
- simtools/simtel/simtel_config_reader.py +0 -2
- simtools/simtel/simtel_config_writer.py +118 -26
- simtools/simtel/simtel_io_metadata.py +3 -3
- simtools/simtel/simulator_array.py +43 -85
- simtools/simtel/simulator_camera_efficiency.py +0 -2
- simtools/simtel/simulator_light_emission.py +336 -631
- simtools/simtel/simulator_ray_tracing.py +2 -4
- simtools/simulator.py +45 -19
- simtools/testing/assertions.py +2 -2
- simtools/testing/configuration.py +21 -6
- simtools/testing/sim_telarray_metadata.py +4 -4
- simtools/utils/general.py +5 -13
- simtools/utils/geometry.py +34 -5
- simtools/utils/names.py +1 -13
- simtools/version.py +83 -0
- simtools/visualization/plot_array_layout.py +129 -23
- simtools/visualization/plot_incident_angles.py +0 -2
- simtools/visualization/plot_psf.py +163 -61
- simtools/visualization/plot_simtel_events.py +1 -12
- simtools/visualization/visualize.py +0 -12
- gammasimtools-0.21.0.dist-info/RECORD +0 -396
- simtools/model/flasher_model.py +0 -106
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/licenses/LICENSE +0 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/top_level.txt +0 -0
|
@@ -8,6 +8,10 @@ functions to interact with and verify the repository.
|
|
|
8
8
|
import logging
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
|
+
from packaging.version import Version
|
|
12
|
+
from packaging.version import parse as parse_version
|
|
13
|
+
|
|
14
|
+
import simtools.data_model.model_data_writer as writer
|
|
11
15
|
from simtools.io import ascii_handler
|
|
12
16
|
from simtools.utils import names
|
|
13
17
|
|
|
@@ -134,7 +138,7 @@ def _get_model_parameter_file_path(
|
|
|
134
138
|
)
|
|
135
139
|
|
|
136
140
|
|
|
137
|
-
def generate_new_production(
|
|
141
|
+
def generate_new_production(modifications, simulation_models_path):
|
|
138
142
|
"""
|
|
139
143
|
Generate a new production definition (production tables and model parameters).
|
|
140
144
|
|
|
@@ -143,68 +147,84 @@ def generate_new_production(args_dict):
|
|
|
143
147
|
- copy of production tables from an existing base model version
|
|
144
148
|
- update production tables with changes defined in a YAML file
|
|
145
149
|
- generate new model parameter entries for changed parameters
|
|
150
|
+
- allows for full or patch updates
|
|
146
151
|
|
|
147
152
|
Parameters
|
|
148
153
|
----------
|
|
149
|
-
|
|
150
|
-
|
|
154
|
+
modifications: str
|
|
155
|
+
Path to the YAML file defining the changes to be applied.
|
|
156
|
+
simulation_models_path: str
|
|
157
|
+
Path to the simulation models repository.
|
|
151
158
|
"""
|
|
152
|
-
modifications = ascii_handler.collect_data_from_file(
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
modifications = ascii_handler.collect_data_from_file(modifications)
|
|
160
|
+
model_version_history = modifications.get("model_version_history", [])
|
|
161
|
+
try:
|
|
162
|
+
# oldest version is the base version
|
|
163
|
+
base_model_version = min(set(model_version_history), key=Version)
|
|
164
|
+
except ValueError as exc:
|
|
165
|
+
raise ValueError(f"Base model version not found in {modifications}") from exc
|
|
155
166
|
model_version = modifications["model_version"]
|
|
156
|
-
|
|
157
|
-
simulation_models_path = Path(args_dict["simulation_models_path"])
|
|
158
|
-
source_path = simulation_models_path / "productions" / base_model_version
|
|
159
|
-
target_path = simulation_models_path / "productions" / model_version
|
|
160
|
-
model_parameters_dir = simulation_models_path / "model_parameters"
|
|
161
|
-
patch_update = args_dict.get("patch_update", False)
|
|
162
|
-
|
|
163
|
-
_logger.info(f"Copying production tables from {source_path} to {target_path}")
|
|
167
|
+
changes = modifications.get("changes", {})
|
|
164
168
|
|
|
165
169
|
_apply_changes_to_production_tables(
|
|
166
|
-
source_path,
|
|
167
|
-
target_path,
|
|
168
170
|
changes,
|
|
171
|
+
base_model_version,
|
|
169
172
|
model_version,
|
|
170
|
-
|
|
173
|
+
modifications.get("model_update", "full_update"),
|
|
174
|
+
simulation_models_path,
|
|
171
175
|
)
|
|
172
176
|
|
|
173
|
-
_apply_changes_to_model_parameters(changes,
|
|
177
|
+
_apply_changes_to_model_parameters(changes, simulation_models_path)
|
|
174
178
|
|
|
175
179
|
|
|
176
180
|
def _apply_changes_to_production_tables(
|
|
177
|
-
|
|
181
|
+
changes, base_model_version, model_version, update_type, simulation_models_path
|
|
178
182
|
):
|
|
179
183
|
"""
|
|
180
184
|
Apply changes to production tables and write them to target directory.
|
|
181
185
|
|
|
182
186
|
Parameters
|
|
183
187
|
----------
|
|
184
|
-
source_path: Path
|
|
185
|
-
Path to the source production tables.
|
|
186
|
-
target_path: Path
|
|
187
|
-
Path to the target production tables.
|
|
188
188
|
changes: dict
|
|
189
189
|
The changes to be applied.
|
|
190
|
+
base_model_version: str
|
|
191
|
+
The base model version (source directory for production tables).
|
|
190
192
|
model_version: str
|
|
191
193
|
The model version to be set in the JSON data.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
+
update_type: str
|
|
195
|
+
Update mode, either 'full_update' or 'patch_update'.
|
|
196
|
+
simulation_models_path: Path
|
|
197
|
+
Path to the simulation models repository.
|
|
194
198
|
"""
|
|
195
|
-
|
|
196
|
-
|
|
199
|
+
source = simulation_models_path / "productions" / base_model_version
|
|
200
|
+
target = simulation_models_path / "productions" / model_version
|
|
201
|
+
_logger.info(f"Production tables {update_type} from {source} to {target}")
|
|
202
|
+
target.mkdir(parents=True, exist_ok=True)
|
|
203
|
+
|
|
204
|
+
# load existing tables
|
|
205
|
+
tables = {}
|
|
206
|
+
for file_path in Path(source).rglob("*.json"):
|
|
197
207
|
data = ascii_handler.collect_data_from_file(file_path)
|
|
198
|
-
|
|
199
|
-
data
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
208
|
+
if not isinstance(data, dict):
|
|
209
|
+
raise TypeError(f"Unsupported data type {type(data)} in {file_path}")
|
|
210
|
+
tables[data["production_table_name"]] = data
|
|
211
|
+
|
|
212
|
+
# placeholder for new tables
|
|
213
|
+
for table_name in changes:
|
|
214
|
+
tables.setdefault(table_name, {})
|
|
203
215
|
|
|
216
|
+
for table_name, data in tables.items():
|
|
217
|
+
if _apply_changes_to_production_table(
|
|
218
|
+
table_name, data, changes, model_version, update_type == "patch_update"
|
|
219
|
+
):
|
|
220
|
+
_logger.info(f"Writing updated production table '{table_name}'")
|
|
221
|
+
data["production_table_name"] = table_name
|
|
222
|
+
ascii_handler.write_data_to_file(data, target / f"{table_name}.json", sort_keys=True)
|
|
204
223
|
|
|
205
|
-
|
|
224
|
+
|
|
225
|
+
def _apply_changes_to_production_table(table_name, data, changes, model_version, patch_update):
|
|
206
226
|
"""
|
|
207
|
-
|
|
227
|
+
Apply changes to a single production table.
|
|
208
228
|
|
|
209
229
|
Parameters
|
|
210
230
|
----------
|
|
@@ -215,32 +235,33 @@ def _apply_changes_to_production_table(data, changes, model_version, patch_updat
|
|
|
215
235
|
model_version: str
|
|
216
236
|
The model version to be set in the JSON data.
|
|
217
237
|
patch_update: bool
|
|
218
|
-
|
|
238
|
+
True if patch update (modify only changed parameters), False for full update.
|
|
219
239
|
|
|
220
240
|
Returns
|
|
221
241
|
-------
|
|
222
242
|
bool
|
|
223
|
-
True if data was modified and should be written to disk (patch updates)
|
|
224
|
-
for full updates.
|
|
243
|
+
True if data was modified and should be written to disk (patch updates);
|
|
244
|
+
always True for full updates.
|
|
225
245
|
"""
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
data
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
else:
|
|
236
|
-
raise TypeError(f"Unsupported data type {type(data)} in production table update")
|
|
246
|
+
data["model_version"] = model_version
|
|
247
|
+
if table_name in changes:
|
|
248
|
+
table_parameters = {} if patch_update else data.get("parameters", {}).get(table_name, {})
|
|
249
|
+
parameters, deprecated = _update_parameters_dict(table_parameters, changes, table_name)
|
|
250
|
+
data["parameters"] = parameters
|
|
251
|
+
if deprecated:
|
|
252
|
+
data["deprecated_parameters"] = deprecated
|
|
253
|
+
elif patch_update:
|
|
254
|
+
return False
|
|
237
255
|
|
|
238
256
|
return True
|
|
239
257
|
|
|
240
258
|
|
|
241
|
-
def
|
|
259
|
+
def _update_parameters_dict(table_parameters, changes, table_name):
|
|
242
260
|
"""
|
|
243
|
-
Create a new parameters dictionary
|
|
261
|
+
Create a new parameters dictionary for the production tables.
|
|
262
|
+
|
|
263
|
+
Include only changes relevant to the specific telescope.
|
|
264
|
+
Do not include parameters if 'deprecated' flag is set to True.
|
|
244
265
|
|
|
245
266
|
Parameters
|
|
246
267
|
----------
|
|
@@ -253,18 +274,26 @@ def _update_parameters(table_parameters, changes, table_name):
|
|
|
253
274
|
|
|
254
275
|
Returns
|
|
255
276
|
-------
|
|
256
|
-
dict
|
|
277
|
+
dict, list
|
|
257
278
|
Dictionary containing only the new/changed parameters for the specified table.
|
|
279
|
+
List of deprecated parameters.
|
|
258
280
|
"""
|
|
259
|
-
|
|
281
|
+
new_params = {table_name: table_parameters}
|
|
282
|
+
deprecated_params = []
|
|
283
|
+
|
|
260
284
|
for param, data in changes[table_name].items():
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
285
|
+
if data.get("deprecated", False):
|
|
286
|
+
_logger.info(f"Removing model parameter '{table_name} - {param}'")
|
|
287
|
+
deprecated_params.append(param)
|
|
288
|
+
else:
|
|
289
|
+
version = data["version"]
|
|
290
|
+
_logger.info(f"Setting '{table_name} - {param}' to version {version}")
|
|
291
|
+
new_params[table_name][param] = version
|
|
292
|
+
|
|
293
|
+
return new_params, deprecated_params
|
|
265
294
|
|
|
266
295
|
|
|
267
|
-
def _apply_changes_to_model_parameters(changes,
|
|
296
|
+
def _apply_changes_to_model_parameters(changes, simulation_models_path):
|
|
268
297
|
"""
|
|
269
298
|
Apply changes to model parameters by creating new parameter entries.
|
|
270
299
|
|
|
@@ -272,18 +301,23 @@ def _apply_changes_to_model_parameters(changes, model_parameters_dir):
|
|
|
272
301
|
----------
|
|
273
302
|
changes: dict
|
|
274
303
|
The changes to be applied.
|
|
275
|
-
|
|
276
|
-
Path to the
|
|
304
|
+
simulation_models_path: Path
|
|
305
|
+
Path to the simulation models directory.
|
|
277
306
|
"""
|
|
278
307
|
for telescope, parameters in changes.items():
|
|
279
308
|
for param, param_data in parameters.items():
|
|
280
|
-
if param_data.get("value"):
|
|
281
|
-
|
|
309
|
+
if param_data.get("value") is not None:
|
|
310
|
+
_create_new_model_parameter_entry(
|
|
311
|
+
telescope, param, param_data, simulation_models_path
|
|
312
|
+
)
|
|
282
313
|
|
|
283
314
|
|
|
284
|
-
def
|
|
315
|
+
def _create_new_model_parameter_entry(telescope, param, param_data, simulation_models_path):
|
|
285
316
|
"""
|
|
286
|
-
Create new model parameter
|
|
317
|
+
Create new model parameter entry in the model parameters directory.
|
|
318
|
+
|
|
319
|
+
If a model parameter files exists, copy latest version and update the fields.
|
|
320
|
+
Otherwise generate new file using the model parameter schema.
|
|
287
321
|
|
|
288
322
|
Parameters
|
|
289
323
|
----------
|
|
@@ -293,43 +327,40 @@ def _create_new_parameter_entry(telescope, param, param_data, model_parameters_d
|
|
|
293
327
|
Name of the parameter.
|
|
294
328
|
param_data: dict
|
|
295
329
|
Dictionary containing the parameter data including version and value.
|
|
296
|
-
|
|
297
|
-
Path to the
|
|
330
|
+
simulation_models_path: Path
|
|
331
|
+
Path to the simulation models directory.
|
|
298
332
|
"""
|
|
299
|
-
telescope_dir =
|
|
333
|
+
telescope_dir = simulation_models_path / "model_parameters" / telescope
|
|
300
334
|
if not telescope_dir.exists():
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
)
|
|
335
|
+
_logger.info(f"Create directory for array element '{telescope}': '{telescope_dir}'.")
|
|
336
|
+
telescope_dir.mkdir(parents=True, exist_ok=True)
|
|
304
337
|
|
|
305
338
|
param_dir = telescope_dir / param
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
latest_file
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
339
|
+
try:
|
|
340
|
+
latest_file = _get_latest_model_parameter_file(param_dir, param)
|
|
341
|
+
except FileNotFoundError:
|
|
342
|
+
latest_file = None
|
|
343
|
+
|
|
344
|
+
if latest_file is not None:
|
|
345
|
+
json_data = ascii_handler.collect_data_from_file(latest_file)
|
|
346
|
+
param_data["version"] = _check_for_major_version_jump(
|
|
347
|
+
json_data, param_data, param, telescope
|
|
315
348
|
)
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
349
|
+
# important for e.g. nsb_pixel_rate
|
|
350
|
+
if isinstance(json_data["value"], list) and not isinstance(param_data["value"], list):
|
|
351
|
+
param_data["value"] = [param_data["value"]] * len(json_data["value"])
|
|
352
|
+
param_data["meta_parameter"] = json_data.get("meta_parameter", False)
|
|
353
|
+
|
|
354
|
+
writer.ModelDataWriter.dump_model_parameter(
|
|
355
|
+
parameter_name=param,
|
|
356
|
+
value=param_data["value"],
|
|
357
|
+
instrument=telescope,
|
|
358
|
+
parameter_version=param_data["version"],
|
|
359
|
+
output_file=f"{param}-{param_data['version']}.json",
|
|
360
|
+
output_path=param_dir,
|
|
361
|
+
unit=param_data.get("unit"),
|
|
362
|
+
meta_parameter=param_data.get("meta_parameter", False),
|
|
321
363
|
)
|
|
322
|
-
# important for e.g. nsb_pixel_rate
|
|
323
|
-
if isinstance(json_data["value"], list) and not isinstance(param_data["value"], list):
|
|
324
|
-
json_data["value"] = [param_data["value"]] * len(json_data["value"])
|
|
325
|
-
else:
|
|
326
|
-
json_data["value"] = param_data["value"]
|
|
327
|
-
|
|
328
|
-
new_file_name = f"{param}-{param_data['version']}.json"
|
|
329
|
-
new_file_path = param_dir / new_file_name
|
|
330
|
-
|
|
331
|
-
ascii_handler.write_data_to_file(json_data, new_file_path, sort_keys=True)
|
|
332
|
-
_logger.info(f"Created new model parameter JSON file: {new_file_path}")
|
|
333
364
|
|
|
334
365
|
|
|
335
366
|
def _get_latest_model_parameter_file(directory, parameter):
|
|
@@ -362,21 +393,23 @@ def _get_latest_model_parameter_file(directory, parameter):
|
|
|
362
393
|
f"No JSON files found for parameter '{parameter}' in directory '{directory}'."
|
|
363
394
|
)
|
|
364
395
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
parts = version_str.split(".")
|
|
369
|
-
return tuple(part.zfill(8) for part in parts)
|
|
396
|
+
def extract_version(path: Path):
|
|
397
|
+
# version is part after first '-'
|
|
398
|
+
return parse_version(path.stem.split("-", 1)[1])
|
|
370
399
|
|
|
371
|
-
files
|
|
372
|
-
return str(
|
|
400
|
+
latest_file = max(files, key=extract_version)
|
|
401
|
+
return str(latest_file)
|
|
373
402
|
|
|
374
403
|
|
|
375
|
-
def
|
|
376
|
-
"""
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
404
|
+
def _check_for_major_version_jump(json_data, param_data, param, telescope):
|
|
405
|
+
"""
|
|
406
|
+
Check for major version jump and print a warning if necessary.
|
|
407
|
+
|
|
408
|
+
Generally a jump from e.g. '3.1.0' to '5.0.0' should be avoided.
|
|
409
|
+
"""
|
|
410
|
+
latest_version = parse_version(json_data.get("parameter_version", "0"))
|
|
411
|
+
new_version = parse_version(param_data["version"])
|
|
412
|
+
if new_version.major > latest_version.major + 1:
|
|
380
413
|
_logger.warning(
|
|
381
414
|
f"Major version jump from {latest_version} to {new_version} "
|
|
382
415
|
f"for parameter '{param}' in telescope '{telescope}'."
|
simtools/model/model_utils.py
CHANGED
|
@@ -3,19 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
import math
|
|
5
5
|
|
|
6
|
+
from simtools.model.calibration_model import CalibrationModel
|
|
6
7
|
from simtools.model.site_model import SiteModel
|
|
7
8
|
from simtools.model.telescope_model import TelescopeModel
|
|
8
9
|
from simtools.utils import names
|
|
9
10
|
|
|
10
|
-
__all__ = [
|
|
11
|
-
"compute_telescope_transmission",
|
|
12
|
-
"is_two_mirror_telescope",
|
|
13
|
-
]
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
def initialize_simulation_models(
|
|
13
|
+
label, db_config, model_version, site, telescope_name, calibration_device_name=None
|
|
14
|
+
):
|
|
17
15
|
"""
|
|
18
|
-
Initialize simulation models for a single telescope and
|
|
16
|
+
Initialize simulation models for a single telescope, site, and calibration device model.
|
|
19
17
|
|
|
20
18
|
Parameters
|
|
21
19
|
----------
|
|
@@ -23,17 +21,19 @@ def initialize_simulation_models(label, db_config, site, telescope_name, model_v
|
|
|
23
21
|
Label for the simulation.
|
|
24
22
|
db_config: dict
|
|
25
23
|
Database configuration.
|
|
24
|
+
model_version: str
|
|
25
|
+
Version of the simulation model
|
|
26
26
|
site: str
|
|
27
27
|
Name of the site.
|
|
28
28
|
telescope_name: str
|
|
29
29
|
Name of the telescope.
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
calibration_device_name: str, optional
|
|
31
|
+
Name of the calibration device.
|
|
32
32
|
|
|
33
33
|
Returns
|
|
34
34
|
-------
|
|
35
35
|
Tuple
|
|
36
|
-
Tuple containing the telescope
|
|
36
|
+
Tuple containing the telescope site, (optional) calibration device model.
|
|
37
37
|
"""
|
|
38
38
|
tel_model = TelescopeModel(
|
|
39
39
|
site=site,
|
|
@@ -48,9 +48,19 @@ def initialize_simulation_models(label, db_config, site, telescope_name, model_v
|
|
|
48
48
|
mongo_db_config=db_config,
|
|
49
49
|
label=label,
|
|
50
50
|
)
|
|
51
|
+
if calibration_device_name is not None:
|
|
52
|
+
calibration_model = CalibrationModel(
|
|
53
|
+
site=site,
|
|
54
|
+
calibration_device_model_name=calibration_device_name,
|
|
55
|
+
mongo_db_config=db_config,
|
|
56
|
+
model_version=model_version,
|
|
57
|
+
label=label,
|
|
58
|
+
)
|
|
59
|
+
else:
|
|
60
|
+
calibration_model = None
|
|
51
61
|
for model in tel_model, site_model:
|
|
52
62
|
model.export_model_files()
|
|
53
|
-
return tel_model, site_model
|
|
63
|
+
return tel_model, site_model, calibration_model
|
|
54
64
|
|
|
55
65
|
|
|
56
66
|
def compute_telescope_transmission(pars: list[float], off_axis: float) -> float:
|
simtools/model/site_model.py
CHANGED
|
@@ -13,8 +13,6 @@ from simtools.model.mirrors import Mirrors
|
|
|
13
13
|
from simtools.model.model_parameter import InvalidModelParameterError, ModelParameter
|
|
14
14
|
from simtools.utils import names
|
|
15
15
|
|
|
16
|
-
__all__ = ["TelescopeModel"]
|
|
17
|
-
|
|
18
16
|
|
|
19
17
|
class TelescopeModel(ModelParameter):
|
|
20
18
|
"""
|
|
@@ -378,3 +376,23 @@ class TelescopeModel(ModelParameter):
|
|
|
378
376
|
except InvalidModelParameterError as exc:
|
|
379
377
|
self._logger.error(f"Coordinate system {coordinate_system} not found.")
|
|
380
378
|
raise exc
|
|
379
|
+
|
|
380
|
+
def get_calibration_device_name(self, device_type):
|
|
381
|
+
"""
|
|
382
|
+
Get the calibration device name for this telescope.
|
|
383
|
+
|
|
384
|
+
Parameters
|
|
385
|
+
----------
|
|
386
|
+
device_type: str
|
|
387
|
+
Type of the calibration device (e.g., 'flasher', 'illuminator')
|
|
388
|
+
|
|
389
|
+
Returns
|
|
390
|
+
-------
|
|
391
|
+
str or None
|
|
392
|
+
Calibration device name or None if not defined.
|
|
393
|
+
"""
|
|
394
|
+
try:
|
|
395
|
+
devices = self.get_parameter_value("calibration_devices") or {}
|
|
396
|
+
except InvalidModelParameterError:
|
|
397
|
+
return None
|
|
398
|
+
return devices.get(device_type)
|
|
@@ -116,7 +116,7 @@ def write_results(results, args_dict):
|
|
|
116
116
|
"""
|
|
117
117
|
table = _create_results_table(results, args_dict["loss_fraction"])
|
|
118
118
|
|
|
119
|
-
output_dir = io_handler.IOHandler().get_output_directory(
|
|
119
|
+
output_dir = io_handler.IOHandler().get_output_directory()
|
|
120
120
|
output_file = output_dir / args_dict["output_file"]
|
|
121
121
|
|
|
122
122
|
table.write(output_file, format="ascii.ecsv", overwrite=True)
|
|
@@ -80,12 +80,12 @@ class IncidentAnglesCalculator:
|
|
|
80
80
|
config_data["site"],
|
|
81
81
|
config_data["telescope"],
|
|
82
82
|
)
|
|
83
|
-
self.telescope_model, self.site_model = initialize_simulation_models(
|
|
84
|
-
self.label,
|
|
85
|
-
db_config,
|
|
86
|
-
config_data["site"],
|
|
87
|
-
config_data["telescope"],
|
|
88
|
-
config_data["model_version"],
|
|
83
|
+
self.telescope_model, self.site_model, _ = initialize_simulation_models(
|
|
84
|
+
label=self.label,
|
|
85
|
+
db_config=db_config,
|
|
86
|
+
site=config_data["site"],
|
|
87
|
+
telescope_name=config_data["telescope"],
|
|
88
|
+
model_version=config_data["model_version"],
|
|
89
89
|
)
|
|
90
90
|
|
|
91
91
|
def _label_suffix(self):
|
|
@@ -110,7 +110,7 @@ class IncidentAnglesCalculator:
|
|
|
110
110
|
Table containing at least the ``angle_incidence_focal`` column
|
|
111
111
|
and, when configured, primary/secondary angles and hit geometry.
|
|
112
112
|
"""
|
|
113
|
-
self.telescope_model.write_sim_telarray_config_file(
|
|
113
|
+
self.telescope_model.write_sim_telarray_config_file(additional_models=self.site_model)
|
|
114
114
|
|
|
115
115
|
photons_file, stars_file, log_file = self._prepare_psf_io_files()
|
|
116
116
|
run_script = self._write_run_script(photons_file, stars_file, log_file)
|
|
@@ -70,7 +70,7 @@ class MirrorPanelPSF:
|
|
|
70
70
|
site_model : SiteModel
|
|
71
71
|
The site model.
|
|
72
72
|
"""
|
|
73
|
-
tel_model, site_model = initialize_simulation_models(
|
|
73
|
+
tel_model, site_model, _ = initialize_simulation_models(
|
|
74
74
|
label=label,
|
|
75
75
|
db_config=db_config,
|
|
76
76
|
site=self.args_dict["site"],
|