gammasimtools 0.16.0__py3-none-any.whl → 0.18.0__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.16.0.dist-info → gammasimtools-0.18.0.dist-info}/METADATA +5 -2
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.18.0.dist-info}/RECORD +82 -74
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.18.0.dist-info}/WHEEL +1 -1
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.18.0.dist-info}/entry_points.txt +4 -1
- simtools/_version.py +2 -2
- simtools/applications/db_add_simulation_model_from_repository_to_db.py +10 -1
- simtools/applications/derive_ctao_array_layouts.py +5 -5
- simtools/applications/derive_mirror_rnda.py +1 -1
- simtools/applications/generate_simtel_event_data.py +128 -46
- simtools/applications/merge_tables.py +102 -0
- simtools/applications/plot_array_layout.py +145 -258
- simtools/applications/plot_tabular_data.py +12 -1
- simtools/applications/plot_tabular_data_for_model_parameter.py +103 -0
- simtools/applications/production_derive_corsika_limits.py +78 -225
- simtools/applications/production_derive_statistics.py +77 -43
- simtools/applications/simulate_light_emission.py +1 -0
- simtools/applications/simulate_prod.py +30 -18
- simtools/applications/simulate_prod_htcondor_generator.py +0 -1
- simtools/applications/submit_array_layouts.py +93 -0
- simtools/applications/verify_simulation_model_production_tables.py +52 -0
- simtools/camera/camera_efficiency.py +3 -3
- simtools/configuration/commandline_parser.py +30 -35
- simtools/configuration/configurator.py +0 -4
- simtools/constants.py +2 -0
- simtools/corsika/corsika_config.py +17 -12
- simtools/corsika/primary_particle.py +46 -13
- simtools/data_model/metadata_collector.py +7 -3
- simtools/data_model/schema.py +15 -1
- simtools/db/db_handler.py +16 -11
- simtools/db/db_model_upload.py +2 -2
- simtools/io_operations/io_handler.py +2 -2
- simtools/io_operations/io_table_handler.py +345 -0
- simtools/job_execution/htcondor_script_generator.py +2 -2
- simtools/job_execution/job_manager.py +7 -121
- simtools/layout/array_layout_utils.py +389 -0
- simtools/model/array_model.py +10 -1
- simtools/model/model_repository.py +134 -0
- simtools/production_configuration/{calculate_statistical_errors_grid_point.py → calculate_statistical_uncertainties_grid_point.py} +101 -112
- simtools/production_configuration/derive_corsika_limits.py +239 -111
- simtools/production_configuration/derive_corsika_limits_grid.py +232 -0
- simtools/production_configuration/derive_production_statistics.py +57 -26
- simtools/production_configuration/derive_production_statistics_handler.py +70 -37
- simtools/production_configuration/interpolation_handler.py +296 -94
- simtools/ray_tracing/ray_tracing.py +7 -6
- simtools/reporting/docs_read_parameters.py +104 -62
- simtools/resources/array-element-ids.json +126 -0
- simtools/runners/corsika_simtel_runner.py +4 -1
- simtools/runners/runner_services.py +5 -4
- simtools/schemas/model_parameter_and_data_schema.metaschema.yml +5 -1
- simtools/schemas/model_parameters/atmospheric_profile.schema.yml +41 -0
- simtools/schemas/model_parameters/atmospheric_transmission.schema.yml +43 -0
- simtools/schemas/model_parameters/camera_filter.schema.yml +10 -0
- simtools/schemas/model_parameters/camera_filter_incidence_angle.schema.yml +10 -0
- simtools/schemas/model_parameters/discriminator_pulse_shape.schema.yml +31 -0
- simtools/schemas/model_parameters/dsum_threshold.schema.yml +41 -0
- simtools/schemas/model_parameters/fadc_pulse_shape.schema.yml +12 -0
- simtools/schemas/model_parameters/lightguide_efficiency_vs_incidence_angle.schema.yml +10 -0
- simtools/schemas/model_parameters/mirror_reflectivity.schema.yml +10 -0
- simtools/schemas/model_parameters/nsb_reference_spectrum.schema.yml +12 -0
- simtools/schemas/model_parameters/pm_photoelectron_spectrum.schema.yml +19 -0
- simtools/schemas/model_parameters/quantum_efficiency.schema.yml +10 -0
- simtools/schemas/plot_configuration.metaschema.yml +46 -57
- simtools/schemas/production_configuration_metrics.schema.yml +2 -2
- simtools/simtel/simtel_config_writer.py +34 -14
- simtools/simtel/simtel_io_event_reader.py +301 -194
- simtools/simtel/simtel_io_event_writer.py +237 -221
- simtools/simtel/simtel_io_file_info.py +9 -4
- simtools/simtel/simtel_io_metadata.py +119 -8
- simtools/simtel/simulator_array.py +2 -2
- simtools/simtel/simulator_light_emission.py +79 -34
- simtools/simtel/simulator_ray_tracing.py +2 -2
- simtools/simulator.py +101 -68
- simtools/testing/validate_output.py +4 -1
- simtools/utils/general.py +1 -3
- simtools/utils/names.py +76 -7
- simtools/visualization/plot_array_layout.py +242 -0
- simtools/visualization/plot_pixels.py +680 -0
- simtools/visualization/plot_tables.py +81 -2
- simtools/visualization/visualize.py +3 -219
- simtools/applications/production_generate_simulation_config.py +0 -152
- simtools/layout/ctao_array_layouts.py +0 -172
- simtools/production_configuration/generate_simulation_config.py +0 -158
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.18.0.dist-info}/licenses/LICENSE +0 -0
- {gammasimtools-0.16.0.dist-info → gammasimtools-0.18.0.dist-info}/top_level.txt +0 -0
- /simtools/{schemas → resources}/array_elements.yml +0 -0
|
@@ -31,3 +31,34 @@ source:
|
|
|
31
31
|
- Calibration
|
|
32
32
|
simulation_software:
|
|
33
33
|
- name: sim_telarray
|
|
34
|
+
plot_configuration:
|
|
35
|
+
- type: discriminator_pulse_shape
|
|
36
|
+
title: 'Discriminator pulse shape'
|
|
37
|
+
xtitle: 'Time [ns]'
|
|
38
|
+
ytitle: 'Amplitude [a.u.]'
|
|
39
|
+
no_markers: true
|
|
40
|
+
tables:
|
|
41
|
+
- parameter: discriminator_pulse_shape
|
|
42
|
+
column_x: 'time'
|
|
43
|
+
column_y: 'amplitude'
|
|
44
|
+
- type: discriminator_pulse_shape_low_gain
|
|
45
|
+
title: 'Discriminator pulse shape (low gain)'
|
|
46
|
+
xtitle: 'Time [ns]'
|
|
47
|
+
ytitle: 'Amplitude [a.u.]'
|
|
48
|
+
no_markers: true
|
|
49
|
+
tables:
|
|
50
|
+
- parameter: discriminator_pulse_shape
|
|
51
|
+
column_x: 'time'
|
|
52
|
+
column_y: 'amplitude (low gain)'
|
|
53
|
+
- type: discriminator_pulse_shape_high_and_low_gain
|
|
54
|
+
title: 'Discriminator pulse shape (high and low gain)'
|
|
55
|
+
xtitle: 'Time [ns]'
|
|
56
|
+
ytitle: 'Amplitude [a.u.]'
|
|
57
|
+
no_markers: true
|
|
58
|
+
tables:
|
|
59
|
+
- parameter: discriminator_pulse_shape
|
|
60
|
+
column_x: 'time'
|
|
61
|
+
column_y: 'amplitude'
|
|
62
|
+
- parameter: discriminator_pulse_shape
|
|
63
|
+
column_x: 'time'
|
|
64
|
+
column_y: 'amplitude (low gain)'
|
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
%YAML 1.2
|
|
2
2
|
---
|
|
3
3
|
title: Schema for dsum_threshold model parameter
|
|
4
|
+
version: 0.2.0
|
|
5
|
+
meta_schema: simpipe-schema
|
|
6
|
+
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/src/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
|
|
7
|
+
meta_schema_version: 0.1.0
|
|
8
|
+
name: dsum_threshold
|
|
9
|
+
description: |-
|
|
10
|
+
The amplitude level above pedestal sum above which a
|
|
11
|
+
digital sum leads to a telescope trigger.
|
|
12
|
+
Note that, like for discriminator/comparator and analog sum, the signal
|
|
13
|
+
must exceed (\'>\') the threshold here before we declare the telescope
|
|
14
|
+
triggered. The assigned threshold value would have to be one count lower
|
|
15
|
+
than in a camera-internal trigger implementation (like MSTx-FlashCam) where
|
|
16
|
+
reaching (\'>=\') the threshold is enough.
|
|
17
|
+
short_description: Amplitude level above which a digital sum leads to a telescope
|
|
18
|
+
trigger.
|
|
19
|
+
data:
|
|
20
|
+
- type: int64
|
|
21
|
+
unit: count
|
|
22
|
+
default: 0
|
|
23
|
+
allowed_range:
|
|
24
|
+
min: 0
|
|
25
|
+
condition: default_trigger==DigitalSum
|
|
26
|
+
instrument:
|
|
27
|
+
class: Camera
|
|
28
|
+
type:
|
|
29
|
+
- MSTx-NectarCam
|
|
30
|
+
- MSTx-FlashCam
|
|
31
|
+
activity:
|
|
32
|
+
setting:
|
|
33
|
+
- SetParameterFromExternal
|
|
34
|
+
- SetTriggerThresholdsFromRateScan
|
|
35
|
+
validation:
|
|
36
|
+
- ValidateParameterByExpert
|
|
37
|
+
- ValidateTriggerPerformance
|
|
38
|
+
source:
|
|
39
|
+
- Observation execution
|
|
40
|
+
simulation_software:
|
|
41
|
+
- name: sim_telarray
|
|
42
|
+
...
|
|
43
|
+
---
|
|
44
|
+
title: Schema for dsum_threshold model parameter
|
|
4
45
|
version: 0.1.0
|
|
5
46
|
meta_schema: simpipe-schema
|
|
6
47
|
meta_schema_url: https://raw.githubusercontent.com/gammasim/simtools/main/src/simtools/schemas/model_parameter_and_data_schema.metaschema.yml
|
|
@@ -37,3 +37,15 @@ source:
|
|
|
37
37
|
- Calibration
|
|
38
38
|
simulation_software:
|
|
39
39
|
- name: sim_telarray
|
|
40
|
+
plot_configuration:
|
|
41
|
+
- type: fadc_pulse_shape
|
|
42
|
+
title: 'FADC pulse shape'
|
|
43
|
+
xtitle: 'Time [ns]'
|
|
44
|
+
ytitle: 'Amplitude [a.u.]'
|
|
45
|
+
xscale: 'linear'
|
|
46
|
+
yscale: 'linear'
|
|
47
|
+
no_markers: true
|
|
48
|
+
tables:
|
|
49
|
+
- parameter: fadc_pulse_shape
|
|
50
|
+
column_x: 'time'
|
|
51
|
+
column_y: 'amplitude'
|
|
@@ -39,3 +39,13 @@ source:
|
|
|
39
39
|
- Calibration
|
|
40
40
|
simulation_software:
|
|
41
41
|
- name: simtools
|
|
42
|
+
plot_configuration:
|
|
43
|
+
- type: lightguide_efficiency_vs_incidence_angle
|
|
44
|
+
title: 'Light guide efficiency'
|
|
45
|
+
xtitle: 'Incident angle [deg]'
|
|
46
|
+
ytitle: 'Efficiency'
|
|
47
|
+
no_markers: true
|
|
48
|
+
tables:
|
|
49
|
+
- parameter: lightguide_efficiency_vs_incidence_angle
|
|
50
|
+
column_x: 'angle'
|
|
51
|
+
column_y: 'efficiency'
|
|
@@ -38,3 +38,13 @@ source:
|
|
|
38
38
|
- Calibration
|
|
39
39
|
simulation_software:
|
|
40
40
|
- name: sim_telarray
|
|
41
|
+
plot_configuration:
|
|
42
|
+
- type: mirror_reflectivity
|
|
43
|
+
title: 'Mirror reflectivity'
|
|
44
|
+
xtitle: 'Wavelength [nm]'
|
|
45
|
+
ytitle: 'Reflectivity'
|
|
46
|
+
no_markers: true
|
|
47
|
+
tables:
|
|
48
|
+
- parameter: mirror_reflectivity
|
|
49
|
+
column_x: 'wavelength'
|
|
50
|
+
column_y: 'reflectivity'
|
|
@@ -32,3 +32,15 @@ source:
|
|
|
32
32
|
- Calibration
|
|
33
33
|
simulation_software:
|
|
34
34
|
- name: simtools
|
|
35
|
+
plot_configuration:
|
|
36
|
+
- type: nsb_reference_spectrum
|
|
37
|
+
title: 'NSB spectrum'
|
|
38
|
+
xtitle: 'Wavelength [nm]'
|
|
39
|
+
ytitle: 'Differential photon rate [10^9 / (nm s m^2 sr)]'
|
|
40
|
+
xscale: 'linear'
|
|
41
|
+
yscale: 'log'
|
|
42
|
+
no_markers: true
|
|
43
|
+
tables:
|
|
44
|
+
- parameter: nsb_reference_spectrum
|
|
45
|
+
column_x: 'wavelength'
|
|
46
|
+
column_y: 'differential photon rate'
|
|
@@ -39,3 +39,22 @@ source:
|
|
|
39
39
|
- Calibration
|
|
40
40
|
simulation_software:
|
|
41
41
|
- name: sim_telarray
|
|
42
|
+
plot_configuration:
|
|
43
|
+
- type: pm_photoelectron_spectrum
|
|
44
|
+
title: 'Single p.e. response'
|
|
45
|
+
xtitle: 'Amplitude'
|
|
46
|
+
ytitle: 'Response'
|
|
47
|
+
xscale: 'linear'
|
|
48
|
+
yscale: 'log'
|
|
49
|
+
xlim: [0., 40.]
|
|
50
|
+
ylim: [1.e-11, null]
|
|
51
|
+
no_markers: true
|
|
52
|
+
tables:
|
|
53
|
+
- parameter: pm_photoelectron_spectrum
|
|
54
|
+
label: 'prompt'
|
|
55
|
+
column_x: 'amplitude'
|
|
56
|
+
column_y: 'response'
|
|
57
|
+
- parameter: pm_photoelectron_spectrum
|
|
58
|
+
label: 'prompt + afterpulsing'
|
|
59
|
+
column_x: 'amplitude'
|
|
60
|
+
column_y: 'response_with_ap'
|
|
@@ -40,3 +40,13 @@ source:
|
|
|
40
40
|
- Calibration
|
|
41
41
|
simulation_software:
|
|
42
42
|
- name: sim_telarray
|
|
43
|
+
plot_configuration:
|
|
44
|
+
- type: quantum_efficiency
|
|
45
|
+
title: 'Quantum/detection efficiency'
|
|
46
|
+
xtitle: 'Wavelength [nm]'
|
|
47
|
+
ytitle: 'Quantum/detection efficiency'
|
|
48
|
+
no_markers: true
|
|
49
|
+
tables:
|
|
50
|
+
- parameter: quantum_efficiency
|
|
51
|
+
column_x: 'wavelength'
|
|
52
|
+
column_y: 'efficiency'
|
|
@@ -6,157 +6,146 @@ description: YAML representation of plot configuration metaschema
|
|
|
6
6
|
version: 0.1.0
|
|
7
7
|
name: plot_configuration.metaschema
|
|
8
8
|
type: object
|
|
9
|
-
additionalProperties: false
|
|
10
9
|
|
|
11
10
|
definitions:
|
|
12
11
|
SimtoolsPlotConfiguration:
|
|
13
12
|
type: object
|
|
14
13
|
additionalProperties: false
|
|
15
14
|
properties:
|
|
16
|
-
|
|
17
|
-
"$ref": "#/definitions/
|
|
18
|
-
|
|
15
|
+
plot:
|
|
16
|
+
"$ref": "#/definitions/plot"
|
|
17
|
+
schema_version:
|
|
19
18
|
type: string
|
|
20
19
|
description: "Version of the schema."
|
|
21
|
-
|
|
20
|
+
schema_url:
|
|
22
21
|
type: string
|
|
23
22
|
format: uri
|
|
24
23
|
description: "URL of the schema."
|
|
25
|
-
|
|
24
|
+
schema_name:
|
|
26
25
|
type: string
|
|
27
26
|
description: "Name of the schema."
|
|
28
27
|
required:
|
|
29
|
-
-
|
|
28
|
+
- plot
|
|
30
29
|
title: "SimtoolsPlotConfiguration"
|
|
31
|
-
|
|
32
|
-
type: object
|
|
33
|
-
additionalProperties: false
|
|
34
|
-
properties:
|
|
35
|
-
PLOT:
|
|
36
|
-
"$ref": "#/definitions/Plot"
|
|
37
|
-
required:
|
|
38
|
-
- PLOT
|
|
39
|
-
title: "CTASimpipe"
|
|
40
|
-
Plot:
|
|
30
|
+
plot:
|
|
41
31
|
description: "Plot configuration of simtools data visualization."
|
|
42
32
|
type: object
|
|
43
33
|
additionalProperties: false
|
|
44
34
|
properties:
|
|
45
|
-
|
|
35
|
+
type:
|
|
46
36
|
type: string
|
|
47
37
|
description: "Type of the plot (e.g., mirror reflectivity, quantum_efficiency)."
|
|
48
|
-
|
|
38
|
+
title:
|
|
49
39
|
type: string
|
|
50
40
|
description: "Title of the plot."
|
|
51
|
-
|
|
41
|
+
xtitle:
|
|
52
42
|
type: string
|
|
53
43
|
description: "Title of x-axis."
|
|
54
|
-
|
|
44
|
+
ytitle:
|
|
55
45
|
type: string
|
|
56
46
|
description: "Title of y-axis."
|
|
57
|
-
|
|
47
|
+
xscale:
|
|
58
48
|
type: string
|
|
59
49
|
enum: ["linear", "log"]
|
|
60
50
|
description: "Scale of x-axis (linear or log)."
|
|
61
|
-
|
|
51
|
+
yscale:
|
|
62
52
|
type: string
|
|
63
53
|
enum: ["linear", "log"]
|
|
64
54
|
description: "Scale of y-axis (linear or log)."
|
|
65
|
-
|
|
55
|
+
xlim:
|
|
66
56
|
type: array
|
|
67
57
|
items:
|
|
68
58
|
type: [number, "null"]
|
|
69
59
|
description: "Limits for x-axis [min, max]. Use null for auto-limit."
|
|
70
60
|
minItems: 2
|
|
71
61
|
maxItems: 2
|
|
72
|
-
|
|
62
|
+
ylim:
|
|
73
63
|
type: array
|
|
74
64
|
items:
|
|
75
65
|
type: [number, "null"]
|
|
76
66
|
description: "Limits for y-axis [min, max]. Use null for auto-limit."
|
|
77
67
|
minItems: 2
|
|
78
68
|
maxItems: 2
|
|
79
|
-
|
|
69
|
+
error_type:
|
|
80
70
|
type: string
|
|
81
71
|
enum: ["fill_between", "errorbar", "none"]
|
|
82
72
|
description: "Type of errors."
|
|
83
|
-
|
|
73
|
+
no_markers:
|
|
84
74
|
type: boolean
|
|
85
75
|
description: "Whether to display markers on data points."
|
|
86
|
-
|
|
76
|
+
plot_ratio:
|
|
87
77
|
type: boolean
|
|
88
78
|
description: "Whether to display ratio plot."
|
|
89
|
-
|
|
79
|
+
tables:
|
|
90
80
|
type: array
|
|
91
81
|
description: "List of tables to plot."
|
|
92
82
|
items:
|
|
93
|
-
"$ref": "#/definitions/
|
|
83
|
+
"$ref": "#/definitions/table_config"
|
|
94
84
|
required:
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
85
|
+
- type
|
|
86
|
+
- title
|
|
87
|
+
- xtitle
|
|
88
|
+
- ytitle
|
|
89
|
+
- tables
|
|
100
90
|
title: "Plot"
|
|
101
|
-
|
|
91
|
+
table_config:
|
|
102
92
|
type: object
|
|
103
93
|
description: "Configuration for a data table to plot."
|
|
104
94
|
additionalProperties: false
|
|
105
95
|
properties:
|
|
106
|
-
|
|
96
|
+
parameter:
|
|
107
97
|
type: string
|
|
108
98
|
description: "Parameter name to retrieve data for."
|
|
109
|
-
|
|
99
|
+
file_name:
|
|
110
100
|
type: string
|
|
111
101
|
description: "Path to the data file."
|
|
112
|
-
|
|
102
|
+
type:
|
|
113
103
|
type: string
|
|
114
104
|
description: "Type of data file."
|
|
115
|
-
|
|
105
|
+
telescope:
|
|
116
106
|
type: string
|
|
117
107
|
description: "Telescope descriptor to retrieve data for."
|
|
118
|
-
|
|
108
|
+
site:
|
|
119
109
|
type: string
|
|
120
110
|
description: "Site name (North/South)."
|
|
121
|
-
|
|
111
|
+
model_version:
|
|
122
112
|
type: string
|
|
123
113
|
description: "Model version to use."
|
|
124
|
-
|
|
114
|
+
parameter_version:
|
|
125
115
|
type: string
|
|
126
116
|
description: "Parameter version to use."
|
|
127
|
-
|
|
117
|
+
label:
|
|
128
118
|
type: string
|
|
129
119
|
description: "Label for the plot legend."
|
|
130
|
-
|
|
120
|
+
column_x:
|
|
131
121
|
type: string
|
|
132
122
|
description: "Column name to use for x-axis."
|
|
133
|
-
|
|
123
|
+
column_y:
|
|
134
124
|
type: string
|
|
135
125
|
description: "Column name to use for y-axis."
|
|
136
|
-
|
|
126
|
+
column_x_err:
|
|
137
127
|
type: string
|
|
138
128
|
description: "Column name to use for x-axis error."
|
|
139
|
-
|
|
129
|
+
column_y_err:
|
|
140
130
|
type: string
|
|
141
131
|
description: "Column name to use for y-axis error."
|
|
142
|
-
|
|
132
|
+
normalize_y:
|
|
143
133
|
type: boolean
|
|
144
134
|
description: "Whether to normalize y values."
|
|
145
|
-
|
|
135
|
+
select_values:
|
|
146
136
|
type: object
|
|
147
137
|
description: "Selection criteria for data filtering."
|
|
148
138
|
properties:
|
|
149
|
-
|
|
139
|
+
column_name:
|
|
150
140
|
type: string
|
|
151
141
|
description: "Column name to use for filtering."
|
|
152
|
-
|
|
142
|
+
value:
|
|
153
143
|
type: [number, string]
|
|
154
144
|
description: "Value to filter by."
|
|
155
145
|
required:
|
|
156
|
-
-
|
|
157
|
-
-
|
|
146
|
+
- column_name
|
|
147
|
+
- value
|
|
158
148
|
required:
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
- LABEL
|
|
149
|
+
- column_x
|
|
150
|
+
- column_y
|
|
162
151
|
title: "TableConfig"
|
|
@@ -29,12 +29,12 @@ definitions:
|
|
|
29
29
|
description:
|
|
30
30
|
type: string
|
|
31
31
|
description: Description of the error metric.
|
|
32
|
-
|
|
32
|
+
target_uncertainty:
|
|
33
33
|
$ref: '#/definitions/TargetError'
|
|
34
34
|
energy_range:
|
|
35
35
|
$ref: '#/definitions/EnergyRange'
|
|
36
36
|
required:
|
|
37
|
-
-
|
|
37
|
+
- target_uncertainty
|
|
38
38
|
- energy_range
|
|
39
39
|
|
|
40
40
|
TargetError:
|
|
@@ -54,12 +54,20 @@ class SimtelConfigWriter:
|
|
|
54
54
|
Layout name.
|
|
55
55
|
label: str
|
|
56
56
|
Instance label. Important for output file naming.
|
|
57
|
+
simtel_path: str or Path
|
|
58
|
+
Path to the sim_telarray installation directory.
|
|
57
59
|
"""
|
|
58
60
|
|
|
59
61
|
TAB = " " * 3
|
|
60
62
|
|
|
61
63
|
def __init__(
|
|
62
|
-
self,
|
|
64
|
+
self,
|
|
65
|
+
site,
|
|
66
|
+
model_version,
|
|
67
|
+
layout_name=None,
|
|
68
|
+
telescope_model_name=None,
|
|
69
|
+
label=None,
|
|
70
|
+
simtel_path=None,
|
|
63
71
|
):
|
|
64
72
|
"""Initialize SimtelConfigWriter."""
|
|
65
73
|
self._logger = logging.getLogger(__name__)
|
|
@@ -70,10 +78,9 @@ class SimtelConfigWriter:
|
|
|
70
78
|
self._label = label
|
|
71
79
|
self._layout_name = layout_name
|
|
72
80
|
self._telescope_model_name = telescope_model_name
|
|
81
|
+
self._simtel_path = simtel_path
|
|
73
82
|
|
|
74
|
-
def write_telescope_config_file(
|
|
75
|
-
self, config_file_path, parameters, telescope_name=None, write_dummy_config=False
|
|
76
|
-
):
|
|
83
|
+
def write_telescope_config_file(self, config_file_path, parameters, telescope_name=None):
|
|
77
84
|
"""
|
|
78
85
|
Write the sim_telarray config file for a single telescope.
|
|
79
86
|
|
|
@@ -85,8 +92,6 @@ class SimtelConfigWriter:
|
|
|
85
92
|
Model parameters
|
|
86
93
|
telescope_name: str
|
|
87
94
|
Name of the telescope (use self._telescope_model_name if None)
|
|
88
|
-
write_dummy_config: bool
|
|
89
|
-
Flag to write a dummy telescope configuration file.
|
|
90
95
|
"""
|
|
91
96
|
self._logger.debug(f"Writing telescope config file {config_file_path}")
|
|
92
97
|
|
|
@@ -97,8 +102,6 @@ class SimtelConfigWriter:
|
|
|
97
102
|
file.write("#ifdef TELESCOPE\n")
|
|
98
103
|
file.write(f" echo Configuration for {telescope_name} - TELESCOPE $(TELESCOPE)\n")
|
|
99
104
|
file.write("#endif\n\n")
|
|
100
|
-
if write_dummy_config:
|
|
101
|
-
file.write("#define DUMMY_CONFIG 1\n")
|
|
102
105
|
|
|
103
106
|
for par, value in parameters.items():
|
|
104
107
|
simtel_name, value = self._convert_model_parameters_to_simtel_format(
|
|
@@ -252,6 +255,8 @@ class SimtelConfigWriter:
|
|
|
252
255
|
file.write(self.TAB + f"echo ModelVersion: {self._model_version}\n")
|
|
253
256
|
file.write(self.TAB + "echo *****************************\n\n")
|
|
254
257
|
|
|
258
|
+
self._write_simtools_parameters(file)
|
|
259
|
+
|
|
255
260
|
self._write_site_parameters(
|
|
256
261
|
file,
|
|
257
262
|
site_model.parameters,
|
|
@@ -392,6 +397,23 @@ class SimtelConfigWriter:
|
|
|
392
397
|
header += f"{comment_char}\n"
|
|
393
398
|
file.write(header)
|
|
394
399
|
|
|
400
|
+
def _write_simtools_parameters(self, file):
|
|
401
|
+
"""Write simtools-specific parameters."""
|
|
402
|
+
meta_items = {
|
|
403
|
+
"simtools_version": simtools.version.__version__,
|
|
404
|
+
"simtools_model_production_version": self._model_version,
|
|
405
|
+
}
|
|
406
|
+
try:
|
|
407
|
+
build_opts = gen.collect_data_from_file(Path(self._simtel_path) / "build_opts.yml")
|
|
408
|
+
for key, value in build_opts.items():
|
|
409
|
+
meta_items[f"simtools_{key}"] = value
|
|
410
|
+
except (FileNotFoundError, TypeError):
|
|
411
|
+
pass # don't expect build_opts.yml to be present on all systems
|
|
412
|
+
|
|
413
|
+
file.write(f"{self.TAB}% Simtools parameters\n")
|
|
414
|
+
for key, value in meta_items.items():
|
|
415
|
+
file.write(f"{self.TAB}metaparam global set {key} = {value}\n")
|
|
416
|
+
|
|
395
417
|
def _write_site_parameters(
|
|
396
418
|
self, file, site_parameters, model_path, telescope_model, sim_telarray_seeds=None
|
|
397
419
|
):
|
|
@@ -556,9 +578,9 @@ class SimtelConfigWriter:
|
|
|
556
578
|
"disc_bins": 10,
|
|
557
579
|
"fadc_sum_bins": 10,
|
|
558
580
|
"fadc_sum_offset": 0,
|
|
559
|
-
"asum_threshold":
|
|
560
|
-
"dsum_threshold":
|
|
561
|
-
"discriminator_threshold":
|
|
581
|
+
"asum_threshold": 9999,
|
|
582
|
+
"dsum_threshold": 9999,
|
|
583
|
+
"discriminator_threshold": 9999,
|
|
562
584
|
"fadc_amplitude": 1.0,
|
|
563
585
|
"discriminator_amplitude": 1.0,
|
|
564
586
|
}
|
|
@@ -567,9 +589,7 @@ class SimtelConfigWriter:
|
|
|
567
589
|
if key in parameters:
|
|
568
590
|
parameters[key]["value"] = val
|
|
569
591
|
|
|
570
|
-
self.write_telescope_config_file(
|
|
571
|
-
config_file_path, parameters, telescope_name, write_dummy_config=True
|
|
572
|
-
)
|
|
592
|
+
self.write_telescope_config_file(config_file_path, parameters, telescope_name)
|
|
573
593
|
|
|
574
594
|
config_file_directory = Path(config_file_path).parent
|
|
575
595
|
self._write_dummy_mirror_list_files(config_file_directory, telescope_name)
|