simtools-simulate-prod#
Generate simulation configuration and run simulations.
Overview#
The application produces multipipe scripts and runs array-layout simulations that include shower and detector simulations. It can execute only the CORSIKA shower simulation or pipe CORSIKA output directly to sim_telarray using the sim_telarray multipipe mechanism.
After a successful job, the application writes simulate_prod_job_metadata.yml to the job output
directory. The manifest records the resolved configuration and the generated production files,
including files in the standard sim_telarray/runNNNNNN and corsika/runNNNNNN subdirectories.
For sim_telarray jobs, it also records simulated and triggered event counts per output under statistics;
these counts are derived from reduced-event data or the sim_telarray log without reading the
simtel event output.
When --grid_output_path is used, the manifest is written alongside the files packed for grid
registration.
sim_telarray event files include CTAO DataProducts metadata. Use --production_id to set the
production name recorded in the file and job manifest; when omitted, --label supplies it.
Existing simtools metadata keys remain available for older readers.
The installed CORSIKA build determines which hadronic interaction-model combinations are
available. Use --list_available_corsika_models to inspect them. For simulations that run
CORSIKA, --corsika_hadronic_transition_energy controls the HILOW transition between the
low- and high-energy models. If omitted, the selected CORSIKA build default is retained.
Simulation chain#
--simulation_software lists the stages of the simulation in order, each as
STAGE or STAGE:KEY=VALUE,.... The default is corsika sim_telarray: showers with CORSIKA,
telescopes and cameras with sim_telarray. A stage must consume what the previous stage produces.
The obdeect stages (for example obdeect_atmosphere and obdeect_optics), their options and the
efficiency factors of a chain are described in obdeect.
Examples:
--simulation_software sim_telarray # sim_telarray only, e.g. from a CORSIKA input file
--simulation_software corsika # CORSIKA only
--simulation_software corsika obdeect_atmosphere obdeect_optics sim_telarray:bypass_optics=camera_only
simtools inserts the converters between programs with different photon formats
(corsika_to_stream, stream_to_simtel); list a converter to give it options.
The same list is used in configuration files:
simulation_software:
- corsika
- sim_telarray
Command line arguments#
options#
- –help
show this help message and exit
- –write_hdata
Write sim_telarray hdata histogram files.
- –list_available_corsika_models
List interaction-model variants available in the CORSIKA installation and exit.
- –corsika_file
Path to the CORSIKA input file (only relevant for simulation software ‘sim_telarray’).
- –grid_output_path
Directory for output files for registering on the grid.
- –production_id
Production identifier written to sim_telarray metadata and the job manifest.
- –save_file_lists
Save lists of output and log files.
- –save_corsika_output
Save CORSIKA output when piping CORSIKA directly to sim_telarray (only relevant for the simulation chain ‘corsika sim_telarray’).
- –reduced_event_lists
Save reduced event lists with event data on simulated and triggered events. Saved with the same name as the sim_telarray output file (different extension).
Default: True.
- –corsika_seeds
Use fixed random seeds for CORSIKA for testing purposes.
- –sequential
Enables single-core mode (as far as possible); otherwise, CORSIKA and sim_telarray run in parallel.
- –job_grid_file
Path to an ECSV job grid file produced by simtools-production-generate-grid. When provided, the selected row defines production parameters and must not be combined with manual production arguments such as ‘–zenith_angle’.
- –job_grid_row
1-based index of the row to read from the file given by ‘–job_grid_file’. When omitted with ‘–backend htcondor’, all rows are submitted; otherwise row 1 is used.
Default: 1.
- –wait
Wait for submitted backend jobs to finish before exiting.
- –submission_burst_size
Maximum number of job-grid jobs submitted per burst.
Default: 250.
- –submission_burst_delay_seconds
Delay between job-grid submission bursts in seconds (default 5).
Default: 5.0.
simulation configuration#
- –simulation_file_format
Simulation input format. Current IACT and sim_telarray files use ‘eventio’.
Default: eventio.
- –primary
Primary particle(s) to simulate. Common names: gamma, electron, positron, muon+, muon-, proton, neutron, helium, carbon, nitrogen, silicon, iron. Use –show_options primary.
- –primary_id_type
Primary particle ID type
Default: common_name. Choices: common_name, corsika7_id, pdg_id.
- –azimuth_angle
Telescope pointing direction in azimuth. It can be in degrees between 0 and 360 or one of north, south, east or west. North is 0 degrees and the azimuth grows clockwise (East is 90 degrees).
- –zenith_angle
Zenith angle in degrees (between 0 and 180).
Default: 20.0 deg.
- –showers_per_run
Baseline number of CORSIKA showers per run.
- –run_number_offset
Offset added to each run number.
- –run_number
Run number to be simulated.
Default: 1.
- –event_number_first_shower
Event number of first shower
Default: 1.
- –correct_for_b_field_alignment
Align North with geographic North (and not magnetic North).
Default: True.
- –curved_atmosphere_min_zenith_angle
Minimum zenith angle (deg) for using curved-atmosphere CORSIKA binaries.
Default: 65.0 deg.
- –instrument_seed
Seed of the random instrument setup (e.g. mirror deviations, gains); with several random instrument instances, their seeds are derived from it (default: random).
- –random_instrument_instances
Number of random instrument instances (e.g. random mirror realisations).
Default: 1.
- –simulation_seed
Seed of the simulation (events, photons) (default: random). Two values: [instrument_seed, simulation_seed] (use for testing only).
simulation model#
- –model_version
Simulation production model version(s). Use –show_options model_version.
- –overwrite_model_parameters
JSON string with model parameters to overwrite
- –site
Observatory site (e.g., North, South). Use –show_options site.
- –array_layout_name
Array layout name(s) (e.g., CTAO-North-Alpha, LSTN-01). Telescope names are assumed as single-telescope layouts. Use –show_options array_layout_name.
simulation software#
- –simulation_software
Stages of the simulation chain in order, each as STAGE or STAGE:KEY=VALUE,… (e.g. corsika sim_telarray).
Default: [‘corsika’, ‘sim_telarray’].
shower parameters#
- –eslope
Slope of the energy spectrum.
Default: -2.0.
- –energy_range
Minimum and maximum primary energy, e.g. ‘10 GeV 5 TeV’.
Default: (<Quantity 3. GeV>, <Quantity 330. TeV>).
- –view_cone
Minimum and maximum view-cone radius, e.g. ‘0 deg 10 deg’.
Default: [‘0 deg 0 deg’].
- –core_scatter
Core positions per shower and maximum scatter radius, e.g. ‘10 500 m’.
Default: [‘10 10000 m’].
corsika configuration#
- –corsika_he_interaction
High-energy interaction model for CORSIKA (default fallback: epos). Use –show_options corsika_he_interaction.
- –corsika_le_interaction
Low-energy interaction model for CORSIKA (default fallback: urqmd). Use –show_options corsika_le_interaction.
- –corsika_hadronic_transition_energy
Transition energy between the low- and high-energy CORSIKA hadronic interaction models. Unitless values are interpreted as GeV. If omitted, the CORSIKA build default is used.
model repository#
- –simulation_models_path
Path containing the simulation-model repository to read.
- –simulation_models_git_path
Path to a local normal, bare, or mirror Git repository containing simulation models.
- –simulation_models_git_revision
Git tag, ref, or commit to read from the simulation-model repository.
application#
- –show_options
Print available values for a supported option and exit.
Examples#
Simulate South gamma rays across model versions#
Run a small CORSIKA and sim_telarray gamma-ray production for the version-appropriate South Alpha layout.
Application: simtools-simulate-prod
Integration test: simulate_prod_gamma_20_deg_south_multiple_model_versions.yml
Command
simtools-simulate-prod --config tests/integration_tests/config/simulate_prod_gamma_20_deg_south_multiple_model_versions.yml
Configuration
array_layout_name:
by_version:
<7.0.0: alpha
'>=7.0.0': CTAO-South-Alpha
azimuth_angle: 85.0
core_scatter: 5 700 m
corsika_seeds:
- 534
- 220
- 1104
- 382
corsika_he_interaction: epos
corsika_le_interaction: urqmd
energy_range: 100 GeV 300 GeV
label: multiple_model_versions
log_level: DEBUG
model_version:
- 6.0
- 6.1
showers_per_run: 5
output_path: simtools-output
grid_output_path: simtools-grid-output
primary: 1
primary_id_type: corsika7_id
run_number: 1
save_corsika_output: true
write_hdata: true
reduced_event_lists: true
simulation_seed:
- 1745
- 290
simulation_software:
- corsika
- sim_telarray
site: South
zenith_angle: 20
Run the CORSIKA stage of a South gamma production#
Select one production-grid row and generate the corresponding 40 deg gamma-ray air showers with CORSIKA.
Application: simtools-simulate-prod
Integration test: simulate_prod_gamma_40_deg_south_corsika_only.yml
Command
simtools-simulate-prod --config tests/integration_tests/config/simulate_prod_gamma_40_deg_south_corsika_only.yml
Configuration
corsika_seeds:
- 534
- 220
- 1104
- 382
job_grid_file: ${generated:production_grid_points_horizontal.ecsv}
job_grid_row: 3
label: test
log_level: DEBUG
output_path: simtools-output
simulation_seed:
- 1745
- 290
Run sim_telarray on South gamma showers#
Read an existing CORSIKA gamma-ray file and simulate detector response for the South LST subarray.
Application: simtools-simulate-prod
Integration test: simulate_prod_gamma_40_deg_south_sim_telarray_only.yml
Command
simtools-simulate-prod --config tests/integration_tests/config/simulate_prod_gamma_40_deg_south_sim_telarray_only.yml
Configuration
corsika_file: ${generated:gamma_run000007_za40deg_azm180deg_South_subsystem_lsts_7.0.0_test.corsika.zst}
array_layout_name: subsystem_lsts
corsika_he_interaction: epos
corsika_le_interaction: urqmd
label: test
log_level: DEBUG
model_version: 7.0.0
output_path: simtools-output
instrument_seed: 1745
simulation_seed:
- 290
simulation_software:
- sim_telarray
site: South
Simulate high-zenith gamma rays for South#
Run CORSIKA and sim_telarray for 62 deg gamma rays using curved-atmosphere settings and the South Beta layout.
Application: simtools-simulate-prod
Integration test: simulate_prod_gamma_62_deg_south_check_output.yml
Command
simtools-simulate-prod --config tests/integration_tests/config/simulate_prod_gamma_62_deg_south_check_output.yml
Configuration
array_layout_name:
by_version:
<7.0.0: beta
'>=7.0.0': CTAO-South-Beta
azimuth_angle: South
core_scatter: 1 840 m
corsika_seeds:
- 534
- 220
- 1104
- 382
corsika_he_interaction: epos
corsika_le_interaction: urqmd
energy_range: 400 GeV 1000 GeV
label: test
log_level: DEBUG
model_version: 7.0.0
showers_per_run: 5
output_path: simtools-output
grid_output_path: simtools-grid-output
primary: gamma
run_number: 20
simulation_seed:
- 1745
- 290
simulation_software:
- corsika
- sim_telarray
site: South
zenith_angle: 62.0
curved_atmosphere_min_zenith_angle: 60. deg
overwrite_model_parameters: tests/resources/static/info_test_model_parameter_changes.yml
Simulate a North proton production#
Run a compact CORSIKA and sim_telarray proton production for the North Alpha array and write reduced event data.
Application: simtools-simulate-prod
Integration test: simulate_prod_proton_20_deg_north_check_output.yml
Command
simtools-simulate-prod --config tests/integration_tests/config/simulate_prod_proton_20_deg_north_check_output.yml
Configuration
array_layout_name:
by_version:
<7.0.0: alpha
'>=7.0.0': CTAO-North-Alpha
azimuth_angle: South
core_scatter: 5 500 m
corsika_seeds:
- 534
- 220
- 1104
- 382
corsika_he_interaction: epos
corsika_le_interaction: urqmd
energy_range: 200 GeV 500 GeV
label: test
log_level: DEBUG
model_version: 7.0.0
showers_per_run: 5
output_path: simtools-output
grid_output_path: simtools-grid-output
primary: proton
run_number: 1
simulation_seed:
- 1745
- 290
simulation_software:
- corsika
- sim_telarray
site: North
view_cone: 0 deg 5 deg
zenith_angle: 20
Shower input file format#
For telescope simulations supplied with a shower input file,
simulation_file_format selects its reader. The default eventio reads current
CORSIKA IACT files. The reader supplies physical pointing, shower counts, reuse,
and observation height without constructing a CORSIKA configuration.
See configuration and file formats for the interfaces used to add formats. Available simulation programs remain CORSIKA7 and sim_telarray.