Simulator#

Base modules for calling external simulation software.

simulator#

Simulator class for managing simulations of showers and array of telescopes.

exception simulator.InvalidRunsToSimulateError[source]#

Exception for invalid runs to simulate.

class simulator.Simulator(args_dict, label=None, extra_commands=None, mongo_db_config=None)[source]#

Simulator is managing the simulation of showers and of the array of telescopes.

It interfaces with simulation software packages (e.g., CORSIKA or sim_telarray).

The configuration is set as a dict corresponding to the command line configuration groups (especially simulation_software, simulation_model, simulation_parameters).

Parameters:
args_dictdict

Configuration dictionary (includes simulation_software, simulation_model, simulation_parameters groups).

label: str

Instance label.

extra_commands: str or list of str

Extra commands to be added to the run script before the run command.

mongo_db_config: dict

MongoDB configuration.

get_file_list(file_type='output')[source]#

Get list of files generated by simulations.

Options are “input”, “output”, “hist”, “log”, “corsika_log”. Not all file types are available for all simulation types. Returns an empty list for an unknown file type.

Parameters:
file_typestr

File type to be listed.

Returns:
list

List with the full path of all output files.

pack_for_register(directory_for_grid_upload=None)[source]#

Pack simulation output files for registering on the grid.

Parameters:
directory_for_grid_upload: str

Directory for the tarball with output files.

print_list_of_files(file_type='output')[source]#

Print list of output files generated by simulations.

Options are “input”, “output”, “hist”, “log”.

Parameters:
file_typestr

File type to be listed.

resources(input_file_list=None)[source]#

Print a simple report on computing resources used.

Includes run time per run only at this point.

Parameters:
input_file_list: str or list of str

Single file or list of files of shower simulations.

save_file_lists()[source]#

Save files lists for output and log files.

simulate(input_file_list=None)[source]#

Submit a run script as a job.

Parameters:
input_file_list: str or list of str

Single file or list of files of shower simulations.

property simulation_software#

The attribute simulation_software.