smiet.corsika.generate_origin_library module

Container to generate origin showers and also copy relevant files.

class smiet.corsika.generate_origin_library.OriginLibraryGenerator(sim_primary: str = 'proton', sim_energy: float = 1e+17, atm_model: int = 17, site: str = 'lofar')

Bases: object

corsika_exec_hadr_label : dict = {'qgsjetII': 'QGSII', 'sibyll': 'SIBYLL'}

Class to generate the origin shower library using CORSIKA simulations.

generate_single_shower(sim_zenith: float, sim_xmax: float, n_nodes: int = 2, n_cores_per_node: int = 76, vxvxB: bool = True, sim_dir='./', sim_nr: int = 999999) str

Generate a single origin shower simulation. This is useful for testing and debugging purposes.

Parameters:
sim_zenith : float

Zenith angle in degrees.

sim_xmax : float

Xmax value in g/cm^2. n_nodes : int

Number of nodes to use for each simulation (default is 2).

n_cores_per_node : int

Number of cores per node (default is 76).

vxvxB : bool

Whether to only generate showers on the vxvxB axis or not. Default is True. Otherwise, a rotate starshape is used.

sim_dir : str

Directory where the simulation will be set up.

sim_nr : int, default=999999

Simulation number to use for the shower.

generate_submit_files(zenith_angles: tuple = (0, 63, 3), xmax_values: tuple = (600, 1300, 100), n_sims: int = 3, n_nodes: int = 2, n_cores_per_node: int = 76, vxvxB: bool = True) list

Generate steering files for CORSIKA simulations.

Parameters:
zenith_angles : tuple

Tuple specifying (min, max, step) for zenith angles in degrees. NOte that max should be less than 60 degrees, and include the step.

xmax_values : tuple

Tuple specifying (min, max, step) for Xmax values in g/cm^2. NOte that max should include the step.

n_sims : int, default=3

The number of times to repeat each simulation (default is 3). This is to ensure that we have enough statistics.

n_nodes : int

Number of nodes to use for each simulation (default is 2).

n_cores_per_node : int

Number of cores per node (default is 76).

vxvxB : bool

Whether to only generate showers on the vxvxB axis or not. Default is True. Otherwise, a rotated starshape is used.

Returns:

List of directories where simulations are set up.

Return type:

list

modify_input_file(inp_file: list, direct: str) list

Modify the input file to include direct and datdir commands.

Parameters:
inp_file : list

List of strings representing the lines of the input file.

Returns:

Modified list of strings for the input file.

Return type:

list

setup_paths(corsika_runner_path: str, run_dir: str, cluster_type: str = 'horeka', hadr_model: str = 'sibyll') None

Configure the paths for CORSIKA runner and run directory.

Parameters:
corsika_runner_path : str

Path to the CORSIKA runner executable.

run_dir : str

Directory where the CORSIKA simulations will be run and saved.

cluster_type : str, default="horeka"

Type of cluster that the jobs are submitted into.

The submit scripts should be placed in the submit_templates directory, with the naming scheme submit_{cluster_type}.sh.

Currently only “horeka” is supported.

hadr_model : str, default="sibyll"

Hadronic interaction model used for the fitting functions. Currently only “sibyll” and “qgsjetII” are supported.

submit_jobs(sim_rundirs: list) None

Submit the generated jobs to the SLURM scheduler.

Parameters:
sim_rundirs : list

List of directories where simulations are set up.