gammasimtools 0.20.0__py3-none-any.whl → 0.22.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.20.0.dist-info → gammasimtools-0.22.0.dist-info}/METADATA +2 -3
- {gammasimtools-0.20.0.dist-info → gammasimtools-0.22.0.dist-info}/RECORD +313 -296
- {gammasimtools-0.20.0.dist-info → gammasimtools-0.22.0.dist-info}/entry_points.txt +3 -2
- simtools/_version.py +2 -2
- simtools/applications/calculate_incident_angles.py +1 -4
- simtools/applications/convert_all_model_parameters_from_simtel.py +1 -2
- simtools/applications/convert_model_parameter_from_simtel.py +0 -1
- simtools/applications/db_generate_compound_indexes.py +4 -17
- simtools/applications/db_upload_model_repository.py +122 -0
- simtools/applications/derive_psf_parameters.py +71 -42
- 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 +8 -185
- simtools/applications/maintain_simulation_model_add_production.py +81 -0
- simtools/applications/merge_tables.py +1 -1
- simtools/applications/plot_array_layout.py +1 -2
- simtools/applications/plot_simtel_events.py +2 -228
- simtools/applications/print_version.py +8 -7
- simtools/applications/production_derive_statistics.py +1 -2
- simtools/applications/production_generate_grid.py +1 -1
- simtools/applications/simulate_flasher.py +74 -72
- simtools/applications/simulate_illuminator.py +52 -186
- simtools/applications/{simulate_calibration_events.py → simulate_pedestals.py} +9 -55
- simtools/applications/submit_model_parameter_from_external.py +0 -1
- simtools/applications/validate_camera_efficiency.py +0 -1
- simtools/applications/validate_camera_fov.py +1 -2
- simtools/applications/validate_cumulative_psf.py +2 -3
- simtools/applications/validate_file_using_schema.py +20 -12
- simtools/applications/validate_optics.py +2 -2
- simtools/camera/camera_efficiency.py +8 -11
- simtools/configuration/commandline_parser.py +1 -7
- simtools/configuration/configurator.py +0 -2
- simtools/corsika/corsika_config.py +9 -11
- simtools/corsika/corsika_histograms.py +82 -1
- simtools/data_model/model_data_writer.py +87 -25
- simtools/data_model/schema.py +61 -2
- simtools/data_model/validate_data.py +1 -1
- simtools/db/db_handler.py +103 -48
- simtools/db/db_model_upload.py +247 -16
- simtools/io/io_handler.py +31 -83
- simtools/job_execution/job_manager.py +45 -0
- simtools/layout/array_layout_utils.py +1 -5
- simtools/model/array_model.py +93 -42
- simtools/model/model_parameter.py +20 -9
- simtools/model/model_repository.py +197 -109
- simtools/model/model_utils.py +21 -6
- simtools/model/telescope_model.py +20 -0
- simtools/production_configuration/derive_corsika_limits.py +1 -1
- simtools/ray_tracing/incident_angles.py +7 -7
- simtools/ray_tracing/mirror_panel_psf.py +1 -1
- simtools/ray_tracing/psf_parameter_optimisation.py +1106 -565
- simtools/ray_tracing/ray_tracing.py +1 -3
- simtools/reporting/docs_read_parameters.py +171 -101
- simtools/resources/array_elements.yml +26 -0
- simtools/runners/corsika_simtel_runner.py +11 -17
- simtools/runners/runner_services.py +5 -6
- 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/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_writer.py +88 -14
- simtools/simtel/simulator_array.py +44 -74
- simtools/simtel/simulator_light_emission.py +336 -629
- simtools/simtel/simulator_ray_tracing.py +2 -2
- simtools/simulator.py +46 -18
- simtools/testing/configuration.py +4 -2
- simtools/testing/sim_telarray_metadata.py +4 -4
- simtools/utils/geometry.py +34 -0
- simtools/version.py +111 -0
- simtools/{corsika/corsika_histograms_visualize.py → visualization/plot_corsika_histograms.py} +109 -0
- simtools/visualization/plot_psf.py +775 -0
- simtools/visualization/plot_simtel_events.py +284 -87
- simtools/applications/maintain_simulation_model_add_production_table.py +0 -71
- simtools/model/flasher_model.py +0 -106
- {gammasimtools-0.20.0.dist-info → gammasimtools-0.22.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.20.0.dist-info → gammasimtools-0.22.0.dist-info}/licenses/LICENSE +0 -0
- {gammasimtools-0.20.0.dist-info → gammasimtools-0.22.0.dist-info}/top_level.txt +0 -0
|
@@ -1,48 +1,59 @@
|
|
|
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
59
|
import logging
|
|
@@ -50,91 +61,82 @@ from pathlib import Path
|
|
|
50
61
|
|
|
51
62
|
import simtools.utils.general as gen
|
|
52
63
|
from simtools.configuration import configurator
|
|
53
|
-
from simtools.model.flasher_model import FlasherModel
|
|
54
|
-
from simtools.model.model_utils import initialize_simulation_models
|
|
55
64
|
from simtools.simtel.simulator_light_emission import SimulatorLightEmission
|
|
65
|
+
from simtools.simulator import Simulator
|
|
56
66
|
|
|
57
67
|
|
|
58
68
|
def _parse(label):
|
|
59
69
|
"""Parse command line configuration."""
|
|
60
|
-
config = configurator.Configurator(
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
config = configurator.Configurator(label=label, description="Simulate flasher devices.")
|
|
71
|
+
config.parser.add_argument(
|
|
72
|
+
"--run_mode",
|
|
73
|
+
help="Flasher simulation run mode",
|
|
74
|
+
type=str,
|
|
75
|
+
choices=["direct_injection", "full_simulation"],
|
|
76
|
+
required=True,
|
|
77
|
+
default="direct_injection",
|
|
63
78
|
)
|
|
64
79
|
config.parser.add_argument(
|
|
65
|
-
"--
|
|
66
|
-
help="Flasher device
|
|
80
|
+
"--light_source",
|
|
81
|
+
help="Flasher device associated with a specific telescope, i.e. MSFx-FlashCam",
|
|
67
82
|
type=str,
|
|
68
83
|
required=True,
|
|
69
84
|
)
|
|
70
85
|
config.parser.add_argument(
|
|
71
|
-
"--
|
|
72
|
-
help="Number of
|
|
86
|
+
"--number_of_events",
|
|
87
|
+
help="Number of flasher events to simulate",
|
|
73
88
|
type=int,
|
|
74
89
|
default=1,
|
|
75
90
|
required=False,
|
|
76
91
|
)
|
|
77
92
|
config.parser.add_argument(
|
|
78
93
|
"--output_prefix",
|
|
79
|
-
help="Prefix for output files
|
|
94
|
+
help="Prefix for output files",
|
|
80
95
|
type=str,
|
|
81
96
|
default=None,
|
|
82
97
|
required=False,
|
|
83
98
|
)
|
|
84
|
-
|
|
85
99
|
return config.initialize(
|
|
86
100
|
db_config=True,
|
|
87
|
-
simulation_model=["telescope", "model_version"],
|
|
88
|
-
|
|
101
|
+
simulation_model=["site", "layout", "telescope", "model_version"],
|
|
102
|
+
simulation_configuration={
|
|
103
|
+
"corsika_configuration": ["run_number"],
|
|
104
|
+
"sim_telarray_configuration": ["all"],
|
|
105
|
+
},
|
|
89
106
|
)
|
|
90
107
|
|
|
91
108
|
|
|
92
|
-
def flasher_configs():
|
|
93
|
-
"""Return default setup for flasher runs (no distances)."""
|
|
94
|
-
return {"light_source_setup": "layout"}
|
|
95
|
-
|
|
96
|
-
|
|
97
109
|
def main():
|
|
98
|
-
"""
|
|
110
|
+
"""Simulate flasher devices."""
|
|
99
111
|
label = Path(__file__).stem
|
|
100
|
-
logger = logging.getLogger(__name__)
|
|
101
112
|
|
|
102
113
|
args_dict, db_config = _parse(label)
|
|
114
|
+
logger = logging.getLogger()
|
|
103
115
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
104
116
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
telescope_name=args_dict["telescope"],
|
|
110
|
-
model_version=args_dict["model_version"],
|
|
117
|
+
logger.info(
|
|
118
|
+
f"Flasher simulation for telescope {args_dict['telescope']} "
|
|
119
|
+
f" with light source {args_dict['light_source']} "
|
|
120
|
+
f" ({args_dict['number_of_events']} events, run mode: {args_dict['run_mode']})"
|
|
111
121
|
)
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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.")
|
|
123
|
+
if args_dict["run_mode"] == "full_simulation":
|
|
124
|
+
light_source = SimulatorLightEmission(
|
|
125
|
+
light_emission_config=args_dict,
|
|
126
|
+
db_config=db_config,
|
|
127
|
+
label=args_dict.get("label"),
|
|
128
|
+
)
|
|
129
|
+
elif args_dict["run_mode"] == "direct_injection":
|
|
130
|
+
light_source = Simulator(
|
|
131
|
+
args_dict=args_dict,
|
|
132
|
+
db_config=db_config,
|
|
133
|
+
label=args_dict.get("label"),
|
|
134
|
+
)
|
|
135
|
+
else:
|
|
136
|
+
raise ValueError(f"Unsupported run_mode: {args_dict['run_mode']}")
|
|
137
|
+
|
|
138
|
+
light_source.simulate()
|
|
139
|
+
logger.info("Flasher simulation completed.")
|
|
138
140
|
|
|
139
141
|
|
|
140
142
|
if __name__ == "__main__":
|
|
@@ -1,116 +1,63 @@
|
|
|
1
1
|
#!/usr/bin/python3
|
|
2
2
|
|
|
3
3
|
r"""
|
|
4
|
-
Simulate
|
|
4
|
+
Simulate illuminator (distant calibration light source).
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Illuminators are calibration light sources not attached to a particular telescope.
|
|
7
|
+
Two types of illuminators are supported:
|
|
8
8
|
|
|
9
|
-
1. Illuminator at
|
|
10
|
-
|
|
9
|
+
1. Illuminator as foreseen at CTAO with fixed positions as defined in the simulation models
|
|
10
|
+
database.
|
|
11
|
+
2. Illuminator at a configurable position relative to the array center. Note that in this case
|
|
12
|
+
the telescope pointing is fixed towards zenith.
|
|
11
13
|
|
|
12
14
|
Example Usage
|
|
13
15
|
-------------
|
|
14
16
|
|
|
15
|
-
1. Simulate
|
|
17
|
+
1. Simulate illuminator with positions as defined in the simulation models database:
|
|
16
18
|
|
|
17
19
|
.. code-block:: console
|
|
18
20
|
|
|
19
|
-
simtools-simulate-illuminator --
|
|
20
|
-
--
|
|
21
|
+
simtools-simulate-illuminator --light_source ILLN-01 \
|
|
22
|
+
--telescope MSTN-04 --site North \
|
|
21
23
|
--model_version 6.0.0
|
|
22
24
|
|
|
23
|
-
2. Simulate
|
|
25
|
+
2. Simulate at a configurable position (1km above array center) and pointing downwards:
|
|
24
26
|
|
|
25
27
|
.. code-block:: console
|
|
26
28
|
|
|
27
|
-
simtools-simulate-illuminator --
|
|
28
|
-
--
|
|
29
|
+
simtools-simulate-illuminator --light_source ILLN-01 \
|
|
30
|
+
--light_source_position 0. 0. 1000. \
|
|
31
|
+
--light_source_pointing 0. 0. -1. \
|
|
32
|
+
--telescope MSTN-15 --site North \
|
|
29
33
|
--model_version 6.0.0
|
|
30
34
|
|
|
31
35
|
Command Line Arguments
|
|
32
36
|
----------------------
|
|
37
|
+
light_source (str, optional)
|
|
38
|
+
Illuminator in array, e.g., ILLN-01.
|
|
39
|
+
number_of_events (int, optional)
|
|
40
|
+
Number of events to simulate.
|
|
33
41
|
telescope (str, required)
|
|
34
42
|
Telescope model name (e.g. LSTN-01, SSTS-design, SSTS-25, ...)
|
|
35
43
|
site (str, required)
|
|
36
44
|
Site name (North or South).
|
|
37
|
-
illuminator (str, optional)
|
|
38
|
-
Illuminator in array, e.g., ILLN-01.
|
|
39
|
-
light_source_setup (str, optional)
|
|
40
|
-
Select calibration light source positioning/setup:
|
|
41
|
-
- "variable" for varying distances.
|
|
42
|
-
- "layout" for actual telescope positions.
|
|
43
45
|
model_version (str, optional)
|
|
44
46
|
Version of the simulation model.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-------
|
|
53
|
-
|
|
54
|
-
Simulate isotropic light source at different distances for the MSTN-04:
|
|
55
|
-
|
|
56
|
-
.. code-block:: console
|
|
57
|
-
|
|
58
|
-
simtools-simulate-illuminator --telescope MSTN-04 --site North \
|
|
59
|
-
--illuminator ILLN-01 --light_source_setup variable \
|
|
60
|
-
--model_version 6.0.0 ```
|
|
61
|
-
|
|
62
|
-
Expected Output:
|
|
63
|
-
|
|
64
|
-
.. code-block:: console
|
|
65
|
-
|
|
66
|
-
light-emission package stage:
|
|
67
|
-
File '/workdir/external/simtools/simtools-output/light_emission/model/
|
|
68
|
-
atmprof_ecmwf_north_winter_fixed.dat' registered for atmospheric profile 99.
|
|
69
|
-
Atmospheric profile 99 to be read from file '/workdir/external/simtools/
|
|
70
|
-
simtools-output/light_emission/model/atmprof_ecmwf_north_winter_fixed.dat'.
|
|
71
|
-
Atmospheric profile 99 with 55 levels read from file /workdir/external/
|
|
72
|
-
simtools/simtools-output/light_emission/model/atmprof_ecmwf_north_winter_fixed.dat
|
|
73
|
-
Initialize atmosphere ranging from 0.000 to 120.000 km a.s.l.
|
|
74
|
-
IACT control parameter line: print_events 999 10 100 1000 0
|
|
75
|
-
Case 1: 1 event with 1e+10 photons.
|
|
76
|
-
Using IACT/ATMO package version 1.67 (2023-11-10) for CORSIKA 6.999
|
|
77
|
-
Output file /workdir/external/simtools/simtools-output/light_emission/xyzls.iact.gz
|
|
78
|
-
not yet created.
|
|
79
|
-
Telescope output file: '/workdir/external/simtools/simtools-output/
|
|
80
|
-
light_emission/xyzls.iact.gz'
|
|
81
|
-
....
|
|
82
|
-
....
|
|
83
|
-
Sim_telarray stage:
|
|
84
|
-
Telescope 1 triggered (1/0/0/0, mask 1), summation from 36 to 95 of 105
|
|
85
|
-
Event end data has been found.
|
|
86
|
-
Shower of 0.0000 TeV energy was seen in 1 of 1 cases.
|
|
87
|
-
Photon statistics:
|
|
88
|
-
All photons: 928518
|
|
89
|
-
Used photons: 928518
|
|
90
|
-
Not absorbed/max. Q.E.: 189560
|
|
91
|
-
Reflected on mirror: 26815
|
|
92
|
-
Camera hit: 25574
|
|
93
|
-
Pixel hit: 25574
|
|
94
|
-
Detected: 20998
|
|
95
|
-
Trigger statistics:
|
|
96
|
-
Tel. triggered: 1
|
|
97
|
-
Tel. + array: 1
|
|
98
|
-
Early readout: 0
|
|
99
|
-
Late readout: 0
|
|
100
|
-
Finish data conversion ...
|
|
101
|
-
Writing 13 histograms to output file.
|
|
102
|
-
|
|
47
|
+
light_source_position (float, float, float, optional)
|
|
48
|
+
Light source position (x,y,z) relative to the array center (ground coordinates) in
|
|
49
|
+
m. If not set, the position from the simulation model is used.
|
|
50
|
+
light_source_pointing (float, float, float, optional)
|
|
51
|
+
Light source pointing direction. If not set, the pointing from the simulation model is used.
|
|
52
|
+
output_prefix (str, optional)
|
|
53
|
+
Prefix for output files (default: empty).
|
|
103
54
|
"""
|
|
104
55
|
|
|
105
56
|
import logging
|
|
106
57
|
from pathlib import Path
|
|
107
58
|
|
|
108
|
-
import astropy.units as u
|
|
109
|
-
|
|
110
59
|
import simtools.utils.general as gen
|
|
111
60
|
from simtools.configuration import configurator
|
|
112
|
-
from simtools.model.calibration_model import CalibrationModel
|
|
113
|
-
from simtools.model.model_utils import initialize_simulation_models
|
|
114
61
|
from simtools.simtel.simulator_light_emission import SimulatorLightEmission
|
|
115
62
|
|
|
116
63
|
|
|
@@ -119,41 +66,38 @@ def _parse(label):
|
|
|
119
66
|
config = configurator.Configurator(
|
|
120
67
|
label=label,
|
|
121
68
|
description=(
|
|
122
|
-
"Simulate
|
|
69
|
+
"Simulate light emission by a calibration light source (not attached to a telescope)."
|
|
123
70
|
),
|
|
124
71
|
)
|
|
125
72
|
config.parser.add_argument(
|
|
126
|
-
"--
|
|
127
|
-
help="
|
|
128
|
-
type=float,
|
|
129
|
-
default=0.0,
|
|
130
|
-
required=False,
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
config.parser.add_argument(
|
|
134
|
-
"--light_source_setup",
|
|
135
|
-
help="Select calibration light source positioning/setup: \
|
|
136
|
-
varying distances (variable), layout positions (layout)",
|
|
73
|
+
"--light_source",
|
|
74
|
+
help="Illuminator name, i.e. ILLN-design",
|
|
137
75
|
type=str,
|
|
138
|
-
choices=["layout", "variable"],
|
|
139
76
|
default=None,
|
|
140
77
|
required=True,
|
|
141
78
|
)
|
|
142
|
-
config.parser.
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
79
|
+
configurable_light_source_args = config.parser.add_argument_group(
|
|
80
|
+
"Configurable light source position and pointing (override simulation model values)"
|
|
81
|
+
)
|
|
82
|
+
configurable_light_source_args.add_argument(
|
|
83
|
+
"--light_source_position",
|
|
84
|
+
help="Light source position (x,y,z) relative to the array center (ground coordinates) in m",
|
|
85
|
+
metavar=("X", "Y", "Z"),
|
|
86
|
+
nargs=3,
|
|
146
87
|
required=False,
|
|
147
88
|
)
|
|
148
|
-
|
|
149
|
-
"--
|
|
150
|
-
help=
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
89
|
+
configurable_light_source_args.add_argument(
|
|
90
|
+
"--light_source_pointing",
|
|
91
|
+
help=(
|
|
92
|
+
"Light source pointing direction "
|
|
93
|
+
"(Example for pointing downwards: --light_source_pointing 0 0 -1)"
|
|
94
|
+
),
|
|
95
|
+
metavar=("X", "Y", "Z"),
|
|
96
|
+
nargs=3,
|
|
97
|
+
required=False,
|
|
154
98
|
)
|
|
155
99
|
config.parser.add_argument(
|
|
156
|
-
"--
|
|
100
|
+
"--number_of_events",
|
|
157
101
|
help="Number of events to simulate",
|
|
158
102
|
type=int,
|
|
159
103
|
default=1,
|
|
@@ -173,98 +117,20 @@ def _parse(label):
|
|
|
173
117
|
)
|
|
174
118
|
|
|
175
119
|
|
|
176
|
-
def light_emission_configs(args_dict):
|
|
177
|
-
"""
|
|
178
|
-
Define default light emission configurations.
|
|
179
|
-
|
|
180
|
-
Predefined angular distribution names not requiring to read any table are
|
|
181
|
-
"Isotropic", "Gauss:<rms>", "Rayleigh", "Cone:<angle>", and "FilledCone:<angle>", "Parallel",
|
|
182
|
-
with all angles given in degrees, all with respect to the given direction vector
|
|
183
|
-
(vertically downwards if missing). If the light source has a non-zero length and velocity
|
|
184
|
-
(in units of the vacuum speed of light), it is handled as a moving source,
|
|
185
|
-
in the given direction.
|
|
186
|
-
|
|
187
|
-
Parameters
|
|
188
|
-
----------
|
|
189
|
-
args_dict: dict
|
|
190
|
-
Dictionary with command line arguments.
|
|
191
|
-
|
|
192
|
-
args_dict: dict
|
|
193
|
-
Dictionary with command line arguments.
|
|
194
|
-
|
|
195
|
-
Returns
|
|
196
|
-
-------
|
|
197
|
-
default_config: dict
|
|
198
|
-
Default light emission configuration.
|
|
199
|
-
"""
|
|
200
|
-
if args_dict["light_source_setup"] == "variable":
|
|
201
|
-
cfg = {
|
|
202
|
-
"x_pos": {"len": 1, "unit": u.Unit("cm"), "default": 0 * u.cm, "names": ["x_position"]},
|
|
203
|
-
"y_pos": {"len": 1, "unit": u.Unit("cm"), "default": 0 * u.cm, "names": ["y_position"]},
|
|
204
|
-
"z_pos": {
|
|
205
|
-
"len": 1,
|
|
206
|
-
"unit": u.Unit("cm"),
|
|
207
|
-
"default": [i * 100 for i in [200, 300, 400, 600, 800, 1200, 2000, 4000]] * u.cm,
|
|
208
|
-
"names": ["z_position"],
|
|
209
|
-
},
|
|
210
|
-
"direction": {
|
|
211
|
-
"len": 3,
|
|
212
|
-
"unit": u.dimensionless_unscaled,
|
|
213
|
-
"default": [0, 0, -1],
|
|
214
|
-
"names": ["direction", "cx,cy,cz"],
|
|
215
|
-
},
|
|
216
|
-
}
|
|
217
|
-
args_dict.update(cfg)
|
|
218
|
-
return args_dict
|
|
219
|
-
return args_dict
|
|
220
|
-
|
|
221
|
-
|
|
222
120
|
def main():
|
|
223
|
-
"""Simulate light emission."""
|
|
121
|
+
"""Simulate light emission from illuminator."""
|
|
224
122
|
label = Path(__file__).stem
|
|
123
|
+
|
|
225
124
|
args_dict, db_config = _parse(label)
|
|
226
|
-
light_emission_config = light_emission_configs(args_dict)
|
|
227
|
-
print(light_emission_config)
|
|
228
125
|
logger = logging.getLogger()
|
|
229
126
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
230
127
|
|
|
231
|
-
telescope_model, site_model = initialize_simulation_models(
|
|
232
|
-
label=label,
|
|
233
|
-
db_config=db_config,
|
|
234
|
-
site=args_dict["site"],
|
|
235
|
-
telescope_name=args_dict["telescope"],
|
|
236
|
-
model_version=args_dict["model_version"],
|
|
237
|
-
)
|
|
238
|
-
|
|
239
|
-
calibration_model = CalibrationModel(
|
|
240
|
-
site=args_dict["site"],
|
|
241
|
-
calibration_device_model_name=args_dict["illuminator"],
|
|
242
|
-
mongo_db_config=db_config,
|
|
243
|
-
model_version=args_dict["model_version"],
|
|
244
|
-
label=label,
|
|
245
|
-
)
|
|
246
|
-
|
|
247
128
|
light_source = SimulatorLightEmission(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
site_model=site_model,
|
|
251
|
-
light_emission_config=light_emission_config,
|
|
252
|
-
light_source_setup=args_dict["light_source_setup"],
|
|
253
|
-
simtel_path=args_dict["simtel_path"],
|
|
254
|
-
light_source_type="illuminator",
|
|
129
|
+
light_emission_config=args_dict,
|
|
130
|
+
db_config=db_config,
|
|
255
131
|
label=label,
|
|
256
|
-
test=args_dict["test"],
|
|
257
132
|
)
|
|
258
|
-
|
|
259
|
-
if args_dict["light_source_setup"] == "variable":
|
|
260
|
-
outputs = light_source.simulate_variable_distances(args_dict)
|
|
261
|
-
elif args_dict["light_source_setup"] == "layout":
|
|
262
|
-
outputs = light_source.simulate_layout_positions(args_dict)
|
|
263
|
-
else:
|
|
264
|
-
outputs = []
|
|
265
|
-
|
|
266
|
-
if outputs:
|
|
267
|
-
logger.info("Simulation outputs:\n%s", "\n".join(str(p) for p in outputs))
|
|
133
|
+
light_source.simulate()
|
|
268
134
|
|
|
269
135
|
|
|
270
136
|
if __name__ == "__main__":
|
|
@@ -1,47 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/python3
|
|
2
2
|
|
|
3
3
|
r"""
|
|
4
|
-
Simulate
|
|
4
|
+
Simulate pedestal events.
|
|
5
5
|
|
|
6
|
-
Use sim_telarray to simulate
|
|
7
|
-
The following types
|
|
6
|
+
Use sim_telarray to simulate pedestal events for an array of telescopes.
|
|
7
|
+
The following types are supported:
|
|
8
8
|
|
|
9
9
|
* Pedestal events (includes night-sky background and camera noise)
|
|
10
10
|
* Dark pedestal events (closed camera lid, camera noise only)
|
|
11
|
-
*
|
|
11
|
+
* NSB-only pedestal events (open camera lid, night-sky background only, no camera noise)
|
|
12
12
|
|
|
13
13
|
Example
|
|
14
14
|
-------
|
|
15
15
|
|
|
16
|
-
Simulate pedestal events for
|
|
16
|
+
Simulate pedestal events for Alpha North. The assumed level night-sky background is 2.0 times the
|
|
17
17
|
nominal value. A list of stars can be provided to simulate additional contributions.
|
|
18
18
|
|
|
19
19
|
.. code-block:: console
|
|
20
20
|
|
|
21
|
-
simtools-simulate-
|
|
21
|
+
simtools-simulate-pedestals --run_mode=pedestals \\
|
|
22
22
|
--run_number 10 --number_of_events 1000 \\
|
|
23
23
|
--array_layout_name alpha --site North \\
|
|
24
24
|
--model_version 6.0.0 \\
|
|
25
25
|
--zenith_angle 20 --azimuth_angle 0 \\
|
|
26
26
|
--nsb_scaling_factor 2.0
|
|
27
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
28
|
|
|
41
29
|
Command Line Arguments
|
|
42
30
|
----------------------
|
|
43
31
|
run_mode (str, required)
|
|
44
|
-
Run mode, e.g. "pedestals"
|
|
32
|
+
Run mode, e.g. "pedestals"
|
|
45
33
|
run_number (int, required)
|
|
46
34
|
Run number for the simulation.
|
|
47
35
|
number_of_events (int, required)
|
|
@@ -64,15 +52,6 @@ zenith_angle (float, optional)
|
|
|
64
52
|
Zenith angle in degrees.
|
|
65
53
|
azimuth_angle (float, optional)
|
|
66
54
|
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
55
|
"""
|
|
77
56
|
|
|
78
57
|
import logging
|
|
@@ -91,11 +70,11 @@ def _parse(label):
|
|
|
91
70
|
help="Calibration run mode",
|
|
92
71
|
type=str,
|
|
93
72
|
required=True,
|
|
94
|
-
choices=["pedestals", "dark_pedestals", "nsb_only_pedestals"
|
|
73
|
+
choices=["pedestals", "dark_pedestals", "nsb_only_pedestals"],
|
|
95
74
|
)
|
|
96
75
|
config.parser.add_argument(
|
|
97
76
|
"--number_of_events",
|
|
98
|
-
help="Number of
|
|
77
|
+
help="Number of pedestal events to simulate",
|
|
99
78
|
type=int,
|
|
100
79
|
required=True,
|
|
101
80
|
)
|
|
@@ -115,31 +94,6 @@ def _parse(label):
|
|
|
115
94
|
type=str,
|
|
116
95
|
default=None,
|
|
117
96
|
)
|
|
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
97
|
|
|
144
98
|
return config.initialize(
|
|
145
99
|
db_config=True,
|
|
@@ -120,7 +120,6 @@ def main(): # noqa: D103
|
|
|
120
120
|
parameter_version=args_dict["parameter_version"],
|
|
121
121
|
output_file=Path(args_dict["parameter"] + "-" + args_dict["parameter_version"] + ".json"),
|
|
122
122
|
output_path=output_path,
|
|
123
|
-
use_plain_output_path=args_dict.get("use_plain_output_path"),
|
|
124
123
|
metadata_input_dict=args_dict,
|
|
125
124
|
db_config=db_config if args_dict.get("check_parameter_version") else None,
|
|
126
125
|
)
|
|
@@ -129,7 +129,6 @@ def main(): # noqa: D103
|
|
|
129
129
|
parameter_version=args_dict.get("parameter_version", "0.0.0"),
|
|
130
130
|
output_file=Path(f"nsb_pixel_rate-{args_dict.get('parameter_version', '0.0.0')}.json"),
|
|
131
131
|
output_path=Path(args_dict["output_path"]) / args_dict["telescope"] / "nsb_pixel_rate",
|
|
132
|
-
use_plain_output_path=args_dict.get("use_plain_output_path"),
|
|
133
132
|
)
|
|
134
133
|
|
|
135
134
|
|
|
@@ -94,9 +94,8 @@ def main(): # noqa: D103
|
|
|
94
94
|
logger = logging.getLogger()
|
|
95
95
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
96
96
|
|
|
97
|
-
# Output directory to save files related directly to this app
|
|
98
97
|
_io_handler = io_handler.IOHandler()
|
|
99
|
-
output_dir = _io_handler.get_output_directory(
|
|
98
|
+
output_dir = _io_handler.get_output_directory()
|
|
100
99
|
|
|
101
100
|
tel_model = TelescopeModel(
|
|
102
101
|
site=args_dict["site"],
|