gammasimtools 0.21.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.21.0.dist-info → gammasimtools-0.22.0.dist-info}/METADATA +2 -3
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.22.0.dist-info}/RECORD +311 -295
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.22.0.dist-info}/entry_points.txt +2 -1
- 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 +3 -16
- simtools/applications/db_upload_model_repository.py +122 -0
- simtools/applications/derive_psf_parameters.py +13 -3
- 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/maintain_simulation_model_add_production.py +7 -31
- simtools/applications/merge_tables.py +1 -1
- simtools/applications/plot_array_layout.py +1 -2
- simtools/applications/print_version.py +1 -1
- 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 +1 -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 +58 -37
- simtools/db/db_model_upload.py +210 -5
- 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 +139 -106
- 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 +180 -73
- 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 +87 -13
- 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 +45 -14
- simtools/testing/configuration.py +4 -2
- simtools/testing/sim_telarray_metadata.py +4 -4
- simtools/utils/geometry.py +34 -0
- simtools/version.py +22 -0
- simtools/visualization/plot_psf.py +163 -61
- simtools/visualization/plot_simtel_events.py +1 -1
- simtools/model/flasher_model.py +0 -106
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.22.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.22.0.dist-info}/licenses/LICENSE +0 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.22.0.dist-info}/top_level.txt +0 -0
|
@@ -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"],
|
|
@@ -132,11 +132,10 @@ def main(): # noqa: D103
|
|
|
132
132
|
logger = logging.getLogger()
|
|
133
133
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
134
134
|
|
|
135
|
-
# Output directory to save files related directly to this app
|
|
136
135
|
_io_handler = io_handler.IOHandler()
|
|
137
|
-
output_dir = _io_handler.get_output_directory(
|
|
136
|
+
output_dir = _io_handler.get_output_directory()
|
|
138
137
|
|
|
139
|
-
tel_model, site_model = initialize_simulation_models(
|
|
138
|
+
tel_model, site_model, _ = initialize_simulation_models(
|
|
140
139
|
label=label,
|
|
141
140
|
db_config=db_config,
|
|
142
141
|
site=args_dict["site"],
|
|
@@ -61,12 +61,15 @@ def _parse(label, description):
|
|
|
61
61
|
|
|
62
62
|
"""
|
|
63
63
|
config = configurator.Configurator(label=label, description=description)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
config.parser.add_argument(
|
|
65
|
+
"--file_name",
|
|
66
|
+
help="File to be validated (full path or name pattern, e.g., '*.json')",
|
|
67
|
+
default="*.json",
|
|
68
|
+
)
|
|
69
|
+
config.parser.add_argument(
|
|
67
70
|
"--file_directory",
|
|
68
71
|
help=(
|
|
69
|
-
"Directory with
|
|
72
|
+
"Directory with files to be validated. "
|
|
70
73
|
"If no schema file is provided, the assumption is that model "
|
|
71
74
|
"parameters are validated and the schema files are taken from "
|
|
72
75
|
f"{MODEL_PARAMETER_SCHEMA_PATH}."
|
|
@@ -84,6 +87,11 @@ def _parse(label, description):
|
|
|
84
87
|
help="Require exact data type for validation",
|
|
85
88
|
action="store_true",
|
|
86
89
|
)
|
|
90
|
+
config.parser.add_argument(
|
|
91
|
+
"--ignore_software_version",
|
|
92
|
+
help="Ignore software version check.",
|
|
93
|
+
action="store_true",
|
|
94
|
+
)
|
|
87
95
|
return config.initialize(paths=False)
|
|
88
96
|
|
|
89
97
|
|
|
@@ -115,11 +123,11 @@ def _get_schema_file_name(args_dict, data_dict=None):
|
|
|
115
123
|
return schema_file
|
|
116
124
|
|
|
117
125
|
|
|
118
|
-
def
|
|
119
|
-
"""Return list of
|
|
126
|
+
def _get_file_list(file_directory=None, file_name="*.json"):
|
|
127
|
+
"""Return list of files in a directory."""
|
|
120
128
|
file_list = []
|
|
121
129
|
if file_directory is not None:
|
|
122
|
-
file_list = list(Path(file_directory).rglob(
|
|
130
|
+
file_list = list(Path(file_directory).rglob(file_name))
|
|
123
131
|
if not file_list:
|
|
124
132
|
raise FileNotFoundError(f"No files found in {file_directory}")
|
|
125
133
|
elif file_name is not None:
|
|
@@ -137,9 +145,7 @@ def validate_dict_using_schema(args_dict, logger):
|
|
|
137
145
|
the metadata section of the data dictionary.
|
|
138
146
|
|
|
139
147
|
"""
|
|
140
|
-
for file_name in
|
|
141
|
-
args_dict.get("file_directory"), args_dict.get("file_name")
|
|
142
|
-
):
|
|
148
|
+
for file_name in _get_file_list(args_dict.get("file_directory"), args_dict.get("file_name")):
|
|
143
149
|
try:
|
|
144
150
|
data = ascii_handler.collect_data_from_file(file_name=file_name)
|
|
145
151
|
except FileNotFoundError as exc:
|
|
@@ -148,7 +154,9 @@ def validate_dict_using_schema(args_dict, logger):
|
|
|
148
154
|
try:
|
|
149
155
|
for data_dict in data:
|
|
150
156
|
schema.validate_dict_using_schema(
|
|
151
|
-
data_dict,
|
|
157
|
+
data_dict,
|
|
158
|
+
_get_schema_file_name(args_dict, data_dict),
|
|
159
|
+
ignore_software_version=args_dict.get("ignore_software_version", False),
|
|
152
160
|
)
|
|
153
161
|
except Exception as exc:
|
|
154
162
|
raise ValueError(f"Validation of file {file_name} failed") from exc
|
|
@@ -159,7 +167,7 @@ def validate_data_files(args_dict, logger):
|
|
|
159
167
|
"""Validate data files."""
|
|
160
168
|
if args_dict.get("file_directory") is not None:
|
|
161
169
|
tmp_args_dict = {}
|
|
162
|
-
for file_name in
|
|
170
|
+
for file_name in _get_file_list(args_dict.get("file_directory")):
|
|
163
171
|
tmp_args_dict["file_name"] = file_name
|
|
164
172
|
parameter_name = re.sub(r"-\d+\.\d+\.\d+", "", file_name.stem)
|
|
165
173
|
schema_file = schema.get_model_parameter_schema_file(f"{parameter_name}")
|
|
@@ -126,9 +126,9 @@ def main(): # noqa: D103
|
|
|
126
126
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
127
127
|
|
|
128
128
|
_io_handler = io_handler.IOHandler()
|
|
129
|
-
output_dir = _io_handler.get_output_directory(
|
|
129
|
+
output_dir = _io_handler.get_output_directory()
|
|
130
130
|
|
|
131
|
-
tel_model, site_model = initialize_simulation_models(
|
|
131
|
+
tel_model, site_model, _ = initialize_simulation_models(
|
|
132
132
|
label=label,
|
|
133
133
|
db_config=db_config,
|
|
134
134
|
site=args_dict["site"],
|
|
@@ -40,14 +40,14 @@ class CameraEfficiency:
|
|
|
40
40
|
self.label = label
|
|
41
41
|
|
|
42
42
|
self.io_handler = io_handler.IOHandler()
|
|
43
|
-
self.telescope_model, self.site_model = initialize_simulation_models(
|
|
44
|
-
self.label,
|
|
45
|
-
db_config,
|
|
46
|
-
config_data["
|
|
47
|
-
config_data["
|
|
48
|
-
config_data["
|
|
43
|
+
self.telescope_model, self.site_model, _ = initialize_simulation_models(
|
|
44
|
+
label=self.label,
|
|
45
|
+
db_config=db_config,
|
|
46
|
+
model_version=config_data["model_version"],
|
|
47
|
+
site=config_data["site"],
|
|
48
|
+
telescope_name=config_data["telescope"],
|
|
49
49
|
)
|
|
50
|
-
self.output_dir = self.io_handler.get_output_directory(
|
|
50
|
+
self.output_dir = self.io_handler.get_output_directory()
|
|
51
51
|
|
|
52
52
|
self._results = None
|
|
53
53
|
self._has_results = False
|
|
@@ -101,10 +101,7 @@ class CameraEfficiency:
|
|
|
101
101
|
label=self.label,
|
|
102
102
|
)
|
|
103
103
|
|
|
104
|
-
_file[label] = self.io_handler.get_output_directory(
|
|
105
|
-
label=self.label,
|
|
106
|
-
sub_dir="camera_efficiency",
|
|
107
|
-
).joinpath(file_name)
|
|
104
|
+
_file[label] = self.io_handler.get_output_directory().joinpath(file_name)
|
|
108
105
|
return _file
|
|
109
106
|
|
|
110
107
|
def simulate(self):
|
|
@@ -21,7 +21,7 @@ class CommandLineParser(argparse.ArgumentParser):
|
|
|
21
21
|
|
|
22
22
|
Wrapper around standard python argparse.ArgumentParser.
|
|
23
23
|
|
|
24
|
-
Command line arguments should be given in snake_case, e.g.
|
|
24
|
+
Command line arguments should be given in snake_case, e.g. 'input_meta'.
|
|
25
25
|
|
|
26
26
|
Parameters
|
|
27
27
|
----------
|
|
@@ -102,12 +102,6 @@ class CommandLineParser(argparse.ArgumentParser):
|
|
|
102
102
|
default="./simtools-output/",
|
|
103
103
|
required=False,
|
|
104
104
|
)
|
|
105
|
-
_job_group.add_argument(
|
|
106
|
-
"--use_plain_output_path",
|
|
107
|
-
help="use plain output path (without the tool name and dates)",
|
|
108
|
-
action="store_true",
|
|
109
|
-
required=False,
|
|
110
|
-
)
|
|
111
105
|
_job_group.add_argument(
|
|
112
106
|
"--model_path",
|
|
113
107
|
help="path pointing towards simulation model file directory",
|
|
@@ -340,8 +340,6 @@ class Configurator:
|
|
|
340
340
|
_io_handler = io_handler.IOHandler()
|
|
341
341
|
_io_handler.set_paths(
|
|
342
342
|
output_path=self.config.get("output_path", None),
|
|
343
|
-
use_plain_output_path=self.config.get("use_plain_output_path", False),
|
|
344
|
-
data_path=self.config.get("data_path", None),
|
|
345
343
|
model_path=self.config.get("model_path", None),
|
|
346
344
|
)
|
|
347
345
|
|