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,421 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
|
|
3
|
+
r"""
|
|
4
|
+
Plot simulated events.
|
|
5
|
+
|
|
6
|
+
Produces figures from one or more sim_telarray (.simtel.zst) files
|
|
7
|
+
It is meant to run after simulations (e.g., simtools-simulate-flasher,
|
|
8
|
+
simtools-simulate-illuminator).
|
|
9
|
+
|
|
10
|
+
What it does
|
|
11
|
+
------------
|
|
12
|
+
- Loads each provided sim_telarray file
|
|
13
|
+
- Generates selected plots (camera image, time traces, waveform matrices, peak timing, etc.)
|
|
14
|
+
- Optionally saves all figures to a single multi-page PDF per input file
|
|
15
|
+
- Optionally also saves individual PNGs
|
|
16
|
+
|
|
17
|
+
Command line arguments
|
|
18
|
+
----------------------
|
|
19
|
+
simtel_files (list, required)
|
|
20
|
+
One or more sim_telarray files to visualize (.simtel.zst).
|
|
21
|
+
plots (list, optional)
|
|
22
|
+
Which plots to generate. Choose from: event_image, time_traces, waveform_matrix,
|
|
23
|
+
step_traces, integrated_signal_image, integrated_pedestal_image, peak_timing, all.
|
|
24
|
+
Default: event_image.
|
|
25
|
+
tel_id (int, optional)
|
|
26
|
+
Telescope ID to visualize. If omitted, the first available telescope will be used.
|
|
27
|
+
n_pixels (int, optional)
|
|
28
|
+
For time_traces: number of pixel traces to draw. Default: 3.
|
|
29
|
+
pixel_step (int, optional)
|
|
30
|
+
For step_traces and waveform_matrix: step between pixel indices. Default: 100.
|
|
31
|
+
max_pixels (int, optional)
|
|
32
|
+
For step_traces: cap the number of plotted pixels. Default: None.
|
|
33
|
+
vmax (float, optional)
|
|
34
|
+
For waveform_matrix: upper limit of color scale. Default: None.
|
|
35
|
+
half_width (int, optional)
|
|
36
|
+
For integrated_*_image: half window width in samples. Default: 8.
|
|
37
|
+
offset (int, optional)
|
|
38
|
+
For integrated_pedestal_image: offset between pedestal and peak windows. Default: 16.
|
|
39
|
+
sum_threshold (float, optional)
|
|
40
|
+
For peak_timing: minimum pixel sum to consider a pixel. Default: 10.0.
|
|
41
|
+
peak_width (int, optional)
|
|
42
|
+
For peak_timing: expected peak width in samples. Default: 8.
|
|
43
|
+
examples (int, optional)
|
|
44
|
+
For peak_timing: show example traces. Default: 3.
|
|
45
|
+
timing_bins (int, optional)
|
|
46
|
+
For peak_timing: number of histogram bins for peak sample. Default: None (contiguous bins).
|
|
47
|
+
distance (float, optional)
|
|
48
|
+
Optional distance annotation for event_image.
|
|
49
|
+
output_file (str, optional)
|
|
50
|
+
Base name for output. If provided, outputs will be placed under the standard IOHandler
|
|
51
|
+
output directory and named ``<base>_<inputstem>.pdf``. If omitted, defaults are derived
|
|
52
|
+
from each input file name.
|
|
53
|
+
save_pngs (flag, optional)
|
|
54
|
+
Also save individual PNG files per figure.
|
|
55
|
+
dpi (int, optional)
|
|
56
|
+
DPI for PNG outputs. Default: 300.
|
|
57
|
+
output_path (str, optional)
|
|
58
|
+
Path to save the output files.
|
|
59
|
+
|
|
60
|
+
Examples
|
|
61
|
+
--------
|
|
62
|
+
1) Camera image and time traces for a single file, save a PDF:
|
|
63
|
+
|
|
64
|
+
simtools-plot-simtel-events \
|
|
65
|
+
--simtel_files tests/resources/ff-1m_flasher.simtel.zst \
|
|
66
|
+
--plots event_image time_traces \
|
|
67
|
+
--tel_id 1 \
|
|
68
|
+
--output_file simulate_illuminator_inspect
|
|
69
|
+
|
|
70
|
+
2) All plots for multiple files, PNGs and PDFs:
|
|
71
|
+
|
|
72
|
+
simtools-plot-simtel-events \
|
|
73
|
+
--simtel_files f1.simtel.zst f2.simtel.zst \
|
|
74
|
+
--plots all \
|
|
75
|
+
--save_pngs --dpi 200
|
|
76
|
+
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
import logging
|
|
80
|
+
from pathlib import Path
|
|
81
|
+
|
|
82
|
+
import simtools.utils.general as gen
|
|
83
|
+
from simtools.configuration import configurator
|
|
84
|
+
from simtools.corsika.corsika_histograms_visualize import save_figs_to_pdf
|
|
85
|
+
from simtools.data_model.metadata_collector import MetadataCollector
|
|
86
|
+
from simtools.io import io_handler
|
|
87
|
+
from simtools.visualization.plot_simtel_events import (
|
|
88
|
+
plot_simtel_event_image,
|
|
89
|
+
plot_simtel_integrated_pedestal_image,
|
|
90
|
+
plot_simtel_integrated_signal_image,
|
|
91
|
+
plot_simtel_peak_timing,
|
|
92
|
+
plot_simtel_step_traces,
|
|
93
|
+
plot_simtel_time_traces,
|
|
94
|
+
plot_simtel_waveform_matrix,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
PLOT_CHOICES = {
|
|
98
|
+
"event_image": "event_image",
|
|
99
|
+
"time_traces": "time_traces",
|
|
100
|
+
"waveform_matrix": "waveform_matrix",
|
|
101
|
+
"step_traces": "step_traces",
|
|
102
|
+
"integrated_signal_image": "integrated_signal_image",
|
|
103
|
+
"integrated_pedestal_image": "integrated_pedestal_image",
|
|
104
|
+
"peak_timing": "peak_timing",
|
|
105
|
+
"all": "all",
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def _call_peak_timing(
|
|
110
|
+
filename,
|
|
111
|
+
*,
|
|
112
|
+
tel_id=None,
|
|
113
|
+
sum_threshold=10.0,
|
|
114
|
+
peak_width=8,
|
|
115
|
+
examples=3,
|
|
116
|
+
timing_bins=None,
|
|
117
|
+
event_index=None,
|
|
118
|
+
):
|
|
119
|
+
"""Call ``plot_simtel_peak_timing`` and support optional ``return_stats``.
|
|
120
|
+
|
|
121
|
+
Parameters
|
|
122
|
+
----------
|
|
123
|
+
filename : pathlib.Path or str
|
|
124
|
+
Path to the input simtel file.
|
|
125
|
+
tel_id : int, optional
|
|
126
|
+
Telescope ID to visualize.
|
|
127
|
+
sum_threshold : float, default 10.0
|
|
128
|
+
Minimum pixel sum to consider a pixel.
|
|
129
|
+
peak_width : int, default 8
|
|
130
|
+
Expected peak width in samples.
|
|
131
|
+
examples : int, default 3
|
|
132
|
+
Number of example traces to draw.
|
|
133
|
+
timing_bins : int or None, optional
|
|
134
|
+
Number of bins for timing histogram (contiguous if not set).
|
|
135
|
+
event_index : int or None, optional
|
|
136
|
+
0-based index of the event to plot; default is the first event.
|
|
137
|
+
|
|
138
|
+
Returns
|
|
139
|
+
-------
|
|
140
|
+
object or None
|
|
141
|
+
The matplotlib Figure if available, otherwise ``None``.
|
|
142
|
+
"""
|
|
143
|
+
try:
|
|
144
|
+
fig_stats = plot_simtel_peak_timing(
|
|
145
|
+
filename,
|
|
146
|
+
tel_id=tel_id,
|
|
147
|
+
sum_threshold=sum_threshold,
|
|
148
|
+
peak_width=peak_width,
|
|
149
|
+
examples=examples,
|
|
150
|
+
timing_bins=timing_bins,
|
|
151
|
+
return_stats=True,
|
|
152
|
+
event_index=event_index,
|
|
153
|
+
)
|
|
154
|
+
return fig_stats[0] if isinstance(fig_stats, tuple) else fig_stats
|
|
155
|
+
except TypeError:
|
|
156
|
+
return plot_simtel_peak_timing(
|
|
157
|
+
filename,
|
|
158
|
+
tel_id=tel_id,
|
|
159
|
+
sum_threshold=sum_threshold,
|
|
160
|
+
peak_width=peak_width,
|
|
161
|
+
examples=examples,
|
|
162
|
+
timing_bins=timing_bins,
|
|
163
|
+
event_index=event_index,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
def _parse(label: str):
|
|
168
|
+
"""Parse command line configuration."""
|
|
169
|
+
config = configurator.Configurator(
|
|
170
|
+
label=label,
|
|
171
|
+
description=(
|
|
172
|
+
"Create diagnostic plots from sim_telarray files using simtools visualization."
|
|
173
|
+
),
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
config.parser.add_argument(
|
|
177
|
+
"--simtel_files",
|
|
178
|
+
help="One or more sim_telarray files (.simtel.zst)",
|
|
179
|
+
nargs="+",
|
|
180
|
+
required=True,
|
|
181
|
+
)
|
|
182
|
+
config.parser.add_argument(
|
|
183
|
+
"--plots",
|
|
184
|
+
help=f"Plots to generate. Choices: {', '.join(sorted(PLOT_CHOICES))}",
|
|
185
|
+
nargs="+",
|
|
186
|
+
default=["event_image"],
|
|
187
|
+
choices=sorted(PLOT_CHOICES),
|
|
188
|
+
)
|
|
189
|
+
# common plotting options
|
|
190
|
+
config.parser.add_argument("--tel_id", type=int, default=None, help="Telescope ID")
|
|
191
|
+
config.parser.add_argument(
|
|
192
|
+
"--n_pixels", type=int, default=3, help="For time_traces: number of pixel traces"
|
|
193
|
+
)
|
|
194
|
+
config.parser.add_argument(
|
|
195
|
+
"--pixel_step", type=int, default=100, help="Step between pixel ids for step plots"
|
|
196
|
+
)
|
|
197
|
+
config.parser.add_argument(
|
|
198
|
+
"--max_pixels", type=int, default=None, help="Cap number of pixels for step traces"
|
|
199
|
+
)
|
|
200
|
+
config.parser.add_argument("--vmax", type=float, default=None, help="Color scale vmax")
|
|
201
|
+
config.parser.add_argument(
|
|
202
|
+
"--half_width", type=int, default=8, help="Half window width for integrated images"
|
|
203
|
+
)
|
|
204
|
+
config.parser.add_argument(
|
|
205
|
+
"--offset",
|
|
206
|
+
type=int,
|
|
207
|
+
default=16,
|
|
208
|
+
help="offset between pedestal and peak windows (integrated_pedestal_image)",
|
|
209
|
+
)
|
|
210
|
+
config.parser.add_argument(
|
|
211
|
+
"--sum_threshold",
|
|
212
|
+
type=float,
|
|
213
|
+
default=10.0,
|
|
214
|
+
help="Minimum pixel sum to consider in peak timing",
|
|
215
|
+
)
|
|
216
|
+
config.parser.add_argument(
|
|
217
|
+
"--peak_width", type=int, default=8, help="Expected peak width in samples"
|
|
218
|
+
)
|
|
219
|
+
config.parser.add_argument(
|
|
220
|
+
"--examples", type=int, default=3, help="Number of example traces to draw"
|
|
221
|
+
)
|
|
222
|
+
config.parser.add_argument(
|
|
223
|
+
"--timing_bins",
|
|
224
|
+
type=int,
|
|
225
|
+
default=None,
|
|
226
|
+
help="Number of bins for timing histogram (contiguous if not set)",
|
|
227
|
+
)
|
|
228
|
+
config.parser.add_argument(
|
|
229
|
+
"--distance",
|
|
230
|
+
type=float,
|
|
231
|
+
default=None,
|
|
232
|
+
help="Optional distance annotation for event_image (same units as input expects)",
|
|
233
|
+
)
|
|
234
|
+
config.parser.add_argument(
|
|
235
|
+
"--event_index",
|
|
236
|
+
type=int,
|
|
237
|
+
default=None,
|
|
238
|
+
help="0-based index of the event to plot; default is the first event",
|
|
239
|
+
)
|
|
240
|
+
# outputs
|
|
241
|
+
config.parser.add_argument(
|
|
242
|
+
"--output_file",
|
|
243
|
+
type=str,
|
|
244
|
+
default=None,
|
|
245
|
+
help=(
|
|
246
|
+
"Base name for output. If set, PDFs will be named '<base>_<inputstem>.pdf' "
|
|
247
|
+
"in the standard output directory"
|
|
248
|
+
),
|
|
249
|
+
)
|
|
250
|
+
config.parser.add_argument(
|
|
251
|
+
"--save_pngs",
|
|
252
|
+
action="store_true",
|
|
253
|
+
help="Also save individual PNG images per plot",
|
|
254
|
+
)
|
|
255
|
+
config.parser.add_argument("--dpi", type=int, default=300, help="PNG dpi")
|
|
256
|
+
|
|
257
|
+
return config.initialize(db_config=False, require_command_line=True)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def _save_png(fig, out_dir: Path, stem: str, suffix: str, dpi: int):
|
|
261
|
+
"""Save ``fig`` as a PNG into ``out_dir`` using ``stem`` and ``suffix``.
|
|
262
|
+
|
|
263
|
+
Errors during saving are logged as warnings and otherwise ignored.
|
|
264
|
+
"""
|
|
265
|
+
png_path = out_dir.joinpath(f"{stem}_{suffix}.png")
|
|
266
|
+
try:
|
|
267
|
+
fig.savefig(png_path, dpi=dpi, bbox_inches="tight")
|
|
268
|
+
except Exception as ex: # pylint:disable=broad-except
|
|
269
|
+
logging.getLogger(__name__).warning("Failed to save PNG %s: %s", png_path, ex)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def _make_output_paths(
|
|
273
|
+
ioh: io_handler.IOHandler, base: str | None, input_file: Path
|
|
274
|
+
) -> tuple[Path, Path]:
|
|
275
|
+
"""Return (out_dir, pdf_path) based on base and input_file."""
|
|
276
|
+
out_dir = ioh.get_output_directory(label=Path(__file__).stem)
|
|
277
|
+
if base:
|
|
278
|
+
pdf_path = ioh.get_output_file(f"{base}_{input_file.stem}")
|
|
279
|
+
else:
|
|
280
|
+
pdf_path = ioh.get_output_file(input_file.stem)
|
|
281
|
+
pdf_path = Path(f"{pdf_path}.pdf") if pdf_path.suffix != ".pdf" else Path(pdf_path)
|
|
282
|
+
return out_dir, pdf_path
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def _collect_figures_for_file(
|
|
286
|
+
filename: Path,
|
|
287
|
+
plots: list[str],
|
|
288
|
+
args: dict,
|
|
289
|
+
out_dir: Path,
|
|
290
|
+
base_stem: str,
|
|
291
|
+
save_pngs: bool,
|
|
292
|
+
dpi: int,
|
|
293
|
+
):
|
|
294
|
+
"""Generate the selected plots for a single sim_telarray file.
|
|
295
|
+
|
|
296
|
+
Returns a list of figures. If ``save_pngs`` is True, also writes PNGs to
|
|
297
|
+
``out_dir`` using ``base_stem`` for filenames.
|
|
298
|
+
"""
|
|
299
|
+
logger = logging.getLogger(__name__)
|
|
300
|
+
figures: list[object] = []
|
|
301
|
+
|
|
302
|
+
def add(fig, tag: str):
|
|
303
|
+
if fig is not None:
|
|
304
|
+
figures.append(fig)
|
|
305
|
+
if save_pngs:
|
|
306
|
+
_save_png(fig, out_dir, base_stem, tag, dpi)
|
|
307
|
+
else:
|
|
308
|
+
logger.warning("Plot '%s' returned no figure for %s", tag, filename)
|
|
309
|
+
|
|
310
|
+
plots_to_run = (
|
|
311
|
+
[
|
|
312
|
+
"event_image",
|
|
313
|
+
"time_traces",
|
|
314
|
+
"waveform_matrix",
|
|
315
|
+
"step_traces",
|
|
316
|
+
"integrated_signal_image",
|
|
317
|
+
"integrated_pedestal_image",
|
|
318
|
+
"peak_timing",
|
|
319
|
+
]
|
|
320
|
+
if "all" in plots
|
|
321
|
+
else list(plots)
|
|
322
|
+
)
|
|
323
|
+
|
|
324
|
+
# function name -> (callable, defaults)
|
|
325
|
+
dispatch: dict[str, tuple[object, dict[str, object]]] = {
|
|
326
|
+
"event_image": (
|
|
327
|
+
plot_simtel_event_image,
|
|
328
|
+
{"distance": None, "event_index": None},
|
|
329
|
+
),
|
|
330
|
+
"time_traces": (
|
|
331
|
+
plot_simtel_time_traces,
|
|
332
|
+
{"tel_id": None, "n_pixels": 3, "event_index": None},
|
|
333
|
+
),
|
|
334
|
+
"waveform_matrix": (
|
|
335
|
+
plot_simtel_waveform_matrix,
|
|
336
|
+
{"tel_id": None, "vmax": None, "event_index": None},
|
|
337
|
+
),
|
|
338
|
+
"step_traces": (
|
|
339
|
+
plot_simtel_step_traces,
|
|
340
|
+
{"tel_id": None, "pixel_step": None, "max_pixels": None, "event_index": None},
|
|
341
|
+
),
|
|
342
|
+
"integrated_signal_image": (
|
|
343
|
+
plot_simtel_integrated_signal_image,
|
|
344
|
+
{"tel_id": None, "half_width": 8, "event_index": None},
|
|
345
|
+
),
|
|
346
|
+
"integrated_pedestal_image": (
|
|
347
|
+
plot_simtel_integrated_pedestal_image,
|
|
348
|
+
{"tel_id": None, "half_width": 8, "offset": 16, "event_index": None},
|
|
349
|
+
),
|
|
350
|
+
"peak_timing": (
|
|
351
|
+
_call_peak_timing,
|
|
352
|
+
{
|
|
353
|
+
"tel_id": None,
|
|
354
|
+
"sum_threshold": 10.0,
|
|
355
|
+
"peak_width": 8,
|
|
356
|
+
"examples": 3,
|
|
357
|
+
"timing_bins": None,
|
|
358
|
+
"event_index": None,
|
|
359
|
+
},
|
|
360
|
+
),
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
for plot_name in plots_to_run:
|
|
364
|
+
entry = dispatch.get(plot_name)
|
|
365
|
+
if entry is None:
|
|
366
|
+
logger.warning("Unknown plot selection '%s'", plot_name)
|
|
367
|
+
continue
|
|
368
|
+
func, defaults = entry
|
|
369
|
+
# Build kwargs with user args overriding defaults
|
|
370
|
+
kwargs = {k: args.get(k, v) for k, v in defaults.items()}
|
|
371
|
+
fig = func(filename, **kwargs) # type: ignore[misc]
|
|
372
|
+
add(fig, plot_name)
|
|
373
|
+
|
|
374
|
+
return figures
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
def main():
|
|
378
|
+
"""Generate plots from sim_telarray files."""
|
|
379
|
+
label = Path(__file__).stem
|
|
380
|
+
args, _db = _parse(label)
|
|
381
|
+
|
|
382
|
+
logger = logging.getLogger()
|
|
383
|
+
logger.setLevel(gen.get_log_level_from_user(args.get("log_level", "INFO")))
|
|
384
|
+
|
|
385
|
+
ioh = io_handler.IOHandler()
|
|
386
|
+
|
|
387
|
+
simtel_files = [Path(p).expanduser() for p in gen.ensure_iterable(args["simtel_files"])]
|
|
388
|
+
plots = list(gen.ensure_iterable(args.get("plots")))
|
|
389
|
+
|
|
390
|
+
for simtel in simtel_files:
|
|
391
|
+
out_dir, pdf_path = _make_output_paths(ioh, args.get("output_file"), simtel)
|
|
392
|
+
figures = _collect_figures_for_file(
|
|
393
|
+
filename=simtel,
|
|
394
|
+
plots=plots,
|
|
395
|
+
args=args,
|
|
396
|
+
out_dir=out_dir,
|
|
397
|
+
base_stem=simtel.stem,
|
|
398
|
+
save_pngs=bool(args.get("save_pngs", False)),
|
|
399
|
+
dpi=int(args.get("dpi", 300)),
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
if not figures:
|
|
403
|
+
logger.warning("No figures produced for %s", simtel)
|
|
404
|
+
continue
|
|
405
|
+
|
|
406
|
+
# Save a multipage PDF
|
|
407
|
+
try:
|
|
408
|
+
save_figs_to_pdf(figures, pdf_path)
|
|
409
|
+
logger.info("Saved PDF: %s", pdf_path)
|
|
410
|
+
except Exception as ex: # pylint:disable=broad-except
|
|
411
|
+
logger.error("Failed to save PDF %s: %s", pdf_path, ex)
|
|
412
|
+
|
|
413
|
+
# Dump run metadata alongside PDF
|
|
414
|
+
try:
|
|
415
|
+
MetadataCollector.dump(args, pdf_path, add_activity_name=True)
|
|
416
|
+
except Exception as ex: # pylint:disable=broad-except
|
|
417
|
+
logger.warning("Failed to write metadata for %s: %s", pdf_path, ex)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
if __name__ == "__main__":
|
|
421
|
+
main()
|
|
@@ -31,7 +31,7 @@ from simtools.configuration import configurator
|
|
|
31
31
|
from simtools.constants import PLOT_CONFIG_SCHEMA
|
|
32
32
|
from simtools.data_model import schema
|
|
33
33
|
from simtools.data_model.metadata_collector import MetadataCollector
|
|
34
|
-
from simtools.
|
|
34
|
+
from simtools.io import ascii_handler, io_handler
|
|
35
35
|
from simtools.visualization import plot_tables
|
|
36
36
|
|
|
37
37
|
|
|
@@ -62,6 +62,12 @@ def _parse(label, description, usage):
|
|
|
62
62
|
required=True,
|
|
63
63
|
default=None,
|
|
64
64
|
)
|
|
65
|
+
config.parser.add_argument(
|
|
66
|
+
"--table_data_path",
|
|
67
|
+
help="Path to the data files (optional). Expect all files to be in the same directory.",
|
|
68
|
+
type=str,
|
|
69
|
+
default=None,
|
|
70
|
+
)
|
|
65
71
|
config.parser.add_argument(
|
|
66
72
|
"--output_file",
|
|
67
73
|
help="Output file name (without suffix)",
|
|
@@ -85,7 +91,7 @@ def main():
|
|
|
85
91
|
|
|
86
92
|
plot_config = gen.convert_keys_in_dict_to_lowercase(
|
|
87
93
|
schema.validate_dict_using_schema(
|
|
88
|
-
|
|
94
|
+
ascii_handler.collect_data_from_file(args_dict["plot_config"]),
|
|
89
95
|
PLOT_CONFIG_SCHEMA,
|
|
90
96
|
)
|
|
91
97
|
)
|
|
@@ -94,6 +100,7 @@ def main():
|
|
|
94
100
|
config=plot_config["plot"],
|
|
95
101
|
output_file=io_handler_instance.get_output_file(args_dict["output_file"]),
|
|
96
102
|
db_config=db_config_,
|
|
103
|
+
data_path=args_dict.get("table_data_path"),
|
|
97
104
|
)
|
|
98
105
|
|
|
99
106
|
MetadataCollector.dump(
|
|
@@ -52,7 +52,7 @@ from pathlib import Path
|
|
|
52
52
|
import simtools.utils.general as gen
|
|
53
53
|
from simtools.configuration import configurator
|
|
54
54
|
from simtools.data_model.metadata_collector import MetadataCollector
|
|
55
|
-
from simtools.
|
|
55
|
+
from simtools.io import io_handler
|
|
56
56
|
from simtools.visualization import plot_tables
|
|
57
57
|
|
|
58
58
|
|
|
@@ -88,6 +88,7 @@ def main():
|
|
|
88
88
|
telescope=args_dict.get("telescope"),
|
|
89
89
|
output_path=io_handler_instance.get_output_directory(),
|
|
90
90
|
plot_type=args_dict["plot_type"],
|
|
91
|
+
db_config=db_config,
|
|
91
92
|
)
|
|
92
93
|
|
|
93
94
|
for plot_config, output_file in zip(plot_configs, output_files):
|
|
@@ -6,13 +6,12 @@ The versions of simtools, the DB, sim_telarray, and CORSIKA are printed.
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
import json
|
|
10
9
|
import logging
|
|
11
10
|
from pathlib import Path
|
|
12
11
|
|
|
13
12
|
from simtools import dependencies, version
|
|
14
13
|
from simtools.configuration import configurator
|
|
15
|
-
from simtools.
|
|
14
|
+
from simtools.io import ascii_handler, io_handler
|
|
16
15
|
from simtools.utils import general as gen
|
|
17
16
|
|
|
18
17
|
|
|
@@ -66,15 +65,15 @@ def main():
|
|
|
66
65
|
|
|
67
66
|
version_list = version_string.strip().split("\n")
|
|
68
67
|
for version_entry in version_list:
|
|
69
|
-
key, value = version_entry.split(": ")
|
|
68
|
+
key, value = version_entry.split(": ", 1)
|
|
70
69
|
version_dict[key] = value
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
ascii_handler.write_data_to_file(
|
|
72
|
+
data=version_dict,
|
|
73
|
+
output_file=io_handler_instance.get_output_file(
|
|
74
|
+
args_dict.get("output_file", "simtools_version.json"), label=label
|
|
75
|
+
),
|
|
76
|
+
)
|
|
78
77
|
|
|
79
78
|
|
|
80
79
|
if __name__ == "__main__":
|
|
@@ -45,7 +45,7 @@ directions, level of night sky background, etc.).
|
|
|
45
45
|
|
|
46
46
|
Command line arguments
|
|
47
47
|
----------------------
|
|
48
|
-
|
|
48
|
+
event_data_file (str, required)
|
|
49
49
|
Path to reduced event data file.
|
|
50
50
|
telescope_ids (str, optional)
|
|
51
51
|
Custom array layout file containing telescope IDs.
|
|
@@ -64,7 +64,7 @@ Derive limits for a list of array layouts (use 'all' to derive limits for all la
|
|
|
64
64
|
.. code-block:: console
|
|
65
65
|
|
|
66
66
|
simtools-production-derive-corsika-limits \\
|
|
67
|
-
--
|
|
67
|
+
--event_data_file event_dat_file.hdf5 \\
|
|
68
68
|
--array_layout_name alpha,beta \\
|
|
69
69
|
--loss_fraction 1e-6 \\
|
|
70
70
|
--plot_histograms \\
|
|
@@ -75,7 +75,7 @@ Derive limits for a given file for custom defined array layouts:
|
|
|
75
75
|
.. code-block:: console
|
|
76
76
|
|
|
77
77
|
simtools-production-derive-corsika-limits \\
|
|
78
|
-
--
|
|
78
|
+
--event_data_file event_dat_file.hdf5 \\
|
|
79
79
|
--telescope_ids path/to/telescope_configs.yaml \\
|
|
80
80
|
--loss_fraction 1e-6 \\
|
|
81
81
|
--plot_histograms \\
|
|
@@ -86,7 +86,7 @@ import logging
|
|
|
86
86
|
|
|
87
87
|
import simtools.utils.general as gen
|
|
88
88
|
from simtools.configuration import configurator
|
|
89
|
-
from simtools.production_configuration.
|
|
89
|
+
from simtools.production_configuration.derive_corsika_limits import (
|
|
90
90
|
generate_corsika_limits_grid,
|
|
91
91
|
)
|
|
92
92
|
|
|
@@ -97,11 +97,10 @@ def _parse():
|
|
|
97
97
|
description="Derive limits for energy, radial distance, and viewcone."
|
|
98
98
|
)
|
|
99
99
|
config.parser.add_argument(
|
|
100
|
-
"--
|
|
100
|
+
"--event_data_file",
|
|
101
101
|
type=str,
|
|
102
|
-
nargs="+",
|
|
103
102
|
required=True,
|
|
104
|
-
help="
|
|
103
|
+
help="Event data file containing reduced event data.",
|
|
105
104
|
)
|
|
106
105
|
config.parser.add_argument(
|
|
107
106
|
"--telescope_ids",
|
|
@@ -54,7 +54,7 @@ import logging
|
|
|
54
54
|
from pathlib import Path
|
|
55
55
|
|
|
56
56
|
from simtools.configuration import configurator
|
|
57
|
-
from simtools.
|
|
57
|
+
from simtools.io import io_handler
|
|
58
58
|
from simtools.production_configuration.derive_production_statistics_handler import (
|
|
59
59
|
ProductionStatisticsHandler,
|
|
60
60
|
)
|
|
@@ -49,10 +49,10 @@ from astropy.coordinates import EarthLocation
|
|
|
49
49
|
from astropy.time import Time
|
|
50
50
|
|
|
51
51
|
from simtools.configuration import configurator
|
|
52
|
-
from simtools.
|
|
52
|
+
from simtools.io import io_handler
|
|
53
|
+
from simtools.io.ascii_handler import collect_data_from_file
|
|
53
54
|
from simtools.model.site_model import SiteModel
|
|
54
55
|
from simtools.production_configuration.generate_production_grid import GridGeneration
|
|
55
|
-
from simtools.utils.general import collect_data_from_file
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
def _parse(label, description):
|