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
|
@@ -16,9 +16,11 @@ from simtools.db import db_handler
|
|
|
16
16
|
from simtools.io import ascii_handler, io_handler
|
|
17
17
|
from simtools.model.telescope_model import TelescopeModel
|
|
18
18
|
from simtools.utils import names
|
|
19
|
+
from simtools.version import sort_versions
|
|
19
20
|
from simtools.visualization import plot_pixels, plot_tables
|
|
20
21
|
|
|
21
22
|
logger = logging.getLogger()
|
|
23
|
+
MARKDOWN_LINK_RE = re.compile(r"\[([^\]]+)\]\(([^)]+)\)")
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
class ReadParameters:
|
|
@@ -64,7 +66,7 @@ class ReadParameters:
|
|
|
64
66
|
)
|
|
65
67
|
self._model_version = model_version
|
|
66
68
|
|
|
67
|
-
def _generate_plots(self, parameter, parameter_version, input_file, outpath
|
|
69
|
+
def _generate_plots(self, parameter, parameter_version, input_file, outpath):
|
|
68
70
|
"""Generate plots based on the parameter type."""
|
|
69
71
|
plot_names = []
|
|
70
72
|
|
|
@@ -72,7 +74,9 @@ class ReadParameters:
|
|
|
72
74
|
plot_names = self._plot_camera_config(parameter, parameter_version, input_file, outpath)
|
|
73
75
|
elif parameter_version:
|
|
74
76
|
plot_names = self._plot_parameter_tables(
|
|
75
|
-
parameter,
|
|
77
|
+
parameter,
|
|
78
|
+
parameter_version,
|
|
79
|
+
outpath,
|
|
76
80
|
)
|
|
77
81
|
|
|
78
82
|
return plot_names
|
|
@@ -111,18 +115,9 @@ class ReadParameters:
|
|
|
111
115
|
|
|
112
116
|
return plot_names
|
|
113
117
|
|
|
114
|
-
def _plot_parameter_tables(self, parameter, parameter_version, outpath
|
|
118
|
+
def _plot_parameter_tables(self, parameter, parameter_version, outpath):
|
|
115
119
|
"""Generate plots for parameter tables."""
|
|
116
|
-
|
|
117
|
-
self.model_version, self.array_element, collection="telescopes"
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
if not self.array_element:
|
|
121
|
-
tel = None
|
|
122
|
-
elif not design_type:
|
|
123
|
-
tel = telescope_design
|
|
124
|
-
else:
|
|
125
|
-
tel = self.array_element
|
|
120
|
+
tel = self._get_telescope_identifier()
|
|
126
121
|
|
|
127
122
|
config_data = plot_tables.generate_plot_configurations(
|
|
128
123
|
parameter=parameter,
|
|
@@ -152,7 +147,20 @@ class ReadParameters:
|
|
|
152
147
|
|
|
153
148
|
return plot_names
|
|
154
149
|
|
|
155
|
-
def
|
|
150
|
+
def _get_telescope_identifier(self, model_version=None):
|
|
151
|
+
"""Get the appropriate telescope design type for file naming (e.g., LSTN-design)."""
|
|
152
|
+
model_version = model_version or self.model_version
|
|
153
|
+
telescope_design = self.db.get_design_model(
|
|
154
|
+
model_version, self.array_element, collection="telescopes"
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
if not self.array_element:
|
|
158
|
+
return None
|
|
159
|
+
if not names.is_design_type(self.array_element):
|
|
160
|
+
return telescope_design
|
|
161
|
+
return self.array_element
|
|
162
|
+
|
|
163
|
+
def _convert_to_md(self, parameter, parameter_version, input_file):
|
|
156
164
|
"""Convert a file to a Markdown file, preserving formatting."""
|
|
157
165
|
input_file = Path(input_file)
|
|
158
166
|
|
|
@@ -170,9 +178,7 @@ class ReadParameters:
|
|
|
170
178
|
outpath = Path(io_handler.IOHandler().get_output_directory().parent / "_images")
|
|
171
179
|
outpath.mkdir(parents=True, exist_ok=True)
|
|
172
180
|
|
|
173
|
-
plot_names = self._generate_plots(
|
|
174
|
-
parameter, parameter_version, input_file, outpath, design_type
|
|
175
|
-
)
|
|
181
|
+
plot_names = self._generate_plots(parameter, parameter_version, input_file, outpath)
|
|
176
182
|
# Write markdown file using the stored path
|
|
177
183
|
file_contents = ascii_handler.read_file_encoded_in_utf_or_latin(input_file)
|
|
178
184
|
|
|
@@ -198,7 +204,7 @@ class ReadParameters:
|
|
|
198
204
|
return relative_path
|
|
199
205
|
|
|
200
206
|
def _format_parameter_value(
|
|
201
|
-
self, parameter, value_data, unit, file_flag, parameter_version=None
|
|
207
|
+
self, parameter, value_data, unit, file_flag, parameter_version=None
|
|
202
208
|
):
|
|
203
209
|
"""Format parameter value based on type."""
|
|
204
210
|
if file_flag:
|
|
@@ -209,9 +215,7 @@ class ReadParameters:
|
|
|
209
215
|
"cta-science/simulations/simulation-model/simulation-models/-/blob/main/"
|
|
210
216
|
f"simulation-models/model_parameters/Files/{value_data})"
|
|
211
217
|
).strip()
|
|
212
|
-
output_file_name = self._convert_to_md(
|
|
213
|
-
parameter, parameter_version, input_file_name, design_type
|
|
214
|
-
)
|
|
218
|
+
output_file_name = self._convert_to_md(parameter, parameter_version, input_file_name)
|
|
215
219
|
return f"[{Path(value_data).name}]({output_file_name})".strip()
|
|
216
220
|
if isinstance(value_data, (str | int | float)):
|
|
217
221
|
return f"{value_data} {unit}".strip()
|
|
@@ -223,26 +227,6 @@ class ReadParameters:
|
|
|
223
227
|
else ", ".join(f"{v} {unit}" for v in value_data)
|
|
224
228
|
).strip()
|
|
225
229
|
|
|
226
|
-
def _wrap_at_underscores(self, text, max_width):
|
|
227
|
-
"""Wrap text at underscores to fit within a specified width."""
|
|
228
|
-
parts = text.split("_")
|
|
229
|
-
lines = []
|
|
230
|
-
current = []
|
|
231
|
-
|
|
232
|
-
for part in parts:
|
|
233
|
-
# Predict the new length if we add this part
|
|
234
|
-
next_line = "_".join([*current, part])
|
|
235
|
-
if len(next_line) <= max_width:
|
|
236
|
-
current.append(part)
|
|
237
|
-
else:
|
|
238
|
-
lines.append("_".join(current))
|
|
239
|
-
current = [part]
|
|
240
|
-
|
|
241
|
-
if current:
|
|
242
|
-
lines.append("_".join(current))
|
|
243
|
-
|
|
244
|
-
return " ".join(lines)
|
|
245
|
-
|
|
246
230
|
def _group_model_versions_by_parameter_version(self, grouped_data):
|
|
247
231
|
"""Group model versions by parameter version and track the parameter values."""
|
|
248
232
|
result = {}
|
|
@@ -265,7 +249,7 @@ class ReadParameters:
|
|
|
265
249
|
"value": data["value"],
|
|
266
250
|
"parameter_version": param_version,
|
|
267
251
|
"file_flag": data["file_flag"],
|
|
268
|
-
"model_version": ", ".join(data["model_versions"]),
|
|
252
|
+
"model_version": ", ".join(sort_versions(data["model_versions"])),
|
|
269
253
|
}
|
|
270
254
|
for param_version, data in version_grouped.items()
|
|
271
255
|
]
|
|
@@ -397,10 +381,9 @@ class ReadParameters:
|
|
|
397
381
|
if value_data is None:
|
|
398
382
|
continue
|
|
399
383
|
|
|
400
|
-
design_type = names.is_design_type(telescope_model.name)
|
|
401
384
|
file_flag = parameter_data.get("file", False)
|
|
402
385
|
value = self._format_parameter_value(
|
|
403
|
-
parameter, value_data, unit, file_flag, parameter_version
|
|
386
|
+
parameter, value_data, unit, file_flag, parameter_version
|
|
404
387
|
)
|
|
405
388
|
|
|
406
389
|
description = parameter_descriptions.get(parameter).get("description")
|
|
@@ -410,7 +393,7 @@ class ReadParameters:
|
|
|
410
393
|
inst_class = parameter_descriptions.get(parameter).get("inst_class")
|
|
411
394
|
|
|
412
395
|
matching_instrument = parameter_data["instrument"] == telescope_model.name
|
|
413
|
-
if not
|
|
396
|
+
if not names.is_design_type(telescope_model.name) and matching_instrument:
|
|
414
397
|
parameter = f"***{parameter}***"
|
|
415
398
|
parameter_version = f"***{parameter_version}***"
|
|
416
399
|
if not self.is_markdown_link(value):
|
|
@@ -453,7 +436,6 @@ class ReadParameters:
|
|
|
453
436
|
text = short_description if short_description else description
|
|
454
437
|
wrapped_text = textwrap.fill(str(text), column_widths[3]).split("\n")
|
|
455
438
|
wrapped_text = " ".join(wrapped_text)
|
|
456
|
-
parameter_name = self._wrap_at_underscores(parameter_name, column_widths[0])
|
|
457
439
|
|
|
458
440
|
file.write(
|
|
459
441
|
f"| {parameter_name:{column_widths[0]}} |"
|
|
@@ -628,33 +610,82 @@ class ReadParameters:
|
|
|
628
610
|
|
|
629
611
|
description = parameter_descriptions.get("description")
|
|
630
612
|
with output_filename.open("w", encoding="utf-8") as file:
|
|
631
|
-
# Write header
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
f"**Telescope**: {self.array_element}\n\n"
|
|
635
|
-
f"**Description**: {description}\n\n"
|
|
636
|
-
"\n"
|
|
637
|
-
)
|
|
613
|
+
# Write header and table
|
|
614
|
+
self._write_parameter_header(file, parameter, description)
|
|
615
|
+
self._write_table_rows(file, parameter, comparison_data)
|
|
638
616
|
|
|
639
|
-
#
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
"| Value |\n"
|
|
643
|
-
"|------------------------|--------------------"
|
|
644
|
-
"|----------------------|\n"
|
|
645
|
-
)
|
|
617
|
+
# If entries reference files, write the image/plot section
|
|
618
|
+
if comparison_data.get(parameter)[0]["file_flag"]:
|
|
619
|
+
self._write_file_flag_section(file, parameter, comparison_data)
|
|
646
620
|
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
621
|
+
def _write_parameter_header(self, file, parameter, description):
|
|
622
|
+
"""Write the markdown header for a parameter file."""
|
|
623
|
+
file.write(
|
|
624
|
+
f"# {parameter}\n\n"
|
|
625
|
+
f"**Telescope**: {self.array_element}\n\n"
|
|
626
|
+
f"**Description**: {description}\n\n"
|
|
627
|
+
"\n"
|
|
628
|
+
)
|
|
654
629
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
630
|
+
def _write_table_rows(self, file, parameter, comparison_data):
|
|
631
|
+
"""Write the comparison table header and rows for a parameter."""
|
|
632
|
+
# Write table header
|
|
633
|
+
file.write(
|
|
634
|
+
"| Parameter Version | Model Version(s) "
|
|
635
|
+
"| Value |\n"
|
|
636
|
+
"|------------------------|--------------------"
|
|
637
|
+
"|----------------------|\n"
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
# Write table rows
|
|
641
|
+
for item in comparison_data.get(parameter):
|
|
642
|
+
file.write(
|
|
643
|
+
f"| {item['parameter_version']} | {item['model_version']} | {item['value']} |\n"
|
|
644
|
+
)
|
|
645
|
+
|
|
646
|
+
file.write("\n")
|
|
647
|
+
|
|
648
|
+
def _write_file_flag_section(self, file, parameter, comparison_data):
|
|
649
|
+
"""Write image/plot references when parameter entries include files."""
|
|
650
|
+
outpath = Path(io_handler.IOHandler().get_output_directory().parent / "_images")
|
|
651
|
+
latest_parameter_version = max(
|
|
652
|
+
comparison_data.get(parameter),
|
|
653
|
+
key=lambda x: tuple(map(int, x["parameter_version"].split("."))),
|
|
654
|
+
)["parameter_version"]
|
|
655
|
+
|
|
656
|
+
all_model_versions = []
|
|
657
|
+
for item in comparison_data.get(parameter):
|
|
658
|
+
model_versions = item["model_version"].split(", ")
|
|
659
|
+
all_model_versions.extend(model_versions)
|
|
660
|
+
|
|
661
|
+
latest_model_version = max(all_model_versions, key=lambda x: tuple(map(int, x.split("."))))
|
|
662
|
+
tel = self._get_telescope_identifier(latest_model_version)
|
|
663
|
+
|
|
664
|
+
file.write("The latest parameter version is plotted below.\n\n")
|
|
665
|
+
|
|
666
|
+
if parameter != "camera_config_file":
|
|
667
|
+
plot_name = f"{parameter}_{latest_parameter_version}_{self.site}_{tel}"
|
|
668
|
+
image_path = outpath / f"{plot_name}.png"
|
|
669
|
+
file.write(f"})")
|
|
670
|
+
return
|
|
671
|
+
|
|
672
|
+
# camera_config_file: find latest value and convert markdown link to png filename
|
|
673
|
+
latest_value = None
|
|
674
|
+
for item in comparison_data.get(parameter):
|
|
675
|
+
if latest_model_version in item["model_version"].split(", "):
|
|
676
|
+
latest_value = item["value"]
|
|
677
|
+
break
|
|
678
|
+
|
|
679
|
+
if latest_value is None:
|
|
680
|
+
return
|
|
681
|
+
|
|
682
|
+
match = MARKDOWN_LINK_RE.search(latest_value)
|
|
683
|
+
if not match:
|
|
684
|
+
return
|
|
685
|
+
|
|
686
|
+
filename_png = Path(match.group(1)).with_suffix(".png").name
|
|
687
|
+
image_path = outpath / filename_png
|
|
688
|
+
file.write(f"})")
|
|
658
689
|
|
|
659
690
|
def _write_array_layouts_section(self, file, layouts):
|
|
660
691
|
"""Write the array layouts section of the report."""
|
|
@@ -840,20 +871,14 @@ class ReadParameters:
|
|
|
840
871
|
|
|
841
872
|
def produce_calibration_reports(self):
|
|
842
873
|
"""Write calibration reports."""
|
|
843
|
-
|
|
844
|
-
self.model_version, collection="calibration_devices"
|
|
845
|
-
)
|
|
846
|
-
array_elements = calibration_array_elements.copy()
|
|
847
|
-
for element in calibration_array_elements:
|
|
848
|
-
design_model = self.db.get_design_model(
|
|
849
|
-
self.model_version, element, "calibration_devices"
|
|
850
|
-
)
|
|
851
|
-
if design_model and design_model not in array_elements:
|
|
852
|
-
array_elements.append(design_model)
|
|
874
|
+
array_elements = self._collect_calibration_array_elements()
|
|
853
875
|
|
|
854
876
|
for calibration_device in array_elements:
|
|
877
|
+
device_sites = names.get_site_from_array_element_name(calibration_device)
|
|
878
|
+
site = device_sites[0] if isinstance(device_sites, list) else device_sites
|
|
879
|
+
|
|
855
880
|
all_parameter_data = self.db.get_model_parameters(
|
|
856
|
-
site=
|
|
881
|
+
site=site,
|
|
857
882
|
array_element_name=calibration_device,
|
|
858
883
|
collection="calibration_devices",
|
|
859
884
|
model_version=self.model_version,
|
|
@@ -867,32 +892,77 @@ class ReadParameters:
|
|
|
867
892
|
self.model_version, calibration_device, "calibration_devices"
|
|
868
893
|
)
|
|
869
894
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
895
|
+
self._write_single_calibration_report(
|
|
896
|
+
output_filename, calibration_device, data, design_model
|
|
897
|
+
)
|
|
873
898
|
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
"The design model can be found here: "
|
|
877
|
-
f"[{design_model}]"
|
|
878
|
-
f"({design_model}.md).\n\n"
|
|
879
|
-
)
|
|
880
|
-
file.write(
|
|
881
|
-
"Parameters shown in ***bold and italics*** are specific"
|
|
882
|
-
" to each array element.\n"
|
|
883
|
-
"Parameters without emphasis are inherited from the design model.\n"
|
|
884
|
-
)
|
|
885
|
-
file.write("\n\n")
|
|
899
|
+
# produce parameter comparison reports (site-independent)
|
|
900
|
+
self._generate_model_parameter_reports_for_devices(array_elements)
|
|
886
901
|
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
902
|
+
def _collect_calibration_array_elements(self):
|
|
903
|
+
"""Return a list of calibration devices including their design models."""
|
|
904
|
+
calibration_array_elements = self.db.get_array_elements(
|
|
905
|
+
self.model_version, collection="calibration_devices"
|
|
906
|
+
)
|
|
907
|
+
array_elements = calibration_array_elements.copy()
|
|
908
|
+
for element in calibration_array_elements:
|
|
909
|
+
design_model = self.db.get_design_model(
|
|
910
|
+
self.model_version, element, "calibration_devices"
|
|
911
|
+
)
|
|
912
|
+
if design_model and design_model not in array_elements:
|
|
913
|
+
array_elements.append(design_model)
|
|
914
|
+
return array_elements
|
|
915
|
+
|
|
916
|
+
def _write_single_calibration_report(
|
|
917
|
+
self, output_filename, calibration_device, data, design_model
|
|
918
|
+
):
|
|
919
|
+
"""Write a single calibration device markdown report file."""
|
|
920
|
+
with output_filename.open("w", encoding="utf-8") as file:
|
|
921
|
+
file.write(f"# {calibration_device}\n")
|
|
922
|
+
file.write("\n\n")
|
|
891
923
|
|
|
924
|
+
if not names.is_design_type(calibration_device):
|
|
925
|
+
file.write(
|
|
926
|
+
f"The design model can be found here: [{design_model}]({design_model}.md).\n\n"
|
|
927
|
+
)
|
|
928
|
+
file.write(
|
|
929
|
+
"Parameters shown in ***bold and italics*** are specific"
|
|
930
|
+
" to each array element.\n"
|
|
931
|
+
"Parameters without emphasis are inherited from the design model.\n"
|
|
932
|
+
)
|
|
933
|
+
file.write("\n\n")
|
|
934
|
+
|
|
935
|
+
for class_name, group in groupby(data, key=lambda x: x[0]):
|
|
936
|
+
group = sorted(group, key=lambda x: x[1])
|
|
937
|
+
file.write(f"## {class_name}\n\n")
|
|
938
|
+
# Transform parameter display names for human-readable report
|
|
939
|
+
display_group = []
|
|
940
|
+
for row in group:
|
|
941
|
+
param = row[1]
|
|
942
|
+
# Preserve markdown emphasis (***param***) if present
|
|
943
|
+
if isinstance(param, str) and param.startswith("***") and param.endswith("***"):
|
|
944
|
+
inner = param.strip("*")
|
|
945
|
+
new_inner = inner.replace("_", " ")
|
|
946
|
+
new_param = f"***{new_inner}***"
|
|
947
|
+
elif isinstance(param, str):
|
|
948
|
+
new_param = param.replace("_", " ")
|
|
949
|
+
else:
|
|
950
|
+
new_param = param
|
|
951
|
+
|
|
952
|
+
new_row = [row[0], new_param, row[2], row[3], row[4], row[5]]
|
|
953
|
+
display_group.append(new_row)
|
|
954
|
+
|
|
955
|
+
self._write_to_file(display_group, file)
|
|
956
|
+
|
|
957
|
+
def _generate_model_parameter_reports_for_devices(self, array_elements):
|
|
958
|
+
"""Create model-parameter comparison reports for calibration devices."""
|
|
892
959
|
new_output_path = Path(self.output_path).parent.parent / "parameters"
|
|
893
960
|
new_output_path.mkdir(parents=True, exist_ok=True)
|
|
894
961
|
self.output_path = new_output_path
|
|
895
962
|
for calibration_device in array_elements:
|
|
896
|
-
|
|
963
|
+
device_sites = names.get_site_from_array_element_name(calibration_device)
|
|
964
|
+
# parameters are site independent so just take the first site to read from db
|
|
965
|
+
site = device_sites[0] if isinstance(device_sites, list) else device_sites
|
|
966
|
+
self.site = site
|
|
897
967
|
self.array_element = calibration_device
|
|
898
968
|
self.produce_model_parameter_reports(collection="calibration_devices")
|
|
@@ -131,6 +131,32 @@ data:
|
|
|
131
131
|
observatory: "CTAO"
|
|
132
132
|
site: "South"
|
|
133
133
|
description: "Lightning sensor"
|
|
134
|
+
MSFx:
|
|
135
|
+
collection: "calibration_devices"
|
|
136
|
+
observatory: "CTAO"
|
|
137
|
+
site: ["North", "South"]
|
|
138
|
+
design_types: ["FlashCam", "NectarCam", "test"]
|
|
139
|
+
description: "Flat-fielding device (MST)"
|
|
140
|
+
LSFN:
|
|
141
|
+
collection: "calibration_devices"
|
|
142
|
+
observatory: "CTAO"
|
|
143
|
+
site: "North"
|
|
144
|
+
description: "Flat-fielding device (LST)"
|
|
145
|
+
LSFS:
|
|
146
|
+
collection: "calibration_devices"
|
|
147
|
+
observatory: "CTAO"
|
|
148
|
+
site: "South"
|
|
149
|
+
description: "Flat-fielding device (LST)"
|
|
150
|
+
SSFS:
|
|
151
|
+
collection: "calibration_devices"
|
|
152
|
+
observatory: "CTAO"
|
|
153
|
+
site: "South"
|
|
154
|
+
description: "Flat-fielding device (SST)"
|
|
155
|
+
SCFS:
|
|
156
|
+
collection: "calibration_devices"
|
|
157
|
+
observatory: "CTAO"
|
|
158
|
+
site: "South"
|
|
159
|
+
description: "Flat-fielding device (SCT)"
|
|
134
160
|
HESS:
|
|
135
161
|
collection: "telescopes"
|
|
136
162
|
site: "South"
|
|
@@ -4,6 +4,7 @@ import logging
|
|
|
4
4
|
import stat
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
|
|
7
|
+
import simtools.utils.general as gen
|
|
7
8
|
from simtools.runners.corsika_runner import CorsikaRunner
|
|
8
9
|
from simtools.simtel.simulator_array import SimulatorArray
|
|
9
10
|
|
|
@@ -32,6 +33,8 @@ class CorsikaSimtelRunner:
|
|
|
32
33
|
Use multipipe to run CORSIKA and sim_telarray.
|
|
33
34
|
sim_telarray_seeds : dict
|
|
34
35
|
Dictionary with configuration for sim_telarray random instrument setup.
|
|
36
|
+
calibration_config : dict
|
|
37
|
+
Configuration for the calibration of the sim_telarray data.
|
|
35
38
|
"""
|
|
36
39
|
|
|
37
40
|
def __init__(
|
|
@@ -43,12 +46,10 @@ class CorsikaSimtelRunner:
|
|
|
43
46
|
use_multipipe=False,
|
|
44
47
|
sim_telarray_seeds=None,
|
|
45
48
|
sequential=False,
|
|
46
|
-
|
|
49
|
+
calibration_config=None,
|
|
47
50
|
):
|
|
48
51
|
self._logger = logging.getLogger(__name__)
|
|
49
|
-
self.corsika_config = (
|
|
50
|
-
corsika_config if isinstance(corsika_config, list) else [corsika_config]
|
|
51
|
-
)
|
|
52
|
+
self.corsika_config = gen.ensure_iterable(corsika_config)
|
|
52
53
|
# the base corsika config is the one used to define the CORSIKA specific parameters.
|
|
53
54
|
# The others are used for the array configurations.
|
|
54
55
|
self.base_corsika_config = self.corsika_config[0]
|
|
@@ -56,7 +57,6 @@ class CorsikaSimtelRunner:
|
|
|
56
57
|
self.sim_telarray_seeds = sim_telarray_seeds
|
|
57
58
|
self.label = label
|
|
58
59
|
self.sequential = "--sequential" if sequential else ""
|
|
59
|
-
self.calibration_runner_args = calibration_runner_args
|
|
60
60
|
|
|
61
61
|
self.base_corsika_config.set_output_file_and_directory(use_multipipe)
|
|
62
62
|
self.corsika_runner = CorsikaRunner(
|
|
@@ -77,6 +77,7 @@ class CorsikaSimtelRunner:
|
|
|
77
77
|
label=label,
|
|
78
78
|
use_multipipe=use_multipipe,
|
|
79
79
|
sim_telarray_seeds=sim_telarray_seeds,
|
|
80
|
+
calibration_config=calibration_config,
|
|
80
81
|
)
|
|
81
82
|
)
|
|
82
83
|
|
|
@@ -126,18 +127,11 @@ class CorsikaSimtelRunner:
|
|
|
126
127
|
|
|
127
128
|
with open(multipipe_file, "w", encoding="utf-8") as file:
|
|
128
129
|
for simulator_array in self.simulator_array:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
)
|
|
135
|
-
else:
|
|
136
|
-
run_command = simulator_array.make_run_command(
|
|
137
|
-
run_number=run_number,
|
|
138
|
-
input_file="-", # instruct sim_telarray to take input from standard output
|
|
139
|
-
weak_pointing=self._determine_pointing_option(self.label),
|
|
140
|
-
)
|
|
130
|
+
run_command = simulator_array.make_run_command(
|
|
131
|
+
run_number=run_number,
|
|
132
|
+
input_file="-", # instruct sim_telarray to take input from standard output
|
|
133
|
+
weak_pointing=self._determine_pointing_option(self.label),
|
|
134
|
+
)
|
|
141
135
|
file.write(f"{run_command}")
|
|
142
136
|
file.write("\n")
|
|
143
137
|
self._logger.info(f"Multipipe script: {multipipe_file}")
|
|
@@ -90,17 +90,16 @@ class RunnerServices:
|
|
|
90
90
|
dict
|
|
91
91
|
Dictionary containing paths requires for simulation configuration.
|
|
92
92
|
"""
|
|
93
|
-
|
|
93
|
+
ioh = io_handler.IOHandler()
|
|
94
|
+
self.directory["output"] = ioh.get_output_directory()
|
|
94
95
|
_logger.debug(f"Creating output dir {self.directory['output']}")
|
|
95
96
|
for dir_name in ["sub_scripts", "sub_logs"]:
|
|
96
|
-
self.directory[dir_name] =
|
|
97
|
-
self.directory[dir_name].mkdir(parents=True, exist_ok=True)
|
|
97
|
+
self.directory[dir_name] = ioh.get_output_directory(dir_name)
|
|
98
98
|
for _simulation_software in self._get_simulation_software_list(simulation_software):
|
|
99
99
|
for dir_name in ["data", "inputs", "logs"]:
|
|
100
|
-
self.directory[dir_name] =
|
|
101
|
-
_simulation_software, dir_name
|
|
100
|
+
self.directory[dir_name] = ioh.get_output_directory(
|
|
101
|
+
[_simulation_software, dir_name]
|
|
102
102
|
)
|
|
103
|
-
self.directory[dir_name].mkdir(parents=True, exist_ok=True)
|
|
104
103
|
self._logger.debug(f"Data directories for {simulation_software}: {self.directory}")
|
|
105
104
|
return self.directory
|
|
106
105
|
|
|
@@ -122,7 +122,6 @@ def _read_application_configuration(configuration_file, steps, logger):
|
|
|
122
122
|
- output files will be written out to './output/<workflow directory>/'
|
|
123
123
|
|
|
124
124
|
Replaces the placeholders in the configuration file with the actual values.
|
|
125
|
-
Sets 'USE_PLAIN_OUTPUT_PATH' to True for all applications.
|
|
126
125
|
|
|
127
126
|
Parameters
|
|
128
127
|
----------
|
|
@@ -195,7 +194,6 @@ def _replace_placeholders_in_configuration(
|
|
|
195
194
|
for item in value
|
|
196
195
|
]
|
|
197
196
|
if output_path:
|
|
198
|
-
configuration["use_plain_output_path"] = True
|
|
199
197
|
configuration["output_path"] = str(output_path)
|
|
200
198
|
|
|
201
199
|
return configuration
|
|
@@ -148,7 +148,7 @@ definitions:
|
|
|
148
148
|
type: object
|
|
149
149
|
additionalProperties: false
|
|
150
150
|
patternProperties:
|
|
151
|
-
"^[0-9]+\\.[0-9]
|
|
151
|
+
"^[0-9]+\\.[0-9]+(?:\\.[0-9]+)?$": # Version pattern (e.g., "5.0", "6.0", "5.0.0", "6.0.0")
|
|
152
152
|
type: string
|
|
153
153
|
description: Path to the configuration file for the given version.
|
|
154
154
|
minProperties: 1
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
$schema: http://json-schema.org/draft-06/schema#
|
|
3
|
+
$id: common_definitions.schema.yml
|
|
4
|
+
title: Common Schema Definitions
|
|
5
|
+
description: |
|
|
6
|
+
Common definitions and patterns used across multiple schema files
|
|
7
|
+
schema_version: 0.1.0
|
|
8
|
+
schema_name: common_definitions
|
|
9
|
+
type: object
|
|
10
|
+
|
|
11
|
+
$defs:
|
|
12
|
+
telescope_name_pattern:
|
|
13
|
+
type: string
|
|
14
|
+
description: |
|
|
15
|
+
Pattern for valid telescope names including:
|
|
16
|
+
- Standard telescope types (LST, MST, SST, CT) with site (N/S/x) and number
|
|
17
|
+
- Design telescopes with specific camera types (FlashCam, NectarCam)
|
|
18
|
+
- Observatory sites (North/South)
|
|
19
|
+
- Dummy telescopes for testing
|
|
20
|
+
pattern: '^([A-Za-z](ST|LL|CT|SF)[N,S,x]-\d{2,3}|[A-Za-z](ST|LL|CT|SF)[N,S,x]-(design|FlashCam|NectarCam)|OBS-(North|South)|Dummy-Telescope)$'
|
|
21
|
+
examples:
|
|
22
|
+
- "LSTN-01"
|
|
23
|
+
- "MSTN-02"
|
|
24
|
+
- "SSTN-03"
|
|
25
|
+
- "LSTN-design"
|
|
26
|
+
- "MSTx-FlashCam"
|
|
27
|
+
- "SSTx-NectarCam"
|
|
28
|
+
- "OBS-North"
|
|
29
|
+
- "OBS-South"
|
|
30
|
+
- "Dummy-Telescope"
|
|
31
|
+
|
|
32
|
+
semantic_version_pattern:
|
|
33
|
+
type: string
|
|
34
|
+
description: Semantic version pattern (MAJOR.MINOR.PATCH)
|
|
35
|
+
pattern: '^\d+\.\d+\.\d+$'
|
|
36
|
+
examples:
|
|
37
|
+
- "1.0.0"
|
|
38
|
+
- "2.1.3"
|
|
39
|
+
- "0.5.12"
|
|
@@ -51,20 +51,24 @@ definitions:
|
|
|
51
51
|
- South
|
|
52
52
|
description: "Associated CTAO site."
|
|
53
53
|
type:
|
|
54
|
-
type: string
|
|
55
54
|
description: "Data type"
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
oneOf:
|
|
56
|
+
- type: string
|
|
57
|
+
enum: &data_types
|
|
58
|
+
- boolean
|
|
59
|
+
- dict
|
|
60
|
+
- double
|
|
61
|
+
- file
|
|
62
|
+
- float64
|
|
63
|
+
- int
|
|
64
|
+
- int64
|
|
65
|
+
- string
|
|
66
|
+
- uint
|
|
67
|
+
- uint32
|
|
68
|
+
- uint64
|
|
69
|
+
- type: array
|
|
70
|
+
items:
|
|
71
|
+
enum: *data_types
|
|
68
72
|
unit:
|
|
69
73
|
anyOf:
|
|
70
74
|
- type: string
|
|
@@ -82,6 +86,7 @@ definitions:
|
|
|
82
86
|
- type: string
|
|
83
87
|
- type: "null"
|
|
84
88
|
- type: array
|
|
89
|
+
- type: object # allow dictionary
|
|
85
90
|
description: "Value of the parameter."
|
|
86
91
|
parameter_version:
|
|
87
92
|
anyOf:
|
|
@@ -178,6 +183,7 @@ definitions:
|
|
|
178
183
|
- type: string
|
|
179
184
|
- type: "null"
|
|
180
185
|
- type: array
|
|
186
|
+
- type: object
|
|
181
187
|
description: "Value of the parameter."
|
|
182
188
|
parameter_version:
|
|
183
189
|
anyOf:
|