gammasimtools 0.6.1__py3-none-any.whl → 0.8.1__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.8.1.dist-info/METADATA +172 -0
- gammasimtools-0.8.1.dist-info/RECORD +346 -0
- {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.1.dist-info}/WHEEL +1 -1
- gammasimtools-0.8.1.dist-info/entry_points.txt +31 -0
- simtools/_version.py +2 -2
- simtools/applications/calculate_trigger_rate.py +210 -0
- simtools/applications/convert_all_model_parameters_from_simtel.py +372 -0
- simtools/applications/{print_array_elements.py → convert_geo_coordinates_of_array_elements.py} +58 -63
- simtools/applications/convert_model_parameter_from_simtel.py +119 -0
- simtools/applications/{add_file_to_db.py → db_add_file_to_db.py} +70 -60
- simtools/applications/db_add_model_parameters_from_repository_to_db.py +184 -0
- simtools/applications/db_add_value_from_json_to_db.py +105 -0
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +180 -0
- simtools/applications/db_get_array_layouts_from_db.py +162 -0
- simtools/applications/{get_file_from_db.py → db_get_file_from_db.py} +30 -34
- simtools/applications/db_get_parameter_from_db.py +131 -0
- simtools/applications/db_inspect_databases.py +52 -0
- simtools/applications/derive_mirror_rnda.py +39 -255
- simtools/applications/derive_psf_parameters.py +441 -0
- simtools/applications/generate_array_config.py +82 -0
- simtools/applications/generate_corsika_histograms.py +52 -52
- simtools/applications/generate_default_metadata.py +5 -8
- simtools/applications/generate_regular_arrays.py +117 -0
- simtools/applications/generate_simtel_array_histograms.py +97 -56
- simtools/applications/plot_array_layout.py +345 -115
- simtools/applications/production_generate_simulation_config.py +158 -0
- simtools/applications/production_scale_events.py +168 -0
- simtools/applications/simulate_light_emission.py +478 -0
- simtools/applications/simulate_prod.py +97 -175
- simtools/applications/submit_data_from_external.py +9 -12
- simtools/applications/submit_model_parameter_from_external.py +122 -0
- simtools/applications/validate_camera_efficiency.py +35 -102
- simtools/applications/validate_camera_fov.py +20 -19
- simtools/applications/{compare_cumulative_psf.py → validate_cumulative_psf.py} +45 -44
- simtools/applications/validate_file_using_schema.py +113 -47
- simtools/applications/validate_optics.py +17 -22
- simtools/camera_efficiency.py +193 -202
- simtools/configuration/commandline_parser.py +384 -96
- simtools/configuration/configurator.py +55 -71
- simtools/constants.py +5 -5
- simtools/corsika/corsika_config.py +482 -342
- simtools/corsika/corsika_histograms.py +226 -204
- simtools/corsika/corsika_histograms_visualize.py +23 -24
- simtools/corsika/primary_particle.py +159 -0
- simtools/data_model/data_reader.py +25 -20
- simtools/data_model/format_checkers.py +52 -0
- simtools/data_model/metadata_collector.py +210 -184
- simtools/data_model/metadata_model.py +115 -37
- simtools/data_model/model_data_writer.py +335 -26
- simtools/data_model/validate_data.py +366 -154
- simtools/db/db_array_elements.py +130 -0
- simtools/db/db_from_repo_handler.py +106 -0
- simtools/db/db_handler.py +1246 -0
- simtools/io_operations/hdf5_handler.py +3 -1
- simtools/io_operations/io_handler.py +32 -57
- simtools/job_execution/job_manager.py +82 -69
- simtools/layout/array_layout.py +325 -537
- simtools/layout/geo_coordinates.py +8 -11
- simtools/layout/telescope_position.py +163 -86
- simtools/model/array_model.py +305 -256
- simtools/model/calibration_model.py +50 -0
- simtools/model/camera.py +233 -493
- simtools/model/mirrors.py +61 -44
- simtools/model/model_parameter.py +602 -0
- simtools/model/model_utils.py +7 -35
- simtools/model/site_model.py +161 -0
- simtools/model/telescope_model.py +127 -621
- simtools/production_configuration/calculate_statistical_errors_grid_point.py +454 -0
- simtools/production_configuration/event_scaler.py +146 -0
- simtools/production_configuration/generate_simulation_config.py +193 -0
- simtools/production_configuration/interpolation_handler.py +197 -0
- simtools/ray_tracing/__init__.py +0 -0
- simtools/ray_tracing/mirror_panel_psf.py +280 -0
- simtools/{psf_analysis.py → ray_tracing/psf_analysis.py} +133 -47
- simtools/ray_tracing/ray_tracing.py +646 -0
- simtools/runners/__init__.py +0 -0
- simtools/runners/corsika_runner.py +240 -0
- simtools/runners/corsika_simtel_runner.py +225 -0
- simtools/runners/runner_services.py +307 -0
- simtools/runners/simtel_runner.py +224 -0
- simtools/schemas/array_elements.yml +137 -0
- simtools/schemas/integration_tests_config.metaschema.yml +93 -0
- simtools/schemas/metadata.metaschema.yml +6 -0
- simtools/schemas/model_parameter.metaschema.yml +78 -0
- simtools/schemas/{data.metaschema.yml → model_parameter_and_data_schema.metaschema.yml} +27 -44
- simtools/schemas/model_parameters/adjust_gain.schema.yml +37 -0
- simtools/schemas/model_parameters/altitude.schema.yml +37 -0
- simtools/schemas/model_parameters/array_coordinates.schema.yml +33 -0
- simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +77 -0
- simtools/schemas/model_parameters/array_element_position_ground.schema.yml +39 -0
- simtools/schemas/model_parameters/array_element_position_utm.schema.yml +39 -0
- simtools/schemas/model_parameters/array_layouts.schema.yml +48 -0
- simtools/schemas/model_parameters/array_triggers.schema.yml +93 -0
- simtools/schemas/model_parameters/asum_clipping.schema.yml +38 -0
- simtools/schemas/model_parameters/asum_offset.schema.yml +35 -0
- simtools/schemas/model_parameters/asum_shaping.schema.yml +35 -0
- simtools/schemas/model_parameters/asum_threshold.schema.yml +38 -0
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +32 -0
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +35 -0
- simtools/schemas/model_parameters/axes_offsets.schema.yml +53 -0
- simtools/schemas/model_parameters/camera_body_diameter.schema.yml +40 -0
- simtools/schemas/model_parameters/camera_body_shape.schema.yml +45 -0
- simtools/schemas/model_parameters/camera_config_file.schema.yml +40 -0
- simtools/schemas/model_parameters/camera_config_rotate.schema.yml +36 -0
- simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +43 -0
- simtools/schemas/model_parameters/camera_degraded_map.schema.yml +42 -0
- simtools/schemas/model_parameters/camera_depth.schema.yml +42 -0
- simtools/schemas/model_parameters/camera_filter.schema.yml +45 -0
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +29 -0
- simtools/schemas/model_parameters/camera_pixels.schema.yml +36 -0
- simtools/schemas/model_parameters/camera_transmission.schema.yml +41 -0
- simtools/schemas/model_parameters/channels_per_chip.schema.yml +36 -0
- simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +35 -0
- simtools/schemas/model_parameters/corsika_cherenkov_photon_bunch_size.schema.yml +27 -0
- simtools/schemas/model_parameters/corsika_cherenkov_photon_wavelength_range.schema.yml +38 -0
- simtools/schemas/model_parameters/corsika_first_interaction_height.schema.yml +28 -0
- simtools/schemas/model_parameters/corsika_iact_io_buffer.schema.yml +23 -0
- simtools/schemas/model_parameters/corsika_iact_max_bunches.schema.yml +27 -0
- simtools/schemas/model_parameters/corsika_iact_split_auto.schema.yml +28 -0
- simtools/schemas/model_parameters/corsika_longitudinal_shower_development.schema.yml +27 -0
- simtools/schemas/model_parameters/corsika_observation_level.schema.yml +38 -0
- simtools/schemas/model_parameters/corsika_particle_kinetic_energy_cutoff.schema.yml +52 -0
- simtools/schemas/model_parameters/corsika_starting_grammage.schema.yml +27 -0
- simtools/schemas/model_parameters/dark_events.schema.yml +32 -0
- simtools/schemas/model_parameters/default_trigger.schema.yml +35 -0
- simtools/schemas/model_parameters/design_model.schema.yml +31 -0
- simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +32 -0
- simtools/schemas/model_parameters/disc_bins.schema.yml +39 -0
- simtools/schemas/model_parameters/disc_start.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +42 -0
- simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +39 -0
- simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +40 -0
- simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +33 -0
- simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +42 -0
- simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +37 -0
- simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +44 -0
- simtools/schemas/model_parameters/discriminator_threshold.schema.yml +36 -0
- simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +45 -0
- simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +40 -0
- simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +41 -0
- simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +38 -0
- simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +38 -0
- simtools/schemas/model_parameters/dish_shape_length.schema.yml +41 -0
- simtools/schemas/model_parameters/dsum_clipping.schema.yml +38 -0
- simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +38 -0
- simtools/schemas/model_parameters/dsum_offset.schema.yml +37 -0
- simtools/schemas/model_parameters/dsum_pedsub.schema.yml +33 -0
- simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +39 -0
- simtools/schemas/model_parameters/dsum_prescale.schema.yml +44 -0
- simtools/schemas/model_parameters/dsum_presum_max.schema.yml +38 -0
- simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +45 -0
- simtools/schemas/model_parameters/dsum_shaping.schema.yml +44 -0
- simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +32 -0
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +43 -0
- simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +42 -0
- simtools/schemas/model_parameters/effective_focal_length.schema.yml +61 -0
- simtools/schemas/model_parameters/epsg_code.schema.yml +37 -0
- simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +35 -0
- simtools/schemas/model_parameters/fadc_amplitude.schema.yml +46 -0
- simtools/schemas/model_parameters/fadc_bins.schema.yml +40 -0
- simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +50 -0
- simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +38 -0
- simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +49 -0
- simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +47 -0
- simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +51 -0
- simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +37 -0
- simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +49 -0
- simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +39 -0
- simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +40 -0
- simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +50 -0
- simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_max_signal.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_max_sum.schema.yml +39 -0
- simtools/schemas/model_parameters/fadc_mhz.schema.yml +31 -0
- simtools/schemas/model_parameters/fadc_noise.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_pedestal.schema.yml +40 -0
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +39 -0
- simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +50 -0
- simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +43 -0
- simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +42 -0
- simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +42 -0
- simtools/schemas/model_parameters/flatfielding.schema.yml +37 -0
- simtools/schemas/model_parameters/focal_length.schema.yml +45 -0
- simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +158 -0
- simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +29 -0
- simtools/schemas/model_parameters/focus_offset.schema.yml +66 -0
- simtools/schemas/model_parameters/gain_variation.schema.yml +43 -0
- simtools/schemas/model_parameters/geomag_horizontal.schema.yml +34 -0
- simtools/schemas/model_parameters/geomag_rotation.schema.yml +37 -0
- simtools/schemas/model_parameters/geomag_vertical.schema.yml +34 -0
- simtools/schemas/model_parameters/hg_lg_variation.schema.yml +36 -0
- simtools/schemas/model_parameters/iobuf_maximum.schema.yml +34 -0
- simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +34 -0
- simtools/schemas/model_parameters/laser_events.schema.yml +36 -0
- simtools/schemas/model_parameters/laser_external_trigger.schema.yml +35 -0
- simtools/schemas/model_parameters/laser_photons.schema.yml +32 -0
- simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +34 -0
- simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +34 -0
- simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +33 -0
- simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +33 -0
- simtools/schemas/model_parameters/laser_var_photons.schema.yml +33 -0
- simtools/schemas/model_parameters/laser_wavelength.schema.yml +33 -0
- simtools/schemas/model_parameters/led_events.schema.yml +34 -0
- simtools/schemas/model_parameters/led_photons.schema.yml +34 -0
- simtools/schemas/model_parameters/led_pulse_offset.schema.yml +32 -0
- simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +33 -0
- simtools/schemas/model_parameters/led_var_photons.schema.yml +34 -0
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +41 -0
- simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +43 -0
- simtools/schemas/model_parameters/min_photoelectrons.schema.yml +35 -0
- simtools/schemas/model_parameters/min_photons.schema.yml +32 -0
- simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +36 -0
- simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +64 -0
- simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +64 -0
- simtools/schemas/model_parameters/mirror_class.schema.yml +41 -0
- simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +51 -0
- simtools/schemas/model_parameters/mirror_focal_length.schema.yml +42 -0
- simtools/schemas/model_parameters/mirror_list.schema.yml +38 -0
- simtools/schemas/model_parameters/mirror_offset.schema.yml +41 -0
- simtools/schemas/model_parameters/mirror_panel_2f_measurements.schema.yml +39 -0
- simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +61 -0
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +40 -0
- simtools/schemas/model_parameters/multiplicity_offset.schema.yml +46 -0
- simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +51 -0
- simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +37 -0
- simtools/schemas/model_parameters/nsb_offaxis.schema.yml +79 -0
- simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +47 -0
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +34 -0
- simtools/schemas/model_parameters/nsb_reference_value.schema.yml +33 -0
- simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +35 -0
- simtools/schemas/model_parameters/nsb_skymap.schema.yml +39 -0
- simtools/schemas/model_parameters/nsb_spectrum.schema.yml +50 -0
- simtools/schemas/model_parameters/num_gains.schema.yml +34 -0
- simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +33 -0
- simtools/schemas/model_parameters/optics_properties.schema.yml +31 -0
- simtools/schemas/model_parameters/parabolic_dish.schema.yml +32 -0
- simtools/schemas/model_parameters/pedestal_events.schema.yml +32 -0
- simtools/schemas/model_parameters/photon_delay.schema.yml +38 -0
- simtools/schemas/model_parameters/photons_per_run.schema.yml +33 -0
- simtools/schemas/model_parameters/pixel_cells.schema.yml +35 -0
- simtools/schemas/model_parameters/pixels_parallel.schema.yml +54 -0
- simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +40 -0
- simtools/schemas/model_parameters/pm_average_gain.schema.yml +34 -0
- simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +40 -0
- simtools/schemas/model_parameters/pm_gain_index.schema.yml +36 -0
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +41 -0
- simtools/schemas/model_parameters/pm_transit_time.schema.yml +63 -0
- simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +39 -0
- simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +42 -0
- simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +33 -0
- simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +33 -0
- simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +29 -0
- simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +168 -0
- simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +36 -0
- simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +34 -0
- simtools/schemas/model_parameters/qe_variation.schema.yml +43 -0
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +42 -0
- simtools/schemas/model_parameters/random_focal_length.schema.yml +45 -0
- simtools/schemas/model_parameters/random_generator.schema.yml +36 -0
- simtools/schemas/model_parameters/reference_point_altitude.schema.yml +35 -0
- simtools/schemas/model_parameters/reference_point_latitude.schema.yml +36 -0
- simtools/schemas/model_parameters/reference_point_longitude.schema.yml +36 -0
- simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +34 -0
- simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +34 -0
- simtools/schemas/model_parameters/sampled_output.schema.yml +31 -0
- simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +34 -0
- simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +79 -0
- simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +42 -0
- simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +41 -0
- simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +33 -0
- simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +36 -0
- simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +29 -0
- simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +168 -0
- simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +36 -0
- simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +35 -0
- simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +37 -0
- simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +40 -0
- simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +40 -0
- simtools/schemas/model_parameters/store_photoelectrons.schema.yml +41 -0
- simtools/schemas/model_parameters/tailcut_scale.schema.yml +40 -0
- simtools/schemas/model_parameters/telescope_axis_height.schema.yml +31 -0
- simtools/schemas/model_parameters/telescope_random_angle.schema.yml +35 -0
- simtools/schemas/model_parameters/telescope_random_error.schema.yml +34 -0
- simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +37 -0
- simtools/schemas/model_parameters/telescope_transmission.schema.yml +113 -0
- simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +41 -0
- simtools/schemas/model_parameters/teltrig_min_time.schema.yml +36 -0
- simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +36 -0
- simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +37 -0
- simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +38 -0
- simtools/schemas/model_parameters/transit_time_error.schema.yml +45 -0
- simtools/schemas/model_parameters/transit_time_jitter.schema.yml +36 -0
- simtools/schemas/model_parameters/trigger_current_limit.schema.yml +32 -0
- simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +53 -0
- simtools/schemas/model_parameters/trigger_pixels.schema.yml +40 -0
- simtools/simtel/simtel_config_reader.py +353 -0
- simtools/simtel/simtel_config_writer.py +244 -63
- simtools/simtel/{simtel_events.py → simtel_io_events.py} +26 -25
- simtools/simtel/simtel_io_histogram.py +661 -0
- simtools/simtel/simtel_io_histograms.py +569 -0
- simtools/simtel/simulator_array.py +145 -0
- simtools/simtel/{simtel_runner_camera_efficiency.py → simulator_camera_efficiency.py} +76 -52
- simtools/simtel/simulator_light_emission.py +473 -0
- simtools/simtel/simulator_ray_tracing.py +262 -0
- simtools/simulator.py +220 -446
- simtools/testing/__init__.py +0 -0
- simtools/testing/assertions.py +151 -0
- simtools/testing/configuration.py +226 -0
- simtools/testing/helpers.py +42 -0
- simtools/testing/validate_output.py +240 -0
- simtools/utils/general.py +340 -437
- simtools/utils/geometry.py +12 -12
- simtools/utils/names.py +258 -644
- simtools/utils/value_conversion.py +176 -0
- simtools/version.py +2 -0
- simtools/visualization/legend_handlers.py +135 -152
- simtools/visualization/plot_camera.py +379 -0
- simtools/visualization/visualize.py +346 -167
- gammasimtools-0.6.1.dist-info/METADATA +0 -180
- gammasimtools-0.6.1.dist-info/RECORD +0 -91
- gammasimtools-0.6.1.dist-info/entry_points.txt +0 -23
- simtools/applications/db_development_tools/add_new_parameter_to_db.py +0 -81
- simtools/applications/db_development_tools/add_unit_to_parameter_in_db.py +0 -59
- simtools/applications/db_development_tools/mark_non_optics_parameters_non_applicable.py +0 -102
- simtools/applications/get_parameter.py +0 -92
- simtools/applications/make_regular_arrays.py +0 -160
- simtools/applications/produce_array_config.py +0 -136
- simtools/applications/production.py +0 -313
- simtools/applications/sim_showers_for_trigger_rates.py +0 -187
- simtools/applications/tune_psf.py +0 -334
- simtools/corsika/corsika_default_config.py +0 -282
- simtools/corsika/corsika_runner.py +0 -450
- simtools/corsika_simtel/corsika_simtel_runner.py +0 -197
- simtools/db_handler.py +0 -1480
- simtools/ray_tracing.py +0 -525
- simtools/simtel/simtel_histograms.py +0 -414
- simtools/simtel/simtel_runner.py +0 -244
- simtools/simtel/simtel_runner_array.py +0 -293
- simtools/simtel/simtel_runner_ray_tracing.py +0 -277
- {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.1.dist-info}/LICENSE +0 -0
- {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.1.dist-info}/top_level.txt +0 -0
- /simtools/{corsika_simtel → db}/__init__.py +0 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"""Base service methods for simulation runners."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
from simtools.io_operations import io_handler
|
|
7
|
+
|
|
8
|
+
_logger = logging.getLogger(__name__)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class RunnerServices:
|
|
12
|
+
"""
|
|
13
|
+
Base services for simulation runners.
|
|
14
|
+
|
|
15
|
+
Parameters
|
|
16
|
+
----------
|
|
17
|
+
corsika_config : CorsikaConfig
|
|
18
|
+
Configuration parameters for CORSIKA.
|
|
19
|
+
label : str
|
|
20
|
+
Label.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self, corsika_config, label=None):
|
|
24
|
+
"""Initialize RunnerServices."""
|
|
25
|
+
self._logger = logging.getLogger(__name__)
|
|
26
|
+
self._logger.debug("Init RunnerServices")
|
|
27
|
+
self.label = label
|
|
28
|
+
self.corsika_config = corsika_config
|
|
29
|
+
self.directory = {}
|
|
30
|
+
|
|
31
|
+
def _get_info_for_file_name(self, run_number):
|
|
32
|
+
"""
|
|
33
|
+
Return dictionary for building names for simulation output files.
|
|
34
|
+
|
|
35
|
+
Parameters
|
|
36
|
+
----------
|
|
37
|
+
run_number : int
|
|
38
|
+
Run number.
|
|
39
|
+
|
|
40
|
+
Returns
|
|
41
|
+
-------
|
|
42
|
+
dict
|
|
43
|
+
Dictionary with the keys or building the file names for simulation output files.
|
|
44
|
+
"""
|
|
45
|
+
_vc_high = self.corsika_config.get_config_parameter("VIEWCONE")[1]
|
|
46
|
+
primary_name = self.corsika_config.primary
|
|
47
|
+
if primary_name == "gamma" and _vc_high > 0:
|
|
48
|
+
primary_name = "gamma_diffuse"
|
|
49
|
+
return {
|
|
50
|
+
"run_number": self.corsika_config.validate_run_number(run_number),
|
|
51
|
+
"primary": primary_name,
|
|
52
|
+
"array_name": self.corsika_config.array_model.layout_name,
|
|
53
|
+
"site": self.corsika_config.array_model.site,
|
|
54
|
+
"label": self.label,
|
|
55
|
+
"zenith": self.corsika_config.zenith_angle,
|
|
56
|
+
"azimuth": self.corsika_config.azimuth_angle,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@staticmethod
|
|
60
|
+
def _get_simulation_software_list(simulation_software):
|
|
61
|
+
"""
|
|
62
|
+
Return a list of simulation software based on the input string.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
simulation_software: String representing the desired software.
|
|
66
|
+
|
|
67
|
+
Returns
|
|
68
|
+
-------
|
|
69
|
+
List of simulation software names.
|
|
70
|
+
"""
|
|
71
|
+
software_map = {
|
|
72
|
+
"corsika": ["corsika"],
|
|
73
|
+
"simtel": ["simtel"],
|
|
74
|
+
"corsika_simtel": ["corsika", "simtel"],
|
|
75
|
+
}
|
|
76
|
+
return software_map.get(simulation_software.lower(), [])
|
|
77
|
+
|
|
78
|
+
def load_data_directories(self, simulation_software):
|
|
79
|
+
"""
|
|
80
|
+
Create and return directories for output, data, log and input.
|
|
81
|
+
|
|
82
|
+
Parameters
|
|
83
|
+
----------
|
|
84
|
+
simulation_software : str
|
|
85
|
+
Simulation software to be used.
|
|
86
|
+
|
|
87
|
+
Returns
|
|
88
|
+
-------
|
|
89
|
+
dict
|
|
90
|
+
Dictionary containing paths requires for simulation configuration.
|
|
91
|
+
"""
|
|
92
|
+
self.directory["output"] = io_handler.IOHandler().get_output_directory(self.label)
|
|
93
|
+
_logger.debug(f"Creating output dir {self.directory['output']}")
|
|
94
|
+
for dir_name in ["sub_scripts", "sub_logs"]:
|
|
95
|
+
self.directory[dir_name] = self.directory["output"].joinpath(dir_name)
|
|
96
|
+
self.directory[dir_name].mkdir(parents=True, exist_ok=True)
|
|
97
|
+
for _simulation_software in self._get_simulation_software_list(simulation_software):
|
|
98
|
+
for dir_name in ["data", "inputs", "logs"]:
|
|
99
|
+
self.directory[dir_name] = self.directory["output"].joinpath(
|
|
100
|
+
_simulation_software, dir_name
|
|
101
|
+
)
|
|
102
|
+
self.directory[dir_name].mkdir(parents=True, exist_ok=True)
|
|
103
|
+
self._logger.debug(f"Data directories for {simulation_software}: {self.directory}")
|
|
104
|
+
return self.directory
|
|
105
|
+
|
|
106
|
+
def has_file(self, file_type, run_number=None, mode="out"):
|
|
107
|
+
"""
|
|
108
|
+
Check that the file of file_type for the specified run number exists.
|
|
109
|
+
|
|
110
|
+
Parameters
|
|
111
|
+
----------
|
|
112
|
+
file_type: str
|
|
113
|
+
File type to check.
|
|
114
|
+
run_number: int
|
|
115
|
+
Run number.
|
|
116
|
+
|
|
117
|
+
"""
|
|
118
|
+
run_sub_file = self.get_file_name(file_type, run_number=run_number, mode=mode)
|
|
119
|
+
_logger.debug(f"Checking if {run_sub_file} exists")
|
|
120
|
+
return Path(run_sub_file).is_file()
|
|
121
|
+
|
|
122
|
+
def _get_file_basename(self, run_number):
|
|
123
|
+
"""
|
|
124
|
+
Get the base name for the simulation files.
|
|
125
|
+
|
|
126
|
+
Parameters
|
|
127
|
+
----------
|
|
128
|
+
run_number: int
|
|
129
|
+
Run number.
|
|
130
|
+
|
|
131
|
+
Returns
|
|
132
|
+
-------
|
|
133
|
+
str
|
|
134
|
+
Base name for the simulation files.
|
|
135
|
+
"""
|
|
136
|
+
info_for_file_name = self._get_info_for_file_name(run_number)
|
|
137
|
+
file_label = f"_{info_for_file_name['label']}" if info_for_file_name.get("label") else ""
|
|
138
|
+
zenith = self.corsika_config.get_config_parameter("THETAP")[0]
|
|
139
|
+
azimuth = self.corsika_config.azimuth_angle
|
|
140
|
+
run_dir = self._get_run_number_string(info_for_file_name["run_number"])
|
|
141
|
+
return (
|
|
142
|
+
f"{run_dir}_{info_for_file_name['primary']}_"
|
|
143
|
+
f"za{round(zenith):02}deg_azm{azimuth:03}deg_"
|
|
144
|
+
f"{info_for_file_name['site']}_{info_for_file_name['array_name']}{file_label}"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
def _get_log_file_path(self, file_type, file_name):
|
|
148
|
+
"""
|
|
149
|
+
Return path for log files.
|
|
150
|
+
|
|
151
|
+
Parameters
|
|
152
|
+
----------
|
|
153
|
+
file_type : str
|
|
154
|
+
File type.
|
|
155
|
+
file_name : str
|
|
156
|
+
File name.
|
|
157
|
+
|
|
158
|
+
Returns
|
|
159
|
+
-------
|
|
160
|
+
Path
|
|
161
|
+
Path for log files.
|
|
162
|
+
"""
|
|
163
|
+
log_suffixes = {
|
|
164
|
+
"log": ".log.gz",
|
|
165
|
+
"histogram": ".hdata.zst",
|
|
166
|
+
}
|
|
167
|
+
return self.directory["logs"].joinpath(f"{file_name}{log_suffixes[file_type]}")
|
|
168
|
+
|
|
169
|
+
def _get_data_file_path(self, file_type, file_name, run_number):
|
|
170
|
+
"""
|
|
171
|
+
Return path for data files.
|
|
172
|
+
|
|
173
|
+
Parameters
|
|
174
|
+
----------
|
|
175
|
+
file_type : str
|
|
176
|
+
File type.
|
|
177
|
+
file_name : str
|
|
178
|
+
File name.
|
|
179
|
+
run_number : int
|
|
180
|
+
Run number.
|
|
181
|
+
|
|
182
|
+
Returns
|
|
183
|
+
-------
|
|
184
|
+
Path
|
|
185
|
+
Path for data files.
|
|
186
|
+
"""
|
|
187
|
+
data_suffixes = {
|
|
188
|
+
"output": ".zst",
|
|
189
|
+
"corsika_output": ".zst",
|
|
190
|
+
"corsika_log": ".log",
|
|
191
|
+
"simtel_output": ".simtel.zst",
|
|
192
|
+
}
|
|
193
|
+
run_dir = self._get_run_number_string(run_number)
|
|
194
|
+
data_run_dir = self.directory["data"].joinpath(run_dir)
|
|
195
|
+
data_run_dir.mkdir(parents=True, exist_ok=True)
|
|
196
|
+
return data_run_dir.joinpath(f"{file_name}{data_suffixes[file_type]}")
|
|
197
|
+
|
|
198
|
+
def _get_sub_file_path(self, file_type, file_name, mode):
|
|
199
|
+
"""
|
|
200
|
+
Return path for submission files.
|
|
201
|
+
|
|
202
|
+
Parameters
|
|
203
|
+
----------
|
|
204
|
+
file_type : str
|
|
205
|
+
File type.
|
|
206
|
+
file_name : str
|
|
207
|
+
File name.
|
|
208
|
+
mode : str
|
|
209
|
+
Mode (out or err).
|
|
210
|
+
|
|
211
|
+
Returns
|
|
212
|
+
-------
|
|
213
|
+
Path
|
|
214
|
+
Path for submission files.
|
|
215
|
+
"""
|
|
216
|
+
suffix = ".log" if file_type == "sub_log" else ".sh"
|
|
217
|
+
if mode and mode != "":
|
|
218
|
+
suffix = f".{mode}"
|
|
219
|
+
sub_log_file_dir = self.directory["output"].joinpath(f"{file_type}s")
|
|
220
|
+
sub_log_file_dir.mkdir(parents=True, exist_ok=True)
|
|
221
|
+
return sub_log_file_dir.joinpath(f"sub_{file_name}{suffix}")
|
|
222
|
+
|
|
223
|
+
def get_file_name(self, file_type, run_number=None, mode=None):
|
|
224
|
+
"""
|
|
225
|
+
Get a CORSIKA/sim_telarray style file name for various log and data file types.
|
|
226
|
+
|
|
227
|
+
Parameters
|
|
228
|
+
----------
|
|
229
|
+
file_type : str
|
|
230
|
+
The type of file (determines the file suffix).
|
|
231
|
+
run_number : int
|
|
232
|
+
Run number.
|
|
233
|
+
mode: str
|
|
234
|
+
out or err (optional, relevant only for sub_log).
|
|
235
|
+
|
|
236
|
+
Returns
|
|
237
|
+
-------
|
|
238
|
+
str
|
|
239
|
+
File name with full path.
|
|
240
|
+
|
|
241
|
+
Raises
|
|
242
|
+
------
|
|
243
|
+
ValueError
|
|
244
|
+
If file_type is unknown.
|
|
245
|
+
"""
|
|
246
|
+
file_name = self._get_file_basename(run_number)
|
|
247
|
+
|
|
248
|
+
if file_type in ["log", "histogram"]:
|
|
249
|
+
return self._get_log_file_path(file_type, file_name)
|
|
250
|
+
|
|
251
|
+
if file_type in ["output", "corsika_output", "corsika_log", "simtel_output"]:
|
|
252
|
+
return self._get_data_file_path(file_type, file_name, run_number)
|
|
253
|
+
|
|
254
|
+
if file_type in ("sub_log", "sub_script"):
|
|
255
|
+
return self._get_sub_file_path(file_type, file_name, mode)
|
|
256
|
+
|
|
257
|
+
raise ValueError(f"The requested file type ({file_type}) is unknown")
|
|
258
|
+
|
|
259
|
+
@staticmethod
|
|
260
|
+
def _get_run_number_string(run_number):
|
|
261
|
+
"""
|
|
262
|
+
Get run number string as used for the simulation file names(ex. run000014).
|
|
263
|
+
|
|
264
|
+
Parameters
|
|
265
|
+
----------
|
|
266
|
+
run_number: int
|
|
267
|
+
Run number.
|
|
268
|
+
|
|
269
|
+
Returns
|
|
270
|
+
-------
|
|
271
|
+
str
|
|
272
|
+
Run number string.
|
|
273
|
+
"""
|
|
274
|
+
nn = str(run_number)
|
|
275
|
+
if len(nn) > 6:
|
|
276
|
+
raise ValueError("Run number cannot have more than 6 digits")
|
|
277
|
+
return "run" + nn.zfill(6)
|
|
278
|
+
|
|
279
|
+
def get_resources(self, run_number=None):
|
|
280
|
+
"""
|
|
281
|
+
Read run time of job from last line of submission log file.
|
|
282
|
+
|
|
283
|
+
Parameters
|
|
284
|
+
----------
|
|
285
|
+
run_number: int
|
|
286
|
+
Run number.
|
|
287
|
+
|
|
288
|
+
Returns
|
|
289
|
+
-------
|
|
290
|
+
dict
|
|
291
|
+
run time and number of simulated events
|
|
292
|
+
"""
|
|
293
|
+
sub_log_file = self.get_file_name(file_type="sub_log", run_number=run_number, mode="out")
|
|
294
|
+
_logger.debug(f"Reading resources from {sub_log_file}")
|
|
295
|
+
|
|
296
|
+
_resources = {}
|
|
297
|
+
_resources["runtime"] = None
|
|
298
|
+
with open(sub_log_file, encoding="utf-8") as file:
|
|
299
|
+
for line in reversed(list(file)):
|
|
300
|
+
if "RUNTIME" in line:
|
|
301
|
+
_resources["runtime"] = int(line.split()[1])
|
|
302
|
+
break
|
|
303
|
+
|
|
304
|
+
if _resources["runtime"] is None:
|
|
305
|
+
_logger.debug("RUNTIME was not found in run log file")
|
|
306
|
+
_resources["n_events"] = int(self.corsika_config.get_config_parameter("NSHOW"))
|
|
307
|
+
return _resources
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"""Base class for running sim_telarray simulations."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import simtools.utils.general as gen
|
|
8
|
+
from simtools.runners.runner_services import RunnerServices
|
|
9
|
+
|
|
10
|
+
__all__ = ["InvalidOutputFileError", "SimtelExecutionError", "SimtelRunner"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class SimtelExecutionError(Exception):
|
|
14
|
+
"""Exception for simtel_array execution error."""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class InvalidOutputFileError(Exception):
|
|
18
|
+
"""Exception for invalid output file."""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SimtelRunner:
|
|
22
|
+
"""
|
|
23
|
+
Base class for running sim_telarray simulations.
|
|
24
|
+
|
|
25
|
+
Parameters
|
|
26
|
+
----------
|
|
27
|
+
simtel_path: str or Path
|
|
28
|
+
Location of sim_telarray installation.
|
|
29
|
+
label: str
|
|
30
|
+
Instance label. Important for output file naming.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(self, simtel_path, label=None, corsika_config=None, use_multipipe=False):
|
|
34
|
+
"""Initialize SimtelRunner."""
|
|
35
|
+
self._logger = logging.getLogger(__name__)
|
|
36
|
+
|
|
37
|
+
self._simtel_path = Path(simtel_path)
|
|
38
|
+
self.label = label
|
|
39
|
+
self._base_directory = None
|
|
40
|
+
|
|
41
|
+
self.runs_per_set = 1
|
|
42
|
+
|
|
43
|
+
self.runner_service = RunnerServices(corsika_config, label)
|
|
44
|
+
self._directory = self.runner_service.load_data_directories(
|
|
45
|
+
"corsika_simtel" if use_multipipe else "simtel"
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
def __repr__(self):
|
|
49
|
+
"""Return a string representation of the SimtelRunner object."""
|
|
50
|
+
return f"SimtelRunner(label={self.label})\n"
|
|
51
|
+
|
|
52
|
+
def prepare_run_script(self, test=False, input_file=None, run_number=None, extra_commands=None):
|
|
53
|
+
"""
|
|
54
|
+
Build and return the full path of the bash run script containing the sim_telarray command.
|
|
55
|
+
|
|
56
|
+
Parameters
|
|
57
|
+
----------
|
|
58
|
+
test: bool
|
|
59
|
+
Test flag for faster execution.
|
|
60
|
+
input_file: str or Path
|
|
61
|
+
Full path of the input CORSIKA file.
|
|
62
|
+
run_number: int
|
|
63
|
+
Run number.
|
|
64
|
+
extra_commands: str
|
|
65
|
+
Additional commands for running simulations given in config.yml.
|
|
66
|
+
|
|
67
|
+
Returns
|
|
68
|
+
-------
|
|
69
|
+
Path
|
|
70
|
+
Full path of the run script.
|
|
71
|
+
"""
|
|
72
|
+
self._logger.debug("Creating run bash script")
|
|
73
|
+
|
|
74
|
+
script_file_path = self.get_file_name(file_type="sub_script", run_number=run_number)
|
|
75
|
+
|
|
76
|
+
self._logger.debug(f"Run bash script - {script_file_path}")
|
|
77
|
+
|
|
78
|
+
self._logger.debug(f"Extra commands to be added to the run script {extra_commands}")
|
|
79
|
+
|
|
80
|
+
command = self._make_run_command(run_number=run_number, input_file=input_file)
|
|
81
|
+
with script_file_path.open("w", encoding="utf-8") as file:
|
|
82
|
+
file.write("#!/usr/bin/env bash\n\n")
|
|
83
|
+
file.write("set -e\n")
|
|
84
|
+
file.write("set -o pipefail\n")
|
|
85
|
+
file.write("\nSECONDS=0\n")
|
|
86
|
+
|
|
87
|
+
if extra_commands is not None:
|
|
88
|
+
file.write("# Writing extras\n")
|
|
89
|
+
for line in extra_commands:
|
|
90
|
+
file.write(f"{line}\n")
|
|
91
|
+
file.write("# End of extras\n\n")
|
|
92
|
+
|
|
93
|
+
n = 1 if test else self.runs_per_set
|
|
94
|
+
for _ in range(n):
|
|
95
|
+
file.write(f"{command}\n\n")
|
|
96
|
+
|
|
97
|
+
file.write('\necho "RUNTIME: $SECONDS"\n')
|
|
98
|
+
|
|
99
|
+
os.system(f"chmod ug+x {script_file_path}")
|
|
100
|
+
return script_file_path
|
|
101
|
+
|
|
102
|
+
def run(self, test=False, input_file=None, run_number=None):
|
|
103
|
+
"""
|
|
104
|
+
Make run command and run sim_telarray.
|
|
105
|
+
|
|
106
|
+
Parameters
|
|
107
|
+
----------
|
|
108
|
+
test: bool
|
|
109
|
+
If True, make simulations faster.
|
|
110
|
+
input_file: str or Path
|
|
111
|
+
Full path of the input CORSIKA file.
|
|
112
|
+
run_number: int
|
|
113
|
+
Run number.
|
|
114
|
+
"""
|
|
115
|
+
self._logger.debug("Running sim_telarray")
|
|
116
|
+
|
|
117
|
+
command = self._make_run_command(run_number=run_number, input_file=input_file)
|
|
118
|
+
|
|
119
|
+
if test:
|
|
120
|
+
self._logger.info(f"Running (test) with command: {command}")
|
|
121
|
+
self._run_simtel_and_check_output(command)
|
|
122
|
+
else:
|
|
123
|
+
self._logger.debug(f"Running ({self.runs_per_set}x) with command: {command}")
|
|
124
|
+
for _ in range(self.runs_per_set):
|
|
125
|
+
self._run_simtel_and_check_output(command)
|
|
126
|
+
|
|
127
|
+
self._check_run_result(run_number=run_number)
|
|
128
|
+
|
|
129
|
+
def _check_run_result(self, run_number=None): # pylint: disable=all
|
|
130
|
+
"""Check if simtel output file exists."""
|
|
131
|
+
pass
|
|
132
|
+
|
|
133
|
+
def _raise_simtel_error(self):
|
|
134
|
+
"""
|
|
135
|
+
Raise sim_telarray execution error.
|
|
136
|
+
|
|
137
|
+
Final 30 lines from the log file are collected and printed.
|
|
138
|
+
|
|
139
|
+
Raises
|
|
140
|
+
------
|
|
141
|
+
SimtelExecutionError
|
|
142
|
+
"""
|
|
143
|
+
if hasattr(self, "_log_file"):
|
|
144
|
+
msg = gen.get_log_excerpt(self._log_file)
|
|
145
|
+
else:
|
|
146
|
+
msg = "Simtel log file does not exist."
|
|
147
|
+
|
|
148
|
+
self._logger.error(msg)
|
|
149
|
+
raise SimtelExecutionError(msg)
|
|
150
|
+
|
|
151
|
+
def _run_simtel_and_check_output(self, command):
|
|
152
|
+
"""
|
|
153
|
+
Run the sim_telarray command and check the exit code.
|
|
154
|
+
|
|
155
|
+
Raises
|
|
156
|
+
------
|
|
157
|
+
SimtelExecutionError
|
|
158
|
+
if run was not successful.
|
|
159
|
+
"""
|
|
160
|
+
if os.system(command) != 0:
|
|
161
|
+
self._raise_simtel_error()
|
|
162
|
+
|
|
163
|
+
def _make_run_command(self, run_number=None, input_file=None):
|
|
164
|
+
self._logger.debug(
|
|
165
|
+
"make_run_command is being called from the base class - "
|
|
166
|
+
"it should be implemented in the sub class"
|
|
167
|
+
)
|
|
168
|
+
input_file = input_file if input_file else "nofile"
|
|
169
|
+
run_number = run_number if run_number else 1
|
|
170
|
+
return f"{input_file}-{run_number}"
|
|
171
|
+
|
|
172
|
+
@staticmethod
|
|
173
|
+
def get_config_option(par, value=None, weak_option=False):
|
|
174
|
+
"""
|
|
175
|
+
Build sim_telarray command.
|
|
176
|
+
|
|
177
|
+
Parameters
|
|
178
|
+
----------
|
|
179
|
+
par: str
|
|
180
|
+
Parameter name.
|
|
181
|
+
value: str
|
|
182
|
+
Parameter value.
|
|
183
|
+
weak_option: bool
|
|
184
|
+
If True, use -W option instead of -C.
|
|
185
|
+
|
|
186
|
+
Returns
|
|
187
|
+
-------
|
|
188
|
+
str
|
|
189
|
+
Command for sim_telarray.
|
|
190
|
+
"""
|
|
191
|
+
option_syntax = "-W" if weak_option else "-C"
|
|
192
|
+
c = f" {option_syntax} {par}"
|
|
193
|
+
c += f"={value}" if value is not None else ""
|
|
194
|
+
return c
|
|
195
|
+
|
|
196
|
+
def get_resources(self, run_number=None):
|
|
197
|
+
"""Return computing resources used."""
|
|
198
|
+
return self.runner_service.get_resources(run_number)
|
|
199
|
+
|
|
200
|
+
def get_file_name(self, simulation_software="simtel", file_type=None, run_number=None, mode=""):
|
|
201
|
+
"""
|
|
202
|
+
Get the full path of a file for a given run number.
|
|
203
|
+
|
|
204
|
+
Parameters
|
|
205
|
+
----------
|
|
206
|
+
simulation_software: str
|
|
207
|
+
Simulation software.
|
|
208
|
+
file_type: str
|
|
209
|
+
File type.
|
|
210
|
+
run_number: int
|
|
211
|
+
Run number.
|
|
212
|
+
|
|
213
|
+
Returns
|
|
214
|
+
-------
|
|
215
|
+
str
|
|
216
|
+
File name with full path.
|
|
217
|
+
"""
|
|
218
|
+
if simulation_software.lower() != "simtel":
|
|
219
|
+
raise ValueError(
|
|
220
|
+
f"simulation_software ({simulation_software}) is not supported in SimulatorArray"
|
|
221
|
+
)
|
|
222
|
+
return self.runner_service.get_file_name(
|
|
223
|
+
file_type=file_type, run_number=run_number, mode=mode
|
|
224
|
+
)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
%YAML 1.2
|
|
2
|
+
---
|
|
3
|
+
title: List of allowed array elements
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
description: |
|
|
6
|
+
List of array elements known to simtools and its
|
|
7
|
+
corresponding database collections.
|
|
8
|
+
Also used as part of the schema validation process.
|
|
9
|
+
data:
|
|
10
|
+
LSTN:
|
|
11
|
+
collection: "telescopes"
|
|
12
|
+
observatory: "CTAO"
|
|
13
|
+
site: "North"
|
|
14
|
+
MSTN:
|
|
15
|
+
collection: "telescopes"
|
|
16
|
+
observatory: "CTAO"
|
|
17
|
+
site: "North"
|
|
18
|
+
LSTS:
|
|
19
|
+
collection: "telescopes"
|
|
20
|
+
observatory: "CTAO"
|
|
21
|
+
site: "South"
|
|
22
|
+
MSTS:
|
|
23
|
+
collection: "telescopes"
|
|
24
|
+
observatory: "CTAO"
|
|
25
|
+
site: "South"
|
|
26
|
+
SSTS:
|
|
27
|
+
collection: "telescopes"
|
|
28
|
+
observatory: "CTAO"
|
|
29
|
+
site: "South"
|
|
30
|
+
description: "Small-sized telescope"
|
|
31
|
+
SCTS:
|
|
32
|
+
collection: "telescopes"
|
|
33
|
+
observatory: "CTAO"
|
|
34
|
+
site: "South"
|
|
35
|
+
description: "Mid-sized Schwarzschild-Couder telescope"
|
|
36
|
+
ILLN:
|
|
37
|
+
collection: "calibration_devices"
|
|
38
|
+
observatory: "CTAO"
|
|
39
|
+
site: "North"
|
|
40
|
+
description: "Illuminator"
|
|
41
|
+
RLDN:
|
|
42
|
+
collection: "calibration_devices"
|
|
43
|
+
observatory: "CTAO"
|
|
44
|
+
site: "North"
|
|
45
|
+
description: "Raman lidar"
|
|
46
|
+
STPN:
|
|
47
|
+
collection: "calibration_devices"
|
|
48
|
+
observatory: "CTAO"
|
|
49
|
+
site: "North"
|
|
50
|
+
description: "Wide-field stellar photometer"
|
|
51
|
+
MSPN:
|
|
52
|
+
collection: "calibration_devices"
|
|
53
|
+
observatory: "CTAO"
|
|
54
|
+
site: "North"
|
|
55
|
+
description: "Moon/sun photometer"
|
|
56
|
+
CEIN:
|
|
57
|
+
collection: "calibration_devices"
|
|
58
|
+
observatory: "CTAO"
|
|
59
|
+
site: "North"
|
|
60
|
+
description: "Ceilometer"
|
|
61
|
+
WSTN:
|
|
62
|
+
collection: "calibration_devices"
|
|
63
|
+
observatory: "CTAO"
|
|
64
|
+
site: "North"
|
|
65
|
+
description: "Weather station"
|
|
66
|
+
ASCN:
|
|
67
|
+
collection: "calibration_devices"
|
|
68
|
+
observatory: "CTAO"
|
|
69
|
+
site: "North"
|
|
70
|
+
description: "All-sky camera"
|
|
71
|
+
DUSN:
|
|
72
|
+
collection: "calibration_devices"
|
|
73
|
+
observatory: "CTAO"
|
|
74
|
+
site: "North"
|
|
75
|
+
description: "Dust sensor"
|
|
76
|
+
LISN:
|
|
77
|
+
collection: "calibration_devices"
|
|
78
|
+
observatory: "CTAO"
|
|
79
|
+
site: "North"
|
|
80
|
+
description: "Lightning sensor"
|
|
81
|
+
ILLS:
|
|
82
|
+
collection: "calibration_devices"
|
|
83
|
+
observatory: "CTAO"
|
|
84
|
+
site: "South"
|
|
85
|
+
description: "Illuminator"
|
|
86
|
+
RLDS:
|
|
87
|
+
collection: "calibration_devices"
|
|
88
|
+
observatory: "CTAO"
|
|
89
|
+
site: "South"
|
|
90
|
+
description: "Raman lidar"
|
|
91
|
+
STPS:
|
|
92
|
+
collection: "calibration_devices"
|
|
93
|
+
observatory: "CTAO"
|
|
94
|
+
site: "South"
|
|
95
|
+
description: "Wide-field stellar photometer"
|
|
96
|
+
MSPS:
|
|
97
|
+
collection: "calibration_devices"
|
|
98
|
+
observatory: "CTAO"
|
|
99
|
+
site: "South"
|
|
100
|
+
description: "Moon/sun photometer"
|
|
101
|
+
CEIS:
|
|
102
|
+
collection: "calibration_devices"
|
|
103
|
+
observatory: "CTAO"
|
|
104
|
+
site: "South"
|
|
105
|
+
description: "Ceilometer"
|
|
106
|
+
WSTS:
|
|
107
|
+
collection: "calibration_devices"
|
|
108
|
+
observatory: "CTAO"
|
|
109
|
+
site: "South"
|
|
110
|
+
description: "Weather station"
|
|
111
|
+
ASCS:
|
|
112
|
+
collection: "calibration_devices"
|
|
113
|
+
observatory: "CTAO"
|
|
114
|
+
site: "South"
|
|
115
|
+
description: "All-sky camera"
|
|
116
|
+
DUSS:
|
|
117
|
+
collection: "calibration_devices"
|
|
118
|
+
observatory: "CTAO"
|
|
119
|
+
site: "South"
|
|
120
|
+
description: "Dust sensor"
|
|
121
|
+
LISS:
|
|
122
|
+
collection: "calibration_devices"
|
|
123
|
+
observatory: "CTAO"
|
|
124
|
+
site: "South"
|
|
125
|
+
description: "Lightning sensor"
|
|
126
|
+
HESS:
|
|
127
|
+
collection: "telescopes"
|
|
128
|
+
site: "South"
|
|
129
|
+
observatory: "HESS"
|
|
130
|
+
MAGIC:
|
|
131
|
+
collection: "telescopes"
|
|
132
|
+
site: "North"
|
|
133
|
+
observatory: "MAGIC"
|
|
134
|
+
VERITAS:
|
|
135
|
+
collection: "telescopes"
|
|
136
|
+
site: "North"
|
|
137
|
+
observatory: "VERITAS"
|