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
|
@@ -4,99 +4,54 @@ import matplotlib.colors as mcolors
|
|
|
4
4
|
import matplotlib.patches as mpatches
|
|
5
5
|
import numpy as np
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"SCTObject",
|
|
22
|
-
"SSTHandler",
|
|
23
|
-
"SSTObject",
|
|
24
|
-
"SquareEdgePixelHandler",
|
|
25
|
-
"SquareOffPixelHandler",
|
|
26
|
-
"SquarePixelHandler",
|
|
27
|
-
"TelescopeHandler",
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
# assume same size of telescope at both sides
|
|
31
|
-
# (good assumption for plotting)
|
|
32
|
-
lst = "LSTN"
|
|
33
|
-
mst = "MSTN"
|
|
34
|
-
sst = "SSTS"
|
|
35
|
-
sct = "SCTS"
|
|
36
|
-
hess = "HESS"
|
|
37
|
-
magic = "MAGIC"
|
|
38
|
-
veritas = "VERITAS"
|
|
7
|
+
"""
|
|
8
|
+
Define properties of different telescope types for visualization purposes.
|
|
9
|
+
|
|
10
|
+
Radii are relative to a reference radius (REFERENCE_RADIUS).
|
|
11
|
+
"""
|
|
12
|
+
TELESCOPE_CONFIG = {
|
|
13
|
+
"LST": {"color": "darkorange", "radius": 12.5, "shape": "circle", "filled": False},
|
|
14
|
+
"MST": {"color": "dodgerblue", "radius": 9.15, "shape": "circle", "filled": True},
|
|
15
|
+
"SCT": {"color": "black", "radius": 7.15, "shape": "square", "filled": True},
|
|
16
|
+
"SST": {"color": "darkgreen", "radius": 3.0, "shape": "circle", "filled": True},
|
|
17
|
+
"HESS": {"color": "grey", "radius": 6.0, "shape": "hexagon", "filled": True},
|
|
18
|
+
"MAGIC": {"color": "grey", "radius": 8.5, "shape": "hexagon", "filled": True},
|
|
19
|
+
"VERITAS": {"color": "grey", "radius": 6.0, "shape": "hexagon", "filled": True},
|
|
20
|
+
}
|
|
39
21
|
|
|
22
|
+
REFERENCE_RADIUS = 12.5
|
|
40
23
|
|
|
41
|
-
|
|
24
|
+
|
|
25
|
+
def get_telescope_config(telescope_type):
|
|
42
26
|
"""
|
|
43
|
-
|
|
27
|
+
Return the configuration for a given telescope type.
|
|
28
|
+
|
|
29
|
+
Try both site-dependent and site-independent configurations (e.g. "MSTS" and "MST").
|
|
44
30
|
|
|
45
31
|
Parameters
|
|
46
32
|
----------
|
|
47
|
-
|
|
48
|
-
The
|
|
49
|
-
width_factor: int, optional
|
|
50
|
-
The factor to adjust the width.
|
|
51
|
-
height_factor: int, optional
|
|
52
|
-
The factor to adjust the height.
|
|
33
|
+
telescope_type : str
|
|
34
|
+
The type of the telescope (e.g., "LSTN", "MSTS").
|
|
53
35
|
|
|
54
36
|
Returns
|
|
55
37
|
-------
|
|
56
|
-
|
|
57
|
-
The
|
|
38
|
+
dict
|
|
39
|
+
The configuration dictionary for the telescope type.
|
|
58
40
|
"""
|
|
41
|
+
config = TELESCOPE_CONFIG.get(telescope_type)
|
|
42
|
+
if not config and len(telescope_type) >= 3:
|
|
43
|
+
config = TELESCOPE_CONFIG.get(telescope_type[:3])
|
|
44
|
+
return config
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def calculate_center(handlebox, width_factor=3, height_factor=3):
|
|
48
|
+
"""Calculate the center of the handlebox based on given factors."""
|
|
59
49
|
x0 = handlebox.xdescent + handlebox.width / width_factor
|
|
60
50
|
y0 = handlebox.ydescent + handlebox.height / height_factor
|
|
61
51
|
return x0, y0
|
|
62
52
|
|
|
63
53
|
|
|
64
|
-
|
|
65
|
-
"""
|
|
66
|
-
Telescope handler that centralizes the telescope information.
|
|
67
|
-
|
|
68
|
-
Individual telescopes handlers inherit from this class.
|
|
69
|
-
"""
|
|
70
|
-
|
|
71
|
-
def __init__(self, radius=None):
|
|
72
|
-
self.colors_dict = {
|
|
73
|
-
"LSTN": "darkorange",
|
|
74
|
-
"MSTx": "dodgerblue",
|
|
75
|
-
"MSTN": "dodgerblue",
|
|
76
|
-
"LSTS": "darkorange",
|
|
77
|
-
"MSTS": "dodgerblue",
|
|
78
|
-
"SCTS": "black",
|
|
79
|
-
"SSTS": "darkgreen",
|
|
80
|
-
"HESS": "grey",
|
|
81
|
-
"MAGIC": "grey",
|
|
82
|
-
"VERITAS": "grey",
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
# hardwired values; this is for plotting purposes only
|
|
86
|
-
self.radius_dict = {
|
|
87
|
-
"LSTN": 12.5,
|
|
88
|
-
"MSTx": 9.15,
|
|
89
|
-
"MSTN": 9.15,
|
|
90
|
-
"LSTS": 12.5,
|
|
91
|
-
"MSTS": 9.15,
|
|
92
|
-
"SCTS": 7.15,
|
|
93
|
-
"SSTS": 3.0,
|
|
94
|
-
"HESS": 6.0,
|
|
95
|
-
"MAGIC": 8.5,
|
|
96
|
-
"VERITAS": 6.0,
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
54
|
+
# Object classes for legend mapping
|
|
100
55
|
class PixelObject:
|
|
101
56
|
"""Pixel Object."""
|
|
102
57
|
|
|
@@ -141,248 +96,228 @@ class MeanRadiusOuterEdgeObject:
|
|
|
141
96
|
"""Object for Mean radius outer edge."""
|
|
142
97
|
|
|
143
98
|
|
|
144
|
-
|
|
145
|
-
|
|
99
|
+
# Pixel handlers
|
|
100
|
+
class _BaseHexPixelHandler:
|
|
101
|
+
"""Base class for hexagonal pixel handlers."""
|
|
146
102
|
|
|
147
103
|
@staticmethod
|
|
148
|
-
def
|
|
104
|
+
def _create_hex_patch(handlebox, facecolor, edgecolor):
|
|
105
|
+
"""Create a hexagonal patch with specified colors."""
|
|
149
106
|
x0, y0 = calculate_center(handlebox)
|
|
150
107
|
patch = mpatches.RegularPolygon(
|
|
151
108
|
(x0, y0),
|
|
152
109
|
numVertices=6,
|
|
153
110
|
radius=0.7 * handlebox.height,
|
|
154
111
|
orientation=np.deg2rad(30),
|
|
155
|
-
facecolor=
|
|
156
|
-
edgecolor=
|
|
112
|
+
facecolor=facecolor,
|
|
113
|
+
edgecolor=edgecolor,
|
|
157
114
|
transform=handlebox.get_transform(),
|
|
158
115
|
)
|
|
159
116
|
handlebox.add_artist(patch)
|
|
160
117
|
return patch
|
|
161
118
|
|
|
162
119
|
|
|
163
|
-
class
|
|
120
|
+
class HexPixelHandler(_BaseHexPixelHandler):
|
|
121
|
+
"""Legend handler class to plot a hexagonal "on" pixel."""
|
|
122
|
+
|
|
123
|
+
@staticmethod
|
|
124
|
+
def legend_artist(_, __, ___, handlebox):
|
|
125
|
+
"""Legend artist."""
|
|
126
|
+
return HexPixelHandler._create_hex_patch(
|
|
127
|
+
handlebox, facecolor=(1, 1, 1, 0), edgecolor=(0, 0, 0, 1)
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class HexEdgePixelHandler(_BaseHexPixelHandler):
|
|
164
132
|
"""Legend handler class to plot a hexagonal "edge" pixel."""
|
|
165
133
|
|
|
166
134
|
@staticmethod
|
|
167
|
-
def legend_artist(_, __, ___, handlebox):
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
numVertices=6,
|
|
172
|
-
radius=0.7 * handlebox.height,
|
|
173
|
-
orientation=np.deg2rad(30),
|
|
135
|
+
def legend_artist(_, __, ___, handlebox):
|
|
136
|
+
"""Legend artist."""
|
|
137
|
+
return HexEdgePixelHandler._create_hex_patch(
|
|
138
|
+
handlebox,
|
|
174
139
|
facecolor=(*mcolors.to_rgb("brown"), 0.5),
|
|
175
140
|
edgecolor=(*mcolors.to_rgb("black"), 1),
|
|
176
|
-
transform=handlebox.get_transform(),
|
|
177
141
|
)
|
|
178
|
-
handlebox.add_artist(patch)
|
|
179
|
-
return patch
|
|
180
142
|
|
|
181
143
|
|
|
182
|
-
class HexOffPixelHandler:
|
|
144
|
+
class HexOffPixelHandler(_BaseHexPixelHandler):
|
|
183
145
|
"""Legend handler class to plot a hexagonal "off" pixel."""
|
|
184
146
|
|
|
185
147
|
@staticmethod
|
|
186
|
-
def legend_artist(_, __, ___, handlebox):
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
(x0, y0),
|
|
190
|
-
numVertices=6,
|
|
191
|
-
radius=0.7 * handlebox.height,
|
|
192
|
-
orientation=np.deg2rad(30),
|
|
193
|
-
facecolor="black",
|
|
194
|
-
edgecolor="black",
|
|
195
|
-
transform=handlebox.get_transform(),
|
|
196
|
-
)
|
|
197
|
-
handlebox.add_artist(patch)
|
|
198
|
-
return patch
|
|
148
|
+
def legend_artist(_, __, ___, handlebox):
|
|
149
|
+
"""Legend artist."""
|
|
150
|
+
return HexOffPixelHandler._create_hex_patch(handlebox, facecolor="black", edgecolor="black")
|
|
199
151
|
|
|
200
152
|
|
|
201
|
-
class
|
|
202
|
-
"""
|
|
153
|
+
class _BaseSquarePixelHandler:
|
|
154
|
+
"""Base class for square pixel handlers."""
|
|
203
155
|
|
|
204
156
|
@staticmethod
|
|
205
|
-
def
|
|
157
|
+
def _create_square_patch(handlebox, facecolor, edgecolor):
|
|
158
|
+
"""Create a square patch with specified colors."""
|
|
206
159
|
x0, y0 = handlebox.xdescent, handlebox.ydescent
|
|
207
160
|
width = height = handlebox.height
|
|
208
161
|
patch = mpatches.Rectangle(
|
|
209
162
|
[x0, y0],
|
|
210
163
|
width,
|
|
211
164
|
height,
|
|
212
|
-
facecolor=
|
|
213
|
-
edgecolor=
|
|
165
|
+
facecolor=facecolor,
|
|
166
|
+
edgecolor=edgecolor,
|
|
214
167
|
transform=handlebox.get_transform(),
|
|
215
168
|
)
|
|
216
169
|
handlebox.add_artist(patch)
|
|
217
170
|
return patch
|
|
218
171
|
|
|
219
172
|
|
|
220
|
-
class
|
|
173
|
+
class SquarePixelHandler(_BaseSquarePixelHandler):
|
|
174
|
+
"""Legend handler class to plot a square "on" pixel."""
|
|
175
|
+
|
|
176
|
+
@staticmethod
|
|
177
|
+
def legend_artist(_, __, ___, handlebox):
|
|
178
|
+
"""Legend artist."""
|
|
179
|
+
return SquarePixelHandler._create_square_patch(
|
|
180
|
+
handlebox, facecolor=(1, 1, 1, 0), edgecolor=(0, 0, 0, 1)
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class SquareEdgePixelHandler(_BaseSquarePixelHandler):
|
|
221
185
|
"""Legend handler class to plot a square "edge" pixel."""
|
|
222
186
|
|
|
223
187
|
@staticmethod
|
|
224
|
-
def legend_artist(_, __, ___, handlebox):
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
[x0, y0],
|
|
229
|
-
width,
|
|
230
|
-
height,
|
|
188
|
+
def legend_artist(_, __, ___, handlebox):
|
|
189
|
+
"""Legend artist."""
|
|
190
|
+
return SquareEdgePixelHandler._create_square_patch(
|
|
191
|
+
handlebox,
|
|
231
192
|
facecolor=(*mcolors.to_rgb("brown"), 0.5),
|
|
232
193
|
edgecolor=(*mcolors.to_rgb("black"), 1),
|
|
233
|
-
transform=handlebox.get_transform(),
|
|
234
194
|
)
|
|
235
|
-
handlebox.add_artist(patch)
|
|
236
|
-
return patch
|
|
237
195
|
|
|
238
196
|
|
|
239
|
-
class SquareOffPixelHandler:
|
|
197
|
+
class SquareOffPixelHandler(_BaseSquarePixelHandler):
|
|
240
198
|
"""Legend handler class to plot a square "off" pixel."""
|
|
241
199
|
|
|
242
200
|
@staticmethod
|
|
243
|
-
def legend_artist(_, __, ___, handlebox):
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
[x0, y0],
|
|
248
|
-
width,
|
|
249
|
-
height,
|
|
250
|
-
facecolor="black",
|
|
251
|
-
edgecolor="black",
|
|
252
|
-
transform=handlebox.get_transform(),
|
|
201
|
+
def legend_artist(_, __, ___, handlebox):
|
|
202
|
+
"""Legend artist."""
|
|
203
|
+
return SquareOffPixelHandler._create_square_patch(
|
|
204
|
+
handlebox, facecolor="black", edgecolor="black"
|
|
253
205
|
)
|
|
254
|
-
handlebox.add_artist(patch)
|
|
255
|
-
return patch
|
|
256
206
|
|
|
257
207
|
|
|
258
|
-
class
|
|
259
|
-
"""
|
|
208
|
+
class BaseLegendHandler:
|
|
209
|
+
"""Base telescope handler that can handle any telescope type."""
|
|
260
210
|
|
|
261
|
-
def
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
211
|
+
def __init__(self, telescope_type):
|
|
212
|
+
self.telescope_type = telescope_type
|
|
213
|
+
self.config = get_telescope_config(telescope_type)
|
|
214
|
+
|
|
215
|
+
def _create_circle(self, handlebox, x0, y0, radius):
|
|
216
|
+
"""Create a circle patch."""
|
|
217
|
+
facecolor = self.config["color"] if self.config["filled"] else "none"
|
|
218
|
+
return mpatches.Circle(
|
|
265
219
|
xy=(x0, y0),
|
|
266
|
-
radius=radius * self.
|
|
267
|
-
facecolor=
|
|
268
|
-
edgecolor=self.
|
|
220
|
+
radius=radius * self.config["radius"] / REFERENCE_RADIUS,
|
|
221
|
+
facecolor=facecolor,
|
|
222
|
+
edgecolor=self.config["color"],
|
|
269
223
|
transform=handlebox.get_transform(),
|
|
270
224
|
)
|
|
271
|
-
handlebox.add_artist(patch)
|
|
272
|
-
return patch
|
|
273
225
|
|
|
226
|
+
def _create_square(self, handlebox, x0, y0, size):
|
|
227
|
+
"""Create a square patch."""
|
|
228
|
+
return mpatches.Rectangle(
|
|
229
|
+
[x0, y0],
|
|
230
|
+
size,
|
|
231
|
+
size,
|
|
232
|
+
facecolor=self.config["color"],
|
|
233
|
+
edgecolor=self.config["color"],
|
|
234
|
+
transform=handlebox.get_transform(),
|
|
235
|
+
)
|
|
274
236
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
facecolor=self.colors_dict[mst],
|
|
285
|
-
edgecolor=self.colors_dict[mst],
|
|
237
|
+
def _create_hexagon(self, handlebox, x0, y0, radius):
|
|
238
|
+
"""Create a hexagon patch."""
|
|
239
|
+
return mpatches.RegularPolygon(
|
|
240
|
+
(x0, y0),
|
|
241
|
+
numVertices=6,
|
|
242
|
+
radius=0.7 * radius * self.config["radius"] / REFERENCE_RADIUS,
|
|
243
|
+
orientation=np.deg2rad(30),
|
|
244
|
+
facecolor=self.config["color"],
|
|
245
|
+
edgecolor=self.config["color"],
|
|
286
246
|
transform=handlebox.get_transform(),
|
|
287
247
|
)
|
|
248
|
+
|
|
249
|
+
def legend_artist(self, _, __, ___, handlebox):
|
|
250
|
+
"""Create the appropriate patch based on telescope type."""
|
|
251
|
+
shape = self.config["shape"]
|
|
252
|
+
|
|
253
|
+
if shape == "circle":
|
|
254
|
+
x0, y0 = calculate_center(handlebox, 4, 2)
|
|
255
|
+
radius = handlebox.height
|
|
256
|
+
patch = self._create_circle(handlebox, x0, y0, radius)
|
|
257
|
+
elif shape == "square":
|
|
258
|
+
x0, y0 = calculate_center(handlebox, 10, 1)
|
|
259
|
+
size = handlebox.height
|
|
260
|
+
patch = self._create_square(handlebox, x0, y0, size)
|
|
261
|
+
elif shape == "hexagon":
|
|
262
|
+
x0, y0 = calculate_center(handlebox)
|
|
263
|
+
radius = handlebox.height
|
|
264
|
+
patch = self._create_hexagon(handlebox, x0, y0, radius)
|
|
265
|
+
|
|
288
266
|
handlebox.add_artist(patch)
|
|
289
267
|
return patch
|
|
290
268
|
|
|
291
269
|
|
|
292
|
-
class
|
|
293
|
-
"""Legend handler
|
|
270
|
+
class LSTHandler(BaseLegendHandler):
|
|
271
|
+
"""Legend handler for LST telescopes."""
|
|
294
272
|
|
|
295
|
-
def
|
|
296
|
-
|
|
297
|
-
radius = handlebox.height
|
|
298
|
-
patch = mpatches.Circle(
|
|
299
|
-
xy=(x0, y0),
|
|
300
|
-
radius=radius * self.radius_dict[sst] / self.radius_dict[lst],
|
|
301
|
-
facecolor=self.colors_dict[sst],
|
|
302
|
-
edgecolor=self.colors_dict[sst],
|
|
303
|
-
transform=handlebox.get_transform(),
|
|
304
|
-
)
|
|
305
|
-
handlebox.add_artist(patch)
|
|
306
|
-
return patch
|
|
273
|
+
def __init__(self):
|
|
274
|
+
super().__init__("LST")
|
|
307
275
|
|
|
308
276
|
|
|
309
|
-
class
|
|
310
|
-
"""Legend handler
|
|
277
|
+
class MSTHandler(BaseLegendHandler):
|
|
278
|
+
"""Legend handler for MST telescopes."""
|
|
311
279
|
|
|
312
|
-
def
|
|
313
|
-
|
|
314
|
-
width = height = handlebox.height
|
|
315
|
-
patch = mpatches.Rectangle(
|
|
316
|
-
[x0, y0],
|
|
317
|
-
width,
|
|
318
|
-
height,
|
|
319
|
-
facecolor=self.colors_dict[sct],
|
|
320
|
-
edgecolor=self.colors_dict[sct],
|
|
321
|
-
transform=handlebox.get_transform(),
|
|
322
|
-
)
|
|
323
|
-
handlebox.add_artist(patch)
|
|
324
|
-
return patch
|
|
280
|
+
def __init__(self):
|
|
281
|
+
super().__init__("MST")
|
|
325
282
|
|
|
326
283
|
|
|
327
|
-
class
|
|
328
|
-
"""Legend handler
|
|
284
|
+
class SSTHandler(BaseLegendHandler):
|
|
285
|
+
"""Legend handler for SST telescopes."""
|
|
329
286
|
|
|
330
|
-
def
|
|
331
|
-
|
|
332
|
-
radius = handlebox.height
|
|
333
|
-
patch = mpatches.RegularPolygon(
|
|
334
|
-
(x0, y0),
|
|
335
|
-
numVertices=6,
|
|
336
|
-
radius=0.7 * radius * self.radius_dict[hess] / self.radius_dict[lst],
|
|
337
|
-
orientation=np.deg2rad(30),
|
|
338
|
-
facecolor=self.colors_dict[hess],
|
|
339
|
-
edgecolor=self.colors_dict[hess],
|
|
340
|
-
transform=handlebox.get_transform(),
|
|
341
|
-
)
|
|
342
|
-
handlebox.add_artist(patch)
|
|
343
|
-
return patch
|
|
287
|
+
def __init__(self):
|
|
288
|
+
super().__init__("SST")
|
|
344
289
|
|
|
345
290
|
|
|
346
|
-
class
|
|
347
|
-
"""Legend handler
|
|
291
|
+
class SCTHandler(BaseLegendHandler):
|
|
292
|
+
"""Legend handler for SCT telescopes."""
|
|
348
293
|
|
|
349
|
-
def
|
|
350
|
-
|
|
351
|
-
radius = handlebox.height
|
|
352
|
-
patch = mpatches.RegularPolygon(
|
|
353
|
-
(x0, y0),
|
|
354
|
-
numVertices=6,
|
|
355
|
-
radius=0.7 * radius * self.radius_dict[magic] / self.radius_dict[lst],
|
|
356
|
-
orientation=np.deg2rad(30),
|
|
357
|
-
facecolor=self.colors_dict[magic],
|
|
358
|
-
edgecolor=self.colors_dict[magic],
|
|
359
|
-
transform=handlebox.get_transform(),
|
|
360
|
-
)
|
|
361
|
-
handlebox.add_artist(patch)
|
|
362
|
-
return patch
|
|
294
|
+
def __init__(self):
|
|
295
|
+
super().__init__("SCT")
|
|
363
296
|
|
|
364
297
|
|
|
365
|
-
class
|
|
366
|
-
"""Legend handler
|
|
298
|
+
class HESSHandler(BaseLegendHandler):
|
|
299
|
+
"""Legend handler for HESS telescopes."""
|
|
367
300
|
|
|
368
|
-
def
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
301
|
+
def __init__(self):
|
|
302
|
+
super().__init__("HESS")
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
class MAGICHandler(BaseLegendHandler):
|
|
306
|
+
"""Legend handler for MAGIC telescopes."""
|
|
307
|
+
|
|
308
|
+
def __init__(self):
|
|
309
|
+
super().__init__("MAGIC")
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
class VERITASHandler(BaseLegendHandler):
|
|
313
|
+
"""Legend handler for VERITAS telescopes."""
|
|
314
|
+
|
|
315
|
+
def __init__(self):
|
|
316
|
+
super().__init__("VERITAS")
|
|
382
317
|
|
|
383
318
|
|
|
384
319
|
class MeanRadiusOuterEdgeHandler:
|
|
385
|
-
"""Legend handler class to plot
|
|
320
|
+
"""Legend handler class to plot the mean radius outer edge of the dish."""
|
|
386
321
|
|
|
387
322
|
@staticmethod
|
|
388
323
|
def legend_artist(_, __, ___, handlebox): # noqa: D102
|
|
@@ -399,31 +334,12 @@ class MeanRadiusOuterEdgeHandler:
|
|
|
399
334
|
return patch
|
|
400
335
|
|
|
401
336
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
magic: MAGICObject,
|
|
411
|
-
veritas: VERITASObject,
|
|
412
|
-
}
|
|
413
|
-
all_telescope_handlers = {
|
|
414
|
-
"LSTN": LSTHandler,
|
|
415
|
-
"LSTS": LSTHandler,
|
|
416
|
-
"MSTN": MSTHandler,
|
|
417
|
-
"MSTS": MSTHandler,
|
|
418
|
-
sct: SCTHandler,
|
|
419
|
-
sst: SSTHandler,
|
|
420
|
-
hess: HESSHandler,
|
|
421
|
-
magic: MAGICHandler,
|
|
422
|
-
veritas: VERITASHandler,
|
|
337
|
+
legend_handler_map = {
|
|
338
|
+
LSTObject: LSTHandler,
|
|
339
|
+
MSTObject: MSTHandler,
|
|
340
|
+
SSTObject: SSTHandler,
|
|
341
|
+
SCTObject: SCTHandler,
|
|
342
|
+
HESSObject: HESSHandler,
|
|
343
|
+
MAGICObject: MAGICHandler,
|
|
344
|
+
VERITASObject: VERITASHandler,
|
|
423
345
|
}
|
|
424
|
-
legend_handler_map = {}
|
|
425
|
-
try:
|
|
426
|
-
for tel_type in all_telescope_objects.keys():
|
|
427
|
-
legend_handler_map[all_telescope_objects[tel_type]] = all_telescope_handlers[tel_type]
|
|
428
|
-
except KeyError:
|
|
429
|
-
pass
|
|
@@ -100,7 +100,6 @@ def get_telescope_patch(name, x, y, radius):
|
|
|
100
100
|
patch : Patch
|
|
101
101
|
Circle or rectangle patch.
|
|
102
102
|
"""
|
|
103
|
-
tel_obj = leg_h.TelescopeHandler()
|
|
104
103
|
tel_type = names.get_array_element_type_from_name(name)
|
|
105
104
|
x, y, r = x.to(u.m), y.to(u.m), radius.to(u.m)
|
|
106
105
|
|
|
@@ -110,14 +109,14 @@ def get_telescope_patch(name, x, y, radius):
|
|
|
110
109
|
width=r.value,
|
|
111
110
|
height=r.value,
|
|
112
111
|
fill=False,
|
|
113
|
-
color=
|
|
112
|
+
color=leg_h.get_telescope_config(tel_type)["color"],
|
|
114
113
|
)
|
|
115
114
|
|
|
116
115
|
return mpatches.Circle(
|
|
117
116
|
(x.value, y.value),
|
|
118
117
|
radius=r.value,
|
|
119
118
|
fill=tel_type.startswith("MST"),
|
|
120
|
-
color=
|
|
119
|
+
color=leg_h.get_telescope_config(tel_type)["color"],
|
|
121
120
|
)
|
|
122
121
|
|
|
123
122
|
|
|
@@ -221,12 +220,25 @@ def update_legend(ax, telescopes):
|
|
|
221
220
|
counts = Counter(types)
|
|
222
221
|
|
|
223
222
|
objs, labels = [], []
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
handler_map = {}
|
|
224
|
+
|
|
225
|
+
for telescope_type in names.get_list_of_array_element_types():
|
|
226
|
+
if counts[telescope_type]:
|
|
227
|
+
objs.append(telescope_type)
|
|
228
|
+
labels.append(f"{telescope_type} ({counts[telescope_type]})")
|
|
229
|
+
|
|
230
|
+
class BaseLegendHandlerWrapper: # pylint: disable=R0903
|
|
231
|
+
"""Wrapper for BaseLegendHandler to use in legend."""
|
|
232
|
+
|
|
233
|
+
def __init__(self, tel_type):
|
|
234
|
+
self.tel_type = tel_type
|
|
235
|
+
|
|
236
|
+
def legend_artist(self, legend, orig_handle, fontsize, handlebox):
|
|
237
|
+
handler = leg_h.BaseLegendHandler(self.tel_type)
|
|
238
|
+
return handler.legend_artist(legend, orig_handle, fontsize, handlebox)
|
|
239
|
+
|
|
240
|
+
handler_map[telescope_type] = BaseLegendHandlerWrapper(telescope_type)
|
|
228
241
|
|
|
229
|
-
handler_map = {k: v() for k, v in leg_h.legend_handler_map.items()}
|
|
230
242
|
ax.legend(objs, labels, handler_map=handler_map, prop={"size": 11}, loc="best")
|
|
231
243
|
|
|
232
244
|
|