gammasimtools 0.18.0__py3-none-any.whl → 0.20.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.18.0.dist-info → gammasimtools-0.20.0.dist-info}/METADATA +24 -69
- gammasimtools-0.20.0.dist-info/RECORD +395 -0
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/entry_points.txt +11 -4
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/licenses/LICENSE +1 -1
- simtools/_version.py +16 -3
- simtools/applications/calculate_incident_angles.py +182 -0
- simtools/applications/convert_all_model_parameters_from_simtel.py +4 -3
- simtools/applications/convert_geo_coordinates_of_array_elements.py +3 -3
- simtools/applications/db_add_simulation_model_from_repository_to_db.py +17 -14
- simtools/applications/db_add_value_from_json_to_db.py +8 -10
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +8 -13
- simtools/applications/db_generate_compound_indexes.py +65 -0
- simtools/applications/db_get_file_from_db.py +12 -24
- simtools/applications/db_get_parameter_from_db.py +4 -4
- simtools/applications/db_inspect_databases.py +20 -10
- simtools/applications/derive_mirror_rnda.py +17 -11
- simtools/applications/derive_psf_parameters.py +59 -309
- simtools/applications/derive_trigger_rates.py +91 -0
- simtools/applications/docs_produce_array_element_report.py +1 -1
- simtools/applications/docs_produce_calibration_reports.py +1 -1
- simtools/applications/docs_produce_model_parameter_reports.py +1 -1
- simtools/applications/docs_produce_simulation_configuration_report.py +1 -1
- simtools/applications/generate_corsika_histograms.py +1 -1
- simtools/applications/generate_default_metadata.py +8 -24
- simtools/applications/generate_simtel_event_data.py +11 -11
- simtools/applications/maintain_simulation_model_add_production_table.py +71 -0
- simtools/applications/maintain_simulation_model_compare_productions.py +98 -0
- simtools/applications/{verify_simulation_model_production_tables.py → maintain_simulation_model_verify_production_tables.py} +9 -1
- simtools/applications/merge_tables.py +2 -2
- simtools/applications/plot_array_layout.py +3 -3
- simtools/applications/plot_simtel_events.py +421 -0
- simtools/applications/plot_tabular_data.py +9 -2
- simtools/applications/plot_tabular_data_for_model_parameter.py +2 -1
- simtools/applications/print_version.py +8 -9
- simtools/applications/production_derive_corsika_limits.py +6 -7
- simtools/applications/production_derive_statistics.py +1 -1
- simtools/applications/production_generate_grid.py +2 -2
- simtools/applications/production_merge_corsika_limits.py +214 -0
- simtools/applications/run_application.py +47 -113
- simtools/applications/simulate_calibration_events.py +166 -0
- simtools/applications/simulate_flasher.py +141 -0
- simtools/applications/{simulate_light_emission.py → simulate_illuminator.py} +35 -99
- simtools/applications/simulate_prod.py +6 -24
- simtools/applications/simulate_prod_htcondor_generator.py +7 -0
- simtools/applications/submit_array_layouts.py +2 -1
- simtools/applications/submit_model_parameter_from_external.py +1 -1
- simtools/applications/validate_camera_efficiency.py +30 -12
- simtools/applications/validate_camera_fov.py +1 -1
- simtools/applications/validate_cumulative_psf.py +1 -1
- simtools/applications/validate_file_using_schema.py +9 -5
- simtools/applications/validate_optics.py +1 -1
- simtools/camera/camera_efficiency.py +61 -45
- simtools/camera/single_photon_electron_spectrum.py +1 -1
- simtools/configuration/commandline_parser.py +46 -11
- simtools/configuration/configurator.py +4 -4
- simtools/corsika/corsika_config.py +45 -25
- simtools/corsika/corsika_histograms.py +6 -5
- simtools/data_model/data_reader.py +2 -3
- simtools/data_model/metadata_collector.py +32 -36
- simtools/data_model/metadata_model.py +15 -12
- simtools/data_model/model_data_writer.py +13 -32
- simtools/data_model/schema.py +74 -24
- simtools/data_model/validate_data.py +42 -12
- simtools/db/db_handler.py +125 -62
- simtools/db/db_model_upload.py +14 -19
- simtools/dependencies.py +98 -30
- simtools/io/ascii_handler.py +279 -0
- simtools/{io_operations → io}/io_handler.py +25 -3
- simtools/job_execution/htcondor_script_generator.py +15 -4
- simtools/layout/array_layout.py +1 -1
- simtools/layout/array_layout_utils.py +51 -12
- simtools/model/array_model.py +41 -5
- simtools/model/flasher_model.py +106 -0
- simtools/model/model_parameter.py +4 -4
- simtools/model/model_repository.py +197 -2
- simtools/model/site_model.py +25 -0
- simtools/model/telescope_model.py +3 -1
- simtools/production_configuration/derive_corsika_limits.py +336 -427
- simtools/production_configuration/derive_production_statistics_handler.py +7 -6
- simtools/production_configuration/generate_production_grid.py +9 -11
- simtools/production_configuration/merge_corsika_limits.py +528 -0
- simtools/ray_tracing/incident_angles.py +706 -0
- simtools/ray_tracing/mirror_panel_psf.py +1 -0
- simtools/ray_tracing/psf_parameter_optimisation.py +792 -0
- simtools/ray_tracing/ray_tracing.py +6 -2
- simtools/reporting/docs_read_parameters.py +150 -62
- simtools/runners/corsika_runner.py +1 -1
- simtools/runners/corsika_simtel_runner.py +14 -5
- simtools/runners/runner_services.py +10 -5
- simtools/runners/simtools_runner.py +267 -0
- simtools/schemas/application_workflow.metaschema.yml +101 -68
- simtools/schemas/input/MST_mirror_2f_measurements.schema.yml +1 -1
- simtools/schemas/input/single_pe_spectrum.schema.yml +1 -1
- simtools/schemas/metadata.metaschema.yml +577 -3
- simtools/schemas/model_parameter.metaschema.yml +6 -6
- simtools/schemas/model_parameter_and_data_schema.metaschema.yml +4 -4
- simtools/schemas/model_parameters/adjust_gain.schema.yml +1 -1
- simtools/schemas/model_parameters/altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/array_coordinates.schema.yml +1 -1
- simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +1 -1
- simtools/schemas/model_parameters/array_element_position_ground.schema.yml +1 -1
- simtools/schemas/model_parameters/array_element_position_utm.schema.yml +1 -1
- simtools/schemas/model_parameters/array_layouts.schema.yml +1 -1
- simtools/schemas/model_parameters/array_triggers.schema.yml +1 -1
- simtools/schemas/model_parameters/array_window.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_shaping.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +1 -1
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/axes_offsets.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_body_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_body_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_config_file.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_config_rotate.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_depth.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_filter.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_pixels.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/channels_per_chip.schema.yml +1 -1
- simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_cherenkov_photon_bunch_size.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_cherenkov_photon_wavelength_range.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_first_interaction_height.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_io_buffer.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_max_bunches.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_split_auto.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_longitudinal_shower_development.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_observation_level.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_particle_kinetic_energy_cutoff.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_starting_grammage.schema.yml +3 -3
- simtools/schemas/model_parameters/dark_events.schema.yml +1 -1
- simtools/schemas/model_parameters/default_trigger.schema.yml +1 -1
- simtools/schemas/model_parameters/design_model.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_start.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/dish_shape_length.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_pedsub.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_prescale.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_presum_max.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_shaping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +2 -2
- simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +1 -1
- simtools/schemas/model_parameters/effective_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/epsg_code.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_long_event_threshold.schema.yml +35 -0
- simtools/schemas/model_parameters/fadc_long_sum_bins.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_long_sum_offset.schema.yml +38 -0
- simtools/schemas/model_parameters/fadc_max_signal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_max_sum.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_mhz.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_noise.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fake_mirror_list.schema.yml +1 -1
- simtools/schemas/model_parameters/flatfielding.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/focus_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/gain_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_horizontal.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_rotation.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_vertical.schema.yml +1 -1
- simtools/schemas/model_parameters/hg_lg_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/iobuf_maximum.schema.yml +1 -1
- simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_events.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_external_trigger.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_var_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_wavelength.schema.yml +1 -1
- simtools/schemas/model_parameters/led_events.schema.yml +1 -1
- simtools/schemas/model_parameters/led_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/led_pulse_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +1 -1
- simtools/schemas/model_parameters/led_var_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +50 -1
- simtools/schemas/model_parameters/min_photoelectrons.schema.yml +1 -1
- simtools/schemas/model_parameters/min_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_class.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_list.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_panel_2f_measurements.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +1 -1
- simtools/schemas/model_parameters/multiplicity_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/muon_mono_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_offaxis.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +2 -2
- simtools/schemas/model_parameters/nsb_reference_value.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_sky_map.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_spectrum.schema.yml +23 -30
- simtools/schemas/model_parameters/num_gains.schema.yml +1 -1
- simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +1 -1
- simtools/schemas/model_parameters/optics_properties.schema.yml +1 -1
- simtools/schemas/model_parameters/parabolic_dish.schema.yml +1 -1
- simtools/schemas/model_parameters/pedestal_events.schema.yml +1 -1
- simtools/schemas/model_parameters/photon_delay.schema.yml +1 -1
- simtools/schemas/model_parameters/photons_per_run.schema.yml +1 -1
- simtools/schemas/model_parameters/pixel_cells.schema.yml +1 -1
- simtools/schemas/model_parameters/pixels_parallel.schema.yml +1 -1
- simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_average_gain.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_gain_index.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_transit_time.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +11 -1
- simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +1 -1
- simtools/schemas/model_parameters/qe_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/random_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/random_generator.schema.yml +1 -1
- simtools/schemas/model_parameters/random_mono_probability.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_latitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_longitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +1 -1
- simtools/schemas/model_parameters/sampled_output.schema.yml +1 -1
- simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +11 -1
- simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +11 -1
- simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/stars.schema.yml +2 -2
- simtools/schemas/model_parameters/store_photoelectrons.schema.yml +1 -1
- simtools/schemas/model_parameters/tailcut_scale.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_axis_height.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_random_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_random_error.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +1 -1
- simtools/schemas/model_parameters/teltrig_min_time.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_jitter.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_current_limit.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_pixels.schema.yml +1 -1
- simtools/schemas/plot_configuration.metaschema.yml +5 -2
- simtools/schemas/production_configuration_metrics.schema.yml +12 -2
- simtools/schemas/production_tables.schema.yml +7 -2
- simtools/simtel/simtel_config_reader.py +2 -2
- simtools/simtel/simtel_config_writer.py +33 -23
- simtools/simtel/simtel_io_event_histograms.py +483 -0
- simtools/simtel/simtel_io_event_reader.py +65 -43
- simtools/simtel/simtel_io_event_writer.py +40 -20
- simtools/simtel/simtel_io_metadata.py +1 -1
- simtools/simtel/simtel_table_reader.py +95 -13
- simtools/simtel/simulator_array.py +138 -10
- simtools/simtel/simulator_camera_efficiency.py +32 -23
- simtools/simtel/simulator_light_emission.py +437 -271
- simtools/simtel/simulator_ray_tracing.py +1 -1
- simtools/simulator.py +105 -147
- simtools/telescope_trigger_rates.py +119 -0
- simtools/testing/configuration.py +24 -26
- simtools/testing/helpers.py +2 -2
- simtools/testing/log_inspector.py +52 -0
- simtools/testing/validate_output.py +87 -37
- simtools/utils/general.py +125 -255
- simtools/utils/geometry.py +56 -0
- simtools/utils/names.py +1 -1
- simtools/visualization/legend_handlers.py +180 -264
- simtools/visualization/plot_array_layout.py +20 -8
- simtools/visualization/plot_incident_angles.py +431 -0
- simtools/visualization/plot_pixels.py +1 -1
- simtools/visualization/plot_simtel_event_histograms.py +376 -0
- simtools/visualization/plot_simtel_events.py +816 -0
- simtools/visualization/plot_tables.py +133 -37
- simtools/visualization/visualize.py +1 -100
- gammasimtools-0.18.0.dist-info/RECORD +0 -376
- simtools/applications/calculate_trigger_rate.py +0 -187
- simtools/applications/generate_sim_telarray_histograms.py +0 -196
- simtools/production_configuration/derive_corsika_limits_grid.py +0 -232
- simtools/simtel/simtel_io_histogram.py +0 -621
- simtools/simtel/simtel_io_histograms.py +0 -552
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.18.0.dist-info → gammasimtools-0.20.0.dist-info}/top_level.txt +0 -0
- /simtools/{io_operations → io}/hdf5_handler.py +0 -0
- /simtools/{io_operations → io}/legacy_data_handler.py +0 -0
- /simtools/{io_operations/io_table_handler.py → io/table_handler.py} +0 -0
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
"""Plot incident angle histograms for focal, primary, and secondary mirrors.
|
|
3
|
+
|
|
4
|
+
Plots the primary-mirror hit radius if available.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
import astropy.units as u
|
|
11
|
+
import matplotlib.pyplot as plt
|
|
12
|
+
import numpy as np
|
|
13
|
+
|
|
14
|
+
__all__ = ["plot_incident_angles"]
|
|
15
|
+
|
|
16
|
+
Y_AXIS_BIN_COUNT_LABEL = "Density"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _gather_angle_arrays(results_by_offset, column, log):
|
|
20
|
+
arrays = []
|
|
21
|
+
for off, tab in results_by_offset.items():
|
|
22
|
+
if tab is None or len(tab) == 0:
|
|
23
|
+
if column == "angle_incidence_focal":
|
|
24
|
+
log.warning(f"Empty results for off-axis={off}")
|
|
25
|
+
continue
|
|
26
|
+
if column not in tab.colnames:
|
|
27
|
+
continue
|
|
28
|
+
arrays.append(tab[column].to(u.deg).value)
|
|
29
|
+
return arrays
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _gather_radius_arrays(results_by_offset, column, log):
|
|
33
|
+
arrays = []
|
|
34
|
+
for off, tab in results_by_offset.items():
|
|
35
|
+
if tab is None or len(tab) == 0 or column not in tab.colnames:
|
|
36
|
+
continue
|
|
37
|
+
try:
|
|
38
|
+
arrays.append(tab[column].to(u.m).value)
|
|
39
|
+
except (AttributeError, ValueError, TypeError):
|
|
40
|
+
log.warning("Skipping radius values for off-axis=%s due to unit/format issue", off)
|
|
41
|
+
return arrays
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _plot_radius_vs_angle(
|
|
45
|
+
results_by_offset,
|
|
46
|
+
radius_col,
|
|
47
|
+
angle_col,
|
|
48
|
+
title,
|
|
49
|
+
out_path,
|
|
50
|
+
log,
|
|
51
|
+
):
|
|
52
|
+
any_points = False
|
|
53
|
+
fig, ax = plt.subplots(1, 1, figsize=(7, 5))
|
|
54
|
+
for off in sorted(results_by_offset.keys()):
|
|
55
|
+
tab = results_by_offset[off]
|
|
56
|
+
if tab is None or len(tab) == 0:
|
|
57
|
+
continue
|
|
58
|
+
if radius_col not in tab.colnames or angle_col not in tab.colnames:
|
|
59
|
+
continue
|
|
60
|
+
r = tab[radius_col].to(u.m).value
|
|
61
|
+
a = tab[angle_col].to(u.deg).value
|
|
62
|
+
mask = np.isfinite(r) & np.isfinite(a)
|
|
63
|
+
r, a = r[mask], a[mask]
|
|
64
|
+
if r.size == 0 or a.size == 0:
|
|
65
|
+
continue
|
|
66
|
+
any_points = True
|
|
67
|
+
ax.scatter(r, a, s=4, alpha=0.25, label=f"off-axis {off:g} deg")
|
|
68
|
+
if not any_points:
|
|
69
|
+
plt.close(fig)
|
|
70
|
+
log.warning("No valid data to plot for %s", title)
|
|
71
|
+
return
|
|
72
|
+
ax.set_xlabel("Hit radius (m)")
|
|
73
|
+
ax.set_ylabel("Angle of incidence (deg)")
|
|
74
|
+
ax.set_title(title)
|
|
75
|
+
ax.grid(True, alpha=0.3)
|
|
76
|
+
ax.legend(markerscale=3)
|
|
77
|
+
plt.tight_layout()
|
|
78
|
+
plt.savefig(out_path, dpi=300)
|
|
79
|
+
plt.close(fig)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _plot_xy_heatmap(
|
|
83
|
+
results_by_offset,
|
|
84
|
+
x_col,
|
|
85
|
+
y_col,
|
|
86
|
+
title,
|
|
87
|
+
out_path,
|
|
88
|
+
log,
|
|
89
|
+
bins=400,
|
|
90
|
+
):
|
|
91
|
+
any_points = False
|
|
92
|
+
fig, ax = plt.subplots(1, 1, figsize=(6, 5))
|
|
93
|
+
h = None
|
|
94
|
+
for _off, x, y in _iter_xy_valid_points(results_by_offset, x_col, y_col):
|
|
95
|
+
any_points = True
|
|
96
|
+
h = ax.hist2d(x, y, bins=bins, cmap="viridis", norm=None)
|
|
97
|
+
if not any_points:
|
|
98
|
+
plt.close(fig)
|
|
99
|
+
log.warning("No valid data to plot for %s", title)
|
|
100
|
+
return
|
|
101
|
+
ax.set_xlabel("X hit (m)")
|
|
102
|
+
ax.set_ylabel("Y hit (m)")
|
|
103
|
+
ax.set_title(title)
|
|
104
|
+
ax.grid(False)
|
|
105
|
+
cb = plt.colorbar(h[3], ax=ax)
|
|
106
|
+
cb.set_label("Counts per bin")
|
|
107
|
+
plt.tight_layout()
|
|
108
|
+
plt.savefig(out_path, dpi=300)
|
|
109
|
+
plt.close(fig)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _plot_xy_heatmaps_per_offset(
|
|
113
|
+
results_by_offset,
|
|
114
|
+
x_col,
|
|
115
|
+
y_col,
|
|
116
|
+
title_prefix,
|
|
117
|
+
file_stem,
|
|
118
|
+
out_dir,
|
|
119
|
+
label,
|
|
120
|
+
bins=400,
|
|
121
|
+
):
|
|
122
|
+
for off, x, y in _iter_xy_valid_points(results_by_offset, x_col, y_col):
|
|
123
|
+
fig, ax = plt.subplots(1, 1, figsize=(6, 5))
|
|
124
|
+
h = ax.hist2d(x, y, bins=bins, cmap="viridis", norm=None)
|
|
125
|
+
ax.set_xlabel("X hit (m)")
|
|
126
|
+
ax.set_ylabel("Y hit (m)")
|
|
127
|
+
ax.set_aspect("equal", adjustable="box")
|
|
128
|
+
ax.set_title(f"{title_prefix} (off-axis {off:g} deg)")
|
|
129
|
+
cb = plt.colorbar(h[3], ax=ax)
|
|
130
|
+
cb.set_label("Counts per bin")
|
|
131
|
+
plt.tight_layout()
|
|
132
|
+
out_path = out_dir / f"{file_stem}{off:g}_{label}.png"
|
|
133
|
+
plt.savefig(out_path, dpi=300)
|
|
134
|
+
plt.close(fig)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def _iter_xy_valid_points(results_by_offset, x_col, y_col):
|
|
138
|
+
"""Yield (off, x, y) arrays for valid entries with finite X/Y in meters.
|
|
139
|
+
|
|
140
|
+
Filters out None/empty tables, missing columns, and non-finite rows.
|
|
141
|
+
Offsets are iterated in sorted order.
|
|
142
|
+
"""
|
|
143
|
+
for off in sorted(results_by_offset.keys()):
|
|
144
|
+
tab = results_by_offset[off]
|
|
145
|
+
if tab is None or len(tab) == 0:
|
|
146
|
+
continue
|
|
147
|
+
if x_col not in tab.colnames or y_col not in tab.colnames:
|
|
148
|
+
continue
|
|
149
|
+
x = tab[x_col].to(u.m).value
|
|
150
|
+
y = tab[y_col].to(u.m).value
|
|
151
|
+
mask = np.isfinite(x) & np.isfinite(y)
|
|
152
|
+
x, y = x[mask], y[mask]
|
|
153
|
+
if x.size == 0:
|
|
154
|
+
continue
|
|
155
|
+
yield off, x, y
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def _compute_bins(all_vals, bin_width, log, context):
|
|
159
|
+
finite_mask = np.isfinite(all_vals)
|
|
160
|
+
if not np.any(finite_mask):
|
|
161
|
+
if context == "focal":
|
|
162
|
+
log.warning("No focal-surface incidence angle values to plot for this telescope type")
|
|
163
|
+
else:
|
|
164
|
+
log.warning("No %s values to plot for this telescope type", context)
|
|
165
|
+
return None
|
|
166
|
+
vals = all_vals[finite_mask]
|
|
167
|
+
vmin = float(np.floor(vals.min() / bin_width) * bin_width)
|
|
168
|
+
vmax = float(np.ceil(vals.max() / bin_width) * bin_width)
|
|
169
|
+
if not np.isfinite(vmin) or not np.isfinite(vmax):
|
|
170
|
+
log.warning("Invalid bin edges for %s: vmin=%s vmax=%s", context, vmin, vmax)
|
|
171
|
+
return None
|
|
172
|
+
if vmax <= vmin:
|
|
173
|
+
vmax = vmin + bin_width
|
|
174
|
+
return np.arange(vmin, vmax + bin_width * 0.5, bin_width)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def _plot_radius_histograms(
|
|
178
|
+
results_by_offset,
|
|
179
|
+
radius_col,
|
|
180
|
+
title,
|
|
181
|
+
xlabel,
|
|
182
|
+
out_path,
|
|
183
|
+
bin_width_m,
|
|
184
|
+
log,
|
|
185
|
+
):
|
|
186
|
+
arrays = _gather_radius_arrays(results_by_offset, radius_col, log)
|
|
187
|
+
if not arrays:
|
|
188
|
+
return
|
|
189
|
+
all_vals = np.concatenate(arrays)
|
|
190
|
+
bins_m = _compute_bins(all_vals, bin_width=bin_width_m, log=log, context=f"{radius_col}_m")
|
|
191
|
+
if bins_m is None:
|
|
192
|
+
return
|
|
193
|
+
fig, ax = plt.subplots(1, 1, figsize=(7, 5))
|
|
194
|
+
for off in sorted(results_by_offset.keys()):
|
|
195
|
+
tab = results_by_offset[off]
|
|
196
|
+
if tab is None or len(tab) == 0 or radius_col not in tab.colnames:
|
|
197
|
+
continue
|
|
198
|
+
data = tab[radius_col].to(u.m).value
|
|
199
|
+
data = data[np.isfinite(data)]
|
|
200
|
+
if data.size == 0:
|
|
201
|
+
continue
|
|
202
|
+
_, _, patches = ax.hist(
|
|
203
|
+
data,
|
|
204
|
+
bins=bins_m,
|
|
205
|
+
density=True,
|
|
206
|
+
stacked=True,
|
|
207
|
+
histtype="step",
|
|
208
|
+
linewidth=0.5,
|
|
209
|
+
label=f"off-axis {off:g} deg",
|
|
210
|
+
zorder=3,
|
|
211
|
+
)
|
|
212
|
+
color = patches[0].get_edgecolor() if patches else None
|
|
213
|
+
ax.hist(
|
|
214
|
+
data,
|
|
215
|
+
bins=bins_m,
|
|
216
|
+
density=True,
|
|
217
|
+
stacked=True,
|
|
218
|
+
histtype="stepfilled",
|
|
219
|
+
alpha=0.15,
|
|
220
|
+
color=color,
|
|
221
|
+
edgecolor="none",
|
|
222
|
+
label="_nolegend_",
|
|
223
|
+
zorder=1,
|
|
224
|
+
)
|
|
225
|
+
ax.hist(
|
|
226
|
+
data,
|
|
227
|
+
bins=bins_m,
|
|
228
|
+
density=True,
|
|
229
|
+
stacked=True,
|
|
230
|
+
histtype="step",
|
|
231
|
+
linewidth=0.5,
|
|
232
|
+
color=color,
|
|
233
|
+
label="_nolegend_",
|
|
234
|
+
zorder=4,
|
|
235
|
+
)
|
|
236
|
+
ax.set_xlabel(xlabel)
|
|
237
|
+
ax.set_ylabel(Y_AXIS_BIN_COUNT_LABEL)
|
|
238
|
+
ax.set_title(title)
|
|
239
|
+
ax.grid(True, alpha=0.3)
|
|
240
|
+
ax.legend()
|
|
241
|
+
plt.tight_layout()
|
|
242
|
+
plt.savefig(out_path, dpi=300)
|
|
243
|
+
plt.close(fig)
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
def _plot_debug_plots(results_by_offset, out_dir, label, radius_bin_width_m, log):
|
|
247
|
+
_plot_radius_histograms(
|
|
248
|
+
results_by_offset,
|
|
249
|
+
radius_col="primary_hit_radius",
|
|
250
|
+
title="Primary mirror hit radius vs off-axis angle",
|
|
251
|
+
xlabel="Primary-hit radius on M1 (m)",
|
|
252
|
+
out_path=out_dir / f"incident_radius_primary_multi_{label}.png",
|
|
253
|
+
bin_width_m=radius_bin_width_m,
|
|
254
|
+
log=log,
|
|
255
|
+
)
|
|
256
|
+
_plot_radius_histograms(
|
|
257
|
+
results_by_offset,
|
|
258
|
+
radius_col="secondary_hit_radius",
|
|
259
|
+
title="Secondary mirror hit radius vs off-axis angle",
|
|
260
|
+
xlabel="Secondary-hit radius on M2 (m)",
|
|
261
|
+
out_path=out_dir / f"incident_radius_secondary_multi_{label}.png",
|
|
262
|
+
bin_width_m=radius_bin_width_m,
|
|
263
|
+
log=log,
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
_plot_radius_vs_angle(
|
|
267
|
+
results_by_offset,
|
|
268
|
+
radius_col="primary_hit_radius",
|
|
269
|
+
angle_col="angle_incidence_primary",
|
|
270
|
+
title="Primary mirror: hit radius vs incidence angle",
|
|
271
|
+
out_path=out_dir / f"incident_primary_radius_vs_angle_multi_{label}.png",
|
|
272
|
+
log=log,
|
|
273
|
+
)
|
|
274
|
+
_plot_radius_vs_angle(
|
|
275
|
+
results_by_offset,
|
|
276
|
+
radius_col="secondary_hit_radius",
|
|
277
|
+
angle_col="angle_incidence_secondary",
|
|
278
|
+
title="Secondary mirror: hit radius vs incidence angle",
|
|
279
|
+
out_path=out_dir / f"incident_secondary_radius_vs_angle_multi_{label}.png",
|
|
280
|
+
log=log,
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
_plot_xy_heatmaps_per_offset(
|
|
284
|
+
results_by_offset,
|
|
285
|
+
x_col="primary_hit_x",
|
|
286
|
+
y_col="primary_hit_y",
|
|
287
|
+
title_prefix="Primary mirror: X-Y hit distribution",
|
|
288
|
+
file_stem="incident_primary_xy_heatmap_off",
|
|
289
|
+
out_dir=out_dir,
|
|
290
|
+
label=label,
|
|
291
|
+
)
|
|
292
|
+
_plot_xy_heatmaps_per_offset(
|
|
293
|
+
results_by_offset,
|
|
294
|
+
x_col="secondary_hit_x",
|
|
295
|
+
y_col="secondary_hit_y",
|
|
296
|
+
title_prefix="Secondary mirror: X-Y hit distribution",
|
|
297
|
+
file_stem="incident_secondary_xy_heatmap_off",
|
|
298
|
+
out_dir=out_dir,
|
|
299
|
+
label=label,
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
def _plot_overlay_angles(results_by_offset, column, bins, ax, use_zorder):
|
|
304
|
+
for off in sorted(results_by_offset.keys()):
|
|
305
|
+
tab = results_by_offset[off]
|
|
306
|
+
if tab is None or len(tab) == 0 or column not in tab.colnames:
|
|
307
|
+
continue
|
|
308
|
+
data = tab[column].to(u.deg).value
|
|
309
|
+
data = data[np.isfinite(data)]
|
|
310
|
+
if data.size == 0:
|
|
311
|
+
continue
|
|
312
|
+
z1, z2, z3 = (3, 1, 4) if use_zorder else (None, None, None)
|
|
313
|
+
_, _, patches = ax.hist(
|
|
314
|
+
data,
|
|
315
|
+
bins=bins,
|
|
316
|
+
density=True,
|
|
317
|
+
stacked=True,
|
|
318
|
+
histtype="step",
|
|
319
|
+
linewidth=0.5,
|
|
320
|
+
label=f"off-axis {off:g} deg",
|
|
321
|
+
zorder=z1,
|
|
322
|
+
)
|
|
323
|
+
color = patches[0].get_edgecolor() if patches else None
|
|
324
|
+
ax.hist(
|
|
325
|
+
data,
|
|
326
|
+
bins=bins,
|
|
327
|
+
density=True,
|
|
328
|
+
stacked=True,
|
|
329
|
+
histtype="stepfilled",
|
|
330
|
+
alpha=0.15,
|
|
331
|
+
color=color,
|
|
332
|
+
edgecolor="none",
|
|
333
|
+
label="_nolegend_",
|
|
334
|
+
zorder=z2,
|
|
335
|
+
)
|
|
336
|
+
ax.hist(
|
|
337
|
+
data,
|
|
338
|
+
bins=bins,
|
|
339
|
+
density=True,
|
|
340
|
+
stacked=True,
|
|
341
|
+
histtype="step",
|
|
342
|
+
linewidth=0.5,
|
|
343
|
+
color=color,
|
|
344
|
+
label="_nolegend_",
|
|
345
|
+
zorder=z3,
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
def _plot_component_angles(
|
|
350
|
+
results_by_offset,
|
|
351
|
+
column,
|
|
352
|
+
title_suffix,
|
|
353
|
+
out_path,
|
|
354
|
+
bin_width_deg,
|
|
355
|
+
log,
|
|
356
|
+
):
|
|
357
|
+
arrays = _gather_angle_arrays(results_by_offset, column, log)
|
|
358
|
+
if not arrays:
|
|
359
|
+
return
|
|
360
|
+
bins = _compute_bins(np.concatenate(arrays), bin_width_deg, log, context=column)
|
|
361
|
+
if bins is None:
|
|
362
|
+
return
|
|
363
|
+
fig, ax = plt.subplots(1, 1, figsize=(7, 5))
|
|
364
|
+
_plot_overlay_angles(results_by_offset, column, bins, ax, use_zorder=False)
|
|
365
|
+
ax.set_xlabel("Angle of incidence (deg)")
|
|
366
|
+
ax.set_ylabel(Y_AXIS_BIN_COUNT_LABEL)
|
|
367
|
+
ax.set_title(f"Incident angle {title_suffix} vs off-axis angle")
|
|
368
|
+
ax.grid(True, alpha=0.3)
|
|
369
|
+
ax.legend()
|
|
370
|
+
plt.tight_layout()
|
|
371
|
+
plt.savefig(out_path, dpi=300)
|
|
372
|
+
plt.close(fig)
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
def plot_incident_angles(
|
|
376
|
+
results_by_offset,
|
|
377
|
+
output_dir,
|
|
378
|
+
label,
|
|
379
|
+
bin_width_deg=0.1,
|
|
380
|
+
radius_bin_width_m=0.01,
|
|
381
|
+
debug_plots=False,
|
|
382
|
+
logger=None,
|
|
383
|
+
):
|
|
384
|
+
"""Plot overlaid histograms of focal, primary, secondary angles, and primary hit radius."""
|
|
385
|
+
log = logger or logging.getLogger(__name__)
|
|
386
|
+
if not results_by_offset:
|
|
387
|
+
log.warning("No results provided for multi-offset plot")
|
|
388
|
+
return
|
|
389
|
+
|
|
390
|
+
out_dir = Path(output_dir) / "plots"
|
|
391
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
392
|
+
|
|
393
|
+
# Focal-surface angles
|
|
394
|
+
arrays = _gather_angle_arrays(results_by_offset, "angle_incidence_focal", log)
|
|
395
|
+
if arrays:
|
|
396
|
+
bins = _compute_bins(np.concatenate(arrays), bin_width_deg, log, context="focal")
|
|
397
|
+
if bins is not None:
|
|
398
|
+
fig, ax = plt.subplots(1, 1, figsize=(7, 5))
|
|
399
|
+
_plot_overlay_angles(
|
|
400
|
+
results_by_offset, "angle_incidence_focal", bins, ax, use_zorder=True
|
|
401
|
+
)
|
|
402
|
+
ax.set_xlabel("Angle of incidence at focal surface (deg) w.r.t. optical axis")
|
|
403
|
+
ax.set_ylabel(Y_AXIS_BIN_COUNT_LABEL)
|
|
404
|
+
ax.set_title("Incident angle distribution vs off-axis angle")
|
|
405
|
+
ax.grid(True, alpha=0.3)
|
|
406
|
+
ax.legend()
|
|
407
|
+
plt.tight_layout()
|
|
408
|
+
plt.savefig(out_dir / f"incident_angles_multi_{label}.png", dpi=300)
|
|
409
|
+
plt.close(fig)
|
|
410
|
+
|
|
411
|
+
# Primary and secondary mirror angles
|
|
412
|
+
_plot_component_angles(
|
|
413
|
+
results_by_offset=results_by_offset,
|
|
414
|
+
column="angle_incidence_primary",
|
|
415
|
+
title_suffix="on primary mirror (w.r.t. normal)",
|
|
416
|
+
out_path=out_dir / f"incident_angles_primary_multi_{label}.png",
|
|
417
|
+
bin_width_deg=bin_width_deg,
|
|
418
|
+
log=log,
|
|
419
|
+
)
|
|
420
|
+
_plot_component_angles(
|
|
421
|
+
results_by_offset=results_by_offset,
|
|
422
|
+
column="angle_incidence_secondary",
|
|
423
|
+
title_suffix="on secondary mirror (w.r.t. normal)",
|
|
424
|
+
out_path=out_dir / f"incident_angles_secondary_multi_{label}.png",
|
|
425
|
+
bin_width_deg=bin_width_deg,
|
|
426
|
+
log=log,
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
# Debug plots
|
|
430
|
+
if debug_plots:
|
|
431
|
+
_plot_debug_plots(results_by_offset, out_dir, label, radius_bin_width_m, log)
|
|
@@ -12,7 +12,7 @@ import numpy as np
|
|
|
12
12
|
from matplotlib.collections import PatchCollection
|
|
13
13
|
|
|
14
14
|
from simtools.db import db_handler
|
|
15
|
-
from simtools.
|
|
15
|
+
from simtools.io import io_handler
|
|
16
16
|
from simtools.model.model_utils import is_two_mirror_telescope
|
|
17
17
|
from simtools.utils import names
|
|
18
18
|
from simtools.visualization import legend_handlers as leg_h
|