gammasimtools 0.8.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.1.dist-info → gammasimtools-0.8.2.dist-info}/METADATA +2 -1
- {gammasimtools-0.8.1.dist-info → gammasimtools-0.8.2.dist-info}/RECORD +246 -247
- simtools/_dev_version/__init__.py +9 -0
- simtools/_version.py +2 -2
- simtools/applications/generate_simtel_array_histograms.py +1 -1
- simtools/applications/validate_camera_fov.py +1 -1
- simtools/applications/validate_file_using_schema.py +2 -4
- simtools/configuration/commandline_parser.py +2 -2
- simtools/constants.py +3 -3
- simtools/data_model/metadata_collector.py +1 -1
- simtools/model/array_model.py +30 -26
- simtools/model/calibration_model.py +10 -10
- simtools/model/camera.py +76 -62
- simtools/model/mirrors.py +8 -6
- simtools/model/model_parameter.py +2 -2
- simtools/model/model_utils.py +6 -6
- simtools/model/site_model.py +1 -1
- simtools/model/telescope_model.py +26 -22
- simtools/schemas/model_parameters/adjust_gain.schema.yml +1 -1
- simtools/schemas/model_parameters/altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/array_coordinates.schema.yml +1 -1
- simtools/schemas/model_parameters/array_coordinates_UTM.schema.yml +1 -1
- simtools/schemas/model_parameters/array_element_position_ground.schema.yml +1 -1
- simtools/schemas/model_parameters/array_element_position_utm.schema.yml +1 -1
- simtools/schemas/model_parameters/array_layouts.schema.yml +1 -1
- simtools/schemas/model_parameters/array_triggers.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_shaping.schema.yml +1 -1
- simtools/schemas/model_parameters/asum_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +1 -1
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/axes_offsets.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_body_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_body_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_config_file.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_config_rotate.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_degraded_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_depth.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_filter.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_pixels.schema.yml +1 -1
- simtools/schemas/model_parameters/camera_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/channels_per_chip.schema.yml +1 -1
- simtools/schemas/model_parameters/correct_nsb_spectrum_to_telescope_altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_cherenkov_photon_bunch_size.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_cherenkov_photon_wavelength_range.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_first_interaction_height.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_io_buffer.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_max_bunches.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_iact_split_auto.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_longitudinal_shower_development.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_observation_level.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_particle_kinetic_energy_cutoff.schema.yml +1 -1
- simtools/schemas/model_parameters/corsika_starting_grammage.schema.yml +1 -1
- simtools/schemas/model_parameters/dark_events.schema.yml +1 -1
- simtools/schemas/model_parameters/default_trigger.schema.yml +1 -1
- simtools/schemas/model_parameters/design_model.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_ac_coupled.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/disc_start.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_fall_time.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_gate_length.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_hysteresis.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_output_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_output_var_percent.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_rise_time.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_scale_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_sigsum_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_time_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_gate_length.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_sigsum_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/discriminator_var_time_over_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/dish_shape_length.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_ignore_below.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_pedsub.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_pre_clipping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_prescale.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_presum_max.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_presum_shift.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_shaping.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_shaping_renormalize.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +1 -1
- simtools/schemas/model_parameters/dsum_zero_clip.schema.yml +1 -1
- simtools/schemas/model_parameters/effective_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/epsg_code.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_ac_coupled.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_dev_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_err_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_err_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_dev_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_err_compensate_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_err_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_max_signal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_max_sum.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_noise.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_sysvar_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_var_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_lg_var_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_max_signal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_max_sum.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_mhz.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_noise.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sum_bins.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sum_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_sysvar_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_var_pedestal.schema.yml +1 -1
- simtools/schemas/model_parameters/fadc_var_sensitivity.schema.yml +1 -1
- simtools/schemas/model_parameters/flatfielding.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_surface_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/focal_surface_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/focus_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/gain_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_horizontal.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_rotation.schema.yml +1 -1
- simtools/schemas/model_parameters/geomag_vertical.schema.yml +1 -1
- simtools/schemas/model_parameters/hg_lg_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/iobuf_maximum.schema.yml +1 -1
- simtools/schemas/model_parameters/iobuf_output_maximum.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_events.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_external_trigger.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_exptime.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_sigtime.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_pulse_twidth.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_var_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/laser_wavelength.schema.yml +1 -1
- simtools/schemas/model_parameters/led_events.schema.yml +1 -1
- simtools/schemas/model_parameters/led_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/led_pulse_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/led_pulse_sigtime.schema.yml +1 -1
- simtools/schemas/model_parameters/led_var_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/lightguide_efficiency_vs_wavelength.schema.yml +1 -1
- simtools/schemas/model_parameters/min_photoelectrons.schema.yml +1 -1
- simtools/schemas/model_parameters/min_photons.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_distance.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_horizontal.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_align_random_vertical.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_class.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_degraded_reflection.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_list.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_panel_2f_measurements.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_reflection_random_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +1 -1
- simtools/schemas/model_parameters/multiplicity_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_autoscale_airmass.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_gain_drop_scale.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_offaxis.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_pixel_rate.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_reference_value.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_scaling_factor.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_skymap.schema.yml +1 -1
- simtools/schemas/model_parameters/nsb_spectrum.schema.yml +1 -1
- simtools/schemas/model_parameters/num_gains.schema.yml +1 -1
- simtools/schemas/model_parameters/only_triggered_telescopes.schema.yml +1 -1
- simtools/schemas/model_parameters/optics_properties.schema.yml +1 -1
- simtools/schemas/model_parameters/parabolic_dish.schema.yml +1 -1
- simtools/schemas/model_parameters/pedestal_events.schema.yml +1 -1
- simtools/schemas/model_parameters/photon_delay.schema.yml +1 -1
- simtools/schemas/model_parameters/photons_per_run.schema.yml +1 -1
- simtools/schemas/model_parameters/pixel_cells.schema.yml +1 -1
- simtools/schemas/model_parameters/pixels_parallel.schema.yml +1 -1
- simtools/schemas/model_parameters/pixeltrg_time_step.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_average_gain.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_collection_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_gain_index.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_transit_time.schema.yml +1 -1
- simtools/schemas/model_parameters/pm_voltage_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_hole_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_incidence_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/primary_mirror_segmentation.schema.yml +1 -1
- simtools/schemas/model_parameters/qe_variation.schema.yml +1 -1
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +1 -1
- simtools/schemas/model_parameters/random_focal_length.schema.yml +1 -1
- simtools/schemas/model_parameters/random_generator.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_altitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_latitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_longitude.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_utm_east.schema.yml +1 -1
- simtools/schemas/model_parameters/reference_point_utm_north.schema.yml +1 -1
- simtools/schemas/model_parameters/sampled_output.schema.yml +1 -1
- simtools/schemas/model_parameters/save_pe_with_amplitude.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_baffle.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_degraded_map.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_degraded_reflection.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_hole_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_incidence_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_parameters.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_ref_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_reflectivity.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_segmentation.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_shadow_diameter.schema.yml +1 -1
- simtools/schemas/model_parameters/secondary_mirror_shadow_offset.schema.yml +1 -1
- simtools/schemas/model_parameters/store_photoelectrons.schema.yml +1 -1
- simtools/schemas/model_parameters/tailcut_scale.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_axis_height.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_random_angle.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_random_error.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_sphere_radius.schema.yml +1 -1
- simtools/schemas/model_parameters/telescope_transmission.schema.yml +1 -1
- simtools/schemas/model_parameters/teltrig_min_sigsum.schema.yml +1 -1
- simtools/schemas/model_parameters/teltrig_min_time.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_calib_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_compensate_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_compensate_step.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_error.schema.yml +1 -1
- simtools/schemas/model_parameters/transit_time_jitter.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_current_limit.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml +1 -1
- simtools/schemas/model_parameters/trigger_pixels.schema.yml +1 -1
- simtools/testing/validate_output.py +2 -2
- simtools/utils/names.py +3 -4
- simtools/version.py +1 -1
- simtools/_dev_version/scm_version.py +0 -10
- {gammasimtools-0.8.1.dist-info → gammasimtools-0.8.2.dist-info}/LICENSE +0 -0
- {gammasimtools-0.8.1.dist-info → gammasimtools-0.8.2.dist-info}/WHEEL +0 -0
- {gammasimtools-0.8.1.dist-info → gammasimtools-0.8.2.dist-info}/entry_points.txt +0 -0
- {gammasimtools-0.8.1.dist-info → gammasimtools-0.8.2.dist-info}/top_level.txt +0 -0
simtools/model/camera.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Definition and modeling of camera."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
|
|
5
6
|
import astropy.units as u
|
|
6
7
|
import numpy as np
|
|
@@ -20,9 +21,9 @@ class Camera:
|
|
|
20
21
|
|
|
21
22
|
Parameters
|
|
22
23
|
----------
|
|
23
|
-
telescope_model_name:
|
|
24
|
+
telescope_model_name: str
|
|
24
25
|
As provided by the telescope model method TelescopeModel (e.g., LSTN-01)
|
|
25
|
-
camera_config_file:
|
|
26
|
+
camera_config_file: str or Path
|
|
26
27
|
The sim_telarray file name.
|
|
27
28
|
focal_length: float
|
|
28
29
|
The focal length of the camera in (preferably the effective focal length), assumed to be \
|
|
@@ -34,7 +35,9 @@ class Camera:
|
|
|
34
35
|
SIPM_NEIGHBOR_RADIUS_FACTOR = 1.4
|
|
35
36
|
SIPM_ROW_COLUMN_DIST_FACTOR = 0.2
|
|
36
37
|
|
|
37
|
-
def __init__(
|
|
38
|
+
def __init__(
|
|
39
|
+
self, telescope_model_name: str, camera_config_file: str | Path, focal_length: float
|
|
40
|
+
):
|
|
38
41
|
"""
|
|
39
42
|
Initialize Camera class, defining pixel layout.
|
|
40
43
|
|
|
@@ -58,13 +61,13 @@ class Camera:
|
|
|
58
61
|
self._edge_pixel_indices = None
|
|
59
62
|
|
|
60
63
|
@staticmethod
|
|
61
|
-
def read_pixel_list(camera_config_file):
|
|
64
|
+
def read_pixel_list(camera_config_file: str | Path) -> dict:
|
|
62
65
|
"""
|
|
63
66
|
Read the pixel layout from the camera config file, assumed to be in a sim_telarray format.
|
|
64
67
|
|
|
65
68
|
Parameters
|
|
66
69
|
----------
|
|
67
|
-
camera_config_file:
|
|
70
|
+
camera_config_file: str or Path
|
|
68
71
|
The sim_telarray file name.
|
|
69
72
|
|
|
70
73
|
Returns
|
|
@@ -90,7 +93,7 @@ class Camera:
|
|
|
90
93
|
return pixels
|
|
91
94
|
|
|
92
95
|
@staticmethod
|
|
93
|
-
def initialize_pixel_dict():
|
|
96
|
+
def initialize_pixel_dict() -> dict:
|
|
94
97
|
"""
|
|
95
98
|
Initialize the pixel dictionary with default values.
|
|
96
99
|
|
|
@@ -113,16 +116,16 @@ class Camera:
|
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
@staticmethod
|
|
116
|
-
def process_line(line, pixels):
|
|
119
|
+
def process_line(line: str, pixels: dict):
|
|
117
120
|
"""
|
|
118
|
-
Process a line from the camera config file and update the
|
|
121
|
+
Process a line from the camera config file and update the pixels dictionary.
|
|
119
122
|
|
|
120
123
|
Parameters
|
|
121
124
|
----------
|
|
122
|
-
line:
|
|
125
|
+
line: str
|
|
123
126
|
A line from the camera config file.
|
|
124
127
|
pixels: dict
|
|
125
|
-
The
|
|
128
|
+
The dictionary to update with pixel information.
|
|
126
129
|
"""
|
|
127
130
|
pix_info = line.split()
|
|
128
131
|
|
|
@@ -150,9 +153,9 @@ class Camera:
|
|
|
150
153
|
pixels["pix_on"].append(True)
|
|
151
154
|
|
|
152
155
|
@staticmethod
|
|
153
|
-
def validate_pixels(pixels, camera_config_file):
|
|
156
|
+
def validate_pixels(pixels: dict, camera_config_file: str | Path):
|
|
154
157
|
"""
|
|
155
|
-
Validate the pixel dictionary to ensure
|
|
158
|
+
Validate the pixel dictionary to ensure all required fields are present.
|
|
156
159
|
|
|
157
160
|
Parameters
|
|
158
161
|
----------
|
|
@@ -174,7 +177,7 @@ class Camera:
|
|
|
174
177
|
f"Pixel shape in {camera_config_file} unrecognized (has to be 1, 2 or 3)"
|
|
175
178
|
)
|
|
176
179
|
|
|
177
|
-
def _rotate_pixels(self, pixels):
|
|
180
|
+
def _rotate_pixels(self, pixels: dict) -> dict:
|
|
178
181
|
"""
|
|
179
182
|
Rotate the pixels according to the rotation angle given in pixels['rotate_angle'].
|
|
180
183
|
|
|
@@ -184,7 +187,7 @@ class Camera:
|
|
|
184
187
|
|
|
185
188
|
Parameters
|
|
186
189
|
----------
|
|
187
|
-
pixels:
|
|
190
|
+
pixels: dict
|
|
188
191
|
The dictionary produced by the read_pixel_list method of this class
|
|
189
192
|
|
|
190
193
|
Returns
|
|
@@ -219,9 +222,9 @@ class Camera:
|
|
|
219
222
|
|
|
220
223
|
return pixels
|
|
221
224
|
|
|
222
|
-
def get_number_of_pixels(self):
|
|
225
|
+
def get_number_of_pixels(self) -> int:
|
|
223
226
|
"""
|
|
224
|
-
Get the number of pixels in the camera (all pixels, including those defined as "off".
|
|
227
|
+
Get the number of pixels in the camera (all pixels, including those defined as "off").
|
|
225
228
|
|
|
226
229
|
Returns
|
|
227
230
|
-------
|
|
@@ -230,7 +233,7 @@ class Camera:
|
|
|
230
233
|
"""
|
|
231
234
|
return len(self.pixels["x"])
|
|
232
235
|
|
|
233
|
-
def get_pixel_diameter(self):
|
|
236
|
+
def get_pixel_diameter(self) -> float:
|
|
234
237
|
"""
|
|
235
238
|
Get pixel diameter contained in _pixels.
|
|
236
239
|
|
|
@@ -241,7 +244,7 @@ class Camera:
|
|
|
241
244
|
"""
|
|
242
245
|
return self.pixels["pixel_diameter"]
|
|
243
246
|
|
|
244
|
-
def get_pixel_active_solid_angle(self):
|
|
247
|
+
def get_pixel_active_solid_angle(self) -> float:
|
|
245
248
|
"""
|
|
246
249
|
Get the active solid angle of a pixel in sr.
|
|
247
250
|
|
|
@@ -256,7 +259,7 @@ class Camera:
|
|
|
256
259
|
pixel_area *= np.sqrt(3) / 2
|
|
257
260
|
return pixel_area / (self.focal_length**2)
|
|
258
261
|
|
|
259
|
-
def get_pixel_shape(self):
|
|
262
|
+
def get_pixel_shape(self) -> int:
|
|
260
263
|
"""
|
|
261
264
|
Get pixel shape code 1, 2 or 3.
|
|
262
265
|
|
|
@@ -270,7 +273,7 @@ class Camera:
|
|
|
270
273
|
"""
|
|
271
274
|
return self.pixels["pixel_shape"]
|
|
272
275
|
|
|
273
|
-
def get_lightguide_efficiency_angle_file_name(self):
|
|
276
|
+
def get_lightguide_efficiency_angle_file_name(self) -> str:
|
|
274
277
|
"""
|
|
275
278
|
Get the file name of the light guide efficiency as a function of incidence angle.
|
|
276
279
|
|
|
@@ -281,7 +284,7 @@ class Camera:
|
|
|
281
284
|
"""
|
|
282
285
|
return self.pixels["lightguide_efficiency_angle_file"]
|
|
283
286
|
|
|
284
|
-
def get_lightguide_efficiency_wavelength_file_name(self):
|
|
287
|
+
def get_lightguide_efficiency_wavelength_file_name(self) -> str:
|
|
285
288
|
"""
|
|
286
289
|
Get the file name of the light guide efficiency as a function of wavelength.
|
|
287
290
|
|
|
@@ -292,7 +295,7 @@ class Camera:
|
|
|
292
295
|
"""
|
|
293
296
|
return self.pixels["lightguide_efficiency_wavelength_file"]
|
|
294
297
|
|
|
295
|
-
def get_camera_fill_factor(self):
|
|
298
|
+
def get_camera_fill_factor(self) -> float:
|
|
296
299
|
"""
|
|
297
300
|
Calculate the fill factor of the camera, defined as (pixel_diameter/pixel_spacing)**2.
|
|
298
301
|
|
|
@@ -311,7 +314,7 @@ class Camera:
|
|
|
311
314
|
|
|
312
315
|
return (self.pixels["pixel_diameter"] / self.pixels["pixel_spacing"]) ** 2
|
|
313
316
|
|
|
314
|
-
def calc_fov(self):
|
|
317
|
+
def calc_fov(self) -> tuple[float, float]:
|
|
315
318
|
"""
|
|
316
319
|
Calculate the FOV of the camera in degrees, taking into account the focal length.
|
|
317
320
|
|
|
@@ -327,7 +330,6 @@ class Camera:
|
|
|
327
330
|
The x,y pixel positions and focal length are assumed to have the same unit (usually cm)
|
|
328
331
|
"""
|
|
329
332
|
self._logger.debug("Calculating the FoV")
|
|
330
|
-
|
|
331
333
|
return self._calc_fov(
|
|
332
334
|
self.pixels["x"],
|
|
333
335
|
self.pixels["y"],
|
|
@@ -335,7 +337,13 @@ class Camera:
|
|
|
335
337
|
self.focal_length,
|
|
336
338
|
)
|
|
337
339
|
|
|
338
|
-
def _calc_fov(
|
|
340
|
+
def _calc_fov(
|
|
341
|
+
self,
|
|
342
|
+
x_pixel: list[float],
|
|
343
|
+
y_pixel: list[float],
|
|
344
|
+
edge_pixel_indices: list[int],
|
|
345
|
+
focal_length: float,
|
|
346
|
+
) -> tuple[float, float]:
|
|
339
347
|
"""
|
|
340
348
|
Calculate the FOV of the camera in degrees, taking into account the focal length.
|
|
341
349
|
|
|
@@ -374,7 +382,7 @@ class Camera:
|
|
|
374
382
|
return fov, average_edge_distance
|
|
375
383
|
|
|
376
384
|
@staticmethod
|
|
377
|
-
def _find_neighbors(x_pos, y_pos, radius):
|
|
385
|
+
def _find_neighbors(x_pos: np.ndarray, y_pos: np.ndarray, radius: float) -> list[list[int]]:
|
|
378
386
|
"""
|
|
379
387
|
Use a KD-Tree to quickly find nearest neighbors.
|
|
380
388
|
|
|
@@ -392,20 +400,16 @@ class Camera:
|
|
|
392
400
|
|
|
393
401
|
Returns
|
|
394
402
|
-------
|
|
395
|
-
|
|
396
|
-
Array of neighbor indices in a list for each
|
|
403
|
+
list of lists
|
|
404
|
+
Array of neighbor indices in a list for each pixel
|
|
397
405
|
"""
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
neighbors = [kdtree.query_ball_point(p, r=radius) for p in points]
|
|
406
|
+
tree = KDTree(np.column_stack([x_pos, y_pos]))
|
|
407
|
+
neighbors = tree.query_ball_tree(tree, radius)
|
|
408
|
+
return [list(np.setdiff1d(neigh, [i])) for i, neigh in enumerate(neighbors)]
|
|
402
409
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
return neighbors
|
|
407
|
-
|
|
408
|
-
def _find_adjacent_neighbor_pixels(self, x_pos, y_pos, radius, row_column_dist):
|
|
410
|
+
def _find_adjacent_neighbor_pixels(
|
|
411
|
+
self, x_pos: np.ndarray, y_pos: np.ndarray, radius: float, row_column_dist: float
|
|
412
|
+
) -> list[list[int]]:
|
|
409
413
|
"""
|
|
410
414
|
Find adjacent neighbor pixels in cameras with square pixels.
|
|
411
415
|
|
|
@@ -413,13 +417,13 @@ class Camera:
|
|
|
413
417
|
|
|
414
418
|
Parameters
|
|
415
419
|
----------
|
|
416
|
-
x_pos
|
|
420
|
+
x_pos: np.ndarray
|
|
417
421
|
x position of each pixel
|
|
418
|
-
y_pos
|
|
422
|
+
y_pos: np.ndarray
|
|
419
423
|
y position of each pixel
|
|
420
|
-
radius
|
|
424
|
+
radius: float
|
|
421
425
|
Radius within which to find neighbors
|
|
422
|
-
row_column_dist
|
|
426
|
+
row_column_dist: float
|
|
423
427
|
Distance to consider for row/column adjacency.
|
|
424
428
|
Should be around 20% of the pixel diameter.
|
|
425
429
|
|
|
@@ -441,23 +445,31 @@ class Camera:
|
|
|
441
445
|
|
|
442
446
|
return neighbors
|
|
443
447
|
|
|
444
|
-
def _add_additional_neighbors(
|
|
448
|
+
def _add_additional_neighbors(
|
|
449
|
+
self,
|
|
450
|
+
i_pix: int,
|
|
451
|
+
nn: list[int],
|
|
452
|
+
x_pos: np.ndarray,
|
|
453
|
+
y_pos: np.ndarray,
|
|
454
|
+
radius: float,
|
|
455
|
+
row_column_dist: float,
|
|
456
|
+
):
|
|
445
457
|
"""
|
|
446
458
|
Add neighbors for a given pixel if they are not already neighbors and are adjacent.
|
|
447
459
|
|
|
448
460
|
Parameters
|
|
449
461
|
----------
|
|
450
|
-
i_pix
|
|
462
|
+
i_pix: int
|
|
451
463
|
Index of the pixel to find neighbors for
|
|
452
|
-
nn
|
|
464
|
+
nn: list
|
|
453
465
|
Current list of neighbors for the pixel
|
|
454
|
-
x_pos
|
|
466
|
+
x_pos: np.ndarray
|
|
455
467
|
x position of each pixel
|
|
456
|
-
y_pos
|
|
468
|
+
y_pos: np.ndarray
|
|
457
469
|
y position of each pixel
|
|
458
|
-
radius
|
|
470
|
+
radius: float
|
|
459
471
|
Radius within which to find neighbors
|
|
460
|
-
row_column_dist
|
|
472
|
+
row_column_dist: float
|
|
461
473
|
Distance to consider for row/column adjacency
|
|
462
474
|
"""
|
|
463
475
|
for j_pix, _ in enumerate(x_pos):
|
|
@@ -477,20 +489,20 @@ class Camera:
|
|
|
477
489
|
) and dist < 1.2 * radius:
|
|
478
490
|
nn.append(j_pix)
|
|
479
491
|
|
|
480
|
-
def _calc_neighbor_pixels(self, pixels):
|
|
492
|
+
def _calc_neighbor_pixels(self, pixels: dict) -> list[list[int]]:
|
|
481
493
|
"""
|
|
482
494
|
Find adjacent neighbor pixels in cameras with hexagonal or square pixels.
|
|
483
495
|
|
|
484
|
-
Only directly
|
|
496
|
+
Only directly adjacent neighbors are searched for, no diagonals.
|
|
485
497
|
|
|
486
498
|
Parameters
|
|
487
499
|
----------
|
|
488
|
-
pixels:
|
|
500
|
+
pixels: dict
|
|
489
501
|
The dictionary produced by the read_pixel_list method of this class
|
|
490
502
|
|
|
491
503
|
Returns
|
|
492
504
|
-------
|
|
493
|
-
neighbors:
|
|
505
|
+
neighbors: list of lists
|
|
494
506
|
Array of neighbor indices in a list for each pixel
|
|
495
507
|
"""
|
|
496
508
|
self._logger.debug("Searching for neighbor pixels")
|
|
@@ -515,7 +527,7 @@ class Camera:
|
|
|
515
527
|
|
|
516
528
|
return self._neighbors
|
|
517
529
|
|
|
518
|
-
def get_neighbor_pixels(self, pixels=None):
|
|
530
|
+
def get_neighbor_pixels(self, pixels: dict | None = None) -> list[list[int]]:
|
|
519
531
|
"""
|
|
520
532
|
Get a list of neighbor pixels by calling calc_neighbor_pixels() when necessary.
|
|
521
533
|
|
|
@@ -529,7 +541,7 @@ class Camera:
|
|
|
529
541
|
|
|
530
542
|
Returns
|
|
531
543
|
-------
|
|
532
|
-
neighbors:
|
|
544
|
+
neighbors: list of lists
|
|
533
545
|
Array of neighbor indices in a list for each pixel.
|
|
534
546
|
"""
|
|
535
547
|
if self._neighbors is None:
|
|
@@ -539,20 +551,20 @@ class Camera:
|
|
|
539
551
|
|
|
540
552
|
return self._neighbors
|
|
541
553
|
|
|
542
|
-
def _calc_edge_pixels(self, pixels, neighbors):
|
|
554
|
+
def _calc_edge_pixels(self, pixels: dict, neighbors: list[list[int]]) -> list[int]:
|
|
543
555
|
"""
|
|
544
556
|
Find the edge pixels of the camera.
|
|
545
557
|
|
|
546
558
|
Parameters
|
|
547
559
|
----------
|
|
548
|
-
pixels:
|
|
560
|
+
pixels: dict
|
|
549
561
|
The dictionary produced by the read_pixel_list method of this class.
|
|
550
|
-
neighbors:
|
|
562
|
+
neighbors: list of lists
|
|
551
563
|
Array of neighbor indices in a list for each pixel.
|
|
552
564
|
|
|
553
565
|
Returns
|
|
554
566
|
-------
|
|
555
|
-
edge_pixel_indices:
|
|
567
|
+
edge_pixel_indices: list
|
|
556
568
|
Array of edge pixel indices.
|
|
557
569
|
"""
|
|
558
570
|
self._logger.debug("Searching for edge pixels")
|
|
@@ -574,7 +586,9 @@ class Camera:
|
|
|
574
586
|
|
|
575
587
|
return edge_pixel_indices
|
|
576
588
|
|
|
577
|
-
def get_edge_pixels(
|
|
589
|
+
def get_edge_pixels(
|
|
590
|
+
self, pixels: dict | None = None, neighbors: list[list[int]] | None = None
|
|
591
|
+
) -> list[int]:
|
|
578
592
|
"""
|
|
579
593
|
Get the indices of the edge pixels of the camera.
|
|
580
594
|
|
|
@@ -582,12 +596,12 @@ class Camera:
|
|
|
582
596
|
----------
|
|
583
597
|
pixels: dict
|
|
584
598
|
The dictionary produced by the read_pixel_list method of this class.
|
|
585
|
-
neighbors:
|
|
599
|
+
neighbors: list of lists
|
|
586
600
|
Array of neighbor indices in a list for each pixel.
|
|
587
601
|
|
|
588
602
|
Returns
|
|
589
603
|
-------
|
|
590
|
-
edge_pixel_indices:
|
|
604
|
+
edge_pixel_indices: list
|
|
591
605
|
Array of edge pixel indices.
|
|
592
606
|
"""
|
|
593
607
|
if self._edge_pixel_indices is None:
|
simtools/model/mirrors.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Definition and modeling of mirror panels."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
|
|
5
6
|
import astropy.io.ascii
|
|
6
7
|
import astropy.units as u
|
|
@@ -20,13 +21,13 @@ class Mirrors:
|
|
|
20
21
|
|
|
21
22
|
Parameters
|
|
22
23
|
----------
|
|
23
|
-
mirror_list_file: str
|
|
24
|
-
|
|
25
|
-
parameters: dict
|
|
24
|
+
mirror_list_file: Union[str, Path]
|
|
25
|
+
Mirror list in sim_telarray or ecsv format (with panel focal length only).
|
|
26
|
+
parameters: dict, optional
|
|
26
27
|
Dictionary of parameters from the database.
|
|
27
28
|
"""
|
|
28
29
|
|
|
29
|
-
def __init__(self, mirror_list_file, parameters=None):
|
|
30
|
+
def __init__(self, mirror_list_file: str | Path, parameters: dict | None = None):
|
|
30
31
|
"""Initialize Mirrors."""
|
|
31
32
|
self._logger = logging.getLogger(__name__)
|
|
32
33
|
self._logger.debug("Mirrors Init")
|
|
@@ -180,7 +181,7 @@ class Mirrors:
|
|
|
180
181
|
self._logger.debug(f"Mirror diameter = {self.mirror_diameter}")
|
|
181
182
|
self._logger.debug(f"Number of Mirrors = {self.number_of_mirrors}")
|
|
182
183
|
|
|
183
|
-
def get_single_mirror_parameters(self, number):
|
|
184
|
+
def get_single_mirror_parameters(self, number: int) -> tuple:
|
|
184
185
|
"""
|
|
185
186
|
Get parameters for a single mirror given by number.
|
|
186
187
|
|
|
@@ -191,7 +192,8 @@ class Mirrors:
|
|
|
191
192
|
|
|
192
193
|
Returns
|
|
193
194
|
-------
|
|
194
|
-
|
|
195
|
+
tuple
|
|
196
|
+
(pos_x, pos_y, mirror_diameter, focal_length, shape_type): tuple of float
|
|
195
197
|
X, Y positions, mirror_diameter, focal length and shape_type.
|
|
196
198
|
"""
|
|
197
199
|
mask = self.mirror_table["mirror_panel_id"] == number
|
|
@@ -456,7 +456,7 @@ class ModelParameter:
|
|
|
456
456
|
Change values of multiple existing parameters in the model from a file.
|
|
457
457
|
|
|
458
458
|
This function does not modify the DB, it affects only the current instance.
|
|
459
|
-
|
|
459
|
+
This feature is intended for developers and lacks validation.
|
|
460
460
|
|
|
461
461
|
Parameters
|
|
462
462
|
----------
|
|
@@ -464,7 +464,7 @@ class ModelParameter:
|
|
|
464
464
|
File containing the parameters to be changed.
|
|
465
465
|
"""
|
|
466
466
|
self._logger.warning(
|
|
467
|
-
"Changing multiple parameters from file is
|
|
467
|
+
"Changing multiple parameters from file is a feature for developers."
|
|
468
468
|
"Insufficient validation of parameters."
|
|
469
469
|
)
|
|
470
470
|
self._logger.debug(f"Changing parameters from file {file_name}")
|
simtools/model/model_utils.py
CHANGED
|
@@ -11,7 +11,7 @@ __all__ = [
|
|
|
11
11
|
]
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def compute_telescope_transmission(pars, off_axis):
|
|
14
|
+
def compute_telescope_transmission(pars: list[float], off_axis: float) -> float:
|
|
15
15
|
"""
|
|
16
16
|
Compute telescope transmission (0 < T < 1) for a given off-axis angle.
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ def compute_telescope_transmission(pars, off_axis):
|
|
|
20
20
|
Parameters
|
|
21
21
|
----------
|
|
22
22
|
pars: list of float
|
|
23
|
-
Parameters of the telescope transmission. Len(pars) should be
|
|
23
|
+
Parameters of the telescope transmission. Len(pars) should be 5 or 6.
|
|
24
24
|
off_axis: float
|
|
25
25
|
Off-axis angle in deg.
|
|
26
26
|
|
|
@@ -37,19 +37,19 @@ def compute_telescope_transmission(pars, off_axis):
|
|
|
37
37
|
return pars[0] / (1.0 + pars[2] * t ** pars[4])
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
def is_two_mirror_telescope(telescope_model_name):
|
|
40
|
+
def is_two_mirror_telescope(telescope_model_name: str) -> bool:
|
|
41
41
|
"""
|
|
42
|
-
|
|
42
|
+
Determine if the telescope model is a two-mirror telescope.
|
|
43
43
|
|
|
44
44
|
Parameters
|
|
45
45
|
----------
|
|
46
46
|
telescope_model_name: str
|
|
47
|
-
|
|
47
|
+
Name of the telescope model.
|
|
48
48
|
|
|
49
49
|
Returns
|
|
50
50
|
-------
|
|
51
51
|
bool
|
|
52
|
-
True if
|
|
52
|
+
True if it is a two-mirror telescope.
|
|
53
53
|
"""
|
|
54
54
|
tel_type = names.get_array_element_type_from_name(telescope_model_name)
|
|
55
55
|
if "SST" in tel_type or "SCT" in tel_type:
|
simtools/model/site_model.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""MC model of a telescope."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
|
|
5
6
|
import astropy.io.ascii
|
|
6
7
|
import numpy as np
|
|
@@ -31,23 +32,20 @@ class TelescopeModel(ModelParameter):
|
|
|
31
32
|
MongoDB configuration.
|
|
32
33
|
model_version: str
|
|
33
34
|
Model version.
|
|
34
|
-
label: str
|
|
35
|
+
label: str, optional
|
|
35
36
|
Instance label. Important for output file naming.
|
|
36
37
|
"""
|
|
37
38
|
|
|
38
39
|
def __init__(
|
|
39
40
|
self,
|
|
40
|
-
site,
|
|
41
|
-
telescope_name,
|
|
42
|
-
mongo_db_config,
|
|
43
|
-
model_version,
|
|
44
|
-
label=None,
|
|
41
|
+
site: str,
|
|
42
|
+
telescope_name: str,
|
|
43
|
+
mongo_db_config: dict,
|
|
44
|
+
model_version: str,
|
|
45
|
+
label: str | None = None,
|
|
45
46
|
):
|
|
46
47
|
"""Initialize TelescopeModel."""
|
|
47
|
-
|
|
48
|
-
self._logger.debug("Init TelescopeModel %s %s", site, telescope_name)
|
|
49
|
-
ModelParameter.__init__(
|
|
50
|
-
self,
|
|
48
|
+
super().__init__(
|
|
51
49
|
site=site,
|
|
52
50
|
array_element_name=telescope_name,
|
|
53
51
|
mongo_db_config=mongo_db_config,
|
|
@@ -56,6 +54,9 @@ class TelescopeModel(ModelParameter):
|
|
|
56
54
|
label=label,
|
|
57
55
|
)
|
|
58
56
|
|
|
57
|
+
self._logger = logging.getLogger(__name__)
|
|
58
|
+
self._logger.debug("Init TelescopeModel %s %s", site, telescope_name)
|
|
59
|
+
|
|
59
60
|
self._single_mirror_list_file_paths = None
|
|
60
61
|
self._mirrors = None
|
|
61
62
|
self._camera = None
|
|
@@ -74,7 +75,7 @@ class TelescopeModel(ModelParameter):
|
|
|
74
75
|
self._load_camera()
|
|
75
76
|
return self._camera
|
|
76
77
|
|
|
77
|
-
def export_single_mirror_list_file(self, mirror_number, set_focal_length_to_zero):
|
|
78
|
+
def export_single_mirror_list_file(self, mirror_number: int, set_focal_length_to_zero: bool):
|
|
78
79
|
"""
|
|
79
80
|
Export a mirror list file with a single mirror in it.
|
|
80
81
|
|
|
@@ -107,7 +108,9 @@ class TelescopeModel(ModelParameter):
|
|
|
107
108
|
set_focal_length_to_zero,
|
|
108
109
|
)
|
|
109
110
|
|
|
110
|
-
def get_single_mirror_list_file(
|
|
111
|
+
def get_single_mirror_list_file(
|
|
112
|
+
self, mirror_number: int, set_focal_length_to_zero: bool = False
|
|
113
|
+
):
|
|
111
114
|
"""
|
|
112
115
|
Get the path to the single mirror list file.
|
|
113
116
|
|
|
@@ -143,7 +146,9 @@ class TelescopeModel(ModelParameter):
|
|
|
143
146
|
|
|
144
147
|
self._mirrors = Mirrors(mirror_list_file, parameters=self._parameters)
|
|
145
148
|
|
|
146
|
-
def get_telescope_effective_focal_length(
|
|
149
|
+
def get_telescope_effective_focal_length(
|
|
150
|
+
self, unit: str = "m", return_focal_length_if_zero: bool = False
|
|
151
|
+
) -> float:
|
|
147
152
|
"""
|
|
148
153
|
Return effective focal length.
|
|
149
154
|
|
|
@@ -160,7 +165,6 @@ class TelescopeModel(ModelParameter):
|
|
|
160
165
|
-------
|
|
161
166
|
float:
|
|
162
167
|
Effective focal length.
|
|
163
|
-
|
|
164
168
|
"""
|
|
165
169
|
try:
|
|
166
170
|
eff_focal_length = self.get_parameter_value_with_unit("effective_focal_length")[0]
|
|
@@ -200,7 +204,7 @@ class TelescopeModel(ModelParameter):
|
|
|
200
204
|
focal_length=focal_length,
|
|
201
205
|
)
|
|
202
206
|
|
|
203
|
-
def is_file_2d(self, par):
|
|
207
|
+
def is_file_2d(self, par: str) -> bool:
|
|
204
208
|
"""
|
|
205
209
|
Check if the file referenced by par is a 2D table.
|
|
206
210
|
|
|
@@ -212,7 +216,7 @@ class TelescopeModel(ModelParameter):
|
|
|
212
216
|
Returns
|
|
213
217
|
-------
|
|
214
218
|
bool:
|
|
215
|
-
True if the file is a 2D map type
|
|
219
|
+
True if the file is a 2D map type.
|
|
216
220
|
"""
|
|
217
221
|
try:
|
|
218
222
|
file_name = self.get_parameter_value(par)
|
|
@@ -224,7 +228,7 @@ class TelescopeModel(ModelParameter):
|
|
|
224
228
|
with open(file, encoding="utf-8") as f:
|
|
225
229
|
return "@RPOL@" in f.read()
|
|
226
230
|
|
|
227
|
-
def read_two_dim_wavelength_angle(self, file_name):
|
|
231
|
+
def read_two_dim_wavelength_angle(self, file_name: str | Path) -> dict:
|
|
228
232
|
"""
|
|
229
233
|
Read a two dimensional distribution of wavelength and angle (z-axis can be anything).
|
|
230
234
|
|
|
@@ -259,7 +263,7 @@ class TelescopeModel(ModelParameter):
|
|
|
259
263
|
"z": np.array(_data[:, 1:]).T,
|
|
260
264
|
}
|
|
261
265
|
|
|
262
|
-
def get_on_axis_eff_optical_area(self):
|
|
266
|
+
def get_on_axis_eff_optical_area(self) -> float:
|
|
263
267
|
"""Return the on-axis effective optical area (derived previously for this telescope)."""
|
|
264
268
|
ray_tracing_data = astropy.io.ascii.read(
|
|
265
269
|
self.config_file_directory.joinpath(self.get_parameter_value("optics_properties"))
|
|
@@ -272,7 +276,7 @@ class TelescopeModel(ModelParameter):
|
|
|
272
276
|
raise ValueError
|
|
273
277
|
return ray_tracing_data["eff_area"][0]
|
|
274
278
|
|
|
275
|
-
def read_incidence_angle_distribution(self, incidence_angle_dist_file):
|
|
279
|
+
def read_incidence_angle_distribution(self, incidence_angle_dist_file: str) -> Table:
|
|
276
280
|
"""
|
|
277
281
|
Read the incidence angle distribution from a file.
|
|
278
282
|
|
|
@@ -293,7 +297,7 @@ class TelescopeModel(ModelParameter):
|
|
|
293
297
|
return astropy.io.ascii.read(self.config_file_directory.joinpath(incidence_angle_dist_file))
|
|
294
298
|
|
|
295
299
|
@staticmethod
|
|
296
|
-
def calc_average_curve(curves, incidence_angle_dist):
|
|
300
|
+
def calc_average_curve(curves: dict, incidence_angle_dist: Table) -> Table:
|
|
297
301
|
"""
|
|
298
302
|
Calculate an average curve from a set of curves.
|
|
299
303
|
|
|
@@ -328,7 +332,7 @@ class TelescopeModel(ModelParameter):
|
|
|
328
332
|
names=("Wavelength", "z"),
|
|
329
333
|
)
|
|
330
334
|
|
|
331
|
-
def export_table_to_model_directory(self, file_name, table):
|
|
335
|
+
def export_table_to_model_directory(self, file_name: str, table: Table) -> str:
|
|
332
336
|
"""
|
|
333
337
|
Write out a file with the provided table to the model directory.
|
|
334
338
|
|
|
@@ -348,7 +352,7 @@ class TelescopeModel(ModelParameter):
|
|
|
348
352
|
table.write(file_to_write_to, format="ascii.commented_header", overwrite=True)
|
|
349
353
|
return file_to_write_to.absolute()
|
|
350
354
|
|
|
351
|
-
def position(self, coordinate_system="ground"):
|
|
355
|
+
def position(self, coordinate_system: str = "ground") -> list:
|
|
352
356
|
"""
|
|
353
357
|
Get coordinates in the given system.
|
|
354
358
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
title: Schema for adjust_gain model parameter
|
|
4
4
|
version: 0.1.0
|
|
5
5
|
meta_schema: simpipe-schema
|
|
6
|
-
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
|
|
6
|
+
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/src/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
|
|
7
7
|
meta_schema_version: 0.1.0
|
|
8
8
|
name: adjust_gain
|
|
9
9
|
description: |-
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
title: Schema for altitude model parameter
|
|
4
4
|
version: 0.1.0
|
|
5
5
|
meta_schema: simpipe-schema
|
|
6
|
-
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
|
|
6
|
+
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/src/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
|
|
7
7
|
meta_schema_version: 0.1.0
|
|
8
8
|
name: altitude
|
|
9
9
|
description: |-
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
title: Schema for array_coordinates model parameter
|
|
4
4
|
version: 0.1.0
|
|
5
5
|
meta_schema: simpipe-schema
|
|
6
|
-
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
|
|
6
|
+
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/src/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
|
|
7
7
|
meta_schema_version: 0.1.0
|
|
8
8
|
developer_note: To be replaced by a data table
|
|
9
9
|
name: array_coordinates
|