gammasimtools 0.6.1__py3-none-any.whl → 0.8.2__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.2.dist-info/METADATA +173 -0
- gammasimtools-0.8.2.dist-info/RECORD +345 -0
- {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.2.dist-info}/WHEEL +1 -1
- gammasimtools-0.8.2.dist-info/entry_points.txt +31 -0
- simtools/_dev_version/__init__.py +9 -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 +111 -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 +211 -185
- 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 +312 -259
- simtools/model/calibration_model.py +50 -0
- simtools/model/camera.py +277 -523
- simtools/model/mirrors.py +68 -49
- simtools/model/model_parameter.py +602 -0
- simtools/model/model_utils.py +11 -39
- simtools/model/site_model.py +161 -0
- simtools/model/telescope_model.py +143 -633
- 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 +257 -644
- simtools/utils/value_conversion.py +176 -0
- simtools/version.py +3 -1
- 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/_dev_version/scm_version.py +0 -10
- 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.2.dist-info}/LICENSE +0 -0
- {gammasimtools-0.6.1.dist-info → gammasimtools-0.8.2.dist-info}/top_level.txt +0 -0
- /simtools/{corsika_simtel → db}/__init__.py +0 -0
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/python3
|
|
2
2
|
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
-------
|
|
6
|
-
This application validate the camera efficiency by simulating it using \
|
|
7
|
-
the testeff program provided by sim_telarray.
|
|
3
|
+
r"""
|
|
4
|
+
Validate the camera efficiency by simulating it using the sim_telarray testeff program.
|
|
8
5
|
|
|
9
6
|
The results of camera efficiency for Cherenkov (left) and NSB light (right) as a function\
|
|
10
7
|
of wavelength are plotted. See examples below.
|
|
@@ -20,47 +17,30 @@
|
|
|
20
17
|
site (str, required)
|
|
21
18
|
North or South.
|
|
22
19
|
telescope (str, required)
|
|
23
|
-
Telescope model name (e.g.
|
|
20
|
+
Telescope model name (e.g. LSTN-01, SSTS-15)
|
|
24
21
|
model_version (str, optional)
|
|
25
|
-
Model version
|
|
22
|
+
Model version
|
|
26
23
|
zenith_angle (float, optional)
|
|
27
24
|
Zenith angle in degrees (between 0 and 180).
|
|
28
25
|
azimuth_angle (float, optional)
|
|
29
|
-
Telescope pointing direction in azimuth.
|
|
30
|
-
one of north, south, east or west (case insensitive). Note that North is 0 degrees
|
|
31
|
-
and the azimuth grows clockwise, so East is 90 degrees.
|
|
26
|
+
Telescope pointing direction in azimuth.
|
|
32
27
|
nsb_spectrum (str, optional)
|
|
33
28
|
File with NSB spectrum to use for the efficiency simulation.
|
|
34
|
-
The expected format is two columns with wavelength in nm and
|
|
35
|
-
NSB flux with the units: [1e9 * ph/m2/s/sr/nm].
|
|
36
|
-
If the file has more than two columns, the first and third are used,
|
|
37
|
-
and the second is ignored (native sim_telarray behaviour).
|
|
38
|
-
verbosity (str, optional)
|
|
39
|
-
Log level to print
|
|
40
29
|
|
|
41
30
|
Example
|
|
42
31
|
-------
|
|
43
|
-
|
|
32
|
+
MSTN-01 5.0.0
|
|
44
33
|
|
|
45
34
|
Runtime < 1 min.
|
|
46
35
|
|
|
47
36
|
.. code-block:: console
|
|
48
37
|
|
|
49
|
-
simtools-validate-camera-efficiency --site North
|
|
50
|
-
--azimuth_angle 0 --zenith_angle 20
|
|
51
|
-
--nsb_spectrum average_nsb_spectrum_CTAO-N_ze20_az0.txt
|
|
52
|
-
--telescope
|
|
38
|
+
simtools-validate-camera-efficiency --site North \\
|
|
39
|
+
--azimuth_angle 0 --zenith_angle 20 \\
|
|
40
|
+
--nsb_spectrum average_nsb_spectrum_CTAO-N_ze20_az0.txt \\
|
|
41
|
+
--telescope MSTN-01 --model_version 5.0.0
|
|
53
42
|
|
|
54
43
|
The output is saved in simtools-output/validate_camera_efficiency.
|
|
55
|
-
|
|
56
|
-
Expected final print-out message:
|
|
57
|
-
|
|
58
|
-
.. code-block:: console
|
|
59
|
-
|
|
60
|
-
INFO::validate_camera_efficiency(l118)::main::Plotted NSB efficiency in /workdir/external/\
|
|
61
|
-
simtools/simtools-output/validate_camera_efficiency/application-plots/validate_camera\
|
|
62
|
-
_efficiency_MST-NectarCam-D_nsb
|
|
63
|
-
|
|
64
44
|
"""
|
|
65
45
|
|
|
66
46
|
import logging
|
|
@@ -69,16 +49,10 @@ from pathlib import Path
|
|
|
69
49
|
import simtools.utils.general as gen
|
|
70
50
|
from simtools.camera_efficiency import CameraEfficiency
|
|
71
51
|
from simtools.configuration import configurator
|
|
72
|
-
from simtools.configuration.commandline_parser import CommandLineParser
|
|
73
|
-
from simtools.io_operations import io_handler
|
|
74
|
-
from simtools.model.telescope_model import TelescopeModel
|
|
75
52
|
|
|
76
53
|
|
|
77
54
|
def _parse(label):
|
|
78
|
-
"""
|
|
79
|
-
Parse command line configuration
|
|
80
|
-
|
|
81
|
-
"""
|
|
55
|
+
"""Parse command line configuration."""
|
|
82
56
|
config = configurator.Configurator(
|
|
83
57
|
label=label,
|
|
84
58
|
description=(
|
|
@@ -86,25 +60,6 @@ def _parse(label):
|
|
|
86
60
|
"Plot the camera efficiency vs wavelength for cherenkov and NSB light."
|
|
87
61
|
),
|
|
88
62
|
)
|
|
89
|
-
config.parser.add_argument(
|
|
90
|
-
"--azimuth_angle",
|
|
91
|
-
help=(
|
|
92
|
-
"Telescope pointing direction in azimuth. "
|
|
93
|
-
"It can be in degrees between 0 and 360 or one of north, south, east or west "
|
|
94
|
-
"(case insensitive). Note that North is 0 degrees and "
|
|
95
|
-
"the azimuth grows clockwise, so East is 90 degrees."
|
|
96
|
-
),
|
|
97
|
-
type=CommandLineParser.azimuth_angle,
|
|
98
|
-
default=0,
|
|
99
|
-
required=False,
|
|
100
|
-
)
|
|
101
|
-
config.parser.add_argument(
|
|
102
|
-
"--zenith_angle",
|
|
103
|
-
help="Zenith angle in degrees (between 0 and 180).",
|
|
104
|
-
type=CommandLineParser.zenith_angle,
|
|
105
|
-
default=20,
|
|
106
|
-
required=False,
|
|
107
|
-
)
|
|
108
63
|
config.parser.add_argument(
|
|
109
64
|
"--nsb_spectrum",
|
|
110
65
|
help=(
|
|
@@ -112,13 +67,28 @@ def _parse(label):
|
|
|
112
67
|
"The expected format is two columns with wavelength in nm and "
|
|
113
68
|
"NSB flux with the units: [1e9 * ph/m2/s/sr/nm]."
|
|
114
69
|
"If the file has more than two columns, the first and third are used,"
|
|
115
|
-
"and the second is ignored (native sim_telarray
|
|
70
|
+
"and the second is ignored (native sim_telarray behavior)."
|
|
116
71
|
),
|
|
117
72
|
type=str,
|
|
118
73
|
default=None,
|
|
119
74
|
required=False,
|
|
120
75
|
)
|
|
121
|
-
|
|
76
|
+
config.parser.add_argument(
|
|
77
|
+
"--skip_correction_to_nsb_spectrum",
|
|
78
|
+
help=(
|
|
79
|
+
"Apply a correction to the NSB spectrum to account for the "
|
|
80
|
+
"difference between the altitude used in the reference B&E spectrum and "
|
|
81
|
+
"the observation level at the CTAO sites."
|
|
82
|
+
"This correction is done internally in sim_telarray and is on by default."
|
|
83
|
+
),
|
|
84
|
+
required=False,
|
|
85
|
+
action="store_true",
|
|
86
|
+
)
|
|
87
|
+
_args_dict, _db_config = config.initialize(
|
|
88
|
+
db_config=True,
|
|
89
|
+
simulation_model="telescope",
|
|
90
|
+
simulation_configuration={"corsika_configuration": ["zenith_angle", "azimuth_angle"]},
|
|
91
|
+
)
|
|
122
92
|
if _args_dict["site"] is None or _args_dict["telescope"] is None:
|
|
123
93
|
config.parser.print_help()
|
|
124
94
|
print("\n\nSite and telescope must be provided\n\n")
|
|
@@ -126,60 +96,23 @@ def _parse(label):
|
|
|
126
96
|
return _args_dict, _db_config
|
|
127
97
|
|
|
128
98
|
|
|
129
|
-
def main():
|
|
99
|
+
def main(): # noqa: D103
|
|
130
100
|
label = Path(__file__).stem
|
|
131
101
|
args_dict, _db_config = _parse(label)
|
|
132
102
|
|
|
133
103
|
logger = logging.getLogger()
|
|
134
104
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
135
105
|
|
|
136
|
-
# Output directory to save files related directly to this app
|
|
137
|
-
_io_handler = io_handler.IOHandler()
|
|
138
|
-
output_dir = _io_handler.get_output_directory(label, sub_dir="application-plots")
|
|
139
|
-
|
|
140
|
-
tel_model = TelescopeModel(
|
|
141
|
-
site=args_dict["site"],
|
|
142
|
-
telescope_model_name=args_dict["telescope"],
|
|
143
|
-
mongo_db_config=_db_config,
|
|
144
|
-
model_version=args_dict["model_version"],
|
|
145
|
-
label=label,
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
# For debugging purposes
|
|
149
|
-
tel_model.export_config_file()
|
|
150
|
-
|
|
151
|
-
logger.info(f"Validating the camera efficiency of {tel_model.name}")
|
|
152
|
-
|
|
153
106
|
ce = CameraEfficiency(
|
|
154
|
-
|
|
155
|
-
|
|
107
|
+
db_config=_db_config,
|
|
108
|
+
simtel_path=args_dict["simtel_path"],
|
|
156
109
|
label=label,
|
|
157
|
-
config_data=
|
|
158
|
-
"zenith_angle": args_dict["zenith_angle"],
|
|
159
|
-
"azimuth_angle": args_dict["azimuth_angle"],
|
|
160
|
-
"nsb_spectrum": args_dict["nsb_spectrum"],
|
|
161
|
-
},
|
|
110
|
+
config_data=args_dict,
|
|
162
111
|
)
|
|
163
|
-
ce.simulate(
|
|
112
|
+
ce.simulate()
|
|
164
113
|
ce.analyze(force=True)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
fig = ce.plot_cherenkov_efficiency()
|
|
168
|
-
cherenkov_plot_file_name = label + "_" + tel_model.name + "_cherenkov"
|
|
169
|
-
cherenkov_plot_file = output_dir.joinpath(cherenkov_plot_file_name)
|
|
170
|
-
for f in ["pdf", "png"]:
|
|
171
|
-
fig.savefig(str(cherenkov_plot_file) + "." + f, format=f, bbox_inches="tight")
|
|
172
|
-
logger.info(f"Plotted cherenkov efficiency in {cherenkov_plot_file}")
|
|
173
|
-
fig.clf()
|
|
174
|
-
|
|
175
|
-
# Plotting the camera efficiency for NSB light
|
|
176
|
-
fig = ce.plot_nsb_efficiency()
|
|
177
|
-
nsb_plot_file_name = label + "_" + tel_model.name + "_nsb"
|
|
178
|
-
nsb_plot_file = output_dir.joinpath(nsb_plot_file_name)
|
|
179
|
-
for f in ["pdf", "png"]:
|
|
180
|
-
fig.savefig(str(nsb_plot_file) + "." + f, format=f, bbox_inches="tight")
|
|
181
|
-
logger.info(f"Plotted NSB efficiency in {nsb_plot_file}")
|
|
182
|
-
fig.clf()
|
|
114
|
+
ce.plot_efficiency(efficiency_type="Cherenkov", save_fig=True)
|
|
115
|
+
ce.plot_efficiency(efficiency_type="NSB", save_fig=True)
|
|
183
116
|
|
|
184
117
|
|
|
185
118
|
if __name__ == "__main__":
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/python3
|
|
2
2
|
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
as seen for an observer facing the camera.
|
|
3
|
+
r"""
|
|
4
|
+
Calculate the camera FoV of the telescope requested and plot the camera.
|
|
5
|
+
|
|
6
|
+
The orientation for the plotting is "as seen for an observer facing the camera".
|
|
8
7
|
|
|
9
8
|
An example of the camera plot can be found below.
|
|
10
9
|
|
|
@@ -28,17 +27,14 @@
|
|
|
28
27
|
Up to which pixel ID to print. To suppress printing of pixel IDs, set to zero\
|
|
29
28
|
(--print_pixels_id 0). To print all pixels, set to 'All'."
|
|
30
29
|
|
|
31
|
-
verbosity (str, optional)
|
|
32
|
-
Log level to print
|
|
33
|
-
|
|
34
30
|
Example
|
|
35
31
|
-------
|
|
36
|
-
LST -
|
|
32
|
+
LST - 5.0.0
|
|
37
33
|
|
|
38
34
|
.. code-block:: console
|
|
39
35
|
|
|
40
|
-
simtools-validate-camera-fov --site North
|
|
41
|
-
--telescope
|
|
36
|
+
simtools-validate-camera-fov --site North \\
|
|
37
|
+
--telescope LSTN-01 --model_version 5.0.0
|
|
42
38
|
|
|
43
39
|
The output is saved in simtools-output/validate_camera_fov.
|
|
44
40
|
|
|
@@ -46,7 +42,7 @@
|
|
|
46
42
|
|
|
47
43
|
.. code-block:: console
|
|
48
44
|
|
|
49
|
-
Saved camera plot in /workdir/external/simtools/simtools-output/validate_camera_fov
|
|
45
|
+
Saved camera plot in /workdir/external/simtools/simtools-output/validate_camera_fov\\
|
|
50
46
|
/application-plots/validate_camera_fov_LST-1_pixel_layout.png
|
|
51
47
|
|
|
52
48
|
"""
|
|
@@ -58,9 +54,10 @@ import simtools.utils.general as gen
|
|
|
58
54
|
from simtools.configuration import configurator
|
|
59
55
|
from simtools.io_operations import io_handler
|
|
60
56
|
from simtools.model.telescope_model import TelescopeModel
|
|
57
|
+
from simtools.visualization import plot_camera
|
|
61
58
|
|
|
62
59
|
|
|
63
|
-
def
|
|
60
|
+
def _parse():
|
|
64
61
|
config = configurator.Configurator(
|
|
65
62
|
label=Path(__file__).stem,
|
|
66
63
|
description=(
|
|
@@ -72,7 +69,7 @@ def main():
|
|
|
72
69
|
"--camera_in_sky_coor",
|
|
73
70
|
help=(
|
|
74
71
|
"Plot the camera layout in sky coordinates "
|
|
75
|
-
"(akin to looking at it from behind for single mirror
|
|
72
|
+
"(akin to looking at it from behind for single mirror telescopes)"
|
|
76
73
|
),
|
|
77
74
|
action="store_true",
|
|
78
75
|
default=False,
|
|
@@ -86,8 +83,12 @@ def main():
|
|
|
86
83
|
),
|
|
87
84
|
default=50,
|
|
88
85
|
)
|
|
86
|
+
return config.initialize(db_config=True, simulation_model="telescope")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def main(): # noqa: D103
|
|
90
|
+
args_dict, db_config = _parse()
|
|
89
91
|
|
|
90
|
-
args_dict, db_config = config.initialize(db_config=True, telescope_model=True)
|
|
91
92
|
label = "validate_camera_fov"
|
|
92
93
|
|
|
93
94
|
logger = logging.getLogger()
|
|
@@ -99,7 +100,7 @@ def main():
|
|
|
99
100
|
|
|
100
101
|
tel_model = TelescopeModel(
|
|
101
102
|
site=args_dict["site"],
|
|
102
|
-
|
|
103
|
+
telescope_name=args_dict["telescope"],
|
|
103
104
|
mongo_db_config=db_config,
|
|
104
105
|
model_version=args_dict["model_version"],
|
|
105
106
|
label=label,
|
|
@@ -108,7 +109,7 @@ def main():
|
|
|
108
109
|
|
|
109
110
|
print(f"\nValidating the camera FoV of {tel_model.name}\n")
|
|
110
111
|
|
|
111
|
-
focal_length =
|
|
112
|
+
focal_length = tel_model.get_telescope_effective_focal_length("cm")
|
|
112
113
|
camera = tel_model.camera
|
|
113
114
|
|
|
114
115
|
fov, r_edge_avg = camera.calc_fov()
|
|
@@ -130,10 +131,10 @@ def main():
|
|
|
130
131
|
f"The value provided to --print_pixels_id ({args_dict['print_pixels_id']}) "
|
|
131
132
|
"should be an integer or All"
|
|
132
133
|
) from exc
|
|
133
|
-
fig =
|
|
134
|
+
fig = plot_camera.plot_pixel_layout(camera, args_dict["camera_in_sky_coor"], pixel_ids_to_print)
|
|
134
135
|
plot_file_prefix = output_dir.joinpath(f"{label}_{tel_model.name}_pixel_layout")
|
|
135
136
|
for suffix in ["pdf", "png"]:
|
|
136
|
-
file_name = f"{
|
|
137
|
+
file_name = f"{plot_file_prefix!s}.{suffix}"
|
|
137
138
|
fig.savefig(file_name, format=suffix, bbox_inches="tight")
|
|
138
139
|
print(f"\nSaved camera plot in {file_name}\n")
|
|
139
140
|
fig.clf()
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/python3
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
|
-
|
|
5
|
-
-------
|
|
6
|
-
This application simulates the cumulative PSF and compare with data (if available).
|
|
4
|
+
Simulate the cumulative PSF and compare with data (if available).
|
|
7
5
|
|
|
8
6
|
The telescope zenith angle and the source distance can be set by command line arguments.
|
|
9
7
|
|
|
@@ -17,10 +15,10 @@
|
|
|
17
15
|
Examples of the plots generated by this applications are shown below. On the left, \
|
|
18
16
|
the cumulative PSF and on the right, the simulated PSF image.
|
|
19
17
|
|
|
20
|
-
..
|
|
21
|
-
.. image:: images/
|
|
18
|
+
.. _validate_cumulative_psf_plot:
|
|
19
|
+
.. image:: images/validate_cumulative_psf_North-LST-1_cumulativePSF.png
|
|
22
20
|
:width: 49 %
|
|
23
|
-
.. image:: images/
|
|
21
|
+
.. image:: images/validate_cumulative_psf_North-LST-1_image.png
|
|
24
22
|
:width: 49 %
|
|
25
23
|
|
|
26
24
|
Command line arguments
|
|
@@ -41,12 +39,10 @@
|
|
|
41
39
|
Yaml file with the new model parameters to replace the default ones.
|
|
42
40
|
test (activation mode, optional)
|
|
43
41
|
If activated, application will be faster by simulating fewer photons.
|
|
44
|
-
verbosity (str, optional)
|
|
45
|
-
Log level to print.
|
|
46
42
|
|
|
47
43
|
Example
|
|
48
44
|
-------
|
|
49
|
-
LST-1
|
|
45
|
+
LST-1 5.0.0
|
|
50
46
|
|
|
51
47
|
Runtime < 1 min.
|
|
52
48
|
|
|
@@ -61,9 +57,9 @@
|
|
|
61
57
|
.. code-block:: console
|
|
62
58
|
|
|
63
59
|
simtools-compare-cumulative-psf --site North --telescope LST-1 \
|
|
64
|
-
--model_version
|
|
60
|
+
--model_version 5.0.0 --data PSFcurve_data_v2.txt
|
|
65
61
|
|
|
66
|
-
The output is saved in simtools-output/
|
|
62
|
+
The output is saved in simtools-output/validate_cumulative_psf
|
|
67
63
|
|
|
68
64
|
Expected final print-out message:
|
|
69
65
|
|
|
@@ -80,31 +76,16 @@ from pathlib import Path
|
|
|
80
76
|
import astropy.units as u
|
|
81
77
|
import matplotlib.pyplot as plt
|
|
82
78
|
import numpy as np
|
|
83
|
-
import yaml
|
|
84
79
|
|
|
85
80
|
import simtools.utils.general as gen
|
|
86
81
|
from simtools.configuration import configurator
|
|
87
82
|
from simtools.io_operations import io_handler
|
|
88
83
|
from simtools.model.telescope_model import TelescopeModel
|
|
89
|
-
from simtools.ray_tracing import RayTracing
|
|
84
|
+
from simtools.ray_tracing.ray_tracing import RayTracing
|
|
90
85
|
from simtools.visualization import visualize
|
|
91
86
|
|
|
92
87
|
|
|
93
|
-
def
|
|
94
|
-
"""
|
|
95
|
-
Load the data file with the measured PSF vs radius [cm].
|
|
96
|
-
|
|
97
|
-
"""
|
|
98
|
-
d_type = {"names": ("Radius [cm]", "Relative intensity"), "formats": ("f8", "f8")}
|
|
99
|
-
# test_data_file = io.get_test_data_file('PSFcurve_data_v2.txt')
|
|
100
|
-
data = np.loadtxt(datafile, dtype=d_type, usecols=(0, 2))
|
|
101
|
-
data["Radius [cm]"] *= 0.1
|
|
102
|
-
data["Relative intensity"] /= np.max(np.abs(data["Relative intensity"]))
|
|
103
|
-
return data
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
def main():
|
|
107
|
-
label = Path(__file__).stem
|
|
88
|
+
def _parse(label):
|
|
108
89
|
config = configurator.Configurator(
|
|
109
90
|
label=label,
|
|
110
91
|
description=(
|
|
@@ -118,15 +99,35 @@ def main():
|
|
|
118
99
|
type=float,
|
|
119
100
|
default=10,
|
|
120
101
|
)
|
|
121
|
-
config.parser.add_argument("--zenith", help="Zenith angle in deg", type=float, default=20.0)
|
|
122
102
|
config.parser.add_argument(
|
|
123
|
-
"--
|
|
103
|
+
"--zenith",
|
|
104
|
+
help="Zenith angle in deg",
|
|
105
|
+
type=float,
|
|
106
|
+
default=20.0,
|
|
124
107
|
)
|
|
125
108
|
config.parser.add_argument(
|
|
126
|
-
"--
|
|
109
|
+
"--data",
|
|
110
|
+
help="Data file name with the measured PSF vs radius [cm]",
|
|
111
|
+
type=str,
|
|
127
112
|
)
|
|
113
|
+
return config.initialize(db_config=True, simulation_model="telescope")
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def load_data(datafile):
|
|
117
|
+
"""Load the data file with the measured PSF vs radius [cm]."""
|
|
118
|
+
radius_cm = "Radius [cm]"
|
|
119
|
+
relative_intensity = "Relative intensity"
|
|
120
|
+
|
|
121
|
+
d_type = {"names": (radius_cm, relative_intensity), "formats": ("f8", "f8")}
|
|
122
|
+
data = np.loadtxt(datafile, dtype=d_type, usecols=(0, 2))
|
|
123
|
+
data[radius_cm] *= 0.1
|
|
124
|
+
data[relative_intensity] /= np.max(np.abs(data[relative_intensity]))
|
|
125
|
+
return data
|
|
128
126
|
|
|
129
|
-
|
|
127
|
+
|
|
128
|
+
def main(): # noqa: D103
|
|
129
|
+
label = Path(__file__).stem
|
|
130
|
+
args_dict, db_config = _parse(label)
|
|
130
131
|
|
|
131
132
|
logger = logging.getLogger()
|
|
132
133
|
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
@@ -137,24 +138,20 @@ def main():
|
|
|
137
138
|
|
|
138
139
|
tel_model = TelescopeModel(
|
|
139
140
|
site=args_dict["site"],
|
|
140
|
-
|
|
141
|
+
telescope_name=args_dict["telescope"],
|
|
141
142
|
mongo_db_config=db_config,
|
|
142
143
|
model_version=args_dict["model_version"],
|
|
143
144
|
label=label,
|
|
144
145
|
)
|
|
146
|
+
if args_dict.get("telescope_model_file"):
|
|
147
|
+
tel_model.change_multiple_parameters_from_file(args_dict["telescope_model_file"])
|
|
145
148
|
|
|
146
|
-
|
|
147
|
-
if args_dict.get("pars", None):
|
|
148
|
-
with open(args_dict["pars"], encoding="utf-8") as file:
|
|
149
|
-
new_pars = yaml.safe_load(file)
|
|
150
|
-
tel_model.change_multiple_parameters(**new_pars)
|
|
151
|
-
|
|
152
|
-
ray = RayTracing.from_kwargs(
|
|
149
|
+
ray = RayTracing(
|
|
153
150
|
telescope_model=tel_model,
|
|
154
|
-
|
|
155
|
-
source_distance=args_dict["src_distance"] * u.km,
|
|
151
|
+
simtel_path=args_dict["simtel_path"],
|
|
156
152
|
zenith_angle=args_dict["zenith"] * u.deg,
|
|
157
|
-
|
|
153
|
+
source_distance=args_dict["src_distance"] * u.km,
|
|
154
|
+
off_axis_angle=[0.0] * u.deg,
|
|
158
155
|
)
|
|
159
156
|
|
|
160
157
|
ray.simulate(test=args_dict["test"], force=False)
|
|
@@ -168,13 +165,17 @@ def main():
|
|
|
168
165
|
# Plotting cumulative PSF
|
|
169
166
|
# Measured cumulative PSF
|
|
170
167
|
data_to_plot = OrderedDict()
|
|
168
|
+
radius = None
|
|
171
169
|
if args_dict.get("data", None):
|
|
172
170
|
data_file = gen.find_file(args_dict["data"], args_dict["model_path"])
|
|
173
171
|
data_to_plot["measured"] = load_data(data_file)
|
|
174
172
|
radius = data_to_plot["measured"]["Radius [cm]"]
|
|
175
173
|
|
|
176
174
|
# Simulated cumulative PSF
|
|
177
|
-
|
|
175
|
+
if radius is not None:
|
|
176
|
+
data_to_plot[r"sim$\_$telarray"] = im.get_cumulative_data(radius * u.cm)
|
|
177
|
+
else:
|
|
178
|
+
raise ValueError("Radius data is not available. Cannot compute cumulative PSF.")
|
|
178
179
|
|
|
179
180
|
fig = visualize.plot_1d(data_to_plot)
|
|
180
181
|
fig.gca().set_ylim(0, 1.05)
|