gammasimtools 0.21.0__py3-none-any.whl → 0.23.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/METADATA +3 -3
- gammasimtools-0.23.0.dist-info/RECORD +414 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/entry_points.txt +2 -1
- simtools/_version.py +2 -2
- simtools/application_control.py +118 -0
- simtools/applications/calculate_incident_angles.py +17 -25
- simtools/applications/convert_all_model_parameters_from_simtel.py +29 -45
- simtools/applications/convert_geo_coordinates_of_array_elements.py +26 -45
- simtools/applications/convert_model_parameter_from_simtel.py +21 -42
- simtools/applications/db_add_file_to_db.py +12 -13
- simtools/applications/db_add_simulation_model_from_repository_to_db.py +20 -33
- simtools/applications/db_add_value_from_json_to_db.py +28 -23
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +19 -34
- simtools/applications/db_generate_compound_indexes.py +12 -27
- simtools/applications/db_get_array_layouts_from_db.py +19 -39
- simtools/applications/db_get_file_from_db.py +15 -17
- simtools/applications/db_get_parameter_from_db.py +33 -35
- simtools/applications/db_inspect_databases.py +10 -11
- simtools/applications/db_upload_model_repository.py +104 -0
- simtools/applications/derive_ctao_array_layouts.py +16 -21
- simtools/applications/derive_mirror_rnda.py +9 -14
- simtools/applications/derive_photon_electron_spectrum.py +7 -10
- simtools/applications/derive_psf_parameters.py +24 -21
- simtools/applications/derive_trigger_rates.py +6 -9
- simtools/applications/docs_produce_array_element_report.py +22 -23
- simtools/applications/docs_produce_calibration_reports.py +26 -24
- simtools/applications/docs_produce_model_parameter_reports.py +15 -22
- simtools/applications/docs_produce_simulation_configuration_report.py +21 -22
- simtools/applications/generate_array_config.py +14 -33
- simtools/applications/generate_corsika_histograms.py +22 -43
- simtools/applications/generate_default_metadata.py +15 -36
- simtools/applications/generate_regular_arrays.py +11 -15
- simtools/applications/generate_simtel_event_data.py +23 -33
- simtools/applications/maintain_simulation_model_add_production.py +17 -48
- simtools/applications/maintain_simulation_model_compare_productions.py +10 -12
- simtools/applications/maintain_simulation_model_verify_production_tables.py +8 -11
- simtools/applications/merge_tables.py +15 -24
- simtools/applications/plot_array_layout.py +77 -55
- simtools/applications/plot_simtel_events.py +11 -13
- simtools/applications/plot_tabular_data.py +17 -38
- simtools/applications/plot_tabular_data_for_model_parameter.py +16 -23
- simtools/applications/print_version.py +14 -42
- simtools/applications/production_derive_corsika_limits.py +5 -9
- simtools/applications/production_derive_statistics.py +12 -26
- simtools/applications/production_generate_grid.py +20 -48
- simtools/applications/production_merge_corsika_limits.py +17 -21
- simtools/applications/run_application.py +12 -32
- simtools/applications/simulate_flasher.py +79 -81
- simtools/applications/simulate_illuminator.py +56 -197
- simtools/applications/{simulate_calibration_events.py → simulate_pedestals.py} +22 -68
- simtools/applications/simulate_prod.py +21 -33
- simtools/applications/simulate_prod_htcondor_generator.py +11 -25
- simtools/applications/submit_array_layouts.py +15 -18
- simtools/applications/submit_data_from_external.py +18 -34
- simtools/applications/submit_model_parameter_from_external.py +27 -41
- simtools/applications/validate_camera_efficiency.py +23 -22
- simtools/applications/validate_camera_fov.py +21 -27
- simtools/applications/validate_cumulative_psf.py +28 -37
- simtools/applications/validate_file_using_schema.py +35 -45
- simtools/applications/validate_optics.py +27 -33
- simtools/camera/camera_efficiency.py +8 -13
- simtools/configuration/commandline_parser.py +33 -11
- simtools/configuration/configurator.py +0 -7
- simtools/corsika/corsika_config.py +9 -16
- simtools/corsika/corsika_histograms.py +1 -1
- simtools/data_model/data_reader.py +0 -2
- simtools/data_model/metadata_collector.py +0 -2
- simtools/data_model/model_data_writer.py +87 -27
- simtools/data_model/schema.py +61 -2
- simtools/data_model/validate_data.py +1 -3
- simtools/db/db_handler.py +58 -39
- simtools/db/db_model_upload.py +210 -5
- simtools/io/hdf5_handler.py +0 -5
- simtools/io/io_handler.py +31 -83
- simtools/io/legacy_data_handler.py +0 -5
- simtools/job_execution/job_manager.py +43 -1
- simtools/layout/array_layout.py +0 -2
- simtools/layout/array_layout_utils.py +1 -5
- simtools/layout/telescope_position.py +0 -2
- simtools/model/array_model.py +95 -46
- simtools/model/calibration_model.py +0 -2
- simtools/model/camera.py +0 -2
- simtools/model/mirrors.py +0 -2
- simtools/model/model_parameter.py +50 -16
- simtools/model/model_repository.py +139 -106
- simtools/model/model_utils.py +21 -11
- simtools/model/site_model.py +0 -2
- simtools/model/telescope_model.py +20 -2
- simtools/production_configuration/calculate_statistical_uncertainties_grid_point.py +0 -2
- simtools/production_configuration/derive_corsika_limits.py +1 -1
- simtools/production_configuration/derive_production_statistics.py +0 -2
- simtools/production_configuration/interpolation_handler.py +0 -2
- simtools/ray_tracing/incident_angles.py +7 -7
- simtools/ray_tracing/mirror_panel_psf.py +1 -1
- simtools/ray_tracing/psf_analysis.py +0 -2
- simtools/ray_tracing/psf_parameter_optimisation.py +180 -73
- simtools/ray_tracing/ray_tracing.py +1 -5
- simtools/reporting/docs_auto_report_generator.py +108 -0
- simtools/reporting/docs_read_parameters.py +168 -104
- simtools/resources/array_elements.yml +26 -0
- simtools/runners/corsika_runner.py +0 -2
- simtools/runners/corsika_simtel_runner.py +11 -19
- simtools/runners/runner_services.py +5 -6
- simtools/runners/simtel_runner.py +0 -2
- simtools/runners/simtools_runner.py +0 -2
- simtools/schemas/application_workflow.metaschema.yml +1 -1
- simtools/schemas/common_definitions.schema.yml +39 -0
- simtools/schemas/model_parameter.metaschema.yml +19 -13
- simtools/schemas/model_parameter_and_data_schema.metaschema.yml +6 -12
- simtools/schemas/model_parameters/adjust_gain.schema.yml +0 -5
- simtools/schemas/model_parameters/altitude.schema.yml +0 -5
- simtools/schemas/model_parameters/array_coordinates.schema.yml +0 -5
- simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +0 -5
- simtools/schemas/model_parameters/array_element_position_ground.schema.yml +0 -7
- simtools/schemas/model_parameters/array_element_position_utm.schema.yml +0 -7
- simtools/schemas/model_parameters/array_layouts.schema.yml +0 -5
- simtools/schemas/model_parameters/array_triggers.schema.yml +0 -5
- simtools/schemas/model_parameters/array_window.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_clipping.schema.yml +0 -3
- simtools/schemas/model_parameters/asum_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_shaping.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +0 -5
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +0 -5
- simtools/schemas/model_parameters/axes_offsets.schema.yml +0 -7
- simtools/schemas/model_parameters/calibration_devices.schema.yml +30 -0
- simtools/schemas/model_parameters/camera_body_diameter.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_body_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_config_file.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_config_rotate.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_degraded_map.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_depth.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_filter.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/camera_pixels.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_transmission.schema.yml +0 -7
- simtools/schemas/model_parameters/channels_per_chip.schema.yml +0 -7
- simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +0 -7
- simtools/schemas/model_parameters/corsika_observation_level.schema.yml +0 -5
- simtools/schemas/model_parameters/dark_events.schema.yml +4 -3
- simtools/schemas/model_parameters/default_trigger.schema.yml +0 -7
- simtools/schemas/model_parameters/design_model.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_start.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +1 -9
- simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/dish_shape_length.schema.yml +0 -5
- simtools/schemas/model_parameters/dsum_clipping.schema.yml +1 -5
- simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_pedsub.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_prescale.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_presum_max.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_shaping.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +2 -12
- simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +0 -3
- simtools/schemas/model_parameters/effective_focal_length.schema.yml +0 -7
- simtools/schemas/model_parameters/epsg_code.schema.yml +0 -5
- simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_amplitude.schema.yml +2 -9
- simtools/schemas/model_parameters/fadc_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +2 -9
- simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_long_event_threshold.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_long_sum_bins.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_long_sum_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_max_signal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_max_sum.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_mhz.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_noise.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fake_mirror_list.schema.yml +0 -3
- simtools/schemas/model_parameters/flasher_angular_distribution.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_angular_distribution_width.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_bunch_size.schema.yml +28 -0
- simtools/schemas/model_parameters/flasher_external_trigger.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_photons.schema.yml +34 -0
- simtools/schemas/model_parameters/flasher_position.schema.yml +43 -0
- simtools/schemas/model_parameters/flasher_pulse_exp_decay.schema.yml +29 -0
- simtools/schemas/model_parameters/flasher_pulse_offset.schema.yml +35 -0
- simtools/schemas/model_parameters/flasher_pulse_shape.schema.yml +30 -0
- simtools/schemas/model_parameters/flasher_pulse_width.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_type.schema.yml +28 -0
- simtools/schemas/model_parameters/flasher_var_photons.schema.yml +31 -0
- simtools/schemas/model_parameters/flasher_wavelength.schema.yml +33 -0
- simtools/schemas/model_parameters/flatfielding.schema.yml +0 -7
- simtools/schemas/model_parameters/focal_length.schema.yml +0 -7
- simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/focus_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/gain_variation.schema.yml +0 -7
- simtools/schemas/model_parameters/geomag_horizontal.schema.yml +2 -7
- simtools/schemas/model_parameters/geomag_rotation.schema.yml +2 -7
- simtools/schemas/model_parameters/geomag_vertical.schema.yml +2 -7
- simtools/schemas/model_parameters/hg_lg_variation.schema.yml +0 -5
- simtools/schemas/model_parameters/iobuf_maximum.schema.yml +0 -7
- simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +0 -7
- simtools/schemas/model_parameters/laser_events.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_external_trigger.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_var_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_wavelength.schema.yml +4 -3
- simtools/schemas/model_parameters/led_events.schema.yml +4 -3
- simtools/schemas/model_parameters/led_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/led_pulse_offset.schema.yml +4 -3
- simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +4 -3
- simtools/schemas/model_parameters/led_var_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +0 -7
- simtools/schemas/model_parameters/min_photoelectrons.schema.yml +0 -7
- simtools/schemas/model_parameters/min_photons.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +0 -5
- simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_class.schema.yml +2 -9
- simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_focal_length.schema.yml +0 -5
- simtools/schemas/model_parameters/mirror_list.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +0 -7
- simtools/schemas/model_parameters/multiplicity_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/muon_mono_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +0 -3
- simtools/schemas/model_parameters/nsb_offaxis.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_reference_value.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_sky_map.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_spectrum.schema.yml +0 -5
- simtools/schemas/model_parameters/num_gains.schema.yml +0 -7
- simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +0 -7
- simtools/schemas/model_parameters/optics_properties.schema.yml +0 -7
- simtools/schemas/model_parameters/parabolic_dish.schema.yml +0 -3
- simtools/schemas/model_parameters/pedestal_events.schema.yml +4 -7
- simtools/schemas/model_parameters/photon_delay.schema.yml +0 -7
- simtools/schemas/model_parameters/photons_per_run.schema.yml +4 -4
- simtools/schemas/model_parameters/pixel_cells.schema.yml +0 -3
- simtools/schemas/model_parameters/pixels_parallel.schema.yml +0 -3
- simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +0 -7
- simtools/schemas/model_parameters/pm_average_gain.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_gain_index.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +0 -7
- simtools/schemas/model_parameters/pm_transit_time.schema.yml +4 -9
- simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +0 -5
- simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +0 -7
- simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +0 -3
- simtools/schemas/model_parameters/qe_variation.schema.yml +0 -7
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +0 -7
- simtools/schemas/model_parameters/random_focal_length.schema.yml +2 -7
- simtools/schemas/model_parameters/random_generator.schema.yml +0 -7
- simtools/schemas/model_parameters/random_mono_probability.schema.yml +0 -7
- simtools/schemas/model_parameters/reference_point_altitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_latitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_longitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +0 -5
- simtools/schemas/model_parameters/sampled_output.schema.yml +0 -7
- simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/stars.schema.yml +0 -5
- simtools/schemas/model_parameters/store_photoelectrons.schema.yml +0 -7
- simtools/schemas/model_parameters/tailcut_scale.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_axis_height.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_random_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_random_error.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_transmission.schema.yml +0 -7
- simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +0 -7
- simtools/schemas/model_parameters/teltrig_min_time.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_jitter.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_random.schema.yml +29 -0
- simtools/schemas/model_parameters/trigger_current_limit.schema.yml +0 -7
- simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +0 -7
- simtools/schemas/model_parameters/trigger_pixels.schema.yml +0 -7
- simtools/schemas/production_tables.schema.yml +8 -8
- simtools/schemas/simulation_models_info.schema.yml +78 -0
- simtools/simtel/simtel_config_reader.py +0 -2
- simtools/simtel/simtel_config_writer.py +118 -26
- simtools/simtel/simtel_io_metadata.py +3 -3
- simtools/simtel/simulator_array.py +43 -85
- simtools/simtel/simulator_camera_efficiency.py +0 -2
- simtools/simtel/simulator_light_emission.py +336 -631
- simtools/simtel/simulator_ray_tracing.py +2 -4
- simtools/simulator.py +45 -19
- simtools/testing/assertions.py +2 -2
- simtools/testing/configuration.py +21 -6
- simtools/testing/sim_telarray_metadata.py +4 -4
- simtools/utils/general.py +5 -13
- simtools/utils/geometry.py +34 -5
- simtools/utils/names.py +1 -13
- simtools/version.py +83 -0
- simtools/visualization/plot_array_layout.py +129 -23
- simtools/visualization/plot_incident_angles.py +0 -2
- simtools/visualization/plot_psf.py +163 -61
- simtools/visualization/plot_simtel_events.py +1 -12
- simtools/visualization/visualize.py +0 -12
- gammasimtools-0.21.0.dist-info/RECORD +0 -396
- simtools/model/flasher_model.py +0 -106
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/licenses/LICENSE +0 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/top_level.txt +0 -0
|
@@ -42,46 +42,24 @@ To generate a grid of simulation points, execute the script as follows:
|
|
|
42
42
|
--telescope_ids 1
|
|
43
43
|
"""
|
|
44
44
|
|
|
45
|
-
import logging
|
|
46
45
|
from pathlib import Path
|
|
47
46
|
|
|
48
47
|
from astropy.coordinates import EarthLocation
|
|
49
48
|
from astropy.time import Time
|
|
50
49
|
|
|
50
|
+
from simtools.application_control import get_application_label, startup_application
|
|
51
51
|
from simtools.configuration import configurator
|
|
52
|
-
from simtools.io import io_handler
|
|
53
52
|
from simtools.io.ascii_handler import collect_data_from_file
|
|
54
53
|
from simtools.model.site_model import SiteModel
|
|
55
54
|
from simtools.production_configuration.generate_production_grid import GridGeneration
|
|
56
55
|
|
|
57
56
|
|
|
58
|
-
def _parse(
|
|
59
|
-
"""
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
axes (str, required)
|
|
65
|
-
Path to a YAML or JSON file defining the axes of the grid.
|
|
66
|
-
coordinate_system (str, optional, default='zenith_azimuth')
|
|
67
|
-
The coordinate system for the grid generation ('zenith_azimuth' or 'ra_dec').
|
|
68
|
-
observing_time (str, optional, default=now)
|
|
69
|
-
Time of the observation (format: 'YYYY-MM-DD HH:MM:SS').
|
|
70
|
-
lookup_table (str, required)
|
|
71
|
-
Path to the lookup table for simulation limits. The table should contain
|
|
72
|
-
varying azimuth and/or zenith angles.
|
|
73
|
-
telescope_ids (list of int, optional)
|
|
74
|
-
List of telescope IDs as used in sim_telarray to filter the events.
|
|
75
|
-
output_file (str, optional, default='grid_output.json')
|
|
76
|
-
Output file for the generated grid points (default: 'grid_output.json').
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
Returns
|
|
80
|
-
-------
|
|
81
|
-
CommandLineParser
|
|
82
|
-
Command line parser object.
|
|
83
|
-
"""
|
|
84
|
-
config = configurator.Configurator(label=label, description=description)
|
|
57
|
+
def _parse():
|
|
58
|
+
"""Parse command line configuration."""
|
|
59
|
+
config = configurator.Configurator(
|
|
60
|
+
label=get_application_label(__file__),
|
|
61
|
+
description="Generate a grid of simulation points using flexible axes definitions.",
|
|
62
|
+
)
|
|
85
63
|
|
|
86
64
|
config.parser.add_argument(
|
|
87
65
|
"--axes",
|
|
@@ -148,23 +126,15 @@ def load_axes(file_path: str):
|
|
|
148
126
|
|
|
149
127
|
def main():
|
|
150
128
|
"""Run the Grid Generation application."""
|
|
151
|
-
|
|
152
|
-
args_dict, db_config = _parse(
|
|
153
|
-
label,
|
|
154
|
-
"Generate a grid of simulation points using flexible axes definitions.",
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
_logger = logging.getLogger()
|
|
158
|
-
_logger.setLevel(logging.INFO)
|
|
129
|
+
app_context = startup_application(_parse)
|
|
159
130
|
|
|
160
|
-
|
|
161
|
-
output_filepath = Path(output_path).joinpath(f"{args_dict['output_file']}")
|
|
131
|
+
output_filepath = app_context.io_handler.get_output_file(app_context.args["output_file"])
|
|
162
132
|
|
|
163
|
-
axes = load_axes(
|
|
133
|
+
axes = load_axes(app_context.args["axes"])
|
|
164
134
|
site_model = SiteModel(
|
|
165
|
-
mongo_db_config=db_config,
|
|
166
|
-
model_version=
|
|
167
|
-
site=
|
|
135
|
+
mongo_db_config=app_context.db_config,
|
|
136
|
+
model_version=app_context.args["model_version"],
|
|
137
|
+
site=app_context.args["site"],
|
|
168
138
|
)
|
|
169
139
|
|
|
170
140
|
ref_lat = site_model.get_parameter_value_with_unit("reference_point_latitude")
|
|
@@ -174,21 +144,23 @@ def main():
|
|
|
174
144
|
observing_location = EarthLocation(lat=ref_lat, lon=ref_long, height=altitude)
|
|
175
145
|
|
|
176
146
|
observing_time = (
|
|
177
|
-
Time(
|
|
147
|
+
Time(app_context.args["observing_time"])
|
|
148
|
+
if app_context.args.get("observing_time")
|
|
149
|
+
else Time.now()
|
|
178
150
|
)
|
|
179
151
|
|
|
180
152
|
grid_gen = GridGeneration(
|
|
181
153
|
axes=axes,
|
|
182
|
-
coordinate_system=
|
|
154
|
+
coordinate_system=app_context.args["coordinate_system"],
|
|
183
155
|
observing_location=observing_location,
|
|
184
156
|
observing_time=observing_time,
|
|
185
|
-
lookup_table=
|
|
186
|
-
telescope_ids=
|
|
157
|
+
lookup_table=app_context.args["lookup_table"],
|
|
158
|
+
telescope_ids=app_context.args["telescope_ids"],
|
|
187
159
|
)
|
|
188
160
|
|
|
189
161
|
grid_points = grid_gen.generate_grid()
|
|
190
162
|
|
|
191
|
-
if
|
|
163
|
+
if app_context.args["coordinate_system"] == "ra_dec":
|
|
192
164
|
grid_points = grid_gen.convert_coordinates(grid_points)
|
|
193
165
|
grid_gen.serialize_grid_points(grid_points, output_file=output_filepath)
|
|
194
166
|
|
|
@@ -77,22 +77,20 @@ Examples
|
|
|
77
77
|
--output_file merged_limits.ecsv
|
|
78
78
|
"""
|
|
79
79
|
|
|
80
|
-
import logging
|
|
81
80
|
from pathlib import Path
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
from simtools.application_control import get_application_label, startup_application
|
|
84
83
|
from simtools.configuration import configurator
|
|
85
84
|
from simtools.data_model import data_reader
|
|
86
85
|
from simtools.io import ascii_handler
|
|
87
86
|
from simtools.production_configuration.merge_corsika_limits import CorsikaMergeLimits
|
|
88
87
|
|
|
89
|
-
_logger = logging.getLogger(__name__)
|
|
90
|
-
|
|
91
88
|
|
|
92
89
|
def _parse():
|
|
93
90
|
"""Parse command line configuration."""
|
|
94
91
|
config = configurator.Configurator(
|
|
95
|
-
|
|
92
|
+
label=get_application_label(__file__),
|
|
93
|
+
description="Merge CORSIKA limit tables and check grid completeness.",
|
|
96
94
|
)
|
|
97
95
|
config.parser.add_argument(
|
|
98
96
|
"--input_files",
|
|
@@ -142,29 +140,27 @@ def _parse():
|
|
|
142
140
|
|
|
143
141
|
def main():
|
|
144
142
|
"""Merge CORSIKA limit tables and check grid completeness."""
|
|
145
|
-
|
|
146
|
-
logger = logging.getLogger()
|
|
147
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict.get("log_level", "info")))
|
|
143
|
+
app_context = startup_application(_parse)
|
|
148
144
|
|
|
149
145
|
merger = CorsikaMergeLimits()
|
|
150
146
|
grid_definition = (
|
|
151
|
-
ascii_handler.collect_data_from_file(
|
|
152
|
-
if
|
|
147
|
+
ascii_handler.collect_data_from_file(app_context.args["grid_definition"])
|
|
148
|
+
if app_context.args.get("grid_definition")
|
|
153
149
|
else None
|
|
154
150
|
)
|
|
155
151
|
|
|
156
|
-
if
|
|
152
|
+
if app_context.args.get("merged_table"):
|
|
157
153
|
# Case 3: Check coverage on an existing merged table
|
|
158
|
-
merged_table_path = Path(
|
|
154
|
+
merged_table_path = Path(app_context.args["merged_table"]).expanduser()
|
|
159
155
|
merged_table = data_reader.read_table_from_file(merged_table_path)
|
|
160
156
|
input_files = [merged_table_path]
|
|
161
|
-
elif
|
|
157
|
+
elif app_context.args.get("input_files") or app_context.args.get("input_files_list"):
|
|
162
158
|
# Case 1 & 2: Merge files
|
|
163
159
|
input_files = []
|
|
164
160
|
|
|
165
161
|
# Process input_files argument
|
|
166
|
-
if
|
|
167
|
-
raw_paths =
|
|
162
|
+
if app_context.args.get("input_files"):
|
|
163
|
+
raw_paths = app_context.args.get("input_files")
|
|
168
164
|
if len(raw_paths) == 1 and Path(raw_paths[0]).expanduser().is_dir():
|
|
169
165
|
input_dir = Path(raw_paths[0]).expanduser()
|
|
170
166
|
input_files.extend(input_dir.glob("*.ecsv"))
|
|
@@ -172,8 +168,8 @@ def main():
|
|
|
172
168
|
input_files.extend(Path(f).expanduser() for f in raw_paths)
|
|
173
169
|
|
|
174
170
|
# Process input_files_list argument
|
|
175
|
-
if
|
|
176
|
-
files_from_list = merger.read_file_list(
|
|
171
|
+
if app_context.args.get("input_files_list"):
|
|
172
|
+
files_from_list = merger.read_file_list(app_context.args["input_files_list"])
|
|
177
173
|
input_files.extend(files_from_list)
|
|
178
174
|
|
|
179
175
|
if not input_files:
|
|
@@ -188,15 +184,15 @@ def main():
|
|
|
188
184
|
|
|
189
185
|
is_complete, grid_completeness = merger.check_grid_completeness(merged_table, grid_definition)
|
|
190
186
|
|
|
191
|
-
if
|
|
187
|
+
if app_context.args.get("plot_grid_coverage"):
|
|
192
188
|
merger.plot_grid_coverage(merged_table, grid_definition)
|
|
193
189
|
|
|
194
|
-
if
|
|
190
|
+
if app_context.args.get("plot_limits"):
|
|
195
191
|
merger.plot_limits(merged_table)
|
|
196
192
|
|
|
197
|
-
if not
|
|
193
|
+
if not app_context.args.get("merged_table"):
|
|
198
194
|
# Write output file only when merging
|
|
199
|
-
output_file = merger.output_dir /
|
|
195
|
+
output_file = merger.output_dir / app_context.args["output_file"]
|
|
200
196
|
merger.write_merged_table(
|
|
201
197
|
merged_table,
|
|
202
198
|
output_file,
|
|
@@ -62,33 +62,18 @@ step 2 and 3 (useful for debugging):
|
|
|
62
62
|
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
|
-
import
|
|
66
|
-
from pathlib import Path
|
|
67
|
-
|
|
68
|
-
import simtools.utils.general as gen
|
|
65
|
+
from simtools.application_control import get_application_label, startup_application
|
|
69
66
|
from simtools.configuration import configurator
|
|
70
67
|
from simtools.runners import simtools_runner
|
|
71
68
|
|
|
72
69
|
|
|
73
|
-
def _parse(
|
|
74
|
-
"""
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Label describing the application.
|
|
81
|
-
description : str
|
|
82
|
-
Description of the application.
|
|
83
|
-
usage : str
|
|
84
|
-
Example on how to use the application.
|
|
85
|
-
|
|
86
|
-
Returns
|
|
87
|
-
-------
|
|
88
|
-
CommandLineParser
|
|
89
|
-
Command line parser object.
|
|
90
|
-
"""
|
|
91
|
-
config = configurator.Configurator(label=label, description=description, usage=usage)
|
|
70
|
+
def _parse():
|
|
71
|
+
"""Parse command line configuration."""
|
|
72
|
+
config = configurator.Configurator(
|
|
73
|
+
label=get_application_label(__file__),
|
|
74
|
+
description="Run simtools applications using a configuration file.",
|
|
75
|
+
usage="simtools-run-application --config_file config_file_name",
|
|
76
|
+
)
|
|
92
77
|
|
|
93
78
|
config.parser.add_argument(
|
|
94
79
|
"--configuration_file",
|
|
@@ -112,16 +97,11 @@ def _parse(label, description, usage):
|
|
|
112
97
|
return config.initialize(db_config=True)
|
|
113
98
|
|
|
114
99
|
|
|
115
|
-
def main():
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
description="Run simtools applications using a configuration file.",
|
|
119
|
-
usage="simtools-run-application --config_file config_file_name",
|
|
120
|
-
)
|
|
121
|
-
logger = logging.getLogger()
|
|
122
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
100
|
+
def main():
|
|
101
|
+
"""Run several simtools applications using a configuration file."""
|
|
102
|
+
app_context = startup_application(_parse, setup_io_handler=False)
|
|
123
103
|
|
|
124
|
-
simtools_runner.run_applications(
|
|
104
|
+
simtools_runner.run_applications(app_context.args, app_context.db_config, app_context.logger)
|
|
125
105
|
|
|
126
106
|
|
|
127
107
|
if __name__ == "__main__":
|
|
@@ -1,140 +1,138 @@
|
|
|
1
1
|
#!/usr/bin/python3
|
|
2
2
|
|
|
3
3
|
r"""
|
|
4
|
-
Simulate flasher devices
|
|
4
|
+
Simulate flasher devices used e.g. for camera flat fielding.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
The flasher simulation allows for two different run modes:
|
|
7
|
+
|
|
8
|
+
1. Direct injection of light into the camera (bypassing the telescope optics).
|
|
9
|
+
2. Simulation of the full light path (using the light-emission package from sim_telarray).
|
|
10
|
+
|
|
11
|
+
The direct injection mode uses a simplified model for the flasher light source. Both run modes
|
|
12
|
+
provide events in sim_telarray format that can be processed by standard analysis steps or
|
|
13
|
+
visualized using e.g. the 'simtools-plot-simtel-events' application.
|
|
7
14
|
|
|
8
15
|
Example Usage
|
|
9
16
|
-------------
|
|
10
17
|
|
|
11
|
-
1. Simulate flashers for a telescope:
|
|
18
|
+
1. Simulate flashers for a telescope (direct injection):
|
|
19
|
+
|
|
20
|
+
.. code-block:: console
|
|
21
|
+
|
|
22
|
+
simtools-simulate-flasher --run_mode direct_injection \
|
|
23
|
+
--light_source MSFx-FlashCam --model_version 6.0.0 \
|
|
24
|
+
--array_layout_name subsystem_msts --site South \
|
|
25
|
+
--run_number 3
|
|
26
|
+
|
|
27
|
+
2. Simulate flashers for a telescope (detailed simulation):
|
|
12
28
|
|
|
13
29
|
.. code-block:: console
|
|
14
30
|
|
|
15
|
-
simtools-simulate-flasher --
|
|
16
|
-
--
|
|
31
|
+
simtools-simulate-flasher --run_mode full_simulation \
|
|
32
|
+
--light_source MSFx-FlashCam --model_version 6.0.0 \
|
|
33
|
+
--telescope MSTS-04 --site South
|
|
17
34
|
|
|
18
35
|
Command Line Arguments
|
|
19
36
|
----------------------
|
|
37
|
+
run_mode (str, required)
|
|
38
|
+
Run mode, either "direct_injection" or "full_simulation".
|
|
20
39
|
telescope (str, required)
|
|
21
40
|
Telescope model name (e.g. LSTN-01, MSTN-04, SSTS-04, ...)
|
|
22
41
|
site (str, required)
|
|
23
42
|
Site name (North or South).
|
|
24
|
-
|
|
25
|
-
|
|
43
|
+
light_source (str, required)
|
|
44
|
+
Calibration light source, e.g., MSFx-FlashCam
|
|
26
45
|
number_of_events (int, optional):
|
|
27
46
|
Number of events to simulate (default: 1).
|
|
28
47
|
output_prefix (str, optional):
|
|
29
48
|
Prefix for output files (default: empty).
|
|
30
49
|
model_version (str, optional)
|
|
31
50
|
Version of the simulation model.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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.
|
|
51
|
+
array_layout_name (str, optional)
|
|
52
|
+
Name of the array layout to use (required for direct injection mode).
|
|
53
|
+
run_number (int, optional)
|
|
54
|
+
Run number to use (default: 1, required for direct injection mode).
|
|
55
|
+
telescope (str, optional)
|
|
56
|
+
Telescope name (required for full simulation mode).
|
|
46
57
|
"""
|
|
47
58
|
|
|
48
|
-
import
|
|
49
|
-
from pathlib import Path
|
|
50
|
-
|
|
51
|
-
import simtools.utils.general as gen
|
|
59
|
+
from simtools.application_control import get_application_label, startup_application
|
|
52
60
|
from simtools.configuration import configurator
|
|
53
|
-
from simtools.model.flasher_model import FlasherModel
|
|
54
|
-
from simtools.model.model_utils import initialize_simulation_models
|
|
55
61
|
from simtools.simtel.simulator_light_emission import SimulatorLightEmission
|
|
62
|
+
from simtools.simulator import Simulator
|
|
56
63
|
|
|
57
64
|
|
|
58
|
-
def _parse(
|
|
65
|
+
def _parse():
|
|
59
66
|
"""Parse command line configuration."""
|
|
60
67
|
config = configurator.Configurator(
|
|
61
|
-
label=
|
|
62
|
-
description=("Simulate flasher devices using the light emission package."),
|
|
68
|
+
label=get_application_label(__file__), description="Simulate flasher devices."
|
|
63
69
|
)
|
|
64
70
|
config.parser.add_argument(
|
|
65
|
-
"--
|
|
66
|
-
help="Flasher
|
|
71
|
+
"--run_mode",
|
|
72
|
+
help="Flasher simulation run mode",
|
|
67
73
|
type=str,
|
|
74
|
+
choices=["direct_injection", "full_simulation"],
|
|
68
75
|
required=True,
|
|
76
|
+
default="direct_injection",
|
|
69
77
|
)
|
|
70
78
|
config.parser.add_argument(
|
|
71
|
-
"--
|
|
72
|
-
help="
|
|
79
|
+
"--light_source",
|
|
80
|
+
help="Flasher device associated with a specific telescope, i.e. MSFx-FlashCam",
|
|
81
|
+
type=str,
|
|
82
|
+
required=True,
|
|
83
|
+
)
|
|
84
|
+
config.parser.add_argument(
|
|
85
|
+
"--number_of_events",
|
|
86
|
+
help="Number of flasher events to simulate",
|
|
73
87
|
type=int,
|
|
74
88
|
default=1,
|
|
75
89
|
required=False,
|
|
76
90
|
)
|
|
77
91
|
config.parser.add_argument(
|
|
78
92
|
"--output_prefix",
|
|
79
|
-
help="Prefix for output files
|
|
93
|
+
help="Prefix for output files",
|
|
80
94
|
type=str,
|
|
81
95
|
default=None,
|
|
82
96
|
required=False,
|
|
83
97
|
)
|
|
84
|
-
|
|
85
98
|
return config.initialize(
|
|
86
99
|
db_config=True,
|
|
87
|
-
simulation_model=["telescope", "model_version"],
|
|
88
|
-
|
|
100
|
+
simulation_model=["site", "layout", "telescope", "model_version"],
|
|
101
|
+
simulation_configuration={
|
|
102
|
+
"corsika_configuration": ["run_number"],
|
|
103
|
+
"sim_telarray_configuration": ["all"],
|
|
104
|
+
},
|
|
89
105
|
)
|
|
90
106
|
|
|
91
107
|
|
|
92
|
-
def flasher_configs():
|
|
93
|
-
"""Return default setup for flasher runs (no distances)."""
|
|
94
|
-
return {"light_source_setup": "layout"}
|
|
95
|
-
|
|
96
|
-
|
|
97
108
|
def main():
|
|
98
|
-
"""
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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,
|
|
109
|
+
"""Simulate flasher devices."""
|
|
110
|
+
app_context = startup_application(_parse)
|
|
111
|
+
|
|
112
|
+
app_context.logger.info(
|
|
113
|
+
f"Flasher simulation for telescope {app_context.args['telescope']} "
|
|
114
|
+
f" with light source {app_context.args['light_source']} "
|
|
115
|
+
f" ({app_context.args['number_of_events']} events, "
|
|
116
|
+
f"run mode: {app_context.args['run_mode']})"
|
|
119
117
|
)
|
|
120
118
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
logger.info("Flasher simulation completed.
|
|
119
|
+
if app_context.args["run_mode"] == "full_simulation":
|
|
120
|
+
light_source = SimulatorLightEmission(
|
|
121
|
+
light_emission_config=app_context.args,
|
|
122
|
+
db_config=app_context.db_config,
|
|
123
|
+
label=app_context.args.get("label"),
|
|
124
|
+
)
|
|
125
|
+
elif app_context.args["run_mode"] == "direct_injection":
|
|
126
|
+
light_source = Simulator(
|
|
127
|
+
args_dict=app_context.args,
|
|
128
|
+
db_config=app_context.db_config,
|
|
129
|
+
label=app_context.args.get("label"),
|
|
130
|
+
)
|
|
131
|
+
else:
|
|
132
|
+
raise ValueError(f"Unsupported run_mode: {app_context.args['run_mode']}")
|
|
133
|
+
|
|
134
|
+
light_source.simulate()
|
|
135
|
+
app_context.logger.info("Flasher simulation completed.")
|
|
138
136
|
|
|
139
137
|
|
|
140
138
|
if __name__ == "__main__":
|