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,3 +1,5 @@
|
|
|
1
|
+
"""Definition of geospatial coordinate systems."""
|
|
2
|
+
|
|
1
3
|
import logging
|
|
2
4
|
|
|
3
5
|
import astropy.units as u
|
|
@@ -8,16 +10,13 @@ import pyproj
|
|
|
8
10
|
class GeoCoordinates:
|
|
9
11
|
"""
|
|
10
12
|
Geospatial Coordinate systems.
|
|
13
|
+
|
|
11
14
|
Defines UTM, WGS84 and ground (sim_telarray) coordinate systems.
|
|
12
15
|
|
|
13
16
|
"""
|
|
14
17
|
|
|
15
18
|
def __init__(self):
|
|
16
|
-
"""
|
|
17
|
-
Initialize GeoCoordinates
|
|
18
|
-
|
|
19
|
-
"""
|
|
20
|
-
|
|
19
|
+
"""Initialize GeoCoordinates."""
|
|
21
20
|
self._logger = logging.getLogger(__name__)
|
|
22
21
|
|
|
23
22
|
def crs_utm(self, epsg):
|
|
@@ -58,6 +57,7 @@ class GeoCoordinates:
|
|
|
58
57
|
def crs_local(self, reference_point):
|
|
59
58
|
"""
|
|
60
59
|
Local coordinate system definition.
|
|
60
|
+
|
|
61
61
|
This is a cartesian coordinate system with the origin at the array center.
|
|
62
62
|
X-axis points towards geographic North, y-axis towards geographic West.
|
|
63
63
|
|
|
@@ -93,6 +93,7 @@ class GeoCoordinates:
|
|
|
93
93
|
def _valid_reference_point(self, reference_point):
|
|
94
94
|
"""
|
|
95
95
|
Check if reference point has valid long/lat coordinates (including altitude).
|
|
96
|
+
|
|
96
97
|
This is required to derive the local coordinate system.
|
|
97
98
|
Try if a conversion from UTM coordinates to long/lat is possible.
|
|
98
99
|
|
|
@@ -123,8 +124,7 @@ class GeoCoordinates:
|
|
|
123
124
|
|
|
124
125
|
def _coordinate_scale_factor(self, reference_point):
|
|
125
126
|
"""
|
|
126
|
-
Derive coordinate scale factor for transformation into
|
|
127
|
-
local coordinate system
|
|
127
|
+
Derive coordinate scale factor for transformation into local coordinate system.
|
|
128
128
|
|
|
129
129
|
Depends on latitude and altitude of array center.
|
|
130
130
|
Ignores transformation of geodetic height to geocentric height
|
|
@@ -146,7 +146,6 @@ class GeoCoordinates:
|
|
|
146
146
|
If reference_point does not have a valid center or UTM system is not defined.
|
|
147
147
|
|
|
148
148
|
"""
|
|
149
|
-
|
|
150
149
|
try:
|
|
151
150
|
_center_lat, _, _centre_altitude = reference_point.get_coordinates("mercator")
|
|
152
151
|
except AttributeError:
|
|
@@ -183,14 +182,12 @@ class GeoCoordinates:
|
|
|
183
182
|
Ellipsoid radius at given latitude.
|
|
184
183
|
|
|
185
184
|
"""
|
|
186
|
-
|
|
187
185
|
_lat_rad = np.deg2rad(latitude)
|
|
188
186
|
_numerator = (semi_major_axis**2 * np.cos(_lat_rad)) ** 2 + (
|
|
189
187
|
semi_minor_axis**2 * np.sin(_lat_rad)
|
|
190
188
|
) ** 2
|
|
191
189
|
|
|
192
190
|
_denominator = (
|
|
193
|
-
semi_major_axis**2 * np.cos(_lat_rad) ** 2
|
|
194
|
-
+ semi_minor_axis**2 * np.sin(_lat_rad) ** 2
|
|
191
|
+
semi_major_axis**2 * np.cos(_lat_rad) ** 2 + semi_minor_axis**2 * np.sin(_lat_rad) ** 2
|
|
195
192
|
)
|
|
196
193
|
return np.sqrt(_numerator / _denominator)
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
+
"""Telescope positions and coordinate transformations."""
|
|
2
|
+
|
|
1
3
|
import logging
|
|
2
4
|
|
|
3
5
|
import astropy.units as u
|
|
4
6
|
import numpy as np
|
|
5
7
|
import pyproj
|
|
6
8
|
|
|
7
|
-
__all__ = ["
|
|
9
|
+
__all__ = ["InvalidCoordSystemErrorError", "TelescopePosition"]
|
|
8
10
|
|
|
9
11
|
|
|
10
|
-
class
|
|
12
|
+
class InvalidCoordSystemErrorError(Exception):
|
|
11
13
|
"""Exception for invalid coordinate system."""
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
class TelescopePosition:
|
|
15
17
|
"""
|
|
16
|
-
Store and perform coordinate transformations
|
|
18
|
+
Store a telescope position and perform coordinate transformations.
|
|
17
19
|
|
|
18
20
|
The definition of x_coord and y_coord in this class depend on the \
|
|
19
21
|
coordinate system (e.g., (x_coord, y_coord) == (UTM_east, UTM_north)). \
|
|
20
|
-
Altitude describes always the element height above sea level
|
|
22
|
+
Altitude describes always the element height above sea level, position_z
|
|
23
|
+
the height above a reference altitude (e.g., CORSIKA observation level).
|
|
21
24
|
|
|
22
25
|
Parameters
|
|
23
26
|
----------
|
|
24
27
|
name: str
|
|
25
|
-
Name of the telescope (e.g
|
|
28
|
+
Name of the telescope (e.g LSTN-01, SSTS-05, ...).
|
|
26
29
|
|
|
27
30
|
"""
|
|
28
31
|
|
|
29
32
|
def __init__(self, name=None):
|
|
30
|
-
"""
|
|
31
|
-
Initialize TelescopePosition.
|
|
32
|
-
"""
|
|
33
|
-
|
|
33
|
+
"""Initialize TelescopePosition."""
|
|
34
34
|
self._logger = logging.getLogger(__name__)
|
|
35
35
|
|
|
36
36
|
self.name = name
|
|
37
37
|
self.asset_code = None
|
|
38
38
|
self.sequence_number = None
|
|
39
39
|
self.geo_code = None
|
|
40
|
-
self.crs = self.
|
|
40
|
+
self.crs = self._default_coordinates()
|
|
41
41
|
|
|
42
42
|
def __str__(self):
|
|
43
|
-
"""
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"""
|
|
47
|
-
telstr = self.name
|
|
43
|
+
"""Return string representation of TelescopePosition."""
|
|
44
|
+
tel_str = self.name
|
|
48
45
|
if self.has_coordinates("ground"):
|
|
49
|
-
|
|
46
|
+
tel_str += (
|
|
50
47
|
f"\t Ground x(->North): {self.crs['ground']['xx']['value']:0.2f} "
|
|
51
48
|
f"y(->West): {self.crs['ground']['yy']['value']:0.2f}"
|
|
52
49
|
)
|
|
53
50
|
if self.has_coordinates("utm"):
|
|
54
|
-
|
|
51
|
+
tel_str += (
|
|
55
52
|
f"\t UTM East: {self.crs['utm']['xx']['value']:0.2f} "
|
|
56
53
|
f"UTM North: {self.crs['utm']['yy']['value']:0.2f}"
|
|
57
54
|
)
|
|
58
55
|
if self.has_coordinates("mercator"):
|
|
59
|
-
|
|
56
|
+
tel_str += (
|
|
60
57
|
f"\t Longitude: {self.crs['mercator']['xx']['value']:0.5f} "
|
|
61
58
|
f"Latitude: {self.crs['mercator']['yy']['value']:0.5f}"
|
|
62
59
|
)
|
|
63
60
|
for _crs_name, _crs_now in self.crs.items():
|
|
64
|
-
if self.has_altitude(_crs_name):
|
|
65
|
-
|
|
61
|
+
if self.is_coordinate_system(_crs_name) and self.has_altitude(_crs_name):
|
|
62
|
+
tel_str += f"\t Alt: {_crs_now['zz']['value']:0.2f}"
|
|
66
63
|
break
|
|
67
64
|
|
|
68
|
-
return
|
|
65
|
+
return tel_str
|
|
69
66
|
|
|
70
67
|
def print_compact_format(
|
|
71
|
-
self,
|
|
68
|
+
self,
|
|
69
|
+
crs_name,
|
|
70
|
+
print_header=False,
|
|
71
|
+
corsika_observation_level=None,
|
|
72
72
|
):
|
|
73
73
|
"""
|
|
74
74
|
Print array element coordinates in compact format.
|
|
@@ -79,58 +79,52 @@ class TelescopePosition:
|
|
|
79
79
|
Name of coordinate system to be used for printing.
|
|
80
80
|
print_header: bool
|
|
81
81
|
Print table header.
|
|
82
|
-
|
|
82
|
+
corsika_observation_level: astropy.Quantity
|
|
83
83
|
CORSIKA observation level in equivalent units of meter.
|
|
84
|
-
corsika_sphere_center: astropy.Quantity
|
|
85
|
-
CORSIKA sphere center in equivalent units of meter.
|
|
86
84
|
|
|
87
85
|
Raises
|
|
88
86
|
------
|
|
89
|
-
|
|
87
|
+
InvalidCoordSystemErrorError
|
|
90
88
|
if coordinate system is not defined.
|
|
91
89
|
"""
|
|
92
|
-
|
|
93
90
|
try:
|
|
94
91
|
_zz = self.crs[crs_name]["zz"]["value"]
|
|
95
92
|
_zz_header = self.crs[crs_name]["zz"]["name"]
|
|
96
|
-
if
|
|
97
|
-
crs_name == "ground"
|
|
98
|
-
and corsika_obs_level is not None
|
|
99
|
-
and corsika_sphere_center is not None
|
|
100
|
-
):
|
|
93
|
+
if crs_name == "ground" and corsika_observation_level is not None:
|
|
101
94
|
_zz = (
|
|
102
95
|
self.convert_telescope_altitude_to_corsika_system(
|
|
103
96
|
_zz * u.Unit(self.crs[crs_name]["zz"]["unit"]),
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
corsika_observation_level,
|
|
98
|
+
self.crs["auxiliary"]["telescope_axis_height"]["value"]
|
|
99
|
+
* u.Unit(self.crs["auxiliary"]["telescope_axis_height"]["unit"]),
|
|
106
100
|
)
|
|
107
101
|
).value
|
|
108
102
|
_zz_header = "position_z"
|
|
109
103
|
|
|
110
104
|
if crs_name == "mercator":
|
|
111
|
-
|
|
105
|
+
tel_str = (
|
|
112
106
|
f"{self.name} {self.crs[crs_name]['xx']['value']:10.8f} "
|
|
113
107
|
f"{self.crs[crs_name]['yy']['value']:10.8f} {_zz:10.2f}"
|
|
114
108
|
)
|
|
115
109
|
else:
|
|
116
|
-
|
|
110
|
+
tel_str = (
|
|
117
111
|
f"{self.name} {self.crs[crs_name]['xx']['value']:10.2f} "
|
|
118
112
|
f"{self.crs[crs_name]['yy']['value']:10.2f} {_zz:10.2f}"
|
|
119
113
|
)
|
|
120
|
-
|
|
114
|
+
header_str = (
|
|
121
115
|
f"telescope_name {self.crs[crs_name]['xx']['name']} "
|
|
122
116
|
f"{self.crs[crs_name]['yy']['name']} {_zz_header}"
|
|
123
117
|
)
|
|
124
118
|
|
|
125
119
|
if self.geo_code is not None:
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
tel_str += f" {self.geo_code}"
|
|
121
|
+
header_str += " geo_code"
|
|
128
122
|
if print_header:
|
|
129
|
-
print(
|
|
130
|
-
print(
|
|
123
|
+
print(header_str)
|
|
124
|
+
print(tel_str)
|
|
131
125
|
except KeyError as e:
|
|
132
126
|
self._logger.error(f"Invalid coordinate system ({crs_name})")
|
|
133
|
-
raise
|
|
127
|
+
raise InvalidCoordSystemErrorError from e
|
|
134
128
|
|
|
135
129
|
def get_coordinates(self, crs_name, coordinate_field=None):
|
|
136
130
|
"""
|
|
@@ -150,7 +144,7 @@ class TelescopePosition:
|
|
|
150
144
|
|
|
151
145
|
Raises
|
|
152
146
|
------
|
|
153
|
-
|
|
147
|
+
InvalidCoordSystemErrorError
|
|
154
148
|
if coordinate system is not defined
|
|
155
149
|
|
|
156
150
|
"""
|
|
@@ -163,7 +157,7 @@ class TelescopePosition:
|
|
|
163
157
|
)
|
|
164
158
|
except KeyError as e:
|
|
165
159
|
self._logger.error(f"Invalid coordinate system ({crs_name})")
|
|
166
|
-
raise
|
|
160
|
+
raise InvalidCoordSystemErrorError from e
|
|
167
161
|
else:
|
|
168
162
|
try:
|
|
169
163
|
return (
|
|
@@ -176,16 +170,16 @@ class TelescopePosition:
|
|
|
176
170
|
f"Invalid coordinate system ({crs_name}) "
|
|
177
171
|
f"or coordinate field ({coordinate_field})"
|
|
178
172
|
)
|
|
179
|
-
raise
|
|
173
|
+
raise InvalidCoordSystemErrorError from e
|
|
180
174
|
|
|
181
175
|
def _get_coordinate_value(self, value, unit):
|
|
182
176
|
"""
|
|
183
|
-
Return a value of a coordinate variable
|
|
177
|
+
Return a value of a coordinate variable.
|
|
178
|
+
|
|
184
179
|
i) converted to the given unit, if input value has a unit
|
|
185
180
|
ii) return input value without change, if no unit is given
|
|
186
181
|
|
|
187
182
|
"""
|
|
188
|
-
|
|
189
183
|
if isinstance(value, u.Quantity):
|
|
190
184
|
try:
|
|
191
185
|
return value.to(unit).value
|
|
@@ -212,11 +206,10 @@ class TelescopePosition:
|
|
|
212
206
|
|
|
213
207
|
Raises
|
|
214
208
|
------
|
|
215
|
-
|
|
209
|
+
InvalidCoordSystemErrorError
|
|
216
210
|
If coordinate system is not known.
|
|
217
211
|
|
|
218
212
|
"""
|
|
219
|
-
|
|
220
213
|
try:
|
|
221
214
|
self.crs[crs_name]["xx"]["value"] = self._get_coordinate_value(
|
|
222
215
|
xx, self.crs[crs_name]["xx"]["unit"]
|
|
@@ -230,11 +223,11 @@ class TelescopePosition:
|
|
|
230
223
|
)
|
|
231
224
|
except KeyError as e:
|
|
232
225
|
self._logger.error(f"Invalid coordinate system ({crs_name})")
|
|
233
|
-
raise
|
|
226
|
+
raise InvalidCoordSystemErrorError from e
|
|
234
227
|
|
|
235
228
|
def get_altitude(self):
|
|
236
|
-
"""
|
|
237
|
-
Get altitude of an array element
|
|
229
|
+
"""
|
|
230
|
+
Get altitude of an array element.
|
|
238
231
|
|
|
239
232
|
Returns
|
|
240
233
|
-------
|
|
@@ -250,21 +243,26 @@ class TelescopePosition:
|
|
|
250
243
|
|
|
251
244
|
def set_altitude(self, tel_altitude):
|
|
252
245
|
"""
|
|
253
|
-
Set altitude of an array element.
|
|
254
|
-
|
|
246
|
+
Set altitude of an array element.
|
|
247
|
+
|
|
248
|
+
Assume that all coordinate system have same altitude definition, meaning altitude
|
|
249
|
+
is set for all systems here.
|
|
255
250
|
|
|
256
251
|
Attributes
|
|
257
252
|
----------
|
|
258
253
|
tel_altitude: astropy.Quantity
|
|
259
254
|
"""
|
|
260
|
-
|
|
261
255
|
for _crs in self.crs.values():
|
|
262
|
-
|
|
256
|
+
try:
|
|
257
|
+
_crs["zz"]["value"] = self._get_coordinate_value(tel_altitude, _crs["zz"]["unit"])
|
|
258
|
+
except KeyError:
|
|
259
|
+
pass
|
|
263
260
|
|
|
264
261
|
def _convert(self, crs_from, crs_to, xx, yy):
|
|
265
262
|
"""
|
|
266
|
-
Coordinate transformation of telescope positions.
|
|
267
|
-
|
|
263
|
+
Coordinate transformation of telescope positions.
|
|
264
|
+
|
|
265
|
+
Returns np.nan for failed transformations (and not inf, as pyproj does).
|
|
268
266
|
|
|
269
267
|
Parameters
|
|
270
268
|
----------
|
|
@@ -304,8 +302,9 @@ class TelescopePosition:
|
|
|
304
302
|
|
|
305
303
|
def _get_reference_system_from(self):
|
|
306
304
|
"""
|
|
307
|
-
Return coordinate system and coordinates for a fully defined system.
|
|
308
|
-
|
|
305
|
+
Return coordinate system and coordinates for a fully defined system.
|
|
306
|
+
|
|
307
|
+
The first fully defined system from self.crs is returned.
|
|
309
308
|
|
|
310
309
|
Returns
|
|
311
310
|
-------
|
|
@@ -315,12 +314,38 @@ class TelescopePosition:
|
|
|
315
314
|
Project of coordinate system
|
|
316
315
|
|
|
317
316
|
"""
|
|
318
|
-
|
|
319
317
|
for _crs_name, _crs in self.crs.items():
|
|
320
318
|
if self.has_coordinates(_crs_name, crs_check=True):
|
|
321
319
|
return _crs_name, _crs
|
|
322
320
|
return None, None
|
|
323
321
|
|
|
322
|
+
def is_coordinate_system(self, crs_name):
|
|
323
|
+
"""
|
|
324
|
+
Check if crs_name describes a coordinate system or auxiliary information.
|
|
325
|
+
|
|
326
|
+
Parameters
|
|
327
|
+
----------
|
|
328
|
+
crs_name: str
|
|
329
|
+
Name of coordinate system.
|
|
330
|
+
|
|
331
|
+
Returns
|
|
332
|
+
-------
|
|
333
|
+
bool
|
|
334
|
+
True if coordinate system is defined.
|
|
335
|
+
|
|
336
|
+
Raises
|
|
337
|
+
------
|
|
338
|
+
InvalidCoordSystemErrorError
|
|
339
|
+
If coordinate system is not known.
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
"""
|
|
343
|
+
try:
|
|
344
|
+
return "crs" in self.crs[crs_name]
|
|
345
|
+
except KeyError as e:
|
|
346
|
+
self._logger.error(f"Invalid coordinate system ({crs_name})")
|
|
347
|
+
raise InvalidCoordSystemErrorError from e
|
|
348
|
+
|
|
324
349
|
def has_coordinates(self, crs_name, crs_check=False):
|
|
325
350
|
"""
|
|
326
351
|
Check if coordinates are set for a given coordinate system.
|
|
@@ -339,15 +364,17 @@ class TelescopePosition:
|
|
|
339
364
|
|
|
340
365
|
Raises
|
|
341
366
|
------
|
|
342
|
-
|
|
367
|
+
InvalidCoordSystemErrorError
|
|
343
368
|
If coordinate system is not known.
|
|
344
369
|
"""
|
|
370
|
+
if not self.is_coordinate_system(crs_name):
|
|
371
|
+
return False
|
|
345
372
|
try:
|
|
346
373
|
if not self.crs[crs_name]["crs"] and crs_check:
|
|
347
374
|
return False
|
|
348
375
|
except KeyError as e:
|
|
349
376
|
self._logger.error(f"Invalid coordinate system ({crs_name})")
|
|
350
|
-
raise
|
|
377
|
+
raise InvalidCoordSystemErrorError from e
|
|
351
378
|
|
|
352
379
|
return np.all(
|
|
353
380
|
np.isfinite(
|
|
@@ -375,7 +402,7 @@ class TelescopePosition:
|
|
|
375
402
|
|
|
376
403
|
Raises
|
|
377
404
|
------
|
|
378
|
-
|
|
405
|
+
InvalidCoordSystemErrorError
|
|
379
406
|
If coordinate system is not known
|
|
380
407
|
|
|
381
408
|
"""
|
|
@@ -385,6 +412,9 @@ class TelescopePosition:
|
|
|
385
412
|
return True
|
|
386
413
|
return False
|
|
387
414
|
|
|
415
|
+
if not self.is_coordinate_system(crs_name):
|
|
416
|
+
return False
|
|
417
|
+
|
|
388
418
|
try:
|
|
389
419
|
return (
|
|
390
420
|
self.crs[crs_name]["zz"]["value"] is not np.nan
|
|
@@ -392,7 +422,7 @@ class TelescopePosition:
|
|
|
392
422
|
)
|
|
393
423
|
except KeyError as e:
|
|
394
424
|
self._logger.error(f"Invalid coordinate system ({crs_name})")
|
|
395
|
-
raise
|
|
425
|
+
raise InvalidCoordSystemErrorError from e
|
|
396
426
|
|
|
397
427
|
def _set_coordinate_system(self, crs_name, crs_system):
|
|
398
428
|
"""
|
|
@@ -407,7 +437,7 @@ class TelescopePosition:
|
|
|
407
437
|
|
|
408
438
|
Raises
|
|
409
439
|
------
|
|
410
|
-
|
|
440
|
+
InvalidCoordSystemErrorError
|
|
411
441
|
If coordinate system is not known.
|
|
412
442
|
|
|
413
443
|
"""
|
|
@@ -415,12 +445,12 @@ class TelescopePosition:
|
|
|
415
445
|
self.crs[crs_name]["crs"] = crs_system
|
|
416
446
|
except KeyError as e:
|
|
417
447
|
self._logger.error(f"Invalid coordinate system ({crs_name})")
|
|
418
|
-
raise
|
|
448
|
+
raise InvalidCoordSystemErrorError from e
|
|
419
449
|
|
|
420
450
|
@staticmethod
|
|
421
|
-
@u.quantity_input(tel_altitude=u.m,
|
|
451
|
+
@u.quantity_input(tel_altitude=u.m, corsika_observation_level=u.m, telescope_axis_height=u.m)
|
|
422
452
|
def convert_telescope_altitude_to_corsika_system(
|
|
423
|
-
tel_altitude,
|
|
453
|
+
tel_altitude, corsika_observation_level, telescope_axis_height
|
|
424
454
|
):
|
|
425
455
|
"""
|
|
426
456
|
Convert telescope altitude to CORSIKA system (pos_z).
|
|
@@ -431,21 +461,20 @@ class TelescopePosition:
|
|
|
431
461
|
Telescope altitude in equivalent units of meter.
|
|
432
462
|
corsika_ob_level: astropy.Quantity
|
|
433
463
|
CORSIKA observation level in equivalent units of meter.
|
|
434
|
-
|
|
435
|
-
|
|
464
|
+
telescope_axis_height: astropy.Quantity
|
|
465
|
+
Height of telescope elevation axis above ground level in equivalent units of meter.
|
|
436
466
|
|
|
437
467
|
Returns
|
|
438
468
|
-------
|
|
439
469
|
astropy.units.m
|
|
440
470
|
Z-position of a telescope in CORSIKA system.
|
|
441
471
|
"""
|
|
442
|
-
|
|
443
|
-
return (tel_altitude - corsika_obs_level + corsika_sphere_center).to(u.m)
|
|
472
|
+
return (tel_altitude - corsika_observation_level + telescope_axis_height).to(u.m)
|
|
444
473
|
|
|
445
474
|
@staticmethod
|
|
446
|
-
@u.quantity_input(tel_corsika_z=u.m,
|
|
475
|
+
@u.quantity_input(tel_corsika_z=u.m, corsika_observation_level=u.m, telescope_axis_height=u.m)
|
|
447
476
|
def convert_telescope_altitude_from_corsika_system(
|
|
448
|
-
tel_corsika_z,
|
|
477
|
+
tel_corsika_z, corsika_observation_level=None, telescope_axis_height=None
|
|
449
478
|
):
|
|
450
479
|
"""
|
|
451
480
|
Convert Corsika (pos_z) to altitude.
|
|
@@ -454,17 +483,17 @@ class TelescopePosition:
|
|
|
454
483
|
----------
|
|
455
484
|
tel_corsika_z: astropy.Quantity
|
|
456
485
|
Telescope z-position in CORSIKA system in equivalent units of meter.
|
|
457
|
-
|
|
486
|
+
corsika_observation_level: astropy.Quantity
|
|
458
487
|
CORSIKA observation level in equivalent units of meter.
|
|
459
|
-
|
|
460
|
-
|
|
488
|
+
telescope_axis_height: astropy.Quantity
|
|
489
|
+
Height of telescope elevation axis above ground level in equivalent units of meter.
|
|
461
490
|
|
|
462
491
|
Returns
|
|
463
492
|
-------
|
|
464
493
|
astropy.units.m
|
|
465
494
|
Telescope altitude (above sea level)
|
|
466
495
|
"""
|
|
467
|
-
return tel_corsika_z +
|
|
496
|
+
return tel_corsika_z + corsika_observation_level - telescope_axis_height
|
|
468
497
|
|
|
469
498
|
def convert_all(self, crs_local=None, crs_wgs84=None, crs_utm=None):
|
|
470
499
|
"""
|
|
@@ -480,7 +509,6 @@ class TelescopePosition:
|
|
|
480
509
|
Pyproj CRS of the utm coordinate system.
|
|
481
510
|
|
|
482
511
|
"""
|
|
483
|
-
|
|
484
512
|
self._set_coordinate_system("ground", crs_local)
|
|
485
513
|
self._set_coordinate_system("utm", crs_utm)
|
|
486
514
|
self._set_coordinate_system("mercator", crs_wgs84)
|
|
@@ -490,7 +518,7 @@ class TelescopePosition:
|
|
|
490
518
|
return
|
|
491
519
|
|
|
492
520
|
for _crs_to_name, _crs_to in self.crs.items():
|
|
493
|
-
if _crs_to_name == _crs_from_name:
|
|
521
|
+
if _crs_to_name == _crs_from_name or not self.is_coordinate_system(_crs_to_name):
|
|
494
522
|
continue
|
|
495
523
|
if not self.has_coordinates(_crs_to_name) and _crs_to["crs"] is not None:
|
|
496
524
|
_x, _y = self._convert(
|
|
@@ -503,11 +531,57 @@ class TelescopePosition:
|
|
|
503
531
|
_crs_to_name, _x, _y, _crs_from["zz"]["value"] * _crs_from["zz"]["unit"]
|
|
504
532
|
)
|
|
505
533
|
|
|
534
|
+
def get_axis_height(self):
|
|
535
|
+
"""
|
|
536
|
+
Get telescope axis height.
|
|
537
|
+
|
|
538
|
+
Returns
|
|
539
|
+
-------
|
|
540
|
+
astropy.quantity
|
|
541
|
+
Telescope axis height.
|
|
542
|
+
|
|
543
|
+
"""
|
|
544
|
+
return self.crs["auxiliary"]["telescope_axis_height"]["value"] * u.Unit(
|
|
545
|
+
self.crs["auxiliary"]["telescope_axis_height"]["unit"]
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
def get_sphere_radius(self):
|
|
549
|
+
"""
|
|
550
|
+
Get telescope sphere radius.
|
|
551
|
+
|
|
552
|
+
Returns
|
|
553
|
+
-------
|
|
554
|
+
astropy.quantity
|
|
555
|
+
Telescope sphere radius
|
|
556
|
+
|
|
557
|
+
"""
|
|
558
|
+
return self.crs["auxiliary"]["telescope_sphere_radius"]["value"] * u.Unit(
|
|
559
|
+
self.crs["auxiliary"]["telescope_sphere_radius"]["unit"]
|
|
560
|
+
)
|
|
561
|
+
|
|
562
|
+
def set_auxiliary_parameter(self, parameter_name, quantity):
|
|
563
|
+
"""
|
|
564
|
+
Set auxiliary parameter.
|
|
565
|
+
|
|
566
|
+
Parameters
|
|
567
|
+
----------
|
|
568
|
+
parameter_name: str
|
|
569
|
+
Name of parameter.
|
|
570
|
+
quantity: astropy.units.Quantity
|
|
571
|
+
Quantity of parameter.
|
|
572
|
+
|
|
573
|
+
"""
|
|
574
|
+
self.crs["auxiliary"][parameter_name]["value"] = quantity.value
|
|
575
|
+
self.crs["auxiliary"][parameter_name]["unit"] = quantity.unit
|
|
576
|
+
|
|
506
577
|
@staticmethod
|
|
507
|
-
def
|
|
578
|
+
def _default_coordinates():
|
|
508
579
|
"""
|
|
509
|
-
|
|
510
|
-
|
|
580
|
+
Coordinate definition for a telescope position.
|
|
581
|
+
|
|
582
|
+
Includes all coordinate systems and auxiliary information. Includes axes and
|
|
583
|
+
default axes units. Naming convention follows pyproj for x and y coordinates.
|
|
584
|
+
Includes auxiliary telescope data required for CORSIKA.
|
|
511
585
|
|
|
512
586
|
Returns
|
|
513
587
|
-------
|
|
@@ -515,13 +589,12 @@ class TelescopePosition:
|
|
|
515
589
|
coordinate system definition
|
|
516
590
|
|
|
517
591
|
"""
|
|
518
|
-
|
|
519
592
|
return {
|
|
520
593
|
"ground": {
|
|
521
594
|
"crs": None,
|
|
522
595
|
"xx": {"name": "position_x", "value": np.nan, "unit": u.Unit("m")},
|
|
523
596
|
"yy": {"name": "position_y", "value": np.nan, "unit": u.Unit("m")},
|
|
524
|
-
"zz": {"name": "
|
|
597
|
+
"zz": {"name": "position_z", "value": np.nan, "unit": u.Unit("m")},
|
|
525
598
|
},
|
|
526
599
|
"mercator": {
|
|
527
600
|
"crs": None,
|
|
@@ -535,4 +608,8 @@ class TelescopePosition:
|
|
|
535
608
|
"yy": {"name": "utm_north", "value": np.nan, "unit": u.Unit("m")},
|
|
536
609
|
"zz": {"name": "altitude", "value": np.nan, "unit": u.Unit("m")},
|
|
537
610
|
},
|
|
611
|
+
"auxiliary": {
|
|
612
|
+
"telescope_sphere_radius": {"value": np.nan, "unit": u.Unit("m")},
|
|
613
|
+
"telescope_axis_height": {"value": np.nan, "unit": u.Unit("m")},
|
|
614
|
+
},
|
|
538
615
|
}
|