simulate_prod

simulate_prod#

Summary#

This application is used to run simulations for productions (typically on the grid). It allows to run a Paranal (CTAO-South) or La Palma (CTAO-North) array layout simulation with the provided “prod_tag” simulation configuration (e.g., Prod6) for a given primary particle, azimuth, and zenith angle.

The entire simulation chain is performed, i.e., shower simulations with CORSIKA which are piped directly to sim_telarray using the sim_telarray multipipe mechanism. This script produces all the necessary configuration files for CORSIKA and sim_telarray before running simulation. The multipipe scripts will be produced as part of this script.

This script does not provide a mechanism to submit jobs to a batch system like others in simtools since it is meant to be executed on a grid node (distributed to it by the workload management system).

Command line arguments#

production_config (str, Path, required)

Simulation configuration file (contains the default setup which can be overwritten by the command line options).

model_version (str, required)

The telescope model version to use (e.g., Prod5).

site (str, required)

North or South (case insensitive).

primary (str, required)

Name of the primary particle to simulate. The available options are gamma, gamma_diffuse, electron, proton, muon, helium, nitrogen, silicon, and iron.

azimuth_angle (str or float, required)

Telescope pointing direction in azimuth. It can be in degrees between 0 and 360 or one of north, south, east or west (case insensitive). Note that North is 0 degrees and the azimuth grows clockwise, so East is 90 degrees.

zenith_angle (float, required)

Zenith angle in degrees.

nshow (int, optional)

Number of showers to simulate. The Number of simulated events depends on the number of times a shower is re-used in the telescope simulation. The number provided here is before any reuse factors.

start_run (int, required)

Start run number such that the actual run number will be ‘start_run’ + ‘run’. This is useful in case a new transform is submitted for the same production. It allows the transformation system to keep using sequential run numbers without repetition.

run (int, required)

Run number (actual run number will be ‘start_run’ + ‘run’).

data_directory (str, optional)

The location of the output directories corsika-data and simtel-data. the label is added to the data_directory, such that the output will be written to data_directory/label/simtel-data.

pack_for_grid_register (bool, optional)

Set whether to prepare a tarball for registering the output files on the grid. The files are written to the output_path/directory_for_grid_upload directory.

log_level (str, optional)

Log level to print.

Example#

Run the application:

simtools-simulate-prod \
--production_config tests/resources/prod_multi_config_test.yml --model_version Prod5 \
--site north --primary gamma --azimuth_angle north --zenith_angle 20 \
--start_run 0 --run 1

By default the configuration is saved in simtools-output/test-production together with the actual simulation output in corsika-data and simtel-data within. The location of the latter directories can be set to a different location via the option –data_directory, but the label is always added to the data_directory, such that the output will be written to data_directory/label/simtel-data.

Expected final print-out message:

INFO::array_layout(l569)::read_telescope_list_file::Reading array elements from ...
WARNING::corsika_runner(l127)::_load_corsika_config_data::data_directory not given
in corsika_config - default output directory will be set.
INFO::array_layout(l569)::read_telescope_list_file::Reading array elements from ...
INFO::corsika_config(l493)::_set_output_file_and_directory::Creating directory
INFO::simulator(l405)::simulate::Submission command: local
INFO::simulator(l410)::simulate::Starting submission for 1 run
INFO::array_model(l315)::export_simtel_array_config_file::Writing array config file into
INFO::job_manager(l95)::submit::Submitting script
INFO::job_manager(l96)::submit::Job output stream
INFO::job_manager(l97)::submit::Job error stream
INFO::job_manager(l98)::submit::Job log stream
INFO::job_manager(l119)::_submit_local::Running script locally