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
|
@@ -71,18 +71,17 @@ Example of a secondary mirror incident angle plot for a SST:
|
|
|
71
71
|
:width: 49 %
|
|
72
72
|
"""
|
|
73
73
|
|
|
74
|
-
import
|
|
75
|
-
from pathlib import Path
|
|
76
|
-
|
|
74
|
+
from simtools.application_control import get_application_label, startup_application
|
|
77
75
|
from simtools.configuration import configurator
|
|
76
|
+
from simtools.configuration.commandline_parser import CommandLineParser
|
|
78
77
|
from simtools.ray_tracing.incident_angles import IncidentAnglesCalculator
|
|
79
78
|
from simtools.visualization.plot_incident_angles import plot_incident_angles
|
|
80
79
|
|
|
81
80
|
|
|
82
|
-
def _parse(
|
|
81
|
+
def _parse():
|
|
83
82
|
"""Parse command line configuration."""
|
|
84
83
|
config = configurator.Configurator(
|
|
85
|
-
label=
|
|
84
|
+
label=get_application_label(__file__),
|
|
86
85
|
description=(
|
|
87
86
|
"Calculate photon incident angles on focal plane and primary/secondary mirrors."
|
|
88
87
|
),
|
|
@@ -104,7 +103,7 @@ def _parse(label):
|
|
|
104
103
|
config.parser.add_argument(
|
|
105
104
|
"--number_of_photons",
|
|
106
105
|
help="Number of star photons to trace (per run)",
|
|
107
|
-
type=
|
|
106
|
+
type=CommandLineParser.scientific_int,
|
|
108
107
|
default=10000,
|
|
109
108
|
required=False,
|
|
110
109
|
)
|
|
@@ -135,38 +134,31 @@ def _parse(label):
|
|
|
135
134
|
|
|
136
135
|
|
|
137
136
|
def main():
|
|
138
|
-
"""
|
|
139
|
-
|
|
140
|
-
args_dict, db_config = _parse(label)
|
|
141
|
-
|
|
142
|
-
logger = logging.getLogger()
|
|
143
|
-
logger.setLevel(logging.INFO)
|
|
137
|
+
"""Calculate photon incident angles on focal plane and primary/secondary mirrors."""
|
|
138
|
+
app_context = startup_application(_parse)
|
|
144
139
|
|
|
145
|
-
logger.info("Starting calculation of incident angles")
|
|
140
|
+
app_context.logger.info("Starting calculation of incident angles")
|
|
146
141
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
)
|
|
151
|
-
base_label = args_dict.get("label", label)
|
|
152
|
-
telescope_name = args_dict["telescope"]
|
|
142
|
+
output_dir = app_context.io_handler.get_output_directory()
|
|
143
|
+
base_label = app_context.args.get("label", get_application_label(__file__))
|
|
144
|
+
telescope_name = app_context.args["telescope"]
|
|
153
145
|
label_with_telescope = f"{base_label}_{telescope_name}"
|
|
154
146
|
|
|
155
147
|
calculator = IncidentAnglesCalculator(
|
|
156
|
-
simtel_path=
|
|
157
|
-
db_config=db_config,
|
|
158
|
-
config_data=
|
|
148
|
+
simtel_path=app_context.args["simtel_path"],
|
|
149
|
+
db_config=app_context.db_config,
|
|
150
|
+
config_data=app_context.args,
|
|
159
151
|
output_dir=output_dir,
|
|
160
152
|
label=base_label,
|
|
161
153
|
)
|
|
162
|
-
offsets = [float(v) for v in
|
|
154
|
+
offsets = [float(v) for v in app_context.args.get("off_axis_angles", [0.0])]
|
|
163
155
|
|
|
164
156
|
results_by_offset = calculator.run_for_offsets(offsets)
|
|
165
157
|
plot_incident_angles(
|
|
166
158
|
results_by_offset,
|
|
167
159
|
output_dir,
|
|
168
160
|
label_with_telescope,
|
|
169
|
-
debug_plots=
|
|
161
|
+
debug_plots=app_context.args.get("debug_plots", False),
|
|
170
162
|
)
|
|
171
163
|
total = sum(len(t) for t in results_by_offset.values())
|
|
172
164
|
summary_msg = (
|
|
@@ -175,7 +167,7 @@ def main():
|
|
|
175
167
|
)
|
|
176
168
|
if total < 1_000_000:
|
|
177
169
|
summary_msg += " (below 1e6; results may be statistically unstable)"
|
|
178
|
-
logger.info(summary_msg)
|
|
170
|
+
app_context.logger.info(summary_msg)
|
|
179
171
|
|
|
180
172
|
|
|
181
173
|
if __name__ == "__main__":
|
|
@@ -60,38 +60,24 @@ r"""
|
|
|
60
60
|
|
|
61
61
|
"""
|
|
62
62
|
|
|
63
|
-
import logging
|
|
64
63
|
from pathlib import Path
|
|
65
64
|
|
|
66
65
|
import numpy as np
|
|
67
66
|
|
|
68
67
|
import simtools.data_model.model_data_writer as writer
|
|
69
|
-
|
|
68
|
+
from simtools.application_control import get_application_label, startup_application
|
|
70
69
|
from simtools.configuration import configurator
|
|
71
70
|
from simtools.data_model import schema
|
|
72
71
|
from simtools.io import ascii_handler
|
|
73
|
-
from simtools.io.io_handler import IOHandler
|
|
74
72
|
from simtools.simtel import simtel_config_reader
|
|
75
73
|
|
|
76
74
|
|
|
77
|
-
def _parse(
|
|
78
|
-
"""
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
label: str
|
|
84
|
-
Label describing application.
|
|
85
|
-
description: str
|
|
86
|
-
Description of application.
|
|
87
|
-
|
|
88
|
-
Returns
|
|
89
|
-
-------
|
|
90
|
-
CommandLineParser
|
|
91
|
-
Command line parser object
|
|
92
|
-
|
|
93
|
-
"""
|
|
94
|
-
config = configurator.Configurator(label=label, description=description)
|
|
75
|
+
def _parse():
|
|
76
|
+
"""Parse command line configuration."""
|
|
77
|
+
config = configurator.Configurator(
|
|
78
|
+
label=get_application_label(__file__),
|
|
79
|
+
description="Convert all model parameters from sim_telarray",
|
|
80
|
+
)
|
|
95
81
|
|
|
96
82
|
config.parser.add_argument(
|
|
97
83
|
"--simtel_cfg_file",
|
|
@@ -156,8 +142,8 @@ def get_number_of_camera_pixel(args_dict, logger):
|
|
|
156
142
|
----------
|
|
157
143
|
args_dict: dict
|
|
158
144
|
Dictionary with command line arguments.
|
|
159
|
-
logger: logging.
|
|
160
|
-
|
|
145
|
+
logger: logging.logger
|
|
146
|
+
logger object
|
|
161
147
|
|
|
162
148
|
Returns
|
|
163
149
|
-------
|
|
@@ -177,7 +163,7 @@ def get_number_of_camera_pixel(args_dict, logger):
|
|
|
177
163
|
return _camera_pixel
|
|
178
164
|
|
|
179
165
|
|
|
180
|
-
def read_and_export_parameters(args_dict, logger):
|
|
166
|
+
def read_and_export_parameters(args_dict, logger, io_handler):
|
|
181
167
|
"""
|
|
182
168
|
Read and export parameters from sim_telarray configuration file to json files.
|
|
183
169
|
|
|
@@ -188,8 +174,10 @@ def read_and_export_parameters(args_dict, logger):
|
|
|
188
174
|
----------
|
|
189
175
|
args_dict: dict
|
|
190
176
|
Dictionary with command line arguments.
|
|
191
|
-
logger: logging.
|
|
192
|
-
|
|
177
|
+
logger: logging.logger
|
|
178
|
+
logger object
|
|
179
|
+
io_handler: IOHandler
|
|
180
|
+
IOHandler object
|
|
193
181
|
|
|
194
182
|
Returns
|
|
195
183
|
-------
|
|
@@ -205,9 +193,6 @@ def read_and_export_parameters(args_dict, logger):
|
|
|
205
193
|
)
|
|
206
194
|
logger.info(f"Found {len(_simtel_parameters)} parameters in sim_telarray configuration file.")
|
|
207
195
|
|
|
208
|
-
io_handler = IOHandler()
|
|
209
|
-
io_handler.set_paths(output_path=args_dict["output_path"])
|
|
210
|
-
|
|
211
196
|
_camera_pixel = get_number_of_camera_pixel(args_dict, logger)
|
|
212
197
|
|
|
213
198
|
_parameters_not_in_simtel = []
|
|
@@ -233,8 +218,7 @@ def read_and_export_parameters(args_dict, logger):
|
|
|
233
218
|
parameter_version=args_dict["parameter_version"],
|
|
234
219
|
output_file=io_handler.get_output_file(
|
|
235
220
|
f"{_parameter}-{args_dict['parameter_version']}.json",
|
|
236
|
-
|
|
237
|
-
sub_dir=f"{_parameter}",
|
|
221
|
+
sub_dir=[f"{args_dict['telescope']}", f"{_parameter}"],
|
|
238
222
|
),
|
|
239
223
|
)
|
|
240
224
|
|
|
@@ -264,8 +248,8 @@ def print_parameters_not_found(_parameters_not_in_simtel, _simtel_parameters, ar
|
|
|
264
248
|
List of sim_telarray parameters not found in simtools schema files.
|
|
265
249
|
args_dict: dict
|
|
266
250
|
Dictionary with command line arguments.
|
|
267
|
-
logger: logging.
|
|
268
|
-
|
|
251
|
+
logger: logging.logger
|
|
252
|
+
logger object
|
|
269
253
|
|
|
270
254
|
"""
|
|
271
255
|
logger.info(
|
|
@@ -314,8 +298,8 @@ def print_list_of_files(args_dict, logger):
|
|
|
314
298
|
----------
|
|
315
299
|
args_dict: dict
|
|
316
300
|
Dictionary with command line arguments.
|
|
317
|
-
logger: logging.
|
|
318
|
-
|
|
301
|
+
logger: logging.logger
|
|
302
|
+
logger object
|
|
319
303
|
|
|
320
304
|
"""
|
|
321
305
|
model_files = sorted(Path(args_dict["output_path"]).rglob("*.json"))
|
|
@@ -325,17 +309,17 @@ def print_list_of_files(args_dict, logger):
|
|
|
325
309
|
logger.info(f"{file.name}: {model_dict['value']}")
|
|
326
310
|
|
|
327
311
|
|
|
328
|
-
def main():
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
description="Convert simulation model parameters from sim_telarray to simtools format.",
|
|
332
|
-
)
|
|
333
|
-
logger = logging.getLogger()
|
|
334
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
312
|
+
def main():
|
|
313
|
+
"""Convert all simulation model parameters exported from sim_telarray format."""
|
|
314
|
+
app_context = startup_application(_parse)
|
|
335
315
|
|
|
336
|
-
_parameters_not_in_simtel, _simtel_parameters = read_and_export_parameters(
|
|
337
|
-
|
|
338
|
-
|
|
316
|
+
_parameters_not_in_simtel, _simtel_parameters = read_and_export_parameters(
|
|
317
|
+
app_context.args, app_context.logger, app_context.io_handler
|
|
318
|
+
)
|
|
319
|
+
print_parameters_not_found(
|
|
320
|
+
_parameters_not_in_simtel, _simtel_parameters, app_context.args, app_context.logger
|
|
321
|
+
)
|
|
322
|
+
print_list_of_files(app_context.args, app_context.logger)
|
|
339
323
|
|
|
340
324
|
|
|
341
325
|
if __name__ == "__main__":
|
|
@@ -54,33 +54,19 @@ Expected output is a ecsv file in the directory printed to the screen.
|
|
|
54
54
|
|
|
55
55
|
"""
|
|
56
56
|
|
|
57
|
-
import logging
|
|
58
|
-
from pathlib import Path
|
|
59
|
-
|
|
60
57
|
import simtools.data_model.model_data_writer as writer
|
|
61
|
-
|
|
58
|
+
from simtools.application_control import get_application_label, startup_application
|
|
62
59
|
from simtools.configuration import configurator
|
|
63
60
|
from simtools.data_model.metadata_collector import MetadataCollector
|
|
64
61
|
from simtools.layout import array_layout
|
|
65
62
|
|
|
66
63
|
|
|
67
|
-
def _parse(
|
|
68
|
-
"""
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
label: str
|
|
74
|
-
Label describing application.
|
|
75
|
-
description: str
|
|
76
|
-
Description of application.
|
|
77
|
-
|
|
78
|
-
Returns
|
|
79
|
-
-------
|
|
80
|
-
CommandLineParser
|
|
81
|
-
Command line parser object
|
|
82
|
-
"""
|
|
83
|
-
config = configurator.Configurator(label=label, description=description)
|
|
64
|
+
def _parse():
|
|
65
|
+
"""Parse command line configuration."""
|
|
66
|
+
config = configurator.Configurator(
|
|
67
|
+
label=get_application_label(__file__),
|
|
68
|
+
description="Print a list of array element positions",
|
|
69
|
+
)
|
|
84
70
|
|
|
85
71
|
config.parser.add_argument(
|
|
86
72
|
"--input",
|
|
@@ -139,52 +125,47 @@ def _parse(label=None, description=None):
|
|
|
139
125
|
|
|
140
126
|
def main():
|
|
141
127
|
"""Print a list of array elements."""
|
|
142
|
-
|
|
143
|
-
model_parameter_name = "array_coordinates"
|
|
144
|
-
args_dict, db_config = _parse(
|
|
145
|
-
label,
|
|
146
|
-
description=f"Print a list of array element positions ({model_parameter_name})",
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
logger = logging.getLogger()
|
|
150
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
128
|
+
app_context = startup_application(_parse)
|
|
151
129
|
|
|
152
|
-
if
|
|
153
|
-
site =
|
|
130
|
+
if app_context.args.get("input", "").endswith(".json"):
|
|
131
|
+
site = app_context.args.get("site", None)
|
|
154
132
|
metadata, validate_schema_file = None, None
|
|
155
133
|
else:
|
|
156
|
-
metadata = MetadataCollector(
|
|
134
|
+
metadata = MetadataCollector(
|
|
135
|
+
args_dict=app_context.args, model_parameter_name="array_coordinates"
|
|
136
|
+
)
|
|
157
137
|
site = metadata.get_site(from_input_meta=True)
|
|
158
138
|
validate_schema_file = metadata.get_data_model_schema_file_name()
|
|
159
139
|
|
|
160
140
|
layout = array_layout.ArrayLayout(
|
|
161
|
-
mongo_db_config=db_config,
|
|
162
|
-
model_version=
|
|
141
|
+
mongo_db_config=app_context.db_config,
|
|
142
|
+
model_version=app_context.args["model_version"],
|
|
163
143
|
site=site,
|
|
164
|
-
telescope_list_file=
|
|
165
|
-
telescope_list_metadata_file=
|
|
166
|
-
validate=not
|
|
144
|
+
telescope_list_file=app_context.args["input"],
|
|
145
|
+
telescope_list_metadata_file=app_context.args["input_meta"],
|
|
146
|
+
validate=not app_context.args["skip_input_validation"],
|
|
167
147
|
)
|
|
168
|
-
layout.select_assets(
|
|
148
|
+
layout.select_assets(app_context.args["select_assets"])
|
|
169
149
|
layout.convert_coordinates()
|
|
170
150
|
|
|
171
|
-
if
|
|
151
|
+
if app_context.args["export"] is not None:
|
|
172
152
|
product_data = (
|
|
173
153
|
layout.export_one_telescope_as_json(
|
|
174
|
-
crs_name=
|
|
154
|
+
crs_name=app_context.args["export"],
|
|
155
|
+
parameter_version=app_context.args.get("parameter_version"),
|
|
175
156
|
)
|
|
176
|
-
if
|
|
177
|
-
else layout.export_telescope_list_table(crs_name=
|
|
157
|
+
if app_context.args.get("input", "").endswith(".json")
|
|
158
|
+
else layout.export_telescope_list_table(crs_name=app_context.args["export"])
|
|
178
159
|
)
|
|
179
160
|
writer.ModelDataWriter.dump(
|
|
180
|
-
args_dict=
|
|
161
|
+
args_dict=app_context.args,
|
|
181
162
|
metadata=metadata,
|
|
182
163
|
product_data=product_data,
|
|
183
164
|
validate_schema_file=validate_schema_file,
|
|
184
165
|
)
|
|
185
166
|
else:
|
|
186
167
|
layout.print_telescope_list(
|
|
187
|
-
crs_name=
|
|
168
|
+
crs_name=app_context.args["print"],
|
|
188
169
|
)
|
|
189
170
|
|
|
190
171
|
|
|
@@ -35,33 +35,18 @@ r"""
|
|
|
35
35
|
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
|
-
import logging
|
|
39
|
-
from pathlib import Path
|
|
40
|
-
|
|
41
38
|
import simtools.data_model.model_data_writer as writer
|
|
42
|
-
|
|
39
|
+
from simtools.application_control import get_application_label, startup_application
|
|
43
40
|
from simtools.configuration import configurator
|
|
44
41
|
from simtools.simtel.simtel_config_reader import SimtelConfigReader
|
|
45
42
|
|
|
46
43
|
|
|
47
|
-
def _parse(
|
|
48
|
-
"""
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
label: str
|
|
54
|
-
Label describing application.
|
|
55
|
-
description: str
|
|
56
|
-
Description of application.
|
|
57
|
-
|
|
58
|
-
Returns
|
|
59
|
-
-------
|
|
60
|
-
CommandLineParser
|
|
61
|
-
Command line parser object
|
|
62
|
-
|
|
63
|
-
"""
|
|
64
|
-
config = configurator.Configurator(label=label, description=description)
|
|
44
|
+
def _parse():
|
|
45
|
+
"""Parse command line configuration."""
|
|
46
|
+
config = configurator.Configurator(
|
|
47
|
+
label=get_application_label(__file__),
|
|
48
|
+
description="Convert simulation model parameter from sim_telarray to simtools format.",
|
|
49
|
+
)
|
|
65
50
|
|
|
66
51
|
config.parser.add_argument(
|
|
67
52
|
"--schema", help="Schema file for model parameter validation", required=True
|
|
@@ -81,37 +66,31 @@ def _parse(label=None, description=None):
|
|
|
81
66
|
return config.initialize(simulation_model=["telescope", "parameter_version"], output=True)
|
|
82
67
|
|
|
83
68
|
|
|
84
|
-
def main():
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
description="Convert simulation model parameter from sim_telarray to simtools format.",
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
logger = logging.getLogger()
|
|
91
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
69
|
+
def main():
|
|
70
|
+
"""Convert simulation model parameter from sim_telarray to simtools format."""
|
|
71
|
+
app_context = startup_application(_parse, setup_io_handler=False)
|
|
92
72
|
|
|
93
73
|
simtel_config_reader = SimtelConfigReader(
|
|
94
|
-
schema_file=
|
|
95
|
-
simtel_config_file=
|
|
96
|
-
simtel_telescope_name=
|
|
74
|
+
schema_file=app_context.args["schema"],
|
|
75
|
+
simtel_config_file=app_context.args["simtel_cfg_file"],
|
|
76
|
+
simtel_telescope_name=app_context.args["simtel_telescope_name"],
|
|
97
77
|
)
|
|
98
|
-
logger.info(f"Simtel parameter: {simtel_config_reader.parameter_dict}")
|
|
78
|
+
app_context.logger.info(f"Simtel parameter: {simtel_config_reader.parameter_dict}")
|
|
99
79
|
if simtel_config_reader.parameter_dict is None or len(simtel_config_reader.parameter_dict) == 0:
|
|
100
|
-
logger.error("Parameter not found in sim_telarray configuration file.")
|
|
80
|
+
app_context.logger.error("Parameter not found in sim_telarray configuration file.")
|
|
101
81
|
return
|
|
102
82
|
|
|
103
83
|
simtel_config_reader.compare_simtel_config_with_schema()
|
|
104
84
|
|
|
105
85
|
_json_dict = writer.ModelDataWriter.dump_model_parameter(
|
|
106
86
|
parameter_name=simtel_config_reader.parameter_name,
|
|
107
|
-
value=simtel_config_reader.parameter_dict.get(
|
|
108
|
-
instrument=
|
|
109
|
-
parameter_version=
|
|
110
|
-
output_file=
|
|
111
|
-
output_path=
|
|
112
|
-
use_plain_output_path=args_dict.get("use_plain_output_path"),
|
|
87
|
+
value=simtel_config_reader.parameter_dict.get(app_context.args["simtel_telescope_name"]),
|
|
88
|
+
instrument=app_context.args["telescope"],
|
|
89
|
+
parameter_version=app_context.args["parameter_version"],
|
|
90
|
+
output_file=app_context.args["output_file"],
|
|
91
|
+
output_path=app_context.args.get("output_path"),
|
|
113
92
|
)
|
|
114
|
-
logger.info(f"Validated parameter: {_json_dict}")
|
|
93
|
+
app_context.logger.info(f"Validated parameter: {_json_dict}")
|
|
115
94
|
|
|
116
95
|
|
|
117
96
|
if __name__ == "__main__":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/python3
|
|
2
2
|
|
|
3
|
-
"""
|
|
3
|
+
r"""
|
|
4
4
|
Add a file to a DB.
|
|
5
5
|
|
|
6
6
|
The name and location of the file are required.
|
|
@@ -37,21 +37,22 @@
|
|
|
37
37
|
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
|
-
import logging
|
|
41
40
|
import uuid
|
|
42
41
|
from pathlib import Path
|
|
43
42
|
|
|
44
43
|
import simtools.utils.general as gen
|
|
44
|
+
from simtools.application_control import get_application_label, startup_application
|
|
45
45
|
from simtools.configuration import configurator
|
|
46
46
|
from simtools.db import db_handler
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
def _parse():
|
|
50
|
+
"""Parse command line configuration."""
|
|
50
51
|
config = configurator.Configurator(
|
|
52
|
+
label=get_application_label(__file__),
|
|
51
53
|
description="Add file to the DB.",
|
|
52
54
|
usage="simtools-add-file-to-db --file_name test_application.dat --db test-data",
|
|
53
55
|
)
|
|
54
|
-
|
|
55
56
|
group = config.parser.add_mutually_exclusive_group(required=True)
|
|
56
57
|
group.add_argument(
|
|
57
58
|
"--file_name",
|
|
@@ -135,8 +136,8 @@ def confirm_and_insert_files(files_to_insert, args_dict, db, logger):
|
|
|
135
136
|
Dictionary of parsed command-line arguments.
|
|
136
137
|
db : DatabaseHandler
|
|
137
138
|
Database handler object.
|
|
138
|
-
logger : logging.
|
|
139
|
-
|
|
139
|
+
logger : logging.logger
|
|
140
|
+
logger object for logging messages.
|
|
140
141
|
"""
|
|
141
142
|
plural = "" if len(files_to_insert) == 1 else "s"
|
|
142
143
|
|
|
@@ -161,16 +162,14 @@ def confirm_and_insert_files(files_to_insert, args_dict, db, logger):
|
|
|
161
162
|
db.db_client.drop_database(args_dict["db"])
|
|
162
163
|
|
|
163
164
|
|
|
164
|
-
def main():
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
logger = logging.getLogger()
|
|
168
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
165
|
+
def main():
|
|
166
|
+
"""Add files to the database."""
|
|
167
|
+
app_context = startup_application(_parse, setup_io_handler=False)
|
|
169
168
|
|
|
170
|
-
db = db_handler.DatabaseHandler(mongo_db_config=db_config)
|
|
169
|
+
db = db_handler.DatabaseHandler(mongo_db_config=app_context.db_config)
|
|
171
170
|
|
|
172
|
-
files_to_insert = collect_files_to_insert(
|
|
173
|
-
confirm_and_insert_files(files_to_insert,
|
|
171
|
+
files_to_insert = collect_files_to_insert(app_context.args, app_context.logger, db)
|
|
172
|
+
confirm_and_insert_files(files_to_insert, app_context.args, db, app_context.logger)
|
|
174
173
|
|
|
175
174
|
|
|
176
175
|
if __name__ == "__main__":
|
|
@@ -51,31 +51,19 @@ r"""
|
|
|
51
51
|
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
-
import logging
|
|
55
54
|
from pathlib import Path
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
from simtools.application_control import get_application_label, startup_application
|
|
58
57
|
from simtools.configuration import configurator
|
|
59
58
|
from simtools.db import db_handler, db_model_upload
|
|
60
59
|
|
|
61
60
|
|
|
62
|
-
def _parse(
|
|
63
|
-
"""
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
label : str
|
|
69
|
-
Label describing application.
|
|
70
|
-
description : str
|
|
71
|
-
Description of application.
|
|
72
|
-
|
|
73
|
-
Returns
|
|
74
|
-
-------
|
|
75
|
-
CommandLineParser
|
|
76
|
-
Command line parser object.
|
|
77
|
-
"""
|
|
78
|
-
config = configurator.Configurator(label=label, description=description)
|
|
61
|
+
def _parse():
|
|
62
|
+
"""Parse command line configuration."""
|
|
63
|
+
config = configurator.Configurator(
|
|
64
|
+
label=get_application_label(__file__),
|
|
65
|
+
description="Add or update a model parameter database to the DB",
|
|
66
|
+
)
|
|
79
67
|
config.parser.add_argument(
|
|
80
68
|
"--input_path",
|
|
81
69
|
help="Path to simulation model repository.",
|
|
@@ -102,20 +90,19 @@ def _parse(label=None, description=None):
|
|
|
102
90
|
|
|
103
91
|
|
|
104
92
|
def main():
|
|
105
|
-
"""
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
db_model_upload.add_production_tables_to_db(input_path=Path(args_dict["input_path"]), db=db)
|
|
93
|
+
"""Add or update a model parameter database to the DB."""
|
|
94
|
+
app_context = startup_application(_parse, setup_io_handler=False)
|
|
95
|
+
|
|
96
|
+
db = db_handler.DatabaseHandler(mongo_db_config=app_context.db_config)
|
|
97
|
+
|
|
98
|
+
if app_context.args.get("type") == "model_parameters":
|
|
99
|
+
db_model_upload.add_model_parameters_to_db(
|
|
100
|
+
input_path=Path(app_context.args["input_path"]), db=db
|
|
101
|
+
)
|
|
102
|
+
elif app_context.args.get("type") == "production_tables":
|
|
103
|
+
db_model_upload.add_production_tables_to_db(
|
|
104
|
+
input_path=Path(app_context.args["input_path"]), db=db
|
|
105
|
+
)
|
|
119
106
|
|
|
120
107
|
|
|
121
108
|
if __name__ == "__main__":
|