gammasimtools 0.17.0__py3-none-any.whl → 0.19.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.17.0.dist-info → gammasimtools-0.19.0.dist-info}/METADATA +27 -69
- gammasimtools-0.19.0.dist-info/RECORD +393 -0
- {gammasimtools-0.17.0.dist-info → gammasimtools-0.19.0.dist-info}/entry_points.txt +10 -2
- {gammasimtools-0.17.0.dist-info → gammasimtools-0.19.0.dist-info}/licenses/LICENSE +1 -1
- simtools/_version.py +16 -3
- simtools/applications/calculate_trigger_rate.py +1 -1
- 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 +10 -1
- simtools/applications/db_add_value_from_json_to_db.py +2 -1
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +8 -13
- simtools/applications/db_generate_compound_indexes.py +61 -0
- simtools/applications/db_get_file_from_db.py +1 -1
- simtools/applications/db_get_parameter_from_db.py +4 -4
- simtools/applications/db_inspect_databases.py +20 -10
- simtools/applications/derive_mirror_rnda.py +18 -12
- simtools/applications/derive_psf_parameters.py +59 -309
- 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_sim_telarray_histograms.py +1 -1
- simtools/applications/generate_simtel_event_data.py +97 -5
- 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 +16 -18
- simtools/applications/plot_array_layout.py +3 -3
- simtools/applications/plot_simtel_events.py +379 -0
- simtools/applications/plot_tabular_data.py +21 -3
- simtools/applications/plot_tabular_data_for_model_parameter.py +104 -0
- simtools/applications/print_version.py +8 -9
- simtools/applications/production_derive_corsika_limits.py +64 -27
- 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 +2 -1
- 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 +31 -1
- simtools/configuration/configurator.py +4 -4
- simtools/constants.py +2 -0
- 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 +88 -24
- simtools/data_model/validate_data.py +34 -9
- simtools/db/db_handler.py +48 -37
- simtools/db/db_model_upload.py +3 -3
- simtools/dependencies.py +88 -25
- simtools/io/ascii_handler.py +279 -0
- simtools/{io_operations → io}/io_handler.py +25 -3
- simtools/{io_operations/io_table_handler.py → io/table_handler.py} +1 -1
- simtools/job_execution/htcondor_script_generator.py +15 -4
- simtools/layout/array_layout.py +1 -1
- simtools/layout/array_layout_utils.py +19 -8
- simtools/model/array_model.py +28 -5
- simtools/model/flasher_model.py +106 -0
- simtools/model/model_parameter.py +4 -4
- simtools/model/model_repository.py +197 -2
- simtools/model/telescope_model.py +3 -1
- simtools/production_configuration/derive_corsika_limits.py +361 -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/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/resources/array-element-ids.json +126 -0
- 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 +7 -3
- 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 +42 -1
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +44 -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 +11 -1
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +11 -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 +32 -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 +13 -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 +11 -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 +11 -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 +13 -1
- 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 +1 -1
- 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 +20 -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 +11 -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 +1 -1
- 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 +51 -59
- simtools/schemas/production_configuration_metrics.schema.yml +12 -2
- simtools/schemas/production_tables.schema.yml +2 -2
- simtools/simtel/simtel_config_reader.py +2 -2
- simtools/simtel/simtel_config_writer.py +16 -4
- simtools/simtel/simtel_io_event_histograms.py +746 -0
- simtools/simtel/simtel_io_event_reader.py +16 -43
- simtools/simtel/simtel_io_event_writer.py +46 -10
- simtools/simtel/simtel_io_histogram.py +3 -1
- simtools/simtel/simtel_io_histograms.py +7 -3
- simtools/simtel/simtel_io_metadata.py +99 -3
- simtools/simtel/simtel_table_reader.py +92 -10
- 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/testing/configuration.py +24 -26
- simtools/testing/helpers.py +2 -2
- simtools/testing/log_inspector.py +50 -0
- simtools/testing/validate_output.py +87 -37
- simtools/utils/general.py +125 -257
- simtools/utils/geometry.py +36 -0
- simtools/utils/names.py +72 -3
- simtools/visualization/legend_handlers.py +180 -264
- simtools/visualization/plot_array_layout.py +20 -8
- simtools/visualization/plot_pixels.py +1 -2
- simtools/visualization/plot_tables.py +202 -27
- simtools/visualization/simtel_event_plots.py +816 -0
- simtools/visualization/visualize.py +4 -101
- gammasimtools-0.17.0.dist-info/RECORD +0 -374
- simtools/production_configuration/derive_corsika_limits_grid.py +0 -189
- {gammasimtools-0.17.0.dist-info → gammasimtools-0.19.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.17.0.dist-info → gammasimtools-0.19.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/{schemas → resources}/array_elements.yml +0 -0
|
@@ -8,36 +8,66 @@ both the name of the simtools application and the configuration for the applicat
|
|
|
8
8
|
|
|
9
9
|
This application is used for model parameter setting workflows.
|
|
10
10
|
Strong assumptions are applied on the directory structure for input and output files of
|
|
11
|
-
applications
|
|
11
|
+
applications, for details see the CTAO Simulation Model Parameter Setting
|
|
12
|
+
`repository <https://gitlab.cta-observatory.org/cta-science/simulations/simulation-model/\
|
|
13
|
+
simulation-model-parameter-setting>`_.
|
|
14
|
+
|
|
15
|
+
.. tip::
|
|
16
|
+
Browse the CTAO Simulation Model Parameter Setting
|
|
17
|
+
`repository <https://gitlab.cta-observatory.org/cta-science/simulations/simulation-model/\
|
|
18
|
+
simulation-model-parameter-setting>`_
|
|
19
|
+
for a list of examples and templates for configuration files.
|
|
20
|
+
|
|
21
|
+
For simplified configuration, a placeholder called ``__SETTING_WORKFLOW__`` can be used in the
|
|
22
|
+
configuration file. This placeholder will be replaced with the directory below ``input``
|
|
23
|
+
(example: configuration file is in ``input/LSTN-design/num_gains/20250214T134800/config.yml``,
|
|
24
|
+
then the placeholder will be replaced with ``LSTN-design/num_gains/20250214T134800``).
|
|
25
|
+
This will also be the directory for any output generated by the application.
|
|
26
|
+
|
|
27
|
+
Run time environments can be defined in the configuration file using the ``runtime_environment``
|
|
28
|
+
block. The following example shows how to define a runtime environment:
|
|
29
|
+
|
|
30
|
+
.. code-block:: yaml
|
|
31
|
+
|
|
32
|
+
runtime_environment:
|
|
33
|
+
image: ghcr.io/gammasim/simtools-prod-sim-telarray-240927-corsika-77550-bernlohr-1.68-\
|
|
34
|
+
prod6-baseline-qgs2-no_opt:20250716-122341
|
|
35
|
+
network: simtools-mongo-network
|
|
36
|
+
environment_file: ./.env
|
|
37
|
+
container_engine: podman
|
|
38
|
+
options:
|
|
39
|
+
- '--arch amd64'
|
|
40
|
+
|
|
41
|
+
If the ``ignore_runtime_environment`` flag is set, the application will run in the current
|
|
42
|
+
environment, ignoring any definitions in the configuration file.
|
|
43
|
+
|
|
44
|
+
The database configuration and setting of other environment variables is done as
|
|
45
|
+
described in :ref:`environment-variables`.
|
|
12
46
|
|
|
13
47
|
Example
|
|
14
48
|
-------
|
|
15
49
|
|
|
16
|
-
Run the application with the configuration file
|
|
50
|
+
Run the application with the configuration file ``config_file_name``:
|
|
17
51
|
|
|
18
52
|
.. code-block:: console
|
|
19
53
|
|
|
20
|
-
|
|
54
|
+
simtools-run-application --configuration_file config_file_name
|
|
21
55
|
|
|
22
|
-
Run the application with the configuration file
|
|
56
|
+
Run the application with the configuration file ``config_file_name``, but skipping all steps except
|
|
23
57
|
step 2 and 3 (useful for debugging):
|
|
24
58
|
|
|
25
59
|
.. code-block:: console
|
|
26
60
|
|
|
27
|
-
|
|
61
|
+
simtools-run-application --configuration_file config_file_name --steps 2 3
|
|
28
62
|
|
|
29
63
|
"""
|
|
30
64
|
|
|
31
65
|
import logging
|
|
32
|
-
import subprocess
|
|
33
|
-
import tempfile
|
|
34
66
|
from pathlib import Path
|
|
35
67
|
|
|
36
|
-
import yaml
|
|
37
|
-
|
|
38
68
|
import simtools.utils.general as gen
|
|
39
|
-
from simtools import dependencies
|
|
40
69
|
from simtools.configuration import configurator
|
|
70
|
+
from simtools.runners import simtools_runner
|
|
41
71
|
|
|
42
72
|
|
|
43
73
|
def _parse(label, description, usage):
|
|
@@ -73,91 +103,15 @@ def _parse(label, description, usage):
|
|
|
73
103
|
nargs="+",
|
|
74
104
|
help="List of steps to be execution (e.g., '--steps 7 8 9'; do not specify to run all).",
|
|
75
105
|
)
|
|
106
|
+
config.parser.add_argument(
|
|
107
|
+
"--ignore_runtime_environment",
|
|
108
|
+
action="store_true",
|
|
109
|
+
help="Ignore the runtime environment and run the application in the current environment.",
|
|
110
|
+
default=False,
|
|
111
|
+
)
|
|
76
112
|
return config.initialize(db_config=True)
|
|
77
113
|
|
|
78
114
|
|
|
79
|
-
def run_application(application, configuration, logger):
|
|
80
|
-
"""Run a simtools application and return stdout and stderr."""
|
|
81
|
-
with tempfile.NamedTemporaryFile(mode="w", delete=True, suffix=".yml") as temp_config:
|
|
82
|
-
yaml.dump(configuration, temp_config, default_flow_style=False)
|
|
83
|
-
temp_config.flush()
|
|
84
|
-
configuration_file = Path(temp_config.name)
|
|
85
|
-
try:
|
|
86
|
-
result = subprocess.run(
|
|
87
|
-
[application, "--config", configuration_file],
|
|
88
|
-
check=True,
|
|
89
|
-
capture_output=True,
|
|
90
|
-
text=True,
|
|
91
|
-
)
|
|
92
|
-
except subprocess.CalledProcessError as exc:
|
|
93
|
-
logger.error(f"Error running application {application}: {exc.stderr}")
|
|
94
|
-
raise exc
|
|
95
|
-
return result.stdout, result.stderr
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
def get_subdirectory_name(path):
|
|
99
|
-
"""Get the first subdirectory name under 'input'."""
|
|
100
|
-
path = Path(path).resolve()
|
|
101
|
-
try:
|
|
102
|
-
input_index = path.parts.index("input")
|
|
103
|
-
return path.parts[input_index], path.parts[input_index + 1]
|
|
104
|
-
except (ValueError, IndexError) as exc:
|
|
105
|
-
raise ValueError(f"Could not find subdirectory under 'input': {exc}") from exc
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def read_application_configuration(configuration_file, steps, logger):
|
|
109
|
-
"""
|
|
110
|
-
Read application configuration from file and modify for setting workflows.
|
|
111
|
-
|
|
112
|
-
Strong assumptions on the structure of input and output files:
|
|
113
|
-
|
|
114
|
-
- configuration file is expected to be in './input/<workflow directory>/<yaml file>'
|
|
115
|
-
- output files will be written out to './output/<workflow directory>/'
|
|
116
|
-
|
|
117
|
-
Replaces the placeholders in the configuration file with the actual values.
|
|
118
|
-
Sets 'USE_PLAIN_OUTPUT_PATH' to True for all applications.
|
|
119
|
-
|
|
120
|
-
Parameters
|
|
121
|
-
----------
|
|
122
|
-
configuration_file : str
|
|
123
|
-
Configuration file name.
|
|
124
|
-
steps : list
|
|
125
|
-
List of steps to be executed (None: all steps).
|
|
126
|
-
logger : Logger
|
|
127
|
-
Logger object.
|
|
128
|
-
|
|
129
|
-
Returns
|
|
130
|
-
-------
|
|
131
|
-
dict
|
|
132
|
-
Application configuration.
|
|
133
|
-
Path
|
|
134
|
-
Path to the log file.
|
|
135
|
-
|
|
136
|
-
"""
|
|
137
|
-
application_config = gen.collect_data_from_file(configuration_file).get("CTA_SIMPIPE")
|
|
138
|
-
place_holder = "__SETTING_WORKFLOW__"
|
|
139
|
-
workflow_dir, setting_workflow = get_subdirectory_name(configuration_file)
|
|
140
|
-
output_path = Path(str(workflow_dir).replace("input", "output")) / Path(setting_workflow)
|
|
141
|
-
output_path.mkdir(parents=True, exist_ok=True)
|
|
142
|
-
logger.info(f"Setting workflow output path to {output_path}")
|
|
143
|
-
log_file = output_path / "simtools.log"
|
|
144
|
-
configurations = application_config.get("APPLICATIONS")
|
|
145
|
-
for step_count, config in enumerate(configurations, start=1):
|
|
146
|
-
config["RUN_APPLICATION"] = step_count in steps if steps else True
|
|
147
|
-
for key, value in config.get("CONFIGURATION", {}).items():
|
|
148
|
-
if isinstance(value, str):
|
|
149
|
-
config["CONFIGURATION"][key] = value.replace(place_holder, setting_workflow)
|
|
150
|
-
if isinstance(value, list):
|
|
151
|
-
config["CONFIGURATION"][key] = [
|
|
152
|
-
item.replace(place_holder, setting_workflow) if isinstance(item, str) else item
|
|
153
|
-
for item in value
|
|
154
|
-
]
|
|
155
|
-
config["CONFIGURATION"]["USE_PLAIN_OUTPUT_PATH"] = True
|
|
156
|
-
config["CONFIGURATION"]["OUTPUT_PATH"] = str(output_path)
|
|
157
|
-
|
|
158
|
-
return configurations, log_file
|
|
159
|
-
|
|
160
|
-
|
|
161
115
|
def main(): # noqa: D103
|
|
162
116
|
args_dict, db_config = _parse(
|
|
163
117
|
Path(__file__).stem,
|
|
@@ -167,27 +121,7 @@ def main(): # noqa: D103
|
|
|
167
121
|
logger = logging.getLogger()
|
|
168
122
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
169
123
|
|
|
170
|
-
|
|
171
|
-
args_dict["configuration_file"], args_dict["steps"], logger
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
with log_file.open("w", encoding="utf-8") as file:
|
|
175
|
-
file.write("Running simtools applications\n")
|
|
176
|
-
file.write(dependencies.get_version_string(db_config))
|
|
177
|
-
for config in configurations:
|
|
178
|
-
if config.get("RUN_APPLICATION"):
|
|
179
|
-
logger.info(f"Running application: {config.get('APPLICATION')}")
|
|
180
|
-
else:
|
|
181
|
-
logger.info(f"Skipping application: {config.get('APPLICATION')}")
|
|
182
|
-
continue
|
|
183
|
-
config = gen.change_dict_keys_case(config, False)
|
|
184
|
-
stdout, stderr = run_application(
|
|
185
|
-
config.get("APPLICATION"), config.get("CONFIGURATION"), logger
|
|
186
|
-
)
|
|
187
|
-
file.write("=" * 80 + "\n")
|
|
188
|
-
file.write(f"Application: {config.get('APPLICATION')}\n")
|
|
189
|
-
file.write("STDOUT:\n" + stdout)
|
|
190
|
-
file.write("STDERR:\n" + stderr)
|
|
124
|
+
simtools_runner.run_applications(args_dict, db_config, logger)
|
|
191
125
|
|
|
192
126
|
|
|
193
127
|
if __name__ == "__main__":
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
|
|
3
|
+
r"""
|
|
4
|
+
Simulate calibration events like pedestal or flasher events.
|
|
5
|
+
|
|
6
|
+
Use sim_telarray to simulate calibration events for an array of telescopes.
|
|
7
|
+
The following types of calibration events are supported:
|
|
8
|
+
|
|
9
|
+
* Pedestal events (includes night-sky background and camera noise)
|
|
10
|
+
* Dark pedestal events (closed camera lid, camera noise only)
|
|
11
|
+
* Flasher events (simulated flasher light source)
|
|
12
|
+
|
|
13
|
+
Example
|
|
14
|
+
-------
|
|
15
|
+
|
|
16
|
+
Simulate pedestal events for alpha North. The assumed level night-sky background is 2.0 times the
|
|
17
|
+
nominal value. A list of stars can be provided to simulate additional contributions.
|
|
18
|
+
|
|
19
|
+
.. code-block:: console
|
|
20
|
+
|
|
21
|
+
simtools-simulate-calibration-events --run_mode=pedestals \\
|
|
22
|
+
--run_number 10 --number_of_events 1000 \\
|
|
23
|
+
--array_layout_name alpha --site North \\
|
|
24
|
+
--model_version 6.0.0 \\
|
|
25
|
+
--zenith_angle 20 --azimuth_angle 0 \\
|
|
26
|
+
--nsb_scaling_factor 2.0
|
|
27
|
+
|
|
28
|
+
Simulate flasher events for alpha South. Note that the same flasher configuration is used
|
|
29
|
+
for all telescopes.
|
|
30
|
+
|
|
31
|
+
.. code-block:: console
|
|
32
|
+
|
|
33
|
+
simtools-simulate-calibration-events --run_mode=flasher \\
|
|
34
|
+
--run_number 10 --number_of_events 1000 \\
|
|
35
|
+
--array_layout_name subsystem_msts --site South \\
|
|
36
|
+
--model_version 6.0.0 \\
|
|
37
|
+
--zenith_angle 20 --azimuth_angle 0 \\
|
|
38
|
+
--flasher_photons 500 --flasher_var_photons 0.05 \\
|
|
39
|
+
--flasher_exp_time 1.59 --flasher_sig_time 0.4
|
|
40
|
+
|
|
41
|
+
Command Line Arguments
|
|
42
|
+
----------------------
|
|
43
|
+
run_mode (str, required)
|
|
44
|
+
Run mode, e.g. "pedestals" or "flasher".
|
|
45
|
+
run_number (int, required)
|
|
46
|
+
Run number for the simulation.
|
|
47
|
+
number_of_events (int, required)
|
|
48
|
+
Number of calibration events to simulate.
|
|
49
|
+
array_layout_name (str, required)
|
|
50
|
+
Array layout name, e.g. "alpha".
|
|
51
|
+
site (str, required)
|
|
52
|
+
Site name.
|
|
53
|
+
model_version (str, optional)
|
|
54
|
+
Version of the simulation model.
|
|
55
|
+
nsb_scaling_factor (float, optional)
|
|
56
|
+
Scaling factor for the night-sky background rate. Default is 1.0, which
|
|
57
|
+
corresponds to the nominal (dark sky) NSB rate.
|
|
58
|
+
stars (str, optional)
|
|
59
|
+
Path to a file containing a list of stars (azimuth, zenith, weighting factor
|
|
60
|
+
separated by whitespace). If provided, the stars will be used to simulate
|
|
61
|
+
additional contributions to the night-sky background. For details on the
|
|
62
|
+
parameters, see the sim_telarray manual.
|
|
63
|
+
zenith_angle (float, optional)
|
|
64
|
+
Zenith angle in degrees.
|
|
65
|
+
azimuth_angle (float, optional)
|
|
66
|
+
Azimuth angle in degrees.
|
|
67
|
+
flasher_photons (float, optional)
|
|
68
|
+
Number of photons in the flasher pulse at each photodetector.
|
|
69
|
+
flasher_var_photons (float, optional)
|
|
70
|
+
Relative variance of the number of photons in the flasher pulse.
|
|
71
|
+
flasher_exp_time (float, optional)
|
|
72
|
+
Exponential decay time of the flasher pulse in nano-seconds.
|
|
73
|
+
flasher_sig_time (float, optional)
|
|
74
|
+
Sigma of Gaussian-shaped flasher pulse in nano-seconds.
|
|
75
|
+
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
import logging
|
|
79
|
+
from pathlib import Path
|
|
80
|
+
|
|
81
|
+
import simtools.utils.general as gen
|
|
82
|
+
from simtools.configuration import configurator
|
|
83
|
+
from simtools.simulator import Simulator
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def _parse(label):
|
|
87
|
+
"""Parse command line configuration."""
|
|
88
|
+
config = configurator.Configurator(label=label, description="Simulate calibration events.")
|
|
89
|
+
config.parser.add_argument(
|
|
90
|
+
"--run_mode",
|
|
91
|
+
help="Calibration run mode",
|
|
92
|
+
type=str,
|
|
93
|
+
required=True,
|
|
94
|
+
choices=["pedestals", "dark_pedestals", "nsb_only_pedestals", "flasher"],
|
|
95
|
+
)
|
|
96
|
+
config.parser.add_argument(
|
|
97
|
+
"--number_of_events",
|
|
98
|
+
help="Number of calibration events to simulate",
|
|
99
|
+
type=int,
|
|
100
|
+
required=True,
|
|
101
|
+
)
|
|
102
|
+
config.parser.add_argument(
|
|
103
|
+
"--nsb_scaling_factor",
|
|
104
|
+
help=(
|
|
105
|
+
"Scaling factor for the NSB rate. "
|
|
106
|
+
"Default is 1.0, which corresponds to the nominal (dark sky) NSB rate."
|
|
107
|
+
),
|
|
108
|
+
type=float,
|
|
109
|
+
required=False,
|
|
110
|
+
default=1.0,
|
|
111
|
+
)
|
|
112
|
+
config.parser.add_argument(
|
|
113
|
+
"--stars",
|
|
114
|
+
help="List of stars (azimuth, zenith, weighting factor).",
|
|
115
|
+
type=str,
|
|
116
|
+
default=None,
|
|
117
|
+
)
|
|
118
|
+
flasher_args = config.parser.add_argument_group("Flasher configuration")
|
|
119
|
+
flasher_args.add_argument(
|
|
120
|
+
"--flasher_photons",
|
|
121
|
+
help="Number of photons in the flasher pulse at each photodetector.",
|
|
122
|
+
type=float,
|
|
123
|
+
default=500.0,
|
|
124
|
+
)
|
|
125
|
+
flasher_args.add_argument(
|
|
126
|
+
"--flasher_var_photons",
|
|
127
|
+
help="Relative variance of the number of photons in the flasher pulse.",
|
|
128
|
+
type=float,
|
|
129
|
+
default=0.05,
|
|
130
|
+
)
|
|
131
|
+
flasher_args.add_argument(
|
|
132
|
+
"--flasher_exp_time",
|
|
133
|
+
help="Exponential decay time of the flasher pulse in nanoseconds.",
|
|
134
|
+
type=float,
|
|
135
|
+
default=0.0,
|
|
136
|
+
)
|
|
137
|
+
flasher_args.add_argument(
|
|
138
|
+
"--flasher_sig_time",
|
|
139
|
+
help="Sigma of Gaussian-shaped flasher pulse in nanoseconds.",
|
|
140
|
+
type=float,
|
|
141
|
+
default=0.0,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
return config.initialize(
|
|
145
|
+
db_config=True,
|
|
146
|
+
simulation_model=["site", "layout", "telescope", "model_version"],
|
|
147
|
+
simulation_configuration={
|
|
148
|
+
"corsika_configuration": ["run_number", "azimuth_angle", "zenith_angle"],
|
|
149
|
+
"sim_telarray_configuration": ["all"],
|
|
150
|
+
},
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def main(): # noqa: D103
|
|
155
|
+
label = Path(__file__).stem
|
|
156
|
+
args_dict, db_config = _parse(label)
|
|
157
|
+
|
|
158
|
+
logger = logging.getLogger()
|
|
159
|
+
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
160
|
+
|
|
161
|
+
simulator = Simulator(label=args_dict.get("label"), args_dict=args_dict, db_config=db_config)
|
|
162
|
+
simulator.simulate()
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
if __name__ == "__main__":
|
|
166
|
+
main()
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
#!/usr/bin/python3
|
|
2
|
+
|
|
3
|
+
r"""
|
|
4
|
+
Simulate flasher devices using the light emission package.
|
|
5
|
+
|
|
6
|
+
Run the application in the command line.
|
|
7
|
+
|
|
8
|
+
Example Usage
|
|
9
|
+
-------------
|
|
10
|
+
|
|
11
|
+
1. Simulate flashers for a telescope:
|
|
12
|
+
|
|
13
|
+
.. code-block:: console
|
|
14
|
+
|
|
15
|
+
simtools-simulate-flasher --telescope MSTN-04 --site North \
|
|
16
|
+
--flasher FLSN-01 --model_version 6.0.0
|
|
17
|
+
|
|
18
|
+
Command Line Arguments
|
|
19
|
+
----------------------
|
|
20
|
+
telescope (str, required)
|
|
21
|
+
Telescope model name (e.g. LSTN-01, MSTN-04, SSTS-04, ...)
|
|
22
|
+
site (str, required)
|
|
23
|
+
Site name (North or South).
|
|
24
|
+
flasher (str, required)
|
|
25
|
+
Flasher device in array, e.g., FLSN-01.
|
|
26
|
+
number_of_events (int, optional):
|
|
27
|
+
Number of events to simulate (default: 1).
|
|
28
|
+
output_prefix (str, optional):
|
|
29
|
+
Prefix for output files (default: empty).
|
|
30
|
+
model_version (str, optional)
|
|
31
|
+
Version of the simulation model.
|
|
32
|
+
|
|
33
|
+
Example
|
|
34
|
+
-------
|
|
35
|
+
|
|
36
|
+
Simulate flashers for MSTN-04:
|
|
37
|
+
|
|
38
|
+
.. code-block:: console
|
|
39
|
+
|
|
40
|
+
simtools-simulate-flasher --telescope MSTN-04 --site North \
|
|
41
|
+
--flasher FLSN-01 --model_version 6.0.0
|
|
42
|
+
|
|
43
|
+
Expected Output:
|
|
44
|
+
The simulation will run the light emission package for the flasher
|
|
45
|
+
devices and produce the output files.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
import logging
|
|
49
|
+
from pathlib import Path
|
|
50
|
+
|
|
51
|
+
import simtools.utils.general as gen
|
|
52
|
+
from simtools.configuration import configurator
|
|
53
|
+
from simtools.model.flasher_model import FlasherModel
|
|
54
|
+
from simtools.model.model_utils import initialize_simulation_models
|
|
55
|
+
from simtools.simtel.simulator_light_emission import SimulatorLightEmission
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _parse(label):
|
|
59
|
+
"""Parse command line configuration."""
|
|
60
|
+
config = configurator.Configurator(
|
|
61
|
+
label=label,
|
|
62
|
+
description=("Simulate flasher devices using the light emission package."),
|
|
63
|
+
)
|
|
64
|
+
config.parser.add_argument(
|
|
65
|
+
"--flasher",
|
|
66
|
+
help="Flasher device in array associated with a specific telescope, i.e. FLSN-01",
|
|
67
|
+
type=str,
|
|
68
|
+
required=True,
|
|
69
|
+
)
|
|
70
|
+
config.parser.add_argument(
|
|
71
|
+
"--number_events",
|
|
72
|
+
help="Number of number_events to simulate (default: 1)",
|
|
73
|
+
type=int,
|
|
74
|
+
default=1,
|
|
75
|
+
required=False,
|
|
76
|
+
)
|
|
77
|
+
config.parser.add_argument(
|
|
78
|
+
"--output_prefix",
|
|
79
|
+
help="Prefix for output files (default: empty)",
|
|
80
|
+
type=str,
|
|
81
|
+
default=None,
|
|
82
|
+
required=False,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return config.initialize(
|
|
86
|
+
db_config=True,
|
|
87
|
+
simulation_model=["telescope", "model_version"],
|
|
88
|
+
require_command_line=True,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def flasher_configs():
|
|
93
|
+
"""Return default setup for flasher runs (no distances)."""
|
|
94
|
+
return {"light_source_setup": "layout"}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def main():
|
|
98
|
+
"""Run the application."""
|
|
99
|
+
label = Path(__file__).stem
|
|
100
|
+
logger = logging.getLogger(__name__)
|
|
101
|
+
|
|
102
|
+
args_dict, db_config = _parse(label)
|
|
103
|
+
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
104
|
+
|
|
105
|
+
telescope_model, site_model = initialize_simulation_models(
|
|
106
|
+
label=label,
|
|
107
|
+
db_config=db_config,
|
|
108
|
+
site=args_dict["site"],
|
|
109
|
+
telescope_name=args_dict["telescope"],
|
|
110
|
+
model_version=args_dict["model_version"],
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
flasher_model = FlasherModel(
|
|
114
|
+
site=args_dict["site"],
|
|
115
|
+
flasher_device_model_name=args_dict["flasher"],
|
|
116
|
+
mongo_db_config=db_config,
|
|
117
|
+
model_version=args_dict["model_version"],
|
|
118
|
+
label=label,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
flasher_cfg = flasher_configs()
|
|
122
|
+
|
|
123
|
+
sim_runner = SimulatorLightEmission(
|
|
124
|
+
telescope_model=telescope_model,
|
|
125
|
+
flasher_model=flasher_model,
|
|
126
|
+
site_model=site_model,
|
|
127
|
+
light_emission_config=args_dict,
|
|
128
|
+
light_source_setup=flasher_cfg["light_source_setup"],
|
|
129
|
+
simtel_path=args_dict["simtel_path"],
|
|
130
|
+
light_source_type="flasher",
|
|
131
|
+
label=args_dict["label"],
|
|
132
|
+
test=args_dict.get("test", False),
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
sim_runner.run_simulation()
|
|
136
|
+
|
|
137
|
+
logger.info("Flasher simulation completed. Use simtools-plot-simtel-number_events for plots.")
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
if __name__ == "__main__":
|
|
141
|
+
main()
|