gammasimtools 0.21.0__py3-none-any.whl → 0.23.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/METADATA +3 -3
- gammasimtools-0.23.0.dist-info/RECORD +414 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/entry_points.txt +2 -1
- simtools/_version.py +2 -2
- simtools/application_control.py +118 -0
- simtools/applications/calculate_incident_angles.py +17 -25
- simtools/applications/convert_all_model_parameters_from_simtel.py +29 -45
- simtools/applications/convert_geo_coordinates_of_array_elements.py +26 -45
- simtools/applications/convert_model_parameter_from_simtel.py +21 -42
- simtools/applications/db_add_file_to_db.py +12 -13
- simtools/applications/db_add_simulation_model_from_repository_to_db.py +20 -33
- simtools/applications/db_add_value_from_json_to_db.py +28 -23
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +19 -34
- simtools/applications/db_generate_compound_indexes.py +12 -27
- simtools/applications/db_get_array_layouts_from_db.py +19 -39
- simtools/applications/db_get_file_from_db.py +15 -17
- simtools/applications/db_get_parameter_from_db.py +33 -35
- simtools/applications/db_inspect_databases.py +10 -11
- simtools/applications/db_upload_model_repository.py +104 -0
- simtools/applications/derive_ctao_array_layouts.py +16 -21
- simtools/applications/derive_mirror_rnda.py +9 -14
- simtools/applications/derive_photon_electron_spectrum.py +7 -10
- simtools/applications/derive_psf_parameters.py +24 -21
- simtools/applications/derive_trigger_rates.py +6 -9
- simtools/applications/docs_produce_array_element_report.py +22 -23
- simtools/applications/docs_produce_calibration_reports.py +26 -24
- simtools/applications/docs_produce_model_parameter_reports.py +15 -22
- simtools/applications/docs_produce_simulation_configuration_report.py +21 -22
- simtools/applications/generate_array_config.py +14 -33
- simtools/applications/generate_corsika_histograms.py +22 -43
- simtools/applications/generate_default_metadata.py +15 -36
- simtools/applications/generate_regular_arrays.py +11 -15
- simtools/applications/generate_simtel_event_data.py +23 -33
- simtools/applications/maintain_simulation_model_add_production.py +17 -48
- simtools/applications/maintain_simulation_model_compare_productions.py +10 -12
- simtools/applications/maintain_simulation_model_verify_production_tables.py +8 -11
- simtools/applications/merge_tables.py +15 -24
- simtools/applications/plot_array_layout.py +77 -55
- simtools/applications/plot_simtel_events.py +11 -13
- simtools/applications/plot_tabular_data.py +17 -38
- simtools/applications/plot_tabular_data_for_model_parameter.py +16 -23
- simtools/applications/print_version.py +14 -42
- simtools/applications/production_derive_corsika_limits.py +5 -9
- simtools/applications/production_derive_statistics.py +12 -26
- simtools/applications/production_generate_grid.py +20 -48
- simtools/applications/production_merge_corsika_limits.py +17 -21
- simtools/applications/run_application.py +12 -32
- simtools/applications/simulate_flasher.py +79 -81
- simtools/applications/simulate_illuminator.py +56 -197
- simtools/applications/{simulate_calibration_events.py → simulate_pedestals.py} +22 -68
- simtools/applications/simulate_prod.py +21 -33
- simtools/applications/simulate_prod_htcondor_generator.py +11 -25
- simtools/applications/submit_array_layouts.py +15 -18
- simtools/applications/submit_data_from_external.py +18 -34
- simtools/applications/submit_model_parameter_from_external.py +27 -41
- simtools/applications/validate_camera_efficiency.py +23 -22
- simtools/applications/validate_camera_fov.py +21 -27
- simtools/applications/validate_cumulative_psf.py +28 -37
- simtools/applications/validate_file_using_schema.py +35 -45
- simtools/applications/validate_optics.py +27 -33
- simtools/camera/camera_efficiency.py +8 -13
- simtools/configuration/commandline_parser.py +33 -11
- simtools/configuration/configurator.py +0 -7
- simtools/corsika/corsika_config.py +9 -16
- simtools/corsika/corsika_histograms.py +1 -1
- simtools/data_model/data_reader.py +0 -2
- simtools/data_model/metadata_collector.py +0 -2
- simtools/data_model/model_data_writer.py +87 -27
- simtools/data_model/schema.py +61 -2
- simtools/data_model/validate_data.py +1 -3
- simtools/db/db_handler.py +58 -39
- simtools/db/db_model_upload.py +210 -5
- simtools/io/hdf5_handler.py +0 -5
- simtools/io/io_handler.py +31 -83
- simtools/io/legacy_data_handler.py +0 -5
- simtools/job_execution/job_manager.py +43 -1
- simtools/layout/array_layout.py +0 -2
- simtools/layout/array_layout_utils.py +1 -5
- simtools/layout/telescope_position.py +0 -2
- simtools/model/array_model.py +95 -46
- simtools/model/calibration_model.py +0 -2
- simtools/model/camera.py +0 -2
- simtools/model/mirrors.py +0 -2
- simtools/model/model_parameter.py +50 -16
- simtools/model/model_repository.py +139 -106
- simtools/model/model_utils.py +21 -11
- simtools/model/site_model.py +0 -2
- simtools/model/telescope_model.py +20 -2
- simtools/production_configuration/calculate_statistical_uncertainties_grid_point.py +0 -2
- simtools/production_configuration/derive_corsika_limits.py +1 -1
- simtools/production_configuration/derive_production_statistics.py +0 -2
- simtools/production_configuration/interpolation_handler.py +0 -2
- simtools/ray_tracing/incident_angles.py +7 -7
- simtools/ray_tracing/mirror_panel_psf.py +1 -1
- simtools/ray_tracing/psf_analysis.py +0 -2
- simtools/ray_tracing/psf_parameter_optimisation.py +180 -73
- simtools/ray_tracing/ray_tracing.py +1 -5
- simtools/reporting/docs_auto_report_generator.py +108 -0
- simtools/reporting/docs_read_parameters.py +168 -104
- simtools/resources/array_elements.yml +26 -0
- simtools/runners/corsika_runner.py +0 -2
- simtools/runners/corsika_simtel_runner.py +11 -19
- simtools/runners/runner_services.py +5 -6
- simtools/runners/simtel_runner.py +0 -2
- simtools/runners/simtools_runner.py +0 -2
- simtools/schemas/application_workflow.metaschema.yml +1 -1
- simtools/schemas/common_definitions.schema.yml +39 -0
- simtools/schemas/model_parameter.metaschema.yml +19 -13
- simtools/schemas/model_parameter_and_data_schema.metaschema.yml +6 -12
- simtools/schemas/model_parameters/adjust_gain.schema.yml +0 -5
- simtools/schemas/model_parameters/altitude.schema.yml +0 -5
- simtools/schemas/model_parameters/array_coordinates.schema.yml +0 -5
- simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +0 -5
- simtools/schemas/model_parameters/array_element_position_ground.schema.yml +0 -7
- simtools/schemas/model_parameters/array_element_position_utm.schema.yml +0 -7
- simtools/schemas/model_parameters/array_layouts.schema.yml +0 -5
- simtools/schemas/model_parameters/array_triggers.schema.yml +0 -5
- simtools/schemas/model_parameters/array_window.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_clipping.schema.yml +0 -3
- simtools/schemas/model_parameters/asum_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_shaping.schema.yml +0 -7
- simtools/schemas/model_parameters/asum_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +0 -5
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +0 -5
- simtools/schemas/model_parameters/axes_offsets.schema.yml +0 -7
- simtools/schemas/model_parameters/calibration_devices.schema.yml +30 -0
- simtools/schemas/model_parameters/camera_body_diameter.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_body_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_config_file.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_config_rotate.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_degraded_map.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_depth.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_filter.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/camera_pixels.schema.yml +0 -7
- simtools/schemas/model_parameters/camera_transmission.schema.yml +0 -7
- simtools/schemas/model_parameters/channels_per_chip.schema.yml +0 -7
- simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +0 -7
- simtools/schemas/model_parameters/corsika_observation_level.schema.yml +0 -5
- simtools/schemas/model_parameters/dark_events.schema.yml +4 -3
- simtools/schemas/model_parameters/default_trigger.schema.yml +0 -7
- simtools/schemas/model_parameters/design_model.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/disc_start.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +1 -9
- simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/dish_shape_length.schema.yml +0 -5
- simtools/schemas/model_parameters/dsum_clipping.schema.yml +1 -5
- simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_pedsub.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_prescale.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_presum_max.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_shaping.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +0 -3
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +2 -12
- simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +0 -3
- simtools/schemas/model_parameters/effective_focal_length.schema.yml +0 -7
- simtools/schemas/model_parameters/epsg_code.schema.yml +0 -5
- simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_amplitude.schema.yml +2 -9
- simtools/schemas/model_parameters/fadc_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +2 -9
- simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_long_event_threshold.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_long_sum_bins.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_long_sum_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/fadc_max_signal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_max_sum.schema.yml +0 -2
- simtools/schemas/model_parameters/fadc_mhz.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_noise.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +0 -7
- simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +0 -7
- simtools/schemas/model_parameters/fake_mirror_list.schema.yml +0 -3
- simtools/schemas/model_parameters/flasher_angular_distribution.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_angular_distribution_width.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_bunch_size.schema.yml +28 -0
- simtools/schemas/model_parameters/flasher_external_trigger.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_photons.schema.yml +34 -0
- simtools/schemas/model_parameters/flasher_position.schema.yml +43 -0
- simtools/schemas/model_parameters/flasher_pulse_exp_decay.schema.yml +29 -0
- simtools/schemas/model_parameters/flasher_pulse_offset.schema.yml +35 -0
- simtools/schemas/model_parameters/flasher_pulse_shape.schema.yml +30 -0
- simtools/schemas/model_parameters/flasher_pulse_width.schema.yml +32 -0
- simtools/schemas/model_parameters/flasher_type.schema.yml +28 -0
- simtools/schemas/model_parameters/flasher_var_photons.schema.yml +31 -0
- simtools/schemas/model_parameters/flasher_wavelength.schema.yml +33 -0
- simtools/schemas/model_parameters/flatfielding.schema.yml +0 -7
- simtools/schemas/model_parameters/focal_length.schema.yml +0 -7
- simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/focus_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/gain_variation.schema.yml +0 -7
- simtools/schemas/model_parameters/geomag_horizontal.schema.yml +2 -7
- simtools/schemas/model_parameters/geomag_rotation.schema.yml +2 -7
- simtools/schemas/model_parameters/geomag_vertical.schema.yml +2 -7
- simtools/schemas/model_parameters/hg_lg_variation.schema.yml +0 -5
- simtools/schemas/model_parameters/iobuf_maximum.schema.yml +0 -7
- simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +0 -7
- simtools/schemas/model_parameters/laser_events.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_external_trigger.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_var_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/laser_wavelength.schema.yml +4 -3
- simtools/schemas/model_parameters/led_events.schema.yml +4 -3
- simtools/schemas/model_parameters/led_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/led_pulse_offset.schema.yml +4 -3
- simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +4 -3
- simtools/schemas/model_parameters/led_var_photons.schema.yml +4 -3
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +0 -7
- simtools/schemas/model_parameters/min_photoelectrons.schema.yml +0 -7
- simtools/schemas/model_parameters/min_photons.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +0 -5
- simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_class.schema.yml +2 -9
- simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_focal_length.schema.yml +0 -5
- simtools/schemas/model_parameters/mirror_list.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +0 -7
- simtools/schemas/model_parameters/multiplicity_offset.schema.yml +0 -7
- simtools/schemas/model_parameters/muon_mono_threshold.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +0 -3
- simtools/schemas/model_parameters/nsb_offaxis.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +0 -7
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_reference_value.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_sky_map.schema.yml +0 -5
- simtools/schemas/model_parameters/nsb_spectrum.schema.yml +0 -5
- simtools/schemas/model_parameters/num_gains.schema.yml +0 -7
- simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +0 -7
- simtools/schemas/model_parameters/optics_properties.schema.yml +0 -7
- simtools/schemas/model_parameters/parabolic_dish.schema.yml +0 -3
- simtools/schemas/model_parameters/pedestal_events.schema.yml +4 -7
- simtools/schemas/model_parameters/photon_delay.schema.yml +0 -7
- simtools/schemas/model_parameters/photons_per_run.schema.yml +4 -4
- simtools/schemas/model_parameters/pixel_cells.schema.yml +0 -3
- simtools/schemas/model_parameters/pixels_parallel.schema.yml +0 -3
- simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +0 -7
- simtools/schemas/model_parameters/pm_average_gain.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_gain_index.schema.yml +0 -5
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +0 -7
- simtools/schemas/model_parameters/pm_transit_time.schema.yml +4 -9
- simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +0 -5
- simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +0 -7
- simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +0 -3
- simtools/schemas/model_parameters/qe_variation.schema.yml +0 -7
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +0 -7
- simtools/schemas/model_parameters/random_focal_length.schema.yml +2 -7
- simtools/schemas/model_parameters/random_generator.schema.yml +0 -7
- simtools/schemas/model_parameters/random_mono_probability.schema.yml +0 -7
- simtools/schemas/model_parameters/reference_point_altitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_latitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_longitude.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +0 -5
- simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +0 -5
- simtools/schemas/model_parameters/sampled_output.schema.yml +0 -7
- simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +0 -7
- simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +0 -3
- simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +0 -3
- simtools/schemas/model_parameters/stars.schema.yml +0 -5
- simtools/schemas/model_parameters/store_photoelectrons.schema.yml +0 -7
- simtools/schemas/model_parameters/tailcut_scale.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_axis_height.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_random_angle.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_random_error.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +0 -7
- simtools/schemas/model_parameters/telescope_transmission.schema.yml +0 -7
- simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +0 -7
- simtools/schemas/model_parameters/teltrig_min_time.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_error.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_jitter.schema.yml +0 -7
- simtools/schemas/model_parameters/transit_time_random.schema.yml +29 -0
- simtools/schemas/model_parameters/trigger_current_limit.schema.yml +0 -7
- simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +0 -7
- simtools/schemas/model_parameters/trigger_pixels.schema.yml +0 -7
- simtools/schemas/production_tables.schema.yml +8 -8
- simtools/schemas/simulation_models_info.schema.yml +78 -0
- simtools/simtel/simtel_config_reader.py +0 -2
- simtools/simtel/simtel_config_writer.py +118 -26
- simtools/simtel/simtel_io_metadata.py +3 -3
- simtools/simtel/simulator_array.py +43 -85
- simtools/simtel/simulator_camera_efficiency.py +0 -2
- simtools/simtel/simulator_light_emission.py +336 -631
- simtools/simtel/simulator_ray_tracing.py +2 -4
- simtools/simulator.py +45 -19
- simtools/testing/assertions.py +2 -2
- simtools/testing/configuration.py +21 -6
- simtools/testing/sim_telarray_metadata.py +4 -4
- simtools/utils/general.py +5 -13
- simtools/utils/geometry.py +34 -5
- simtools/utils/names.py +1 -13
- simtools/version.py +83 -0
- simtools/visualization/plot_array_layout.py +129 -23
- simtools/visualization/plot_incident_angles.py +0 -2
- simtools/visualization/plot_psf.py +163 -61
- simtools/visualization/plot_simtel_events.py +1 -12
- simtools/visualization/visualize.py +0 -12
- gammasimtools-0.21.0.dist-info/RECORD +0 -396
- simtools/model/flasher_model.py +0 -106
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/licenses/LICENSE +0 -0
- {gammasimtools-0.21.0.dist-info → gammasimtools-0.23.0.dist-info}/top_level.txt +0 -0
|
@@ -164,36 +164,19 @@ r"""
|
|
|
164
164
|
Total time needed: 8s.
|
|
165
165
|
"""
|
|
166
166
|
|
|
167
|
-
import logging
|
|
168
167
|
import time
|
|
169
|
-
from pathlib import Path
|
|
170
168
|
|
|
171
|
-
|
|
169
|
+
from simtools.application_control import get_application_label, startup_application
|
|
172
170
|
from simtools.configuration import configurator
|
|
173
171
|
from simtools.corsika.corsika_histograms import CorsikaHistograms
|
|
174
|
-
from simtools.io import io_handler
|
|
175
172
|
|
|
176
|
-
logger = logging.getLogger()
|
|
177
173
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
----------
|
|
185
|
-
label: str
|
|
186
|
-
Label describing the application.
|
|
187
|
-
description: str
|
|
188
|
-
Description of the application.
|
|
189
|
-
|
|
190
|
-
Returns
|
|
191
|
-
-------
|
|
192
|
-
CommandLineParser
|
|
193
|
-
Command line parser object
|
|
194
|
-
|
|
195
|
-
"""
|
|
196
|
-
config = configurator.Configurator(label=label, description=description)
|
|
174
|
+
def _parse():
|
|
175
|
+
"""Parse command line configuration."""
|
|
176
|
+
config = configurator.Configurator(
|
|
177
|
+
label=get_application_label(__file__),
|
|
178
|
+
description="Generate histograms for the Cherenkov photons saved in the CORSIKA IACT file.",
|
|
179
|
+
)
|
|
197
180
|
|
|
198
181
|
config.parser.add_argument(
|
|
199
182
|
"--iact_file",
|
|
@@ -280,34 +263,30 @@ def _parse(label, description):
|
|
|
280
263
|
return config_parser, _
|
|
281
264
|
|
|
282
265
|
|
|
283
|
-
def main():
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
io_handler_instance = io_handler.IOHandler()
|
|
287
|
-
args_dict, _ = _parse(label, description)
|
|
288
|
-
|
|
289
|
-
output_path = io_handler_instance.get_output_directory(label, sub_dir="application-plots")
|
|
266
|
+
def main():
|
|
267
|
+
"""Generate a set of histograms for the Cherenkov photons saved in the CORSIKA IACT file."""
|
|
268
|
+
app_context = startup_application(_parse)
|
|
290
269
|
|
|
291
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
292
270
|
initial_time = time.time()
|
|
293
|
-
logger.info("Starting the application.")
|
|
294
271
|
|
|
295
272
|
corsika_histograms_instance = CorsikaHistograms(
|
|
296
|
-
|
|
273
|
+
app_context.args["iact_file"],
|
|
274
|
+
output_path=app_context.io_handler.get_output_directory(),
|
|
275
|
+
hdf5_file_name=app_context.args["hdf5_file_name"],
|
|
297
276
|
)
|
|
298
277
|
corsika_histograms_instance.run_export_pipeline(
|
|
299
|
-
individual_telescopes=
|
|
300
|
-
hist_config=
|
|
301
|
-
indices_arg=
|
|
302
|
-
write_pdf=
|
|
303
|
-
write_hdf5=
|
|
304
|
-
event1d=
|
|
305
|
-
event2d=
|
|
306
|
-
test=
|
|
278
|
+
individual_telescopes=app_context.args["individual_telescopes"],
|
|
279
|
+
hist_config=app_context.args["hist_config"],
|
|
280
|
+
indices_arg=app_context.args["telescope_indices"],
|
|
281
|
+
write_pdf=app_context.args["pdf"],
|
|
282
|
+
write_hdf5=app_context.args["hdf5"],
|
|
283
|
+
event1d=app_context.args["event_1d_histograms"],
|
|
284
|
+
event2d=app_context.args["event_2d_histograms"],
|
|
285
|
+
test=app_context.args["test"],
|
|
307
286
|
)
|
|
308
287
|
|
|
309
288
|
final_time = time.time()
|
|
310
|
-
logger.info(
|
|
289
|
+
app_context.logger.info(
|
|
311
290
|
f"Finalizing the application. Total time needed: {round(final_time - initial_time)}s."
|
|
312
291
|
)
|
|
313
292
|
|
|
@@ -21,33 +21,18 @@ r"""
|
|
|
21
21
|
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
import
|
|
25
|
-
from pathlib import Path
|
|
26
|
-
|
|
27
|
-
import simtools.utils.general as gen
|
|
24
|
+
from simtools.application_control import get_application_label, startup_application
|
|
28
25
|
from simtools.configuration import configurator
|
|
29
26
|
from simtools.data_model import metadata_model
|
|
30
|
-
from simtools.io import ascii_handler
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def _parse(label, description):
|
|
34
|
-
"""
|
|
35
|
-
Parse command line configuration.
|
|
36
|
-
|
|
37
|
-
Parameters
|
|
38
|
-
----------
|
|
39
|
-
label: str
|
|
40
|
-
Label describing application.
|
|
41
|
-
description: str
|
|
42
|
-
Description of application.
|
|
27
|
+
from simtools.io import ascii_handler
|
|
43
28
|
|
|
44
|
-
Returns
|
|
45
|
-
-------
|
|
46
|
-
CommandLineParser
|
|
47
|
-
Command line parser object
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
def _parse():
|
|
31
|
+
"""Parse command line configuration."""
|
|
32
|
+
config = configurator.Configurator(
|
|
33
|
+
label=get_application_label(__file__),
|
|
34
|
+
description="Generate a default simtools metadata file from a json schema.",
|
|
35
|
+
)
|
|
51
36
|
|
|
52
37
|
config.parser.add_argument(
|
|
53
38
|
"--schema",
|
|
@@ -65,23 +50,17 @@ def _parse(label, description):
|
|
|
65
50
|
return config.initialize(output=False, require_command_line=True)
|
|
66
51
|
|
|
67
52
|
|
|
68
|
-
def main():
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
label, description="Generate a default simtools metadata file from a json schema."
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
logger = logging.getLogger()
|
|
75
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
53
|
+
def main():
|
|
54
|
+
"""Generate a default simtools metadata file from a json schema."""
|
|
55
|
+
app_context = startup_application(_parse)
|
|
76
56
|
|
|
77
|
-
default_values = metadata_model.get_default_metadata_dict(
|
|
57
|
+
default_values = metadata_model.get_default_metadata_dict(app_context.args["schema"])
|
|
78
58
|
|
|
79
|
-
if
|
|
59
|
+
if app_context.args["output_file"] is None:
|
|
80
60
|
print(default_values)
|
|
81
61
|
else:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
logger.info(f"Writing default values to {output_file}")
|
|
62
|
+
output_file = app_context.io_handler.get_output_file(app_context.args["output_file"])
|
|
63
|
+
app_context.logger.info(f"Writing default values to {output_file}")
|
|
85
64
|
ascii_handler.write_data_to_file(
|
|
86
65
|
data=default_values, output_file=output_file, sort_keys=False
|
|
87
66
|
)
|
|
@@ -24,14 +24,13 @@ Runtime < 10 s.
|
|
|
24
24
|
simtools-generate-regular-arrays --site=North
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
|
-
import logging
|
|
28
27
|
from pathlib import Path
|
|
29
28
|
|
|
30
29
|
import astropy.units as u
|
|
31
30
|
from astropy.table import QTable
|
|
32
31
|
|
|
33
32
|
import simtools.data_model.model_data_writer as writer
|
|
34
|
-
|
|
33
|
+
from simtools.application_control import get_application_label, startup_application
|
|
35
34
|
from simtools.configuration import configurator
|
|
36
35
|
from simtools.utils import names
|
|
37
36
|
|
|
@@ -42,7 +41,7 @@ telescope_distance = {"LST": 57.5 * u.m, "MST": 70 * u.m, "SST": 80 * u.m}
|
|
|
42
41
|
|
|
43
42
|
def _parse():
|
|
44
43
|
config = configurator.Configurator(
|
|
45
|
-
label=
|
|
44
|
+
label=get_application_label(__file__),
|
|
46
45
|
description=(
|
|
47
46
|
"Generate a regular array of telescope and save as astropy table.\n"
|
|
48
47
|
"Default telescope distances for 4 telescope square arrays are: \n"
|
|
@@ -58,18 +57,15 @@ def _parse():
|
|
|
58
57
|
|
|
59
58
|
def main():
|
|
60
59
|
"""Create layout array files (ecsv) of regular arrays."""
|
|
61
|
-
|
|
60
|
+
app_context = startup_application(_parse)
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
65
|
-
|
|
66
|
-
if args_dict["site"] == "South":
|
|
62
|
+
if app_context.args["site"] == "South":
|
|
67
63
|
array_list = ["1SST", "4SST", "1MST", "4MST", "1LST", "4LST"]
|
|
68
64
|
else:
|
|
69
65
|
array_list = ["1MST", "4MST", "1LST", "4LST"]
|
|
70
66
|
|
|
71
67
|
for array_name in array_list:
|
|
72
|
-
logger.info(f"Processing array {array_name}")
|
|
68
|
+
app_context.logger.info(f"Processing array {array_name}")
|
|
73
69
|
|
|
74
70
|
tel_name, pos_x, pos_y, pos_z = [], [], [], []
|
|
75
71
|
tel_size = array_name[1:4]
|
|
@@ -78,7 +74,7 @@ def main():
|
|
|
78
74
|
if array_name[0] == "1":
|
|
79
75
|
tel_name.append(
|
|
80
76
|
names.generate_array_element_name_from_type_site_id(
|
|
81
|
-
tel_size,
|
|
77
|
+
tel_size, app_context.args["site"], "01"
|
|
82
78
|
)
|
|
83
79
|
)
|
|
84
80
|
pos_x.append(0 * u.m)
|
|
@@ -89,14 +85,14 @@ def main():
|
|
|
89
85
|
for i in range(1, 5):
|
|
90
86
|
tel_name.append(
|
|
91
87
|
names.generate_array_element_name_from_type_site_id(
|
|
92
|
-
tel_size,
|
|
88
|
+
tel_size, app_context.args["site"], f"0{i}"
|
|
93
89
|
)
|
|
94
90
|
)
|
|
95
91
|
pos_x.append(telescope_distance[tel_size] * (-1) ** (i // 2))
|
|
96
92
|
pos_y.append(telescope_distance[tel_size] * (-1) ** (i % 2))
|
|
97
93
|
pos_z.append(0 * u.m)
|
|
98
94
|
|
|
99
|
-
table = QTable(meta={"array_name": array_name, "site":
|
|
95
|
+
table = QTable(meta={"array_name": array_name, "site": app_context.args["site"]})
|
|
100
96
|
table["telescope_name"] = tel_name
|
|
101
97
|
table["position_x"] = pos_x
|
|
102
98
|
table["position_y"] = pos_y
|
|
@@ -104,14 +100,14 @@ def main():
|
|
|
104
100
|
table.sort("telescope_name")
|
|
105
101
|
table.pprint()
|
|
106
102
|
|
|
107
|
-
output_file =
|
|
103
|
+
output_file = app_context.args.get("output_file")
|
|
108
104
|
if output_file:
|
|
109
105
|
output_path = Path(output_file)
|
|
110
106
|
output_file = output_path.with_name(
|
|
111
|
-
f"{output_path.stem}-{
|
|
107
|
+
f"{output_path.stem}-{app_context.args['site']}-{array_name}{output_path.suffix}"
|
|
112
108
|
)
|
|
113
109
|
writer.ModelDataWriter.dump(
|
|
114
|
-
args_dict=
|
|
110
|
+
args_dict=app_context.args,
|
|
115
111
|
output_file=output_file,
|
|
116
112
|
metadata=None,
|
|
117
113
|
product_data=table,
|
|
@@ -124,26 +124,24 @@ To read a reduced event data file, use the following command reading on of the t
|
|
|
124
124
|
|
|
125
125
|
"""
|
|
126
126
|
|
|
127
|
-
import logging
|
|
128
127
|
from pathlib import Path
|
|
129
128
|
|
|
130
|
-
|
|
129
|
+
from simtools.application_control import get_application_label, startup_application
|
|
131
130
|
from simtools.configuration import configurator
|
|
132
131
|
from simtools.data_model.metadata_collector import MetadataCollector
|
|
133
132
|
from simtools.io import io_handler, table_handler
|
|
134
133
|
from simtools.simtel.simtel_io_event_writer import SimtelIOEventDataWriter
|
|
135
134
|
|
|
136
135
|
|
|
137
|
-
def _parse(
|
|
138
|
-
"""
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
config = configurator.Configurator(label=label, description=description)
|
|
136
|
+
def _parse():
|
|
137
|
+
"""Parse command line arguments."""
|
|
138
|
+
config = configurator.Configurator(
|
|
139
|
+
label=get_application_label(__file__),
|
|
140
|
+
description=(
|
|
141
|
+
"Process files and store reduced dataset with event information, "
|
|
142
|
+
"array information and triggered telescopes."
|
|
143
|
+
),
|
|
144
|
+
)
|
|
147
145
|
|
|
148
146
|
config.parser.add_argument(
|
|
149
147
|
"--input",
|
|
@@ -163,36 +161,28 @@ def _parse(label, description):
|
|
|
163
161
|
return config.initialize(db_config=False, output=True)
|
|
164
162
|
|
|
165
163
|
|
|
166
|
-
def main():
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
label=label,
|
|
171
|
-
description=(
|
|
172
|
-
"Process files and store reduced dataset with event information, "
|
|
173
|
-
"array information and triggered telescopes."
|
|
174
|
-
),
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
logger = logging.getLogger()
|
|
178
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
179
|
-
logger.info(f"Loading input files from: {args_dict['input']}")
|
|
164
|
+
def main():
|
|
165
|
+
"""Generate a reduced dataset of event data from output of telescope simulations."""
|
|
166
|
+
app_context = startup_application(_parse, setup_io_handler=False)
|
|
167
|
+
app_context.logger.info(f"Loading input files from: {app_context.args['input']}")
|
|
180
168
|
|
|
181
|
-
input_pattern = Path(
|
|
169
|
+
input_pattern = Path(app_context.args["input"])
|
|
182
170
|
files = list(input_pattern.parent.glob(input_pattern.name))
|
|
183
171
|
if not files:
|
|
184
|
-
logger.warning("No matching input files found.")
|
|
172
|
+
app_context.logger.warning("No matching input files found.")
|
|
185
173
|
return
|
|
186
174
|
|
|
187
|
-
output_filepath = io_handler.IOHandler().get_output_file(
|
|
188
|
-
generator = SimtelIOEventDataWriter(files,
|
|
175
|
+
output_filepath = io_handler.IOHandler().get_output_file(app_context.args["output_file"])
|
|
176
|
+
generator = SimtelIOEventDataWriter(files, app_context.args["max_files"])
|
|
189
177
|
tables = generator.process_files()
|
|
190
178
|
table_handler.write_tables(tables, output_filepath, overwrite_existing=True)
|
|
191
|
-
MetadataCollector.dump(
|
|
179
|
+
MetadataCollector.dump(
|
|
180
|
+
args_dict=app_context.args, output_file=output_filepath.with_suffix(".yml")
|
|
181
|
+
)
|
|
192
182
|
|
|
193
|
-
if
|
|
183
|
+
if app_context.args["print_dataset_information"] > 0:
|
|
194
184
|
for table in tables:
|
|
195
|
-
table.pprint(max_lines=
|
|
185
|
+
table.pprint(max_lines=app_context.args["print_dataset_information"], max_width=-1)
|
|
196
186
|
|
|
197
187
|
|
|
198
188
|
if __name__ == "__main__":
|
|
@@ -7,11 +7,11 @@ to production tables and model parameters as provided in a YAML file (see the ex
|
|
|
7
7
|
|
|
8
8
|
Two main use cases are covered by this script:
|
|
9
9
|
|
|
10
|
-
1.
|
|
10
|
+
1. full update: Create a complete new set of production tables (e.g. for new major or minor
|
|
11
11
|
versions of the simulation models). This will copy all production tables from the source
|
|
12
12
|
directory and apply the modifications to the tables that are listed in the modifications file.
|
|
13
13
|
|
|
14
|
-
2.
|
|
14
|
+
2. patch update: Create a set of new production tables including the changes defined in the
|
|
15
15
|
modifications file. No unmodified tables are copied. For new production tables with patch
|
|
16
16
|
modifications, the key-value pair 'base_model_version: <base_model version>' is added.
|
|
17
17
|
|
|
@@ -27,78 +27,47 @@ The following example applies a patch update with changes defined in a YAML file
|
|
|
27
27
|
|
|
28
28
|
simtools-maintain-simulation-model-add-new-production \\
|
|
29
29
|
--simulation_models_path ../simulation-models-dev/simulation-models/ \\
|
|
30
|
-
--
|
|
31
|
-
--modifications tests/resources/production_tables_changes_for_threshold_study_6.2.0.yml \\
|
|
32
|
-
--patch_update
|
|
30
|
+
--modifications tests/resources/production_tables_changes_for_threshold_study_6.2.0.yml
|
|
33
31
|
|
|
34
32
|
"""
|
|
35
33
|
|
|
36
|
-
import logging
|
|
37
34
|
from pathlib import Path
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
from simtools.application_control import get_application_label, startup_application
|
|
40
37
|
from simtools.configuration import configurator
|
|
41
38
|
from simtools.model import model_repository
|
|
42
39
|
|
|
43
40
|
|
|
44
|
-
def _parse(
|
|
45
|
-
"""
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
dict
|
|
51
|
-
Parsed command-line arguments.
|
|
52
|
-
"""
|
|
53
|
-
config = configurator.Configurator(label=label, description=description)
|
|
41
|
+
def _parse():
|
|
42
|
+
"""Parse command line arguments."""
|
|
43
|
+
config = configurator.Configurator(
|
|
44
|
+
label=get_application_label(__file__),
|
|
45
|
+
description="Generate a new simulation model production",
|
|
46
|
+
)
|
|
54
47
|
config.parser.add_argument(
|
|
55
48
|
"--simulation_models_path",
|
|
56
49
|
type=str,
|
|
57
50
|
required=True,
|
|
58
51
|
help="Path to the simulation models repository.",
|
|
59
52
|
)
|
|
60
|
-
config.parser.add_argument(
|
|
61
|
-
"--base_model_version",
|
|
62
|
-
type=str,
|
|
63
|
-
required=True,
|
|
64
|
-
help="Base model version (which is the source production table subdirectory to copy from).",
|
|
65
|
-
)
|
|
66
53
|
config.parser.add_argument(
|
|
67
54
|
"--modifications",
|
|
68
55
|
type=str,
|
|
69
56
|
required=True,
|
|
70
57
|
help="File containing the list of changes to apply.",
|
|
71
58
|
)
|
|
72
|
-
update_group = config.parser.add_mutually_exclusive_group(required=True)
|
|
73
|
-
update_group.add_argument(
|
|
74
|
-
"--full_update",
|
|
75
|
-
action="store_true",
|
|
76
|
-
default=False,
|
|
77
|
-
help=(
|
|
78
|
-
"Create a full new set of production tables by copying all tables from the "
|
|
79
|
-
"base version and applying the modifications to the relevant tables."
|
|
80
|
-
),
|
|
81
|
-
)
|
|
82
|
-
update_group.add_argument(
|
|
83
|
-
"--patch_update",
|
|
84
|
-
action="store_true",
|
|
85
|
-
default=False,
|
|
86
|
-
help=(
|
|
87
|
-
"Create a new set of production tables including only the changes defined in the "
|
|
88
|
-
"modifications file. No unmodified tables are copied."
|
|
89
|
-
),
|
|
90
|
-
)
|
|
91
59
|
|
|
92
60
|
return config.initialize(db_config=False, output=False)
|
|
93
61
|
|
|
94
62
|
|
|
95
|
-
def main():
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
logger = logging.getLogger()
|
|
99
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
63
|
+
def main():
|
|
64
|
+
"""Generate a new simulation model production."""
|
|
65
|
+
app_context = startup_application(_parse)
|
|
100
66
|
|
|
101
|
-
model_repository.generate_new_production(
|
|
67
|
+
model_repository.generate_new_production(
|
|
68
|
+
modifications=app_context.args["modifications"],
|
|
69
|
+
simulation_models_path=Path(app_context.args["simulation_models_path"]),
|
|
70
|
+
)
|
|
102
71
|
|
|
103
72
|
|
|
104
73
|
if __name__ == "__main__":
|
|
@@ -13,17 +13,20 @@ Example
|
|
|
13
13
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
import logging
|
|
17
16
|
from pathlib import Path
|
|
18
17
|
|
|
19
18
|
import simtools.utils.general as gen
|
|
19
|
+
from simtools.application_control import get_application_label, startup_application
|
|
20
20
|
from simtools.configuration import configurator
|
|
21
21
|
from simtools.io import ascii_handler
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def _parse(
|
|
24
|
+
def _parse():
|
|
25
25
|
"""Parse command line arguments."""
|
|
26
|
-
config = configurator.Configurator(
|
|
26
|
+
config = configurator.Configurator(
|
|
27
|
+
label=get_application_label(__file__),
|
|
28
|
+
description="Compare two directories with model production tables in JSON format.",
|
|
29
|
+
)
|
|
27
30
|
config.parser.add_argument(
|
|
28
31
|
"--directory_1",
|
|
29
32
|
type=str,
|
|
@@ -82,16 +85,11 @@ def _compare_json_dirs(dir1, dir2, ignore_key="model_version"):
|
|
|
82
85
|
print(f"Missing in dir1: {rel_path}")
|
|
83
86
|
|
|
84
87
|
|
|
85
|
-
def main():
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
label=label,
|
|
89
|
-
description=("Compare two directories with model production tables in JSON format."),
|
|
90
|
-
)
|
|
91
|
-
logger = logging.getLogger()
|
|
92
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
88
|
+
def main():
|
|
89
|
+
"""Compare two directories with model production tables in JSON format."""
|
|
90
|
+
app_context = startup_application(_parse, setup_io_handler=False)
|
|
93
91
|
|
|
94
|
-
_compare_json_dirs(Path(
|
|
92
|
+
_compare_json_dirs(Path(app_context.args["directory_1"]), Path(app_context.args["directory_2"]))
|
|
95
93
|
|
|
96
94
|
|
|
97
95
|
if __name__ == "__main__":
|
|
@@ -17,21 +17,20 @@ Example
|
|
|
17
17
|
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
import
|
|
21
|
-
|
|
20
|
+
from simtools.application_control import get_application_label, startup_application
|
|
22
21
|
from simtools.configuration import configurator
|
|
23
22
|
from simtools.model import model_repository
|
|
24
|
-
from simtools.utils import general as gen
|
|
25
23
|
|
|
26
24
|
|
|
27
25
|
def _parse():
|
|
28
|
-
"""Parse command line
|
|
26
|
+
"""Parse command line configuration."""
|
|
29
27
|
config = configurator.Configurator(
|
|
28
|
+
label=get_application_label(__file__),
|
|
30
29
|
description=(
|
|
31
30
|
"Verify simulation model production tables and model parameters for completeness. "
|
|
32
31
|
"This application checks that all model parameters defined in the production tables "
|
|
33
32
|
"exist in the simulation models repository."
|
|
34
|
-
)
|
|
33
|
+
),
|
|
35
34
|
)
|
|
36
35
|
config.parser.add_argument(
|
|
37
36
|
"--simulation_models_path",
|
|
@@ -42,14 +41,12 @@ def _parse():
|
|
|
42
41
|
return config.initialize(db_config=False, output=False, paths=False)
|
|
43
42
|
|
|
44
43
|
|
|
45
|
-
def main():
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
logger = logging.getLogger()
|
|
49
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
44
|
+
def main():
|
|
45
|
+
"""Verify simulation model production tables."""
|
|
46
|
+
app_context = startup_application(_parse)
|
|
50
47
|
|
|
51
48
|
if not model_repository.verify_simulation_model_production_tables(
|
|
52
|
-
simulation_models_path=
|
|
49
|
+
simulation_models_path=app_context.args["simulation_models_path"]
|
|
53
50
|
):
|
|
54
51
|
raise RuntimeError(
|
|
55
52
|
"Verification failed: Some model parameters are missing in the repository."
|
|
@@ -36,24 +36,20 @@ Merge tables from two files generated with 'simtools-generate-simtel-event-data'
|
|
|
36
36
|
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
|
-
import logging
|
|
40
39
|
from pathlib import Path
|
|
41
40
|
|
|
42
41
|
import simtools.utils.general as gen
|
|
42
|
+
from simtools.application_control import get_application_label, startup_application
|
|
43
43
|
from simtools.configuration import configurator
|
|
44
44
|
from simtools.io import io_handler, table_handler
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
def _parse(
|
|
48
|
-
"""
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
dict
|
|
54
|
-
Parsed command-line arguments.
|
|
55
|
-
"""
|
|
56
|
-
config = configurator.Configurator(label=label, description=description)
|
|
47
|
+
def _parse():
|
|
48
|
+
"""Parse command line arguments."""
|
|
49
|
+
config = configurator.Configurator(
|
|
50
|
+
label=get_application_label(__file__),
|
|
51
|
+
description="Merge tables from multiple input files into single tables.",
|
|
52
|
+
)
|
|
57
53
|
|
|
58
54
|
input_group = config.parser.add_mutually_exclusive_group(required=True)
|
|
59
55
|
input_group.add_argument(
|
|
@@ -72,28 +68,23 @@ def _parse(label, description):
|
|
|
72
68
|
return config.initialize(db_config=False, output=True)
|
|
73
69
|
|
|
74
70
|
|
|
75
|
-
def main():
|
|
76
|
-
|
|
71
|
+
def main():
|
|
72
|
+
"""Merge tables from multiple input files into single tables."""
|
|
73
|
+
app_context = startup_application(_parse)
|
|
77
74
|
|
|
78
|
-
|
|
79
|
-
label=label,
|
|
80
|
-
description=("Merge tables from multiple input files into single tables."),
|
|
81
|
-
)
|
|
82
|
-
logger = logging.getLogger()
|
|
83
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
84
|
-
logger.info(f"Loading input files: {args_dict['input_files']}")
|
|
75
|
+
app_context.logger.info(f"Loading input files: {app_context.args['input_files']}")
|
|
85
76
|
|
|
86
77
|
# accept fits.gz files (.gz)
|
|
87
78
|
input_files = gen.get_list_of_files_from_command_line(
|
|
88
|
-
|
|
79
|
+
app_context.args["input_files"], [".hdf5", ".gz"]
|
|
89
80
|
)
|
|
90
81
|
|
|
91
|
-
output_path = io_handler.IOHandler().get_output_directory(
|
|
92
|
-
output_filepath = Path(output_path).joinpath(f"{
|
|
82
|
+
output_path = io_handler.IOHandler().get_output_directory()
|
|
83
|
+
output_filepath = Path(output_path).joinpath(f"{app_context.args['output_file']}")
|
|
93
84
|
|
|
94
85
|
table_handler.merge_tables(
|
|
95
86
|
input_files,
|
|
96
|
-
input_table_names=
|
|
87
|
+
input_table_names=app_context.args["table_names"],
|
|
97
88
|
output_file=output_filepath,
|
|
98
89
|
)
|
|
99
90
|
|