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
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/python3
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Summary
|
|
5
|
-
-------
|
|
6
|
-
|
|
7
|
-
This application creates the layout array files (ECSV) of regular arrays
|
|
8
|
-
with one telescope at the center of the array and with 4 telescopes
|
|
9
|
-
in a square grid. These arrays are used for trigger rate simulations.
|
|
10
|
-
|
|
11
|
-
The array layout files created should be available at the data/layout directory.
|
|
12
|
-
|
|
13
|
-
Command line arguments
|
|
14
|
-
----------------------
|
|
15
|
-
site (str, required)
|
|
16
|
-
observatory site (e.g., North or South).
|
|
17
|
-
model_version (str, optional)
|
|
18
|
-
Model version to use (e.g., prod6). If not provided, the latest version is used.
|
|
19
|
-
verbosity (str, optional)
|
|
20
|
-
Log level to print.
|
|
21
|
-
|
|
22
|
-
Example
|
|
23
|
-
-------
|
|
24
|
-
Runtime < 10 s.
|
|
25
|
-
|
|
26
|
-
.. code-block:: console
|
|
27
|
-
|
|
28
|
-
simtools-make-regular-arrays --site=North
|
|
29
|
-
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
import logging
|
|
33
|
-
import os
|
|
34
|
-
from pathlib import Path
|
|
35
|
-
|
|
36
|
-
import astropy.units as u
|
|
37
|
-
|
|
38
|
-
import simtools.data_model.model_data_writer as writer
|
|
39
|
-
import simtools.utils.general as gen
|
|
40
|
-
from simtools import db_handler
|
|
41
|
-
from simtools.configuration import configurator
|
|
42
|
-
from simtools.io_operations import io_handler
|
|
43
|
-
from simtools.layout.array_layout import ArrayLayout
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def main():
|
|
47
|
-
config = configurator.Configurator(
|
|
48
|
-
label=Path(__file__).stem,
|
|
49
|
-
description=(
|
|
50
|
-
"This application creates the layout array files (ECSV) of regular arrays "
|
|
51
|
-
"with one telescope at the center of the array and with 4 telescopes "
|
|
52
|
-
"in a square grid. These arrays are used for trigger rate simulations. "
|
|
53
|
-
"The array layout files created should be available at the data/layout directory."
|
|
54
|
-
),
|
|
55
|
-
)
|
|
56
|
-
args_dict, db_config = config.initialize(db_config=True, site_model=True, output=True)
|
|
57
|
-
|
|
58
|
-
label = "make_regular_arrays"
|
|
59
|
-
|
|
60
|
-
logger = logging.getLogger()
|
|
61
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
62
|
-
|
|
63
|
-
_io_handler = io_handler.IOHandler()
|
|
64
|
-
|
|
65
|
-
corsika_pars = gen.collect_data_from_file_or_dict(
|
|
66
|
-
_io_handler.get_input_data_file("parameters", "corsika_parameters.yml"), None
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
# Reading site parameters from DB
|
|
70
|
-
db = db_handler.DatabaseHandler(mongo_db_config=db_config)
|
|
71
|
-
site_pars_db = db.get_site_parameters(
|
|
72
|
-
site=args_dict["site"], model_version=args_dict["model_version"]
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
layout_center_data = {}
|
|
76
|
-
layout_center_data["center_lat"] = float(site_pars_db["ref_lat"]["Value"]) * u.deg
|
|
77
|
-
layout_center_data["center_lon"] = float(site_pars_db["ref_long"]["Value"]) * u.deg
|
|
78
|
-
layout_center_data["center_alt"] = float(site_pars_db["altitude"]["Value"]) * u.m
|
|
79
|
-
layout_center_data["EPSG"] = site_pars_db["EPSG"]["Value"]
|
|
80
|
-
corsika_telescope_data = {}
|
|
81
|
-
corsika_telescope_data["corsika_obs_level"] = layout_center_data["center_alt"]
|
|
82
|
-
corsika_telescope_data["corsika_sphere_center"] = corsika_pars["corsika_sphere_center"]
|
|
83
|
-
corsika_telescope_data["corsika_sphere_radius"] = corsika_pars["corsika_sphere_radius"]
|
|
84
|
-
|
|
85
|
-
# Telescope distances for 4 tel square arrays
|
|
86
|
-
# !HARDCODED
|
|
87
|
-
telescope_distance = {"LST": 57.5 * u.m, "MST": 70 * u.m, "SST": 80 * u.m}
|
|
88
|
-
|
|
89
|
-
for array_name in ["1SST", "4SST", "1MST", "4MST", "1LST", "4LST"]:
|
|
90
|
-
logger.info(f"Processing array {array_name}")
|
|
91
|
-
layout = ArrayLayout(
|
|
92
|
-
site=args_dict["site"],
|
|
93
|
-
mongo_db_config=db_config,
|
|
94
|
-
label=label,
|
|
95
|
-
name=f"{args_dict['site']}-{array_name}",
|
|
96
|
-
layout_center_data=layout_center_data,
|
|
97
|
-
corsika_telescope_data=corsika_telescope_data,
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
tel_size = array_name[1:4]
|
|
101
|
-
|
|
102
|
-
# Single telescope at the center
|
|
103
|
-
if array_name[0] == "1":
|
|
104
|
-
layout.add_telescope(
|
|
105
|
-
telescope_name=tel_size + "-01",
|
|
106
|
-
crs_name="ground",
|
|
107
|
-
xx=0 * u.m,
|
|
108
|
-
yy=0 * u.m,
|
|
109
|
-
tel_corsika_z=0 * u.m,
|
|
110
|
-
)
|
|
111
|
-
# 4 telescopes in a regular square grid
|
|
112
|
-
else:
|
|
113
|
-
layout.add_telescope(
|
|
114
|
-
telescope_name=tel_size + "-01",
|
|
115
|
-
crs_name="ground",
|
|
116
|
-
xx=telescope_distance[tel_size],
|
|
117
|
-
yy=telescope_distance[tel_size],
|
|
118
|
-
tel_corsika_z=0 * u.m,
|
|
119
|
-
)
|
|
120
|
-
layout.add_telescope(
|
|
121
|
-
telescope_name=tel_size + "-02",
|
|
122
|
-
crs_name="ground",
|
|
123
|
-
xx=-telescope_distance[tel_size],
|
|
124
|
-
yy=telescope_distance[tel_size],
|
|
125
|
-
tel_corsika_z=0 * u.m,
|
|
126
|
-
)
|
|
127
|
-
layout.add_telescope(
|
|
128
|
-
telescope_name=tel_size + "-03",
|
|
129
|
-
crs_name="ground",
|
|
130
|
-
xx=telescope_distance[tel_size],
|
|
131
|
-
yy=-telescope_distance[tel_size],
|
|
132
|
-
tel_corsika_z=0 * u.m,
|
|
133
|
-
)
|
|
134
|
-
layout.add_telescope(
|
|
135
|
-
telescope_name=tel_size + "-04",
|
|
136
|
-
crs_name="ground",
|
|
137
|
-
xx=-telescope_distance[tel_size],
|
|
138
|
-
yy=-telescope_distance[tel_size],
|
|
139
|
-
tel_corsika_z=0 * u.m,
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
layout.convert_coordinates()
|
|
143
|
-
layout.print_telescope_list()
|
|
144
|
-
output_file = args_dict.get("output_file", None)
|
|
145
|
-
if output_file is not None:
|
|
146
|
-
base_name, file_extension = os.path.splitext(output_file)
|
|
147
|
-
output_file = f"{base_name}-{args_dict['site']}-{array_name}{file_extension}"
|
|
148
|
-
writer.ModelDataWriter.dump(
|
|
149
|
-
args_dict=args_dict,
|
|
150
|
-
output_file=output_file,
|
|
151
|
-
metadata=None,
|
|
152
|
-
product_data=layout.export_telescope_list_table(
|
|
153
|
-
crs_name="ground",
|
|
154
|
-
corsika_z=False,
|
|
155
|
-
),
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if __name__ == "__main__":
|
|
160
|
-
main()
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/python3
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Summary
|
|
5
|
-
-------
|
|
6
|
-
This application is an example of how to produce sim_telarray config \
|
|
7
|
-
files for a given array.
|
|
8
|
-
|
|
9
|
-
All the input required has to be given as a yaml file by the command \
|
|
10
|
-
line argument array_config.
|
|
11
|
-
|
|
12
|
-
The required entries in the array_config file are:
|
|
13
|
-
|
|
14
|
-
'site': South or North
|
|
15
|
-
|
|
16
|
-
'layout_name': name of a valid layout array.
|
|
17
|
-
|
|
18
|
-
'model_version': name of a valid model version.
|
|
19
|
-
|
|
20
|
-
'default': telescope model names to be assigned to each telescope size by default. \
|
|
21
|
-
It must contain entries for 'LST' and 'MST' (and 'SST' in case of South site).
|
|
22
|
-
|
|
23
|
-
As optional data, specific telescope models can be assigned to individual telescopes. \
|
|
24
|
-
This is done by the entries with the name of the telescope (as used by the layout \
|
|
25
|
-
definition, ex. LST-01, MST-05, SST-10).
|
|
26
|
-
|
|
27
|
-
Each telescope model can be set in two ways.
|
|
28
|
-
|
|
29
|
-
a) A single str with the name of telescope model.
|
|
30
|
-
Ex. 'MST-05': 'NectarCam-D'
|
|
31
|
-
|
|
32
|
-
b) A dict containing a 'name' key with the name of the telescope model and further keys \
|
|
33
|
-
with model parameters to be changed from the original model.
|
|
34
|
-
Ex.:
|
|
35
|
-
|
|
36
|
-
.. code-block:: python
|
|
37
|
-
|
|
38
|
-
'MST-05': {
|
|
39
|
-
'name': 'NectarCam-D',
|
|
40
|
-
'fadc_pulse_shape': 'Pulse_template_nectarCam_17042020-noshift.dat',
|
|
41
|
-
'discriminator_pulse_shape': 'Pulse_template_nectarCam_17042020-noshift.dat'
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
This is an example of the content of an array_config file.
|
|
45
|
-
|
|
46
|
-
.. code-block:: python
|
|
47
|
-
|
|
48
|
-
site: North,
|
|
49
|
-
layout_name: Prod5
|
|
50
|
-
model_version: Prod5
|
|
51
|
-
default:
|
|
52
|
-
LST: 'D234' # Design model for the LSTs
|
|
53
|
-
MST: FlashCam-D # Design model for the MST-FlashCam
|
|
54
|
-
LST-01: '1' # Model of LST-01 in the LaPalma site.
|
|
55
|
-
MST-05:
|
|
56
|
-
name: NectarCam-D
|
|
57
|
-
# Parameters to be changed
|
|
58
|
-
fadc_pulse_shape: Pulse_template_nectarCam_17042020-noshift.dat
|
|
59
|
-
discriminator_pulse_shape: Pulse_template_nectarCam_17042020-noshift.dat
|
|
60
|
-
|
|
61
|
-
Command line arguments
|
|
62
|
-
----------------------
|
|
63
|
-
label (str, optional)
|
|
64
|
-
Label to identify the output files/directories.
|
|
65
|
-
array_config (str, required)
|
|
66
|
-
Path to a yaml file with the array config data.
|
|
67
|
-
verbosity (str, optional)
|
|
68
|
-
Log level to print.
|
|
69
|
-
|
|
70
|
-
Example
|
|
71
|
-
-------
|
|
72
|
-
North - Prod5, simple example
|
|
73
|
-
|
|
74
|
-
Get the array configuration from DB:
|
|
75
|
-
|
|
76
|
-
.. code-block:: console
|
|
77
|
-
|
|
78
|
-
simtools-get-file-from-db --file_name array_config_test.yml
|
|
79
|
-
|
|
80
|
-
Run the application. Runtime < 1 min.
|
|
81
|
-
|
|
82
|
-
.. code-block:: console
|
|
83
|
-
|
|
84
|
-
simtools-produce-array-config --label test --array_config \
|
|
85
|
-
array_config_test.yml
|
|
86
|
-
|
|
87
|
-
The output is saved in simtools-output/test/model.
|
|
88
|
-
|
|
89
|
-
Expected final print-out message:
|
|
90
|
-
|
|
91
|
-
.. code-block:: console
|
|
92
|
-
|
|
93
|
-
INFO::array_model(l361)::export_simtel_array_config_file::Writing array config file into \
|
|
94
|
-
/workdir/external/simtools/simtools-output/test/model/CTA-TestLayout-North-2020-06-\
|
|
95
|
-
28_test.cfg
|
|
96
|
-
"""
|
|
97
|
-
|
|
98
|
-
import logging
|
|
99
|
-
from pathlib import Path
|
|
100
|
-
|
|
101
|
-
import simtools.utils.general as gen
|
|
102
|
-
from simtools.configuration import configurator
|
|
103
|
-
from simtools.model.array_model import ArrayModel
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
def main():
|
|
107
|
-
config = configurator.Configurator(
|
|
108
|
-
label=Path(__file__).stem,
|
|
109
|
-
description=("Example of how to produce sim_telarray config files for a given array."),
|
|
110
|
-
)
|
|
111
|
-
config.parser.add_argument(
|
|
112
|
-
"--array_config",
|
|
113
|
-
help="Yaml file with array config data.",
|
|
114
|
-
type=str,
|
|
115
|
-
required=True,
|
|
116
|
-
)
|
|
117
|
-
args_dict, db_config = config.initialize(db_config=True)
|
|
118
|
-
|
|
119
|
-
logger = logging.getLogger("simtools")
|
|
120
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
121
|
-
|
|
122
|
-
array_model = ArrayModel(
|
|
123
|
-
label=args_dict["label"],
|
|
124
|
-
mongo_db_config=db_config,
|
|
125
|
-
array_config_file=args_dict["array_config"],
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
# Printing list of telescope for quick inspection.
|
|
129
|
-
array_model.print_telescope_list()
|
|
130
|
-
|
|
131
|
-
# Exporting config files.
|
|
132
|
-
array_model.export_all_simtel_config_files()
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if __name__ == "__main__":
|
|
136
|
-
main()
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/python3
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
Summary
|
|
5
|
-
-------
|
|
6
|
-
This application perform array simulations.
|
|
7
|
-
|
|
8
|
-
The simulations are split into two stages: showers and array.
|
|
9
|
-
Shower simulations are performed with CORSIKA and array simulations \
|
|
10
|
-
with sim_telarray. Note that either shower or array simulations are \
|
|
11
|
-
submitted (so typically you first run shower simulations, and then the \
|
|
12
|
-
array simulations).
|
|
13
|
-
|
|
14
|
-
By default the configuration is saved in simtools-output/test-production
|
|
15
|
-
and the output in corsika-data and simtel-data. The location of the latter directories
|
|
16
|
-
can be set to a different location via the option --data_directory.
|
|
17
|
-
|
|
18
|
-
A configuration file is required.
|
|
19
|
-
|
|
20
|
-
The workload management system used is given in the configuration file. \
|
|
21
|
-
Allowed systems are qsub (using gridengine), condor_submit \
|
|
22
|
-
(using HTcondor), and local (running the script locally).
|
|
23
|
-
|
|
24
|
-
Command line arguments
|
|
25
|
-
----------------------
|
|
26
|
-
productionconfig (str, required)
|
|
27
|
-
Path to the simulation configuration file.
|
|
28
|
-
primary (str)
|
|
29
|
-
Name of the primary to be selected from the configuration file. In case it \
|
|
30
|
-
is not given, all the primaries listed in the configuration file will be simulated.
|
|
31
|
-
The choices are: gamma, electron, proton, helium, nitrogen, silicon, and iron.
|
|
32
|
-
task (str)
|
|
33
|
-
What task to execute. Options:
|
|
34
|
-
simulate (perform simulations),
|
|
35
|
-
file_list (print list of output files)
|
|
36
|
-
inspect (plot sim_telarray histograms for quick inspection)
|
|
37
|
-
resources (print quicklook into used computational resources)
|
|
38
|
-
array_only (activation mode)
|
|
39
|
-
Simulates only array detector (no showers).
|
|
40
|
-
showers_only (activation mode)
|
|
41
|
-
Simulates only showers (no array detector).
|
|
42
|
-
test (activation mode, optional)
|
|
43
|
-
If activated, no job will be submitted, but all configuration files \
|
|
44
|
-
and run scripts will be created.
|
|
45
|
-
data_directory (str, optional)
|
|
46
|
-
The location of the output directories corsika-data and simtel-data.
|
|
47
|
-
corsika_files (str, optional)
|
|
48
|
-
The CORSIKA files to pass to simtel_array.
|
|
49
|
-
If it is provided, these CORSIKA files are used and the application does not search for them
|
|
50
|
-
in the data directory.
|
|
51
|
-
This option should only be used in combination with the `showers_only` option.
|
|
52
|
-
verbosity (str, optional)
|
|
53
|
-
Log level to print.
|
|
54
|
-
|
|
55
|
-
Example
|
|
56
|
-
-------
|
|
57
|
-
Testing a mini-prod5 simulation.
|
|
58
|
-
|
|
59
|
-
Get the configuration file from the DB
|
|
60
|
-
|
|
61
|
-
.. code-block:: console
|
|
62
|
-
|
|
63
|
-
simtools-get-file-from-db --file_name prod_config_test.yml
|
|
64
|
-
|
|
65
|
-
Run the application:
|
|
66
|
-
|
|
67
|
-
.. code-block:: console
|
|
68
|
-
|
|
69
|
-
simtools-production --task simulate --productionconfig prod_config_test.yml \
|
|
70
|
-
--test --showers_only --submit_command local
|
|
71
|
-
|
|
72
|
-
The output is saved in simtools-output/test-production.
|
|
73
|
-
|
|
74
|
-
Expected final print-out message:
|
|
75
|
-
|
|
76
|
-
.. code-block:: console
|
|
77
|
-
|
|
78
|
-
INFO::job_manager(l124)::_submit_local::Running script locally
|
|
79
|
-
INFO::job_manager(l133)::_submit_local::Testing (local)
|
|
80
|
-
"""
|
|
81
|
-
|
|
82
|
-
import logging
|
|
83
|
-
from copy import copy
|
|
84
|
-
from pathlib import Path
|
|
85
|
-
|
|
86
|
-
from astropy.io.misc import yaml
|
|
87
|
-
|
|
88
|
-
import simtools.utils.general as gen
|
|
89
|
-
from simtools.configuration import configurator
|
|
90
|
-
from simtools.simulator import Simulator
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def _parse(description=None):
|
|
94
|
-
"""
|
|
95
|
-
Parse command line configuration
|
|
96
|
-
|
|
97
|
-
Parameters
|
|
98
|
-
----------
|
|
99
|
-
description: str
|
|
100
|
-
description of application.
|
|
101
|
-
|
|
102
|
-
Returns
|
|
103
|
-
-------
|
|
104
|
-
CommandLineParser
|
|
105
|
-
command line parser object
|
|
106
|
-
|
|
107
|
-
"""
|
|
108
|
-
|
|
109
|
-
config = configurator.Configurator(description=description)
|
|
110
|
-
config.parser.add_argument(
|
|
111
|
-
"--productionconfig",
|
|
112
|
-
help="Simulation configuration file",
|
|
113
|
-
type=str,
|
|
114
|
-
required=True,
|
|
115
|
-
)
|
|
116
|
-
config.parser.add_argument(
|
|
117
|
-
"--task",
|
|
118
|
-
help=(
|
|
119
|
-
"What task to execute. Options: "
|
|
120
|
-
"simulate (perform simulations),"
|
|
121
|
-
"file_list (print list of output files),"
|
|
122
|
-
"inspect (plot sim_telarray histograms for quick inspection),"
|
|
123
|
-
"resources (print report of computing resources)"
|
|
124
|
-
),
|
|
125
|
-
type=str,
|
|
126
|
-
required=True,
|
|
127
|
-
choices=["simulate", "file_list", "inspect", "resources"],
|
|
128
|
-
)
|
|
129
|
-
config.parser.add_argument(
|
|
130
|
-
"--primary",
|
|
131
|
-
help="Primary to be selected from the simulation configuration file.",
|
|
132
|
-
type=str,
|
|
133
|
-
required=False,
|
|
134
|
-
choices=[
|
|
135
|
-
"gamma",
|
|
136
|
-
"electron",
|
|
137
|
-
"proton",
|
|
138
|
-
"helium",
|
|
139
|
-
"nitrogen",
|
|
140
|
-
"silicon",
|
|
141
|
-
"iron",
|
|
142
|
-
],
|
|
143
|
-
)
|
|
144
|
-
config.parser.add_argument(
|
|
145
|
-
"--data_directory",
|
|
146
|
-
help="The directory where to save the corsika-data and simtel-data output directories.",
|
|
147
|
-
type=str.lower,
|
|
148
|
-
required=False,
|
|
149
|
-
default="./",
|
|
150
|
-
)
|
|
151
|
-
config.parser.add_argument(
|
|
152
|
-
"--corsika_files",
|
|
153
|
-
help="The CORSIKA files to pass to simtel_array.",
|
|
154
|
-
type=str,
|
|
155
|
-
required=False,
|
|
156
|
-
default=None,
|
|
157
|
-
)
|
|
158
|
-
group = config.parser.add_mutually_exclusive_group(required=True)
|
|
159
|
-
group.add_argument(
|
|
160
|
-
"--showers_only",
|
|
161
|
-
help="Simulates only showers, no array detection",
|
|
162
|
-
action="store_true",
|
|
163
|
-
)
|
|
164
|
-
group.add_argument(
|
|
165
|
-
"--array_only",
|
|
166
|
-
help="Simulates only array detection, no showers",
|
|
167
|
-
action="store_true",
|
|
168
|
-
)
|
|
169
|
-
return config.initialize(db_config=True, job_submission=True)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
def _proccess_simulation_config_file(config_file, primary_config, logger):
|
|
173
|
-
"""
|
|
174
|
-
Read simulation configuration file with details on shower
|
|
175
|
-
and array simulations
|
|
176
|
-
|
|
177
|
-
Attributes
|
|
178
|
-
----------
|
|
179
|
-
config_file: str
|
|
180
|
-
Name of simulation configuration file
|
|
181
|
-
primary_config: str
|
|
182
|
-
Name of the primary selected from the configuration file.
|
|
183
|
-
|
|
184
|
-
Returns
|
|
185
|
-
-------
|
|
186
|
-
str
|
|
187
|
-
label of simulation configuration
|
|
188
|
-
dict
|
|
189
|
-
configuration of shower simulations
|
|
190
|
-
dict
|
|
191
|
-
configuration of array simulations
|
|
192
|
-
|
|
193
|
-
"""
|
|
194
|
-
|
|
195
|
-
try:
|
|
196
|
-
with open(config_file, encoding="utf-8") as file:
|
|
197
|
-
config_data = yaml.load(file)
|
|
198
|
-
except FileNotFoundError:
|
|
199
|
-
logger.error(f"Error loading simulation configuration file from {config_file}")
|
|
200
|
-
raise
|
|
201
|
-
|
|
202
|
-
label = config_data.pop("label", {})
|
|
203
|
-
default_data = config_data.pop("default", {})
|
|
204
|
-
config_showers = {}
|
|
205
|
-
config_arrays = {}
|
|
206
|
-
|
|
207
|
-
for primary, primary_data in config_data.items():
|
|
208
|
-
if primary_config is not None and primary != primary_config:
|
|
209
|
-
continue
|
|
210
|
-
|
|
211
|
-
this_default = copy(default_data)
|
|
212
|
-
|
|
213
|
-
config_showers[primary] = copy(this_default.pop("showers", {}))
|
|
214
|
-
config_arrays[primary] = copy(this_default.pop("array", {}))
|
|
215
|
-
|
|
216
|
-
# Grabbing common entries for showers and array
|
|
217
|
-
for key, value in primary_data.items():
|
|
218
|
-
if key in ["showers", "array"]:
|
|
219
|
-
continue
|
|
220
|
-
config_showers[primary][key] = value
|
|
221
|
-
config_arrays[primary][key] = value
|
|
222
|
-
|
|
223
|
-
# Grabbing showers entries
|
|
224
|
-
for key, value in primary_data.get("showers", {}).items():
|
|
225
|
-
config_showers[primary][key] = value
|
|
226
|
-
config_showers[primary]["primary"] = primary
|
|
227
|
-
|
|
228
|
-
# Grabbing array entries
|
|
229
|
-
for key, value in primary_data.get("array", {}).items():
|
|
230
|
-
config_arrays[primary][key] = value
|
|
231
|
-
config_arrays[primary]["primary"] = primary
|
|
232
|
-
|
|
233
|
-
# Filling in the remaining default keys
|
|
234
|
-
for key, value in this_default.items():
|
|
235
|
-
config_showers[primary][key] = value
|
|
236
|
-
config_arrays[primary][key] = value
|
|
237
|
-
return label, config_showers, config_arrays
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
def main():
|
|
241
|
-
args_dict, db_config = _parse(description="Air shower and array simulations")
|
|
242
|
-
|
|
243
|
-
logger = logging.getLogger()
|
|
244
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
245
|
-
|
|
246
|
-
label, shower_configs, array_configs = _proccess_simulation_config_file(
|
|
247
|
-
args_dict["productionconfig"], args_dict["primary"], logger
|
|
248
|
-
)
|
|
249
|
-
if args_dict["label"] is None:
|
|
250
|
-
args_dict["label"] = label
|
|
251
|
-
|
|
252
|
-
if args_dict["corsika_files"] is not None and args_dict["array_only"] is False:
|
|
253
|
-
msg = "`--corsika_files` option should be used only with `--array_only` argument."
|
|
254
|
-
logger.error(msg)
|
|
255
|
-
raise ValueError
|
|
256
|
-
|
|
257
|
-
shower_simulators = {}
|
|
258
|
-
for primary, config_data in shower_configs.items():
|
|
259
|
-
if "data_directory" in args_dict:
|
|
260
|
-
config_data["data_directory"] = args_dict["data_directory"]
|
|
261
|
-
shower_simulators[primary] = Simulator(
|
|
262
|
-
label=label,
|
|
263
|
-
simulator="corsika",
|
|
264
|
-
simulator_source_path=args_dict["simtel_path"],
|
|
265
|
-
config_data=config_data,
|
|
266
|
-
submit_command=args_dict["submit_command"],
|
|
267
|
-
test=args_dict["test"],
|
|
268
|
-
mongo_db_config=db_config,
|
|
269
|
-
)
|
|
270
|
-
|
|
271
|
-
if args_dict["showers_only"]:
|
|
272
|
-
for primary, shower in shower_simulators.items():
|
|
273
|
-
_task_function = getattr(shower, args_dict["task"])
|
|
274
|
-
_task_function()
|
|
275
|
-
|
|
276
|
-
if args_dict["array_only"]:
|
|
277
|
-
array_simulators = {}
|
|
278
|
-
for primary, config_data in array_configs.items():
|
|
279
|
-
if "data_directory" in args_dict:
|
|
280
|
-
config_data["data_directory"] = args_dict["data_directory"]
|
|
281
|
-
array_simulators[primary] = Simulator(
|
|
282
|
-
label=label,
|
|
283
|
-
simulator="simtel",
|
|
284
|
-
simulator_source_path=args_dict["simtel_path"],
|
|
285
|
-
config_data=config_data,
|
|
286
|
-
submit_command=args_dict["submit_command"],
|
|
287
|
-
mongo_db_config=db_config,
|
|
288
|
-
)
|
|
289
|
-
for primary, array in array_simulators.items():
|
|
290
|
-
if args_dict["corsika_files"] is None:
|
|
291
|
-
input_list = shower_simulators[primary].get_list_of_output_files()
|
|
292
|
-
else:
|
|
293
|
-
if not isinstance(args_dict["corsika_files"], list):
|
|
294
|
-
args_dict["corsika_files"] = [args_dict["corsika_files"]]
|
|
295
|
-
input_list = args_dict["corsika_files"]
|
|
296
|
-
|
|
297
|
-
for corsika_file in input_list:
|
|
298
|
-
if not Path(corsika_file).exists():
|
|
299
|
-
msg = (
|
|
300
|
-
f"CORSIKA file {corsika_file} does not exist. Please run the "
|
|
301
|
-
"production with the `--showers_only` option first or point the "
|
|
302
|
-
"tool to the correct path to the corsika files with "
|
|
303
|
-
"`--corsika_directory`."
|
|
304
|
-
)
|
|
305
|
-
logger.error(msg)
|
|
306
|
-
raise FileNotFoundError
|
|
307
|
-
logger.info(f"Getting CORSIKA files: {input_list}.")
|
|
308
|
-
_task_function = getattr(array, args_dict["task"])
|
|
309
|
-
_task_function(input_file_list=input_list)
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
if __name__ == "__main__":
|
|
313
|
-
main()
|