gammasimtools 0.22.0__py3-none-any.whl → 0.24.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.22.0.dist-info → gammasimtools-0.24.0.dist-info}/METADATA +2 -1
- {gammasimtools-0.22.0.dist-info → gammasimtools-0.24.0.dist-info}/RECORD +128 -125
- simtools/_version.py +2 -2
- simtools/application_control.py +118 -0
- simtools/applications/calculate_incident_angles.py +17 -22
- simtools/applications/convert_all_model_parameters_from_simtel.py +28 -43
- simtools/applications/convert_geo_coordinates_of_array_elements.py +26 -45
- simtools/applications/convert_model_parameter_from_simtel.py +21 -41
- simtools/applications/db_add_file_to_db.py +13 -14
- simtools/applications/db_add_simulation_model_from_repository_to_db.py +20 -33
- simtools/applications/db_add_value_from_json_to_db.py +29 -24
- simtools/applications/db_development_tools/write_array_elements_positions_to_repository.py +20 -35
- simtools/applications/db_generate_compound_indexes.py +11 -13
- simtools/applications/db_get_array_layouts_from_db.py +20 -40
- simtools/applications/db_get_file_from_db.py +15 -17
- simtools/applications/db_get_parameter_from_db.py +33 -35
- simtools/applications/db_inspect_databases.py +13 -12
- simtools/applications/db_upload_model_repository.py +13 -31
- simtools/applications/derive_ctao_array_layouts.py +16 -21
- simtools/applications/derive_mirror_rnda.py +9 -14
- simtools/applications/derive_photon_electron_spectrum.py +7 -10
- simtools/applications/derive_psf_parameters.py +13 -20
- simtools/applications/derive_trigger_rates.py +6 -9
- simtools/applications/docs_produce_array_element_report.py +22 -23
- simtools/applications/docs_produce_calibration_reports.py +26 -24
- simtools/applications/docs_produce_model_parameter_reports.py +15 -22
- simtools/applications/docs_produce_simulation_configuration_report.py +21 -22
- simtools/applications/generate_array_config.py +14 -33
- simtools/applications/generate_corsika_histograms.py +22 -43
- simtools/applications/generate_default_metadata.py +15 -36
- simtools/applications/generate_regular_arrays.py +11 -15
- simtools/applications/generate_simtel_event_data.py +23 -33
- simtools/applications/maintain_simulation_model_add_production.py +20 -37
- simtools/applications/maintain_simulation_model_compare_productions.py +10 -12
- simtools/applications/maintain_simulation_model_verify_production_tables.py +8 -11
- simtools/applications/merge_tables.py +14 -23
- simtools/applications/plot_array_layout.py +77 -54
- simtools/applications/plot_simtel_events.py +11 -13
- simtools/applications/plot_tabular_data.py +17 -38
- simtools/applications/plot_tabular_data_for_model_parameter.py +16 -23
- simtools/applications/print_version.py +14 -42
- simtools/applications/production_derive_corsika_limits.py +5 -9
- simtools/applications/production_derive_statistics.py +12 -25
- simtools/applications/production_generate_grid.py +20 -48
- simtools/applications/production_merge_corsika_limits.py +17 -21
- simtools/applications/run_application.py +12 -32
- simtools/applications/simulate_flasher.py +21 -25
- simtools/applications/simulate_illuminator.py +7 -14
- simtools/applications/simulate_pedestals.py +13 -13
- simtools/applications/simulate_prod.py +21 -33
- simtools/applications/simulate_prod_htcondor_generator.py +11 -25
- simtools/applications/submit_array_layouts.py +16 -19
- simtools/applications/submit_data_from_external.py +18 -34
- simtools/applications/submit_model_parameter_from_external.py +27 -40
- simtools/applications/validate_camera_efficiency.py +23 -21
- simtools/applications/validate_camera_fov.py +21 -26
- simtools/applications/validate_cumulative_psf.py +27 -35
- simtools/applications/validate_file_using_schema.py +15 -33
- simtools/applications/validate_optics.py +27 -33
- simtools/camera/camera_efficiency.py +0 -2
- simtools/configuration/commandline_parser.py +39 -13
- simtools/configuration/configurator.py +1 -6
- simtools/corsika/corsika_config.py +2 -9
- simtools/data_model/data_reader.py +0 -2
- simtools/data_model/metadata_collector.py +0 -2
- simtools/data_model/model_data_writer.py +1 -3
- simtools/data_model/schema.py +36 -34
- simtools/data_model/validate_data.py +0 -2
- simtools/db/db_handler.py +61 -296
- simtools/db/db_model_upload.py +1 -1
- simtools/db/mongo_db.py +535 -0
- simtools/dependencies.py +33 -8
- simtools/io/hdf5_handler.py +0 -5
- simtools/io/legacy_data_handler.py +0 -5
- simtools/job_execution/job_manager.py +0 -3
- simtools/layout/array_layout.py +7 -9
- simtools/layout/array_layout_utils.py +3 -3
- simtools/layout/telescope_position.py +0 -2
- simtools/model/array_model.py +38 -71
- simtools/model/calibration_model.py +12 -11
- simtools/model/camera.py +0 -2
- simtools/model/mirrors.py +0 -2
- simtools/model/model_parameter.py +200 -140
- simtools/model/model_repository.py +159 -35
- simtools/model/model_utils.py +3 -8
- simtools/model/site_model.py +59 -29
- simtools/model/telescope_model.py +21 -15
- simtools/production_configuration/calculate_statistical_uncertainties_grid_point.py +0 -2
- simtools/production_configuration/derive_production_statistics.py +0 -2
- simtools/production_configuration/interpolation_handler.py +0 -2
- simtools/ray_tracing/mirror_panel_psf.py +4 -4
- simtools/ray_tracing/psf_analysis.py +0 -2
- simtools/ray_tracing/psf_parameter_optimisation.py +1 -1
- simtools/ray_tracing/ray_tracing.py +0 -2
- simtools/reporting/docs_auto_report_generator.py +109 -1
- simtools/reporting/docs_read_parameters.py +4 -9
- simtools/runners/corsika_runner.py +0 -2
- simtools/runners/corsika_simtel_runner.py +0 -2
- simtools/runners/simtel_runner.py +0 -2
- simtools/schemas/model_parameters/transit_time_random.schema.yml +29 -0
- simtools/schemas/simulation_models_info.schema.yml +2 -1
- simtools/simtel/simtel_config_reader.py +0 -2
- simtools/simtel/simtel_config_writer.py +128 -33
- simtools/simtel/simtel_io_metadata.py +3 -3
- simtools/simtel/simulator_array.py +9 -21
- simtools/simtel/simulator_camera_efficiency.py +0 -2
- simtools/simtel/simulator_light_emission.py +1 -3
- simtools/simtel/simulator_ray_tracing.py +0 -2
- simtools/simulator.py +2 -6
- simtools/testing/assertions.py +52 -8
- simtools/testing/configuration.py +17 -4
- simtools/testing/validate_output.py +4 -8
- simtools/utils/general.py +5 -13
- simtools/utils/geometry.py +0 -5
- simtools/utils/names.py +1 -13
- simtools/utils/value_conversion.py +10 -5
- simtools/version.py +85 -0
- simtools/visualization/plot_array_layout.py +129 -23
- simtools/visualization/plot_incident_angles.py +0 -2
- simtools/visualization/plot_pixels.py +1 -1
- simtools/visualization/plot_psf.py +1 -1
- simtools/visualization/plot_simtel_events.py +0 -11
- simtools/visualization/plot_tables.py +1 -1
- simtools/visualization/visualize.py +0 -12
- {gammasimtools-0.22.0.dist-info → gammasimtools-0.24.0.dist-info}/WHEEL +0 -0
- {gammasimtools-0.22.0.dist-info → gammasimtools-0.24.0.dist-info}/entry_points.txt +0 -0
- {gammasimtools-0.22.0.dist-info → gammasimtools-0.24.0.dist-info}/licenses/LICENSE +0 -0
- {gammasimtools-0.22.0.dist-info → gammasimtools-0.24.0.dist-info}/top_level.txt +0 -0
|
@@ -34,18 +34,17 @@ r"""
|
|
|
34
34
|
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
|
-
import logging
|
|
38
37
|
from pathlib import Path
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
from simtools.application_control import get_application_label, startup_application
|
|
41
40
|
from simtools.camera.single_photon_electron_spectrum import SinglePhotonElectronSpectrum
|
|
42
41
|
from simtools.configuration import configurator
|
|
43
42
|
|
|
44
43
|
|
|
45
|
-
def _parse(
|
|
44
|
+
def _parse():
|
|
46
45
|
"""Parse command line configuration."""
|
|
47
46
|
config = configurator.Configurator(
|
|
48
|
-
label=
|
|
47
|
+
label=get_application_label(__file__),
|
|
49
48
|
description="Derive single photon electron spectrum from a given amplitude spectrum.",
|
|
50
49
|
)
|
|
51
50
|
config.parser.add_argument(
|
|
@@ -112,13 +111,11 @@ def _parse(label):
|
|
|
112
111
|
return config.initialize(db_config=False, output=True, simulation_model=["telescope"])
|
|
113
112
|
|
|
114
113
|
|
|
115
|
-
def main():
|
|
116
|
-
|
|
114
|
+
def main():
|
|
115
|
+
"""Derive single photon electron spectrum from a given amplitude spectrum."""
|
|
116
|
+
app_context = startup_application(_parse)
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
120
|
-
|
|
121
|
-
single_pe = SinglePhotonElectronSpectrum(args_dict)
|
|
118
|
+
single_pe = SinglePhotonElectronSpectrum(app_context.args)
|
|
122
119
|
single_pe.derive_single_pe_spectrum()
|
|
123
120
|
single_pe.write_single_pe_spectrum()
|
|
124
121
|
|
|
@@ -110,22 +110,19 @@ r"""
|
|
|
110
110
|
|
|
111
111
|
"""
|
|
112
112
|
|
|
113
|
-
import
|
|
114
|
-
from pathlib import Path
|
|
115
|
-
|
|
113
|
+
from simtools.application_control import get_application_label, startup_application
|
|
116
114
|
from simtools.configuration import configurator
|
|
117
|
-
from simtools.io import io_handler
|
|
118
115
|
from simtools.model.model_utils import initialize_simulation_models
|
|
119
116
|
from simtools.ray_tracing import psf_parameter_optimisation as psf_opt
|
|
120
|
-
from simtools.utils.general import get_log_level_from_user
|
|
121
117
|
|
|
122
118
|
|
|
123
119
|
def _parse():
|
|
124
120
|
config = configurator.Configurator(
|
|
121
|
+
label=get_application_label(__file__),
|
|
125
122
|
description=(
|
|
126
123
|
"Derive mirror_reflection_random_angle, mirror_align_random_horizontal "
|
|
127
124
|
"and mirror_align_random_vertical using cumulative PSF measurement."
|
|
128
|
-
)
|
|
125
|
+
),
|
|
129
126
|
)
|
|
130
127
|
config.parser.add_argument(
|
|
131
128
|
"--src_distance",
|
|
@@ -196,27 +193,23 @@ def _parse():
|
|
|
196
193
|
)
|
|
197
194
|
|
|
198
195
|
|
|
199
|
-
def main():
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
label = label = Path(__file__).stem
|
|
203
|
-
logger = logging.getLogger()
|
|
204
|
-
logger.setLevel(get_log_level_from_user(args_dict["log_level"]))
|
|
196
|
+
def main():
|
|
197
|
+
"""Derive PSF parameters."""
|
|
198
|
+
app_context = startup_application(_parse)
|
|
205
199
|
|
|
206
|
-
_io_handler = io_handler.IOHandler()
|
|
207
200
|
tel_model, site_model, _ = initialize_simulation_models(
|
|
208
|
-
label=label,
|
|
209
|
-
db_config=db_config,
|
|
210
|
-
site=
|
|
211
|
-
telescope_name=
|
|
212
|
-
model_version=
|
|
201
|
+
label=app_context.args.get("label"),
|
|
202
|
+
db_config=app_context.db_config,
|
|
203
|
+
site=app_context.args["site"],
|
|
204
|
+
telescope_name=app_context.args["telescope"],
|
|
205
|
+
model_version=app_context.args["model_version"],
|
|
213
206
|
)
|
|
214
207
|
|
|
215
208
|
psf_opt.run_psf_optimization_workflow(
|
|
216
209
|
tel_model,
|
|
217
210
|
site_model,
|
|
218
|
-
|
|
219
|
-
|
|
211
|
+
app_context.args,
|
|
212
|
+
app_context.io_handler.get_output_directory(),
|
|
220
213
|
)
|
|
221
214
|
|
|
222
215
|
|
|
@@ -37,9 +37,7 @@ Derive trigger rates for the South Alpha layout:
|
|
|
37
37
|
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
|
-
import
|
|
41
|
-
|
|
42
|
-
import simtools.utils.general as gen
|
|
40
|
+
from simtools.application_control import get_application_label, startup_application
|
|
43
41
|
from simtools.configuration import configurator
|
|
44
42
|
from simtools.telescope_trigger_rates import telescope_trigger_rates
|
|
45
43
|
|
|
@@ -47,6 +45,7 @@ from simtools.telescope_trigger_rates import telescope_trigger_rates
|
|
|
47
45
|
def _parse():
|
|
48
46
|
"""Parse command line configuration."""
|
|
49
47
|
config = configurator.Configurator(
|
|
48
|
+
label=get_application_label(__file__),
|
|
50
49
|
description="Derive trigger rates for a single telescope or an array of telescopes.",
|
|
51
50
|
)
|
|
52
51
|
config.parser.add_argument(
|
|
@@ -78,13 +77,11 @@ def _parse():
|
|
|
78
77
|
)
|
|
79
78
|
|
|
80
79
|
|
|
81
|
-
def main():
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
logger = logging.getLogger()
|
|
85
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict.get("log_level", "info")))
|
|
80
|
+
def main():
|
|
81
|
+
"""Derive trigger rates for a single telescope or an array of telescopes."""
|
|
82
|
+
app_context = startup_application(_parse)
|
|
86
83
|
|
|
87
|
-
telescope_trigger_rates(
|
|
84
|
+
telescope_trigger_rates(app_context.args, app_context.db_config)
|
|
88
85
|
|
|
89
86
|
|
|
90
87
|
if __name__ == "__main__":
|
|
@@ -7,20 +7,18 @@ The report includes detailed information on each parameter,
|
|
|
7
7
|
such as the parameter name, value, unit, description, and short description.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
import logging
|
|
11
10
|
from pathlib import Path
|
|
12
11
|
|
|
12
|
+
from simtools.application_control import get_application_label, startup_application
|
|
13
13
|
from simtools.configuration import configurator
|
|
14
|
-
from simtools.io import io_handler
|
|
15
14
|
from simtools.reporting.docs_auto_report_generator import ReportGenerator
|
|
16
15
|
from simtools.reporting.docs_read_parameters import ReadParameters
|
|
17
|
-
from simtools.utils import general as gen
|
|
18
16
|
|
|
19
17
|
|
|
20
|
-
def _parse(
|
|
18
|
+
def _parse():
|
|
21
19
|
"""Parse command line configuration."""
|
|
22
20
|
config = configurator.Configurator(
|
|
23
|
-
label=
|
|
21
|
+
label=get_application_label(__file__),
|
|
24
22
|
description=("Produce a markdown report for model parameters."),
|
|
25
23
|
)
|
|
26
24
|
|
|
@@ -51,34 +49,35 @@ def _parse(label):
|
|
|
51
49
|
)
|
|
52
50
|
|
|
53
51
|
|
|
54
|
-
def main():
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
def main():
|
|
53
|
+
"""Produce a markdown file for a given array element, site, and model version."""
|
|
54
|
+
app_context = startup_application(_parse)
|
|
55
|
+
output_path = app_context.io_handler.get_output_directory()
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
if any(
|
|
58
|
+
[
|
|
59
|
+
app_context.args.get("all_telescopes"),
|
|
60
|
+
app_context.args.get("all_sites"),
|
|
61
|
+
app_context.args.get("all_model_versions"),
|
|
62
|
+
]
|
|
63
|
+
):
|
|
65
64
|
ReportGenerator(
|
|
66
|
-
db_config,
|
|
67
|
-
args,
|
|
65
|
+
app_context.db_config,
|
|
66
|
+
app_context.args,
|
|
68
67
|
output_path,
|
|
69
68
|
).auto_generate_array_element_reports()
|
|
70
69
|
|
|
71
70
|
else:
|
|
72
|
-
model_version = args["model_version"]
|
|
71
|
+
model_version = app_context.args["model_version"]
|
|
73
72
|
ReadParameters(
|
|
74
|
-
db_config,
|
|
75
|
-
args,
|
|
73
|
+
app_context.db_config,
|
|
74
|
+
app_context.args,
|
|
76
75
|
Path(output_path / f"{model_version}"),
|
|
77
76
|
).produce_array_element_report()
|
|
78
77
|
|
|
79
|
-
logger.info(
|
|
80
|
-
f"Markdown report generated for {args['site']}"
|
|
81
|
-
f" Telescope {args['telescope']} (v{model_version}):"
|
|
78
|
+
app_context.logger.info(
|
|
79
|
+
f"Markdown report generated for {app_context.args['site']}"
|
|
80
|
+
f" Telescope {app_context.args['telescope']} (v{model_version}):"
|
|
82
81
|
f" {output_path}"
|
|
83
82
|
)
|
|
84
83
|
|
|
@@ -2,47 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
r"""Produces a markdown file for calibration reports."""
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
from simtools.application_control import get_application_label, startup_application
|
|
7
6
|
from simtools.configuration import configurator
|
|
8
|
-
from simtools.
|
|
9
|
-
from simtools.reporting.docs_read_parameters import ReadParameters
|
|
10
|
-
from simtools.utils import general as gen
|
|
7
|
+
from simtools.reporting.docs_auto_report_generator import ReportGenerator
|
|
11
8
|
|
|
12
9
|
|
|
13
|
-
def _parse(
|
|
10
|
+
def _parse():
|
|
14
11
|
"""Parse command line configuration."""
|
|
15
12
|
config = configurator.Configurator(
|
|
16
|
-
label=
|
|
13
|
+
label=get_application_label(__file__),
|
|
17
14
|
description=("Produce a markdown report for calibration parameters."),
|
|
18
15
|
)
|
|
19
16
|
|
|
17
|
+
config.parser.add_argument(
|
|
18
|
+
"--all_model_versions",
|
|
19
|
+
action="store_true",
|
|
20
|
+
help="Produce reports for all model versions.",
|
|
21
|
+
)
|
|
22
|
+
|
|
20
23
|
return config.initialize(
|
|
21
24
|
db_config=True,
|
|
22
25
|
simulation_model=["model_version"],
|
|
23
26
|
)
|
|
24
27
|
|
|
25
28
|
|
|
26
|
-
def main():
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
io_handler_instance = io_handler.IOHandler()
|
|
31
|
-
output_path = io_handler_instance.get_output_directory()
|
|
32
|
-
|
|
33
|
-
logger = logging.getLogger()
|
|
34
|
-
logger.setLevel(gen.get_log_level_from_user(args["log_level"]))
|
|
35
|
-
|
|
36
|
-
read_parameters = ReadParameters(
|
|
37
|
-
db_config=db_config, args=args, output_path=output_path / f"{args.get('model_version')}"
|
|
38
|
-
)
|
|
29
|
+
def main():
|
|
30
|
+
"""Produce a markdown file for calibration reports."""
|
|
31
|
+
app_context = startup_application(_parse)
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
output_path = app_context.io_handler.get_output_directory()
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
generator = ReportGenerator(
|
|
36
|
+
db_config=app_context.db_config, args=app_context.args, output_path=output_path
|
|
44
37
|
)
|
|
45
|
-
|
|
38
|
+
generator.auto_generate_calibration_reports()
|
|
39
|
+
|
|
40
|
+
if app_context.args.get("all_model_versions"):
|
|
41
|
+
app_context.logger.info("Calibration reports for all model versions produced successfully.")
|
|
42
|
+
else:
|
|
43
|
+
app_context.logger.info(
|
|
44
|
+
f"Calibration reports for model version {app_context.args.get('model_version')}"
|
|
45
|
+
" produced successfully."
|
|
46
|
+
)
|
|
47
|
+
app_context.logger.info(f"Output path: {output_path}")
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
if __name__ == "__main__":
|
|
@@ -8,19 +8,16 @@ comparing their values over various model versions.
|
|
|
8
8
|
Currently only implemented for telescopes.
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
import
|
|
12
|
-
|
|
11
|
+
from simtools.application_control import get_application_label, startup_application
|
|
13
12
|
from simtools.configuration import configurator
|
|
14
|
-
from simtools.io import io_handler
|
|
15
13
|
from simtools.reporting.docs_auto_report_generator import ReportGenerator
|
|
16
14
|
from simtools.reporting.docs_read_parameters import ReadParameters
|
|
17
|
-
from simtools.utils import general as gen
|
|
18
15
|
|
|
19
16
|
|
|
20
|
-
def _parse(
|
|
17
|
+
def _parse():
|
|
21
18
|
"""Parse command line configuration."""
|
|
22
19
|
config = configurator.Configurator(
|
|
23
|
-
label=
|
|
20
|
+
label=get_application_label(__file__),
|
|
24
21
|
description=("Produce a markdown report for model parameters."),
|
|
25
22
|
)
|
|
26
23
|
|
|
@@ -37,32 +34,28 @@ def _parse(label):
|
|
|
37
34
|
return config.initialize(db_config=True, simulation_model=["site", "telescope"])
|
|
38
35
|
|
|
39
36
|
|
|
40
|
-
def main():
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
output_path = io_handler_instance.get_output_directory()
|
|
45
|
-
|
|
46
|
-
logger = logging.getLogger()
|
|
47
|
-
logger.setLevel(gen.get_log_level_from_user(args["log_level"]))
|
|
37
|
+
def main():
|
|
38
|
+
"""Produce a model parameter report per array element."""
|
|
39
|
+
app_context = startup_application(_parse)
|
|
40
|
+
output_path = app_context.io_handler.get_output_directory()
|
|
48
41
|
|
|
49
|
-
if any([args.get("all_telescopes"), args.get("all_sites")]):
|
|
42
|
+
if any([app_context.args.get("all_telescopes"), app_context.args.get("all_sites")]):
|
|
50
43
|
ReportGenerator(
|
|
51
|
-
db_config,
|
|
52
|
-
args,
|
|
44
|
+
app_context.db_config,
|
|
45
|
+
app_context.args,
|
|
53
46
|
output_path,
|
|
54
47
|
).auto_generate_parameter_reports()
|
|
55
48
|
|
|
56
49
|
else:
|
|
57
50
|
ReadParameters(
|
|
58
|
-
db_config,
|
|
59
|
-
args,
|
|
51
|
+
app_context.db_config,
|
|
52
|
+
app_context.args,
|
|
60
53
|
output_path,
|
|
61
54
|
).produce_model_parameter_reports()
|
|
62
55
|
|
|
63
|
-
logger.info(
|
|
64
|
-
f"Markdown report generated for {args['site']}"
|
|
65
|
-
f"Telescope {args['telescope']}: {output_path}"
|
|
56
|
+
app_context.logger.info(
|
|
57
|
+
f"Markdown report generated for {app_context.args['site']}"
|
|
58
|
+
f"Telescope {app_context.args['telescope']}: {output_path}"
|
|
66
59
|
)
|
|
67
60
|
|
|
68
61
|
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
r"""Produces a markdown file for a given simulation configuration."""
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
from simtools.application_control import get_application_label, startup_application
|
|
7
6
|
from simtools.configuration import configurator
|
|
8
|
-
from simtools.
|
|
9
|
-
from simtools.reporting.docs_read_parameters import ReadParameters
|
|
10
|
-
from simtools.utils import general as gen
|
|
7
|
+
from simtools.reporting.docs_auto_report_generator import ReportGenerator
|
|
11
8
|
|
|
12
9
|
|
|
13
|
-
def _parse(
|
|
10
|
+
def _parse():
|
|
14
11
|
"""Parse command line configuration."""
|
|
15
12
|
config = configurator.Configurator(
|
|
16
|
-
label=
|
|
13
|
+
label=get_application_label(__file__),
|
|
17
14
|
description=("Produce a markdown report for model parameters."),
|
|
18
15
|
)
|
|
19
16
|
|
|
17
|
+
config.parser.add_argument(
|
|
18
|
+
"--all_model_versions",
|
|
19
|
+
action="store_true",
|
|
20
|
+
help="Produce reports for all model versions.",
|
|
21
|
+
)
|
|
22
|
+
|
|
20
23
|
return config.initialize(
|
|
21
24
|
db_config=True,
|
|
22
25
|
simulation_model=["model_version"],
|
|
@@ -24,26 +27,22 @@ def _parse(label):
|
|
|
24
27
|
)
|
|
25
28
|
|
|
26
29
|
|
|
27
|
-
def main():
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
def main():
|
|
31
|
+
"""Produce a markdown file for a given simulation configuration."""
|
|
32
|
+
app_context = startup_application(_parse)
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
output_path = io_handler_instance.get_output_directory()
|
|
34
|
+
output_path = app_context.io_handler.get_output_directory()
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
read_parameters = ReadParameters(
|
|
38
|
-
db_config=db_config, args=args, output_path=output_path / f"{args.get('model_version')}"
|
|
36
|
+
report_generator = ReportGenerator(
|
|
37
|
+
db_config=app_context.db_config, args=app_context.args, output_path=output_path
|
|
39
38
|
)
|
|
39
|
+
report_generator.auto_generate_simulation_configuration_reports()
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
f"Configuration reports for {args.get('simulation_software')} produced successfully."
|
|
41
|
+
app_context.logger.info(
|
|
42
|
+
f"Configuration reports for {app_context.args.get('simulation_software')} "
|
|
43
|
+
"produced successfully."
|
|
45
44
|
)
|
|
46
|
-
logger.info(f"Output path: {output_path}
|
|
45
|
+
app_context.logger.info(f"Output path: {output_path}")
|
|
47
46
|
|
|
48
47
|
|
|
49
48
|
if __name__ == "__main__":
|
|
@@ -25,50 +25,31 @@ North - 5.0.0:
|
|
|
25
25
|
The output is saved in simtools-output/test/model.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
|
-
import
|
|
29
|
-
from pathlib import Path
|
|
30
|
-
|
|
31
|
-
import simtools.utils.general as gen
|
|
28
|
+
from simtools.application_control import get_application_label, startup_application
|
|
32
29
|
from simtools.configuration import configurator
|
|
33
30
|
from simtools.model.array_model import ArrayModel
|
|
34
31
|
|
|
35
32
|
|
|
36
|
-
def _parse(
|
|
37
|
-
"""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
label : str
|
|
43
|
-
Label describing the application.
|
|
44
|
-
description : str
|
|
45
|
-
Description of the application.
|
|
46
|
-
|
|
47
|
-
Returns
|
|
48
|
-
-------
|
|
49
|
-
CommandLineParser
|
|
50
|
-
Command line parser object.
|
|
51
|
-
"""
|
|
52
|
-
config = configurator.Configurator(label=label, description=description)
|
|
33
|
+
def _parse():
|
|
34
|
+
"""Parse command line configuration."""
|
|
35
|
+
config = configurator.Configurator(
|
|
36
|
+
label=get_application_label(__file__),
|
|
37
|
+
description="Generate sim_telarray configuration files for a given array.",
|
|
38
|
+
)
|
|
53
39
|
return config.initialize(db_config=True, simulation_model=["site", "layout", "model_version"])
|
|
54
40
|
|
|
55
41
|
|
|
56
42
|
def main():
|
|
57
43
|
"""Generate sim_telarray configuration files for a given array."""
|
|
58
|
-
|
|
59
|
-
label=Path(__file__).stem,
|
|
60
|
-
description=("Generate sim_telarray configuration files for a given array."),
|
|
61
|
-
)
|
|
62
|
-
logger = logging.getLogger("simtools")
|
|
63
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
44
|
+
app_context = startup_application(_parse)
|
|
64
45
|
|
|
65
46
|
array_model = ArrayModel(
|
|
66
|
-
label=
|
|
67
|
-
model_version=
|
|
68
|
-
|
|
69
|
-
site=
|
|
70
|
-
layout_name=
|
|
71
|
-
array_elements=
|
|
47
|
+
label=app_context.args["label"],
|
|
48
|
+
model_version=app_context.args["model_version"],
|
|
49
|
+
db_config=app_context.db_config,
|
|
50
|
+
site=app_context.args.get("site"),
|
|
51
|
+
layout_name=app_context.args.get("array_layout_name"),
|
|
52
|
+
array_elements=app_context.args.get("array_elements"),
|
|
72
53
|
)
|
|
73
54
|
array_model.print_telescope_list()
|
|
74
55
|
array_model.export_all_simtel_config_files()
|
|
@@ -164,36 +164,19 @@ r"""
|
|
|
164
164
|
Total time needed: 8s.
|
|
165
165
|
"""
|
|
166
166
|
|
|
167
|
-
import logging
|
|
168
167
|
import time
|
|
169
|
-
from pathlib import Path
|
|
170
168
|
|
|
171
|
-
|
|
169
|
+
from simtools.application_control import get_application_label, startup_application
|
|
172
170
|
from simtools.configuration import configurator
|
|
173
171
|
from simtools.corsika.corsika_histograms import CorsikaHistograms
|
|
174
|
-
from simtools.io import io_handler
|
|
175
172
|
|
|
176
|
-
logger = logging.getLogger()
|
|
177
173
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
----------
|
|
185
|
-
label: str
|
|
186
|
-
Label describing the application.
|
|
187
|
-
description: str
|
|
188
|
-
Description of the application.
|
|
189
|
-
|
|
190
|
-
Returns
|
|
191
|
-
-------
|
|
192
|
-
CommandLineParser
|
|
193
|
-
Command line parser object
|
|
194
|
-
|
|
195
|
-
"""
|
|
196
|
-
config = configurator.Configurator(label=label, description=description)
|
|
174
|
+
def _parse():
|
|
175
|
+
"""Parse command line configuration."""
|
|
176
|
+
config = configurator.Configurator(
|
|
177
|
+
label=get_application_label(__file__),
|
|
178
|
+
description="Generate histograms for the Cherenkov photons saved in the CORSIKA IACT file.",
|
|
179
|
+
)
|
|
197
180
|
|
|
198
181
|
config.parser.add_argument(
|
|
199
182
|
"--iact_file",
|
|
@@ -280,34 +263,30 @@ def _parse(label, description):
|
|
|
280
263
|
return config_parser, _
|
|
281
264
|
|
|
282
265
|
|
|
283
|
-
def main():
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
io_handler_instance = io_handler.IOHandler()
|
|
287
|
-
args_dict, _ = _parse(label, description)
|
|
288
|
-
|
|
289
|
-
output_path = io_handler_instance.get_output_directory()
|
|
266
|
+
def main():
|
|
267
|
+
"""Generate a set of histograms for the Cherenkov photons saved in the CORSIKA IACT file."""
|
|
268
|
+
app_context = startup_application(_parse)
|
|
290
269
|
|
|
291
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
292
270
|
initial_time = time.time()
|
|
293
|
-
logger.info("Starting the application.")
|
|
294
271
|
|
|
295
272
|
corsika_histograms_instance = CorsikaHistograms(
|
|
296
|
-
|
|
273
|
+
app_context.args["iact_file"],
|
|
274
|
+
output_path=app_context.io_handler.get_output_directory(),
|
|
275
|
+
hdf5_file_name=app_context.args["hdf5_file_name"],
|
|
297
276
|
)
|
|
298
277
|
corsika_histograms_instance.run_export_pipeline(
|
|
299
|
-
individual_telescopes=
|
|
300
|
-
hist_config=
|
|
301
|
-
indices_arg=
|
|
302
|
-
write_pdf=
|
|
303
|
-
write_hdf5=
|
|
304
|
-
event1d=
|
|
305
|
-
event2d=
|
|
306
|
-
test=
|
|
278
|
+
individual_telescopes=app_context.args["individual_telescopes"],
|
|
279
|
+
hist_config=app_context.args["hist_config"],
|
|
280
|
+
indices_arg=app_context.args["telescope_indices"],
|
|
281
|
+
write_pdf=app_context.args["pdf"],
|
|
282
|
+
write_hdf5=app_context.args["hdf5"],
|
|
283
|
+
event1d=app_context.args["event_1d_histograms"],
|
|
284
|
+
event2d=app_context.args["event_2d_histograms"],
|
|
285
|
+
test=app_context.args["test"],
|
|
307
286
|
)
|
|
308
287
|
|
|
309
288
|
final_time = time.time()
|
|
310
|
-
logger.info(
|
|
289
|
+
app_context.logger.info(
|
|
311
290
|
f"Finalizing the application. Total time needed: {round(final_time - initial_time)}s."
|
|
312
291
|
)
|
|
313
292
|
|
|
@@ -21,33 +21,18 @@ r"""
|
|
|
21
21
|
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
import
|
|
25
|
-
from pathlib import Path
|
|
26
|
-
|
|
27
|
-
import simtools.utils.general as gen
|
|
24
|
+
from simtools.application_control import get_application_label, startup_application
|
|
28
25
|
from simtools.configuration import configurator
|
|
29
26
|
from simtools.data_model import metadata_model
|
|
30
|
-
from simtools.io import ascii_handler
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def _parse(label, description):
|
|
34
|
-
"""
|
|
35
|
-
Parse command line configuration.
|
|
36
|
-
|
|
37
|
-
Parameters
|
|
38
|
-
----------
|
|
39
|
-
label: str
|
|
40
|
-
Label describing application.
|
|
41
|
-
description: str
|
|
42
|
-
Description of application.
|
|
27
|
+
from simtools.io import ascii_handler
|
|
43
28
|
|
|
44
|
-
Returns
|
|
45
|
-
-------
|
|
46
|
-
CommandLineParser
|
|
47
|
-
Command line parser object
|
|
48
29
|
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
def _parse():
|
|
31
|
+
"""Parse command line configuration."""
|
|
32
|
+
config = configurator.Configurator(
|
|
33
|
+
label=get_application_label(__file__),
|
|
34
|
+
description="Generate a default simtools metadata file from a json schema.",
|
|
35
|
+
)
|
|
51
36
|
|
|
52
37
|
config.parser.add_argument(
|
|
53
38
|
"--schema",
|
|
@@ -65,23 +50,17 @@ def _parse(label, description):
|
|
|
65
50
|
return config.initialize(output=False, require_command_line=True)
|
|
66
51
|
|
|
67
52
|
|
|
68
|
-
def main():
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
label, description="Generate a default simtools metadata file from a json schema."
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
logger = logging.getLogger()
|
|
75
|
-
logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
|
|
53
|
+
def main():
|
|
54
|
+
"""Generate a default simtools metadata file from a json schema."""
|
|
55
|
+
app_context = startup_application(_parse)
|
|
76
56
|
|
|
77
|
-
default_values = metadata_model.get_default_metadata_dict(
|
|
57
|
+
default_values = metadata_model.get_default_metadata_dict(app_context.args["schema"])
|
|
78
58
|
|
|
79
|
-
if
|
|
59
|
+
if app_context.args["output_file"] is None:
|
|
80
60
|
print(default_values)
|
|
81
61
|
else:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
logger.info(f"Writing default values to {output_file}")
|
|
62
|
+
output_file = app_context.io_handler.get_output_file(app_context.args["output_file"])
|
|
63
|
+
app_context.logger.info(f"Writing default values to {output_file}")
|
|
85
64
|
ascii_handler.write_data_to_file(
|
|
86
65
|
data=default_values, output_file=output_file, sort_keys=False
|
|
87
66
|
)
|