gammasimtools 0.20.0__py3-none-any.whl → 0.21.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.
Files changed (25) hide show
  1. {gammasimtools-0.20.0.dist-info → gammasimtools-0.21.0.dist-info}/METADATA +1 -1
  2. {gammasimtools-0.20.0.dist-info → gammasimtools-0.21.0.dist-info}/RECORD +24 -23
  3. {gammasimtools-0.20.0.dist-info → gammasimtools-0.21.0.dist-info}/entry_points.txt +1 -1
  4. simtools/_version.py +2 -2
  5. simtools/applications/db_generate_compound_indexes.py +1 -1
  6. simtools/applications/derive_psf_parameters.py +58 -39
  7. simtools/applications/generate_corsika_histograms.py +7 -184
  8. simtools/applications/maintain_simulation_model_add_production.py +105 -0
  9. simtools/applications/plot_simtel_events.py +2 -228
  10. simtools/applications/print_version.py +8 -7
  11. simtools/corsika/corsika_histograms.py +81 -0
  12. simtools/db/db_handler.py +45 -11
  13. simtools/db/db_model_upload.py +40 -14
  14. simtools/model/model_repository.py +118 -63
  15. simtools/ray_tracing/psf_parameter_optimisation.py +999 -565
  16. simtools/simtel/simtel_config_writer.py +1 -1
  17. simtools/simulator.py +1 -4
  18. simtools/version.py +89 -0
  19. simtools/{corsika/corsika_histograms_visualize.py → visualization/plot_corsika_histograms.py} +109 -0
  20. simtools/visualization/plot_psf.py +673 -0
  21. simtools/visualization/plot_simtel_events.py +284 -87
  22. simtools/applications/maintain_simulation_model_add_production_table.py +0 -71
  23. {gammasimtools-0.20.0.dist-info → gammasimtools-0.21.0.dist-info}/WHEEL +0 -0
  24. {gammasimtools-0.20.0.dist-info → gammasimtools-0.21.0.dist-info}/licenses/LICENSE +0 -0
  25. {gammasimtools-0.20.0.dist-info → gammasimtools-0.21.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gammasimtools
3
- Version: 0.20.0
3
+ Version: 0.21.0
4
4
  Summary: Tools for the Simulation System of the CTA Observatory
5
5
  Author-email: simtools developers <simtools-developer@desy.de>
6
6
  License-Expression: BSD-3-Clause
@@ -1,11 +1,11 @@
1
- gammasimtools-0.20.0.dist-info/licenses/LICENSE,sha256=a2q6KVo33OrRL_7ZSk7BYOT8KkUNV3WAMZW8CHEDkDU,1548
1
+ gammasimtools-0.21.0.dist-info/licenses/LICENSE,sha256=a2q6KVo33OrRL_7ZSk7BYOT8KkUNV3WAMZW8CHEDkDU,1548
2
2
  simtools/__init__.py,sha256=yvx0i5ygbllmMtF2Tzy7pohvhQNH_dBdj0Bt8bKFYpc,231
3
- simtools/_version.py,sha256=D0Phtt01o1VQl6Hc5KWgvKucsJ2Ve2ykSmH5eQWQ0zU,706
3
+ simtools/_version.py,sha256=1jNZfFOI753oBgzdezhn3bNQqGrO2IvFnr4lHXE6EpI,706
4
4
  simtools/constants.py,sha256=3N5bc8MlMWRzcg8EeSJweoioEo_uhStMxAzdb85Apvw,966
5
5
  simtools/dependencies.py,sha256=bDMw1Nyjya0-TnWp_K6LyV6JbO_aJDARa6KSGXhLcqc,6572
6
- simtools/simulator.py,sha256=O586ehWLBt4XMcYMpYYRDjzO0zoGfzDQy_32vIBPcTU,28108
6
+ simtools/simulator.py,sha256=B2_hF05DiCCnmpfK5eYbWDqdUK-4XzgeE7CtrXjMStc,27991
7
7
  simtools/telescope_trigger_rates.py,sha256=_2NUG8UnhfpMGhaEDgHUOOdnweCUcRTrTOkGGYInHqo,3984
8
- simtools/version.py,sha256=Fri_aFaUOmV8CIygd3DknAmJaFZ05OAeLd1AgZOcgdQ,688
8
+ simtools/version.py,sha256=NsdU6YDeOD58xT4BcJ6OYq2CSu_qV3ztZAnnS6o9pKc,3223
9
9
  simtools/applications/calculate_incident_angles.py,sha256=cWcNf3n6S5TmG7wkC3V52HEU7mxLnUw3UD_3Wrcbwgw,5968
10
10
  simtools/applications/convert_all_model_parameters_from_simtel.py,sha256=OSA01q4Qpjv1pyR8f53gBz6Jo-k-bM0L3HKw-GDvJ54,12177
11
11
  simtools/applications/convert_geo_coordinates_of_array_elements.py,sha256=-P0tbF5T3P23_tYTp18HAmlYH7a7Gx-TTzxESf5Qfvk,5967
@@ -13,7 +13,7 @@ simtools/applications/convert_model_parameter_from_simtel.py,sha256=sQL4m3VM2k1M
13
13
  simtools/applications/db_add_file_to_db.py,sha256=Jvesc9NL4OSGUMGKsZs0yyX2HyQfCwGJemLvMf8JQGY,5555
14
14
  simtools/applications/db_add_simulation_model_from_repository_to_db.py,sha256=02sZBCczjbBZoWb4AjKTcfq3aDn9oPjSF8IduJsqJ6o,4311
15
15
  simtools/applications/db_add_value_from_json_to_db.py,sha256=IOdbgrIUa3xdrXGcblFXDoIIGnXpWkAyu-4K7n17VrQ,3585
16
- simtools/applications/db_generate_compound_indexes.py,sha256=nf45luTOTBNQyObzJ01xMrTdRVnJ1p90VbGHYpnU6GU,1964
16
+ simtools/applications/db_generate_compound_indexes.py,sha256=7yAxaNCtSgeaArbGMKzNRXsZzB9DHx5FtMPc7FzwGMc,1978
17
17
  simtools/applications/db_get_array_layouts_from_db.py,sha256=2St5ZfcohXSHnDYiP326D4fqlbfsgREsC4lGJ5cDUPg,5122
18
18
  simtools/applications/db_get_file_from_db.py,sha256=3aIRyZaHIDYwLGCMFdQFtsp84D5r2MlIC20QPOZ1rck,2394
19
19
  simtools/applications/db_get_parameter_from_db.py,sha256=L0VehfQir3lrLDPa_ezEuU7uo8gmBdfMDqOax39Nqn0,5131
@@ -21,26 +21,26 @@ simtools/applications/db_inspect_databases.py,sha256=Po78qE7qmf97u93fSJpdZTWpDEE
21
21
  simtools/applications/derive_ctao_array_layouts.py,sha256=n6bCW2hRXDg1GxynwouRJKQlBYeG2GCehx61tNvRLMA,4081
22
22
  simtools/applications/derive_mirror_rnda.py,sha256=yYCfdN-KNr_R_mmiVrn3L3QJRinvO5z3o0HIRLzPO3w,8955
23
23
  simtools/applications/derive_photon_electron_spectrum.py,sha256=8Dpz-XTlCmOvoKUFtq78B1of62k8ygyk5_r-ZxZYauo,3968
24
- simtools/applications/derive_psf_parameters.py,sha256=TrP6AqiKc6Te3N1lfl63eSIsL_tcEKZZSBl1aN9NYTo,6900
24
+ simtools/applications/derive_psf_parameters.py,sha256=Uw6KkC2CjvC0cfONqI9VI7R5-jULC1gYBjpkl_zYbt8,7783
25
25
  simtools/applications/derive_trigger_rates.py,sha256=3JqdnjNJJNyWF6HyzUSQfldrbvXGRoNUpCqTET3qtEw,2460
26
26
  simtools/applications/docs_produce_array_element_report.py,sha256=N_vnKRV3r32PF_99QeD1-6BfEBOaVzpedC5pvHsDwDU,2488
27
27
  simtools/applications/docs_produce_calibration_reports.py,sha256=lMddZEZa_BXYifRCXS_XMceP9lLjeDDVGtlJZBJhn4o,1382
28
28
  simtools/applications/docs_produce_model_parameter_reports.py,sha256=tSZJJ7CDha-qU3mfqRXLjiOWgdvd1lPjZYJSM-TEAl0,1973
29
29
  simtools/applications/docs_produce_simulation_configuration_report.py,sha256=EsexpianRJ0ypJJrAviIlUzSLQXHcJglHbMIzmoCcII,1443
30
30
  simtools/applications/generate_array_config.py,sha256=bzuQsEp2wUBLGxVkF_1bpw0iFco--47QhQPByAO3hXA,2224
31
- simtools/applications/generate_corsika_histograms.py,sha256=XU1kTlWADXU4-rqTE2PLqtpQ0b7WbTMid13Vqn1olMk,18243
31
+ simtools/applications/generate_corsika_histograms.py,sha256=tJ3vC9wlxN1uj46qVYh8AExZxsSnekcO42E81_rtDlc,11426
32
32
  simtools/applications/generate_default_metadata.py,sha256=t-4qWX1EyCoUaUs4Pg_ec_MiT9bEFH5jN7KHWzZ8fP8,2370
33
33
  simtools/applications/generate_regular_arrays.py,sha256=JZI4KfhP67K6Qvg2yAsQZgKNnRiQAfdcpDHfgP16Wkk,3846
34
34
  simtools/applications/generate_simtel_event_data.py,sha256=qd25UVoR0qR2B1YNf9UYceYkJR0K9dAWQRqWrdkPmUs,9072
35
- simtools/applications/maintain_simulation_model_add_production_table.py,sha256=2Kp5K3ukMTebReQzO4HTZa59kkJXZ_eeOS7Dy5zqZA0,2048
35
+ simtools/applications/maintain_simulation_model_add_production.py,sha256=jhTdbLugZjMiBYrjIev511Q77y0w2INnnGFRCtNFUFc,3578
36
36
  simtools/applications/maintain_simulation_model_compare_productions.py,sha256=ld3t1AOBYYFDP21XY4LaANsz20XsgT5qe5oAibCLnRo,3172
37
37
  simtools/applications/maintain_simulation_model_verify_production_tables.py,sha256=fFa6QdA7uzRmxCvtdEDxDfGIs88UR7z-NRENHpZKxsk,1758
38
38
  simtools/applications/merge_tables.py,sha256=HtV8imZx4fOPnZnM6Rqm4Eestx3w-ZcmQkEVXNhM0Y4,2730
39
39
  simtools/applications/plot_array_layout.py,sha256=WvgaSdYrSfnNyi7Q1-xGyv7AsT9AiZUJRtHnIRVh5J4,9887
40
- simtools/applications/plot_simtel_events.py,sha256=JV6bHprGilgNgjYnM2XzuYRN7VhtLE5HnfTOlhOeCfE,14053
40
+ simtools/applications/plot_simtel_events.py,sha256=urOcRtRsQXM7s3CeKEe1dxYKiGu_T6EKKoLcay4lZc8,6817
41
41
  simtools/applications/plot_tabular_data.py,sha256=qHDU75GgmXTFoxIbRlewLpbnsYMjNgMdVnc8bUqAszo,3135
42
42
  simtools/applications/plot_tabular_data_for_model_parameter.py,sha256=4N1QmS60OR02Vm9UJRqMr7IURIHi3C5dU1Fx0hzasi4,3320
43
- simtools/applications/print_version.py,sha256=QfyraIi_32ygaKcXFiiyI2OYPy745quEanE8ePDHGGU,2336
43
+ simtools/applications/print_version.py,sha256=8eBAhkLZFRbRXcHvVgLpA4o12uHCLvAWRvm-goUrVyI,2449
44
44
  simtools/applications/production_derive_corsika_limits.py,sha256=ENcN4VyfdgPgnbJDcET8k5m0j7_BiVU7-yf-1WwoE10,5834
45
45
  simtools/applications/production_derive_statistics.py,sha256=v9FSp25U0dIQyWHdIccpXO7C8i8G_EfNo27bEdxH9ws,5114
46
46
  simtools/applications/production_generate_grid.py,sha256=Qz4iEaYszJ9I-f9oHtH5zyt4ZaNSqElLDoi5ybrD64o,6761
@@ -65,8 +65,7 @@ simtools/camera/single_photon_electron_spectrum.py,sha256=eQTpmy8NH8v5kkrlFjYmlI
65
65
  simtools/configuration/commandline_parser.py,sha256=qVcBDG4jxZaK7i4bKb0eejhoGkLhR7KN1MbGzr8q6WQ,27344
66
66
  simtools/configuration/configurator.py,sha256=fVze9No1nebT2xTg7hPHU1Y9tkI7kwuMM9ew6i_9SZg,15008
67
67
  simtools/corsika/corsika_config.py,sha256=hw2myjSEkYgw5cbjm00tLNdlKQx52YDuHnQjPYsR2E4,29067
68
- simtools/corsika/corsika_histograms.py,sha256=lA0BiscQwhPSQSLYw-aICTtjKVCbyMjfXTCcfrXemGc,67691
69
- simtools/corsika/corsika_histograms_visualize.py,sha256=HjGLcff-ILXh8VYQKWycbHocVBVQp3TTOPmxAky0guI,18169
68
+ simtools/corsika/corsika_histograms.py,sha256=7mQdMyk6UFGTslxgain-fJAijPmDmL59Ra5ecyAUc3k,70536
70
69
  simtools/corsika/primary_particle.py,sha256=WK0UKYtdPSefes286ZGXsoGV9r6JqH19Tk9myza_plU,6613
71
70
  simtools/data_model/data_reader.py,sha256=M_TmHRe8AyA291twrmHGNRu11fMibDhWWDCvVptDoRM,4111
72
71
  simtools/data_model/format_checkers.py,sha256=bXF9dItkpZCGXAHdCH7vhgxEsIhXLLVFLOha-hKRspY,1949
@@ -75,8 +74,8 @@ simtools/data_model/metadata_model.py,sha256=wH52gC6MdwFw9A6UswZLsRlss7vbXDyxybB
75
74
  simtools/data_model/model_data_writer.py,sha256=w2lbFLBPS6ViPF0xDiXXUlrfqZYYR7nJwmmB6PLhxfI,14648
76
75
  simtools/data_model/schema.py,sha256=wrPKmY073wGfKHp7NAO5FLjjS2Z9N0oGMpRUwK-mRWA,8680
77
76
  simtools/data_model/validate_data.py,sha256=laKI4LCIkKhYkrQgPUHFoIwVCx-moBtuosgVMbOJU98,31082
78
- simtools/db/db_handler.py,sha256=41PEd3pNp0bfEpJsAvHOxzZswY8reDTlRfryaUBcp-s,35912
79
- simtools/db/db_model_upload.py,sha256=SRWq6dzY4AXwL9mfLXaQmcDnIHoCR0Xd3oZ_2na9DDY,4731
77
+ simtools/db/db_handler.py,sha256=BBwgvn9iwQNRaNLcXT8YAUZQsCD-33Mti_ANiiPR5_g,37614
78
+ simtools/db/db_model_upload.py,sha256=XjIsehucRUdGdmd9Vdp52l5lT2pStskLW8dPmuffDaI,5568
80
79
  simtools/io/ascii_handler.py,sha256=S2fP2x6vE4nEF5g0NRARIWKs8vKU3c9SW8XtcdrwhQU,7826
81
80
  simtools/io/hdf5_handler.py,sha256=CqP76MCfxvWH8AOnkIbQM5wBHIvSDEbdZ03wn7t6XgI,4232
82
81
  simtools/io/io_handler.py,sha256=k-A91MYdOD64XRdiyEJtgu7fFtJYyfe0xjmx63u2daM,5081
@@ -94,7 +93,7 @@ simtools/model/camera.py,sha256=Gj9yWfAfM4GrrX5q6ZGSQy80WsOUqZaTnP7DoCYfOJ0,2140
94
93
  simtools/model/flasher_model.py,sha256=SXSWJu9QWjMdrEHefhIXz_NuPsODTnb5HfY4Nhc5_oA,3948
95
94
  simtools/model/mirrors.py,sha256=uGCAT68WpnESv9IAgg8Xae9Z2-XgxMBL_Phnv6Ro0XQ,9151
96
95
  simtools/model/model_parameter.py,sha256=ZquhZCTonqbuC5wRJejUzvuAFWd7EHRua8hWSVxRN0g,19241
97
- simtools/model/model_repository.py,sha256=zli7zeZU-zdKX3nuAcK3D7RsBXlu607fvErk0NVPoQU,11124
96
+ simtools/model/model_repository.py,sha256=MGyMGA5we9B6KUat5i5XXO_ci8ggd6sfpmalFw70Ijo,12711
98
97
  simtools/model/model_utils.py,sha256=OFMKgrHLzStAE7k5JRuj6iAI4Z1_ND13lXWzUTGfZ_M,2485
99
98
  simtools/model/site_model.py,sha256=0oHrVWq9YPtuQKO6gg9LdPirEfqqaFtBT0dAxUlLR_8,6181
100
99
  simtools/model/telescope_model.py,sha256=bsHctXxwo1k5Xno9wVNAVhFyDPRFk4CNoCNpHYkB-jE,13504
@@ -108,7 +107,7 @@ simtools/production_configuration/merge_corsika_limits.py,sha256=t9JDvrpkP33ISCR
108
107
  simtools/ray_tracing/incident_angles.py,sha256=uSMa1bGeqt5bhjUY3AT9WGJfV5YoudUC6ZlnCwVGLo8,25913
109
108
  simtools/ray_tracing/mirror_panel_psf.py,sha256=xE_io65fGjv5GnH035xC84iSqC3Ltz1sxnybSqD6T20,11238
110
109
  simtools/ray_tracing/psf_analysis.py,sha256=kw431lbLNd8nm7FoOkCZwSw1iXvNIit-WKX9n-GMLJw,18164
111
- simtools/ray_tracing/psf_parameter_optimisation.py,sha256=no0dYe-dlk0XceSlfd9jpslB1kS8Ulo6ZsWGlHm8oek,26214
110
+ simtools/ray_tracing/psf_parameter_optimisation.py,sha256=d0XvU3EDF_mArjXSHvFDyMIJMKkhRzglF41URwXvsuQ,42923
112
111
  simtools/ray_tracing/ray_tracing.py,sha256=GTORirYWQz4NNJi8aB83Nm0MwdC9WVChYPAtfeYRBrw,22046
113
112
  simtools/reporting/docs_auto_report_generator.py,sha256=i4GGtpKKN0cVtGPEK4m3tpOrD8-PP5uot4kRHUujt8U,9236
114
113
  simtools/reporting/docs_read_parameters.py,sha256=4_CpJJJ92_CO9o8fV3-_OiFo4wbVMMipbD5DA8SO7bM,36349
@@ -358,7 +357,7 @@ simtools/schemas/model_parameters/trigger_current_limit.schema.yml,sha256=rCeU2q
358
357
  simtools/schemas/model_parameters/trigger_delay_compensation.schema.yml,sha256=7PMB5RY4S8zZZFjc8a33FZZmpfVKbP7qATsKHAvrf2w,1569
359
358
  simtools/schemas/model_parameters/trigger_pixels.schema.yml,sha256=Yvpp3FP7IVS2OMMdwayKKS3W1lNGKg4EZH4WHHY-Qe4,1105
360
359
  simtools/simtel/simtel_config_reader.py,sha256=_rDPaD2Fleqx8XlPVy97KnWYvZQBZdrDjZr9QNKM5PU,15039
361
- simtools/simtel/simtel_config_writer.py,sha256=4r5KxodabcA7Si7UllIaH8Gpt2s3MCuCityeErVBgEM,24367
360
+ simtools/simtel/simtel_config_writer.py,sha256=rZWr8Ru8rgwURmBYt1ysXvaGj21xh2Wua8udDvhDwjs,24366
362
361
  simtools/simtel/simtel_io_event_histograms.py,sha256=M0EnmiS9AbzwLyZapkP2JJc3Dze40NoPTHKtWHxe1kg,17688
363
362
  simtools/simtel/simtel_io_event_reader.py,sha256=YPP4Cs4NncTIXxbu40veksnJ_3_cZ00-56kGoEuR8so,14595
364
363
  simtools/simtel/simtel_io_event_writer.py,sha256=8iK4qvCEjA3X8HB6QdcMWD1w0cC1UEdAm_XRuOM-sGE,12739
@@ -382,14 +381,16 @@ simtools/utils/value_conversion.py,sha256=Cl-BHOZWUhWr-W_hT4CR1iLfiphd8MSNkzYEjD
382
381
  simtools/visualization/legend_handlers.py,sha256=QhUeZwuftA1VxfcMQ40KrwnPaD2FU95fNgZfX68YTJE,9792
383
382
  simtools/visualization/plot_array_layout.py,sha256=1SMiZwNuYCQu7Uf5p8Extie1pQBSKtxyYRsG_J3mG0I,7305
384
383
  simtools/visualization/plot_camera.py,sha256=dLXKHYfY_elqaKhj91HlntASoVixTrpc_Kf0jPU8RmU,11167
384
+ simtools/visualization/plot_corsika_histograms.py,sha256=6DV0NT-b-yYZ9dbCgSU3UCUHJTTWkthBsXaYgrF7JAg,21874
385
385
  simtools/visualization/plot_incident_angles.py,sha256=aAlLNHoTOoVF9uKSvwbZrPjsSPNkJVU-sKjiD-5ArXY,13460
386
386
  simtools/visualization/plot_pixels.py,sha256=CrgO_sJNYfmiRwUSKL9dpQvzkGw73Jd-4sZW_1KUfTI,20570
387
+ simtools/visualization/plot_psf.py,sha256=ww90nRhYk9mePjL2PPU538Ths4YzAOviri7e323qaX4,22464
387
388
  simtools/visualization/plot_simtel_event_histograms.py,sha256=o9fPkKE1568MRumPVRyBs8ah5eyTN2mCLXseEwAy4RA,12751
388
- simtools/visualization/plot_simtel_events.py,sha256=x7XFOWY2bRMUZsC0884FugyW-J76kxjxG1s5cH7b28Q,25795
389
+ simtools/visualization/plot_simtel_events.py,sha256=CZRX9xO4dxyzItGgCFmWYj4XOj2qn9Vbj61bbulmS0o,31768
389
390
  simtools/visualization/plot_tables.py,sha256=YfGrT1rj7wijKUgrFROrQ057SE0MbvSzxbkCdMLMEjw,8668
390
391
  simtools/visualization/visualize.py,sha256=5NkEf-ZHkyA4eUR0YK64s3Sugzj2sizSmRAKJQBpSso,18974
391
- gammasimtools-0.20.0.dist-info/METADATA,sha256=c_teBXKuL1RVa57tbodSgW3LkLCDToteTbxm-NvkidY,5977
392
- gammasimtools-0.20.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
393
- gammasimtools-0.20.0.dist-info/entry_points.txt,sha256=RSap2jP3H4R5s98pU3nsF0Wv1op1iSrsPr9Zie3O1ow,4968
394
- gammasimtools-0.20.0.dist-info/top_level.txt,sha256=9Yi7Q7aQX6alvpP2YGQtIYo208wdGkXUApHboEdj-ys,9
395
- gammasimtools-0.20.0.dist-info/RECORD,,
392
+ gammasimtools-0.21.0.dist-info/METADATA,sha256=vWr34hLIVk7HOqqqQmPuRdWsJx5r8qhoPA3hibP1LJ4,5977
393
+ gammasimtools-0.21.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
394
+ gammasimtools-0.21.0.dist-info/entry_points.txt,sha256=m2vT9CExjHsFyATSzoXOC1XL-U4GpinWI0V9_P8wIWo,4956
395
+ gammasimtools-0.21.0.dist-info/top_level.txt,sha256=9Yi7Q7aQX6alvpP2YGQtIYo208wdGkXUApHboEdj-ys,9
396
+ gammasimtools-0.21.0.dist-info/RECORD,,
@@ -25,7 +25,7 @@ simtools-generate-corsika-histograms = simtools.applications.generate_corsika_hi
25
25
  simtools-generate-default-metadata = simtools.applications.generate_default_metadata:main
26
26
  simtools-generate-regular-arrays = simtools.applications.generate_regular_arrays:main
27
27
  simtools-generate-simtel-event-data = simtools.applications.generate_simtel_event_data:main
28
- simtools-maintain-simulation-model-add-production-table = simtools.applications.maintain_simulation_model_add_production_table:main
28
+ simtools-maintain-simulation-model-add-production = simtools.applications.maintain_simulation_model_add_production:main
29
29
  simtools-maintain-simulation-model-compare-productions = simtools.applications.maintain_simulation_model_compare_productions:main
30
30
  simtools-maintain-simulation-model-verify-production-tables = simtools.applications.maintain_simulation_model_verify_production_tables:main
31
31
  simtools-merge-tables = simtools.applications.merge_tables:main
simtools/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.20.0'
32
- __version_tuple__ = version_tuple = (0, 20, 0)
31
+ __version__ = version = '0.21.0'
32
+ __version_tuple__ = version_tuple = (0, 21, 0)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -46,7 +46,7 @@ def main(): # noqa: D103
46
46
  ]
47
47
  requested = db.get_db_name(
48
48
  db_name=args_dict["db_name"],
49
- model_version=args_dict.get("db_simulation_model_version"),
49
+ db_simulation_model_version=args_dict.get("db_simulation_model_version"),
50
50
  model_name=args_dict.get("db_simulation_model"),
51
51
  )
52
52
  if requested != "all" and requested not in databases:
@@ -6,25 +6,22 @@ r"""
6
6
  This includes parameters mirror_reflection_random_angle, \
7
7
  mirror_align_random_horizontal and mirror_align_random_vertical.
8
8
 
9
- The telescope zenith angle and the source distance can be set by command line arguments.
10
-
11
9
  The measured cumulative PSF should be provided by using the command line argument data. \
12
10
  A file name is expected, in which the file should contain 3 columns: radial distance in mm, \
13
11
  differential value of photon intensity and its integral value.
14
12
 
15
- The derivation is performed through a random search. A number of random combination of the \
16
- parameters are tested and the best ones are selected based on the minimum value of \
17
- the Root Mean Squared Deviation between data and simulations. The range in which the \
18
- parameter are drawn uniformly are defined based on the previous value on the telescope model.
13
+ The derivation is performed through gradient descent optimization that minimizes either the \
14
+ Root Mean Squared Deviation (RMSD) between measured and simulated PSF curves (default) or the \
15
+ Kolmogorov-Smirnov (KS) statistic when the --ks_statistic flag is used.
19
16
 
20
17
  The optimization workflow includes:
21
18
 
22
19
  * Loading and preprocessing PSF data from measurement files
23
- * Generating random parameter combinations for optimization
24
- * Running ray-tracing simulations for each parameter set
25
- * Calculating RMSD between measured and simulated PSF curves
26
- * Identifying the best-fit parameters with minimum RMSD
27
- * Creating comprehensive plots and D80 vs off-axis angle analysis
20
+ * Running gradient descent optimization to minimize RMSD
21
+ * Generating cumulative PSF plots for each iteration showing optimization progression
22
+ * Logging parameter evolution through gradient descent steps
23
+ * Creating convergence plots showing RMSD and D80 evolution
24
+ * Automatically generating D80 vs off-axis angle analysis for best parameters
28
25
  * Optionally exporting optimized parameters as simulation model files
29
26
 
30
27
  The assumption are:
@@ -36,7 +33,7 @@ r"""
36
33
  One example of the plot generated by this applications are shown below.
37
34
 
38
35
  .. _derive_psf_parameters_plot:
39
- .. image:: images/derive_psf_parameters.png
36
+ .. image:: images/gradient_descent.png
40
37
  :width: 49 %
41
38
 
42
39
  Command line arguments
@@ -63,47 +60,53 @@ r"""
63
60
  If activated, application will be faster by simulating fewer photons.
64
61
  write_psf_parameters (activation mode, optional)
65
62
  Write the optimized PSF parameters as simulation model parameter files.
66
- random_seed (int, optional)
67
- Random seed for parameter generation.
68
- n_runs (int, optional)
69
- Number of parameter combinations to test.
63
+ rmsd_threshold (float, optional)
64
+ RMSD threshold for gradient descent convergence (default: 0.007).
65
+ learning_rate (float, optional)
66
+ Learning rate for gradient descent optimization (default: 0.01).
67
+ monte_carlo_analysis (activation mode, optional)
68
+ Run Monte Carlo analysis to find statistical uncertainties.
70
69
 
71
70
  Example
72
71
  -------
73
- LSTN-01 5.0.0
74
-
75
- Runtime < 3 min.
76
-
77
- Get PSF data from the DB:
72
+ --telescope LSTN-01 --model_version 6.0.0
78
73
 
79
- .. code-block:: console
80
74
 
81
- simtools-db-get-file-from-db --file_name PSFcurve_data_v2.txt
82
75
 
83
76
  Run the application:
84
77
 
85
78
  .. code-block:: console
86
79
 
87
80
  simtools-derive-psf-parameters --site North --telescope LSTN-01 \\
88
- --model_version 6.0.0 --data tests/resources/PSFcurve_data_v2.txt --plot_all --test
81
+ --model_version 6.0.0 --data tests/resources/PSFcurve_data_v2.ecsv --plot_all --test
89
82
 
90
83
  Run with parameter export:
91
84
 
92
85
  .. code-block:: console
93
86
 
94
- simtools-derive-psf-parameters --site North --telescope LSTN-01 \\
95
- --model_version 6.0.0 \\
96
- --data tests/resources/PSFcurve_data_v2.txt --write_psf_parameters
87
+ simtools-derive-psf-parameters --site North --telescope LSTN-01 --model_version 6.0.0 \\
88
+ --plot_all --test --rmsd_threshold 0.01 --learning_rate 0.001 \\
89
+ --data tests/resources/PSFcurve_data_v2.ecsv \\
90
+ --write_psf_parameters
97
91
 
98
- The output is saved in simtools-output/tune_psf.
92
+ Run monte carlo analysis:
93
+
94
+ .. code-block:: console
95
+
96
+ simtools-derive-psf-parameters --site North --telescope LSTN-01 --model_version 6.0.0 \\
97
+ --plot_all --test --monte_carlo_analysis \\
98
+ --data tests/resources/PSFcurve_data_v2.ecsv \\
99
+ --write_psf_parameters
100
+
101
+ The output is saved in simtools-output/derive_psf_parameters.
99
102
 
100
103
  Output files include:
101
104
 
102
- * Parameter optimization results in tested_psf_parameters.txt
103
- * PSF comparison plots in tune_psf_[telescope].pdf
105
+ * Gradient descent progression log in psf_gradient_descent_[telescope].log
106
+ * Gradient descent convergence plots in gradient_descent_convergence_[telescope].png
107
+ * PSF progression plots showing evolution through iterations (if --plot_all is specified)
104
108
  * D80 vs off-axis angle plots (d80_vs_offaxis_cm.png, d80_vs_offaxis_deg.png)
105
109
  * Optimized simulation model parameter files (if --write_psf_parameters is specified)
106
- * Cumulative PSF plots for all tested combinations (if --plot_all is specified)
107
110
 
108
111
  """
109
112
 
@@ -154,16 +157,32 @@ def _parse():
154
157
  required=False,
155
158
  )
156
159
  config.parser.add_argument(
157
- "--random_seed",
158
- help="Random seed for parameter generation.",
159
- type=int,
160
- default=None,
160
+ "--rmsd_threshold",
161
+ help=(
162
+ "RMSD threshold for gradient descent convergence "
163
+ "(not used with --monte_carlo_analysis)."
164
+ ),
165
+ type=float,
166
+ default=0.01,
167
+ )
168
+ config.parser.add_argument(
169
+ "--learning_rate",
170
+ help=(
171
+ "Learning rate for gradient descent optimization "
172
+ "(not used with --monte_carlo_analysis)."
173
+ ),
174
+ type=float,
175
+ default=0.01,
161
176
  )
162
177
  config.parser.add_argument(
163
- "--n_runs",
164
- help="Number of parameter combinations to test.",
165
- type=int,
166
- default=5,
178
+ "--monte_carlo_analysis",
179
+ help="Run analysis to find monte carlo uncertainties.",
180
+ action="store_true",
181
+ )
182
+ config.parser.add_argument(
183
+ "--ks_statistic",
184
+ help="Use KS statistic for monte carlo uncertainty analysis.",
185
+ action="store_true",
167
186
  )
168
187
  return config.initialize(
169
188
  db_config=True,
@@ -165,15 +165,11 @@ r"""
165
165
  """
166
166
 
167
167
  import logging
168
- import re
169
168
  import time
170
169
  from pathlib import Path
171
170
 
172
- import numpy as np
173
-
174
171
  import simtools.utils.general as gen
175
172
  from simtools.configuration import configurator
176
- from simtools.corsika import corsika_histograms_visualize
177
173
  from simtools.corsika.corsika_histograms import CorsikaHistograms
178
174
  from simtools.io import io_handler
179
175
 
@@ -284,134 +280,6 @@ def _parse(label, description):
284
280
  return config_parser, _
285
281
 
286
282
 
287
- def _plot_figures(corsika_histograms_instance, test=False):
288
- """
289
- Auxiliary function to centralize the plotting functions.
290
-
291
- Parameters
292
- ----------
293
- corsika_histograms_instance: CorsikaHistograms instance.
294
- The CorsikaHistograms instance created in main.
295
- test: bool
296
- If true plots the figures for the first two functions only.
297
- """
298
- plot_function_names = [
299
- plotting_method
300
- for plotting_method in dir(corsika_histograms_visualize)
301
- if plotting_method.startswith("plot_")
302
- and "event_header_distribution" not in plotting_method
303
- ]
304
- if test:
305
- plot_function_names = plot_function_names[:2]
306
-
307
- figure_list = []
308
- for function_name in plot_function_names:
309
- plot_function = getattr(corsika_histograms_visualize, function_name)
310
- figures = plot_function(corsika_histograms_instance)
311
- for fig in figures:
312
- figure_list.append(fig)
313
-
314
- figure_list = np.array(figure_list).flatten()
315
- core_name = re.sub(r"\.hdf5$", "", corsika_histograms_instance.hdf5_file_name)
316
- output_file_name = Path(corsika_histograms_instance.output_path).joinpath(f"{core_name}.pdf")
317
- corsika_histograms_visualize.save_figs_to_pdf(figure_list, output_file_name)
318
-
319
-
320
- def _derive_event_1d_histograms(
321
- corsika_histograms_instance, event_1d_header_keys, pdf, hdf5, overwrite=False
322
- ):
323
- """
324
- Auxiliary function to derive the histograms for the arguments given by event_1d_histograms.
325
-
326
- Parameters
327
- ----------
328
- corsika_histograms_instance: CorsikaHistograms instance.
329
- The CorsikaHistograms instance created in main.
330
- event_1d_header_keys: str
331
- Generate 1D histograms for elements given in event_1d_header_keys from the CORSIKA event
332
- header and save into hdf5/pdf files.
333
- pdf: bool
334
- If true, histograms are saved into a pdf file.
335
- hdf5: bool
336
- If true, histograms are saved into hdf5 files.
337
- overwrite: bool
338
- If true, overwrites the current output hdf5 file.
339
- """
340
- figure_list = []
341
- for event_header_element in event_1d_header_keys:
342
- if pdf:
343
- figure = corsika_histograms_visualize.plot_1d_event_header_distribution(
344
- corsika_histograms_instance, event_header_element
345
- )
346
- figure_list.append(figure)
347
- if hdf5:
348
- corsika_histograms_instance.export_event_header_1d_histogram(
349
- event_header_element, bins=50, hist_range=None, overwrite=overwrite
350
- )
351
- if pdf:
352
- figures_list = np.array(figure_list).flatten()
353
- output_file_name = Path(corsika_histograms_instance.output_path).joinpath(
354
- f"{corsika_histograms_instance.hdf5_file_name}_event_1d_histograms.pdf"
355
- )
356
- corsika_histograms_visualize.save_figs_to_pdf(figures_list, output_file_name)
357
-
358
-
359
- def _derive_event_2d_histograms(
360
- corsika_histograms_instance, event_2d_header_keys, pdf, hdf5, overwrite=False
361
- ):
362
- """
363
- Auxiliary function to derive the histograms for the arguments given by event_1d_histograms.
364
-
365
- If an odd number of event header keys are given, the last one is discarded.
366
-
367
- Parameters
368
- ----------
369
- corsika_histograms_instance: CorsikaHistograms instance.
370
- The CorsikaHistograms instance created in main.
371
- event_2d_header_keys: str
372
- Generate 1D histograms for elements given in event_1d_header_keys from the CORSIKA event
373
- header and save into hdf5/pdf files.
374
- pdf: bool
375
- If true, histograms are saved into a pdf file.
376
- hdf5: bool
377
- If true, histograms are saved into hdf5 files.
378
- overwrite: bool
379
- If true, overwrites the current output hdf5 file.
380
- """
381
- figure_list = []
382
- for i_event_header_element, _ in enumerate(event_2d_header_keys[::2]):
383
- # [::2] to discard the last one in case an odd number of keys are passed
384
-
385
- if len(event_2d_header_keys) % 2 == 1: # if odd number of keys
386
- msg = (
387
- "An odd number of keys was passed to generate 2D histograms."
388
- "The last key is being ignored."
389
- )
390
- logger.warning(msg)
391
-
392
- if pdf:
393
- figure = corsika_histograms_visualize.plot_2d_event_header_distribution(
394
- corsika_histograms_instance,
395
- event_2d_header_keys[i_event_header_element],
396
- event_2d_header_keys[i_event_header_element + 1],
397
- )
398
- figure_list.append(figure)
399
- if hdf5:
400
- corsika_histograms_instance.export_event_header_2d_histogram(
401
- event_2d_header_keys[i_event_header_element],
402
- event_2d_header_keys[i_event_header_element + 1],
403
- bins=50,
404
- hist_range=None,
405
- overwrite=overwrite,
406
- )
407
- if pdf:
408
- figures_list = np.array(figure_list).flatten()
409
- output_file_name = Path(corsika_histograms_instance.output_path).joinpath(
410
- f"{corsika_histograms_instance.hdf5_file_name}_event_2d_histograms.pdf"
411
- )
412
- corsika_histograms_visualize.save_figs_to_pdf(figures_list, output_file_name)
413
-
414
-
415
283
  def main(): # noqa: D103
416
284
  label = Path(__file__).stem
417
285
  description = "Generate histograms for the Cherenkov photons saved in the CORSIKA IACT file."
@@ -427,62 +295,17 @@ def main(): # noqa: D103
427
295
  corsika_histograms_instance = CorsikaHistograms(
428
296
  args_dict["iact_file"], output_path=output_path, hdf5_file_name=args_dict["hdf5_file_name"]
429
297
  )
430
- if args_dict["telescope_indices"] is not None:
431
- try:
432
- indices = np.array(args_dict["telescope_indices"]).astype(int)
433
- except ValueError:
434
- msg = (
435
- f"{args_dict['telescope_indices']} not a valid input. "
436
- f"Please use integer numbers for telescope_indices"
437
- )
438
- logger.error(msg)
439
- raise
440
- else:
441
- indices = None
442
- # If the hdf5 output file already exists, the results are appended to it.
443
- if (Path(corsika_histograms_instance.hdf5_file_name).exists()) and (
444
- args_dict["hdf5"] or args_dict["event_1d_histograms"] or args_dict["event_2d_histograms"]
445
- ):
446
- msg = (
447
- f"Output hdf5 file {corsika_histograms_instance.hdf5_file_name} already exists. "
448
- f"Overwriting it."
449
- )
450
- logger.warning(msg)
451
- overwrite = True
452
- else:
453
- overwrite = False
454
- corsika_histograms_instance.set_histograms(
455
- telescope_indices=indices,
298
+ corsika_histograms_instance.run_export_pipeline(
456
299
  individual_telescopes=args_dict["individual_telescopes"],
457
300
  hist_config=args_dict["hist_config"],
301
+ indices_arg=args_dict["telescope_indices"],
302
+ write_pdf=args_dict["pdf"],
303
+ write_hdf5=args_dict["hdf5"],
304
+ event1d=args_dict["event_1d_histograms"],
305
+ event2d=args_dict["event_2d_histograms"],
306
+ test=args_dict["test"],
458
307
  )
459
308
 
460
- # Cherenkov photons
461
- if args_dict["pdf"]:
462
- _plot_figures(
463
- corsika_histograms_instance=corsika_histograms_instance, test=args_dict["test"]
464
- )
465
- if args_dict["hdf5"]:
466
- corsika_histograms_instance.export_histograms(overwrite=overwrite)
467
-
468
- # Event information
469
- if args_dict["event_1d_histograms"] is not None:
470
- _derive_event_1d_histograms(
471
- corsika_histograms_instance,
472
- args_dict["event_1d_histograms"],
473
- args_dict["pdf"],
474
- args_dict["hdf5"],
475
- overwrite=not args_dict["hdf5"],
476
- )
477
- if args_dict["event_2d_histograms"] is not None:
478
- _derive_event_2d_histograms(
479
- corsika_histograms_instance,
480
- args_dict["event_2d_histograms"],
481
- args_dict["pdf"],
482
- args_dict["hdf5"],
483
- overwrite=not (args_dict["hdf5"] or args_dict["event_1d_histograms"]),
484
- )
485
-
486
309
  final_time = time.time()
487
310
  logger.info(
488
311
  f"Finalizing the application. Total time needed: {round(final_time - initial_time)}s."
@@ -0,0 +1,105 @@
1
+ r"""
2
+ Generate a new simulation model production and update tables and model parameters.
3
+
4
+ This script is used to maintain the simulation model repository. It allows to create
5
+ new production tables by copying an existing base version and applies modifications
6
+ to production tables and model parameters as provided in a YAML file (see the example file below).
7
+
8
+ Two main use cases are covered by this script:
9
+
10
+ 1. full_update: Create a complete new set of production tables (e.g. for new major or minor
11
+ versions of the simulation models). This will copy all production tables from the source
12
+ directory and apply the modifications to the tables that are listed in the modifications file.
13
+
14
+ 2. patch_update: Create a set of new production tables including the changes defined in the
15
+ modifications file. No unmodified tables are copied. For new production tables with patch
16
+ modifications, the key-value pair 'base_model_version: <base_model version>' is added.
17
+
18
+ Both use cases will also apply the modifications to the model parameters as defined in the
19
+ modifications file.
20
+
21
+ Example
22
+ -------
23
+
24
+ The following example applies a patch update with changes defined in a YAML file.
25
+
26
+ .. code-block:: console
27
+
28
+ simtools-maintain-simulation-model-add-new-production \\
29
+ --simulation_models_path ../simulation-models-dev/simulation-models/ \\
30
+ --base_model_version 6.0.0 \\
31
+ --modifications tests/resources/production_tables_changes_for_threshold_study_6.2.0.yml \\
32
+ --patch_update
33
+
34
+ """
35
+
36
+ import logging
37
+ from pathlib import Path
38
+
39
+ import simtools.utils.general as gen
40
+ from simtools.configuration import configurator
41
+ from simtools.model import model_repository
42
+
43
+
44
+ def _parse(label, description):
45
+ """
46
+ Parse command line arguments.
47
+
48
+ Returns
49
+ -------
50
+ dict
51
+ Parsed command-line arguments.
52
+ """
53
+ config = configurator.Configurator(label=label, description=description)
54
+ config.parser.add_argument(
55
+ "--simulation_models_path",
56
+ type=str,
57
+ required=True,
58
+ help="Path to the simulation models repository.",
59
+ )
60
+ config.parser.add_argument(
61
+ "--base_model_version",
62
+ type=str,
63
+ required=True,
64
+ help="Base model version (which is the source production table subdirectory to copy from).",
65
+ )
66
+ config.parser.add_argument(
67
+ "--modifications",
68
+ type=str,
69
+ required=True,
70
+ help="File containing the list of changes to apply.",
71
+ )
72
+ update_group = config.parser.add_mutually_exclusive_group(required=True)
73
+ update_group.add_argument(
74
+ "--full_update",
75
+ action="store_true",
76
+ default=False,
77
+ help=(
78
+ "Create a full new set of production tables by copying all tables from the "
79
+ "base version and applying the modifications to the relevant tables."
80
+ ),
81
+ )
82
+ update_group.add_argument(
83
+ "--patch_update",
84
+ action="store_true",
85
+ default=False,
86
+ help=(
87
+ "Create a new set of production tables including only the changes defined in the "
88
+ "modifications file. No unmodified tables are copied."
89
+ ),
90
+ )
91
+
92
+ return config.initialize(db_config=False, output=False)
93
+
94
+
95
+ def main(): # noqa: D103
96
+ label = Path(__file__).stem
97
+ args_dict, _ = _parse(label=label, description="Generate a new simulation model production")
98
+ logger = logging.getLogger()
99
+ logger.setLevel(gen.get_log_level_from_user(args_dict["log_level"]))
100
+
101
+ model_repository.generate_new_production(args_dict)
102
+
103
+
104
+ if __name__ == "__main__":
105
+ main()