Skip to content

This project provides a Python framework for running single-telescope CORSIKA simulations, allows users to parse the resulting particle track and Cherenkov photon information as pandas DataFrames, and generate visualizations of the simulated particle tracks and Cherenkov photon distributions.

Notifications You must be signed in to change notification settings

jschaefer-hub/ShowerPy

Repository files navigation

ShowerPy Logo

Overview

ShowerPy is a set of Python classes that provides users with a simple interface to create single-shower CORSIKA simulations, extract full particle track information, and generate shower plots.
Shower Image

All data is available as pandas DataFrames, allowing you to create custom plots and perform detailed analysis. A quick overview of the workflow is shown below

software flowchart `

Attribution

The ShowerPy classes use pyeventio and pycorsikaio to load the fortran files produced by CORSIKA. Further, demo install on woodycap uses CORSIKA 7.8000 (Released February 2025). For more information visit the official website. You can also cite the showerpy releases using the Zenodo DOI.

1. Getting Started

First, create and activate the showerpy mamba environment using the following commands:

mamba env create -f environment.yml
mamba activate showerpy

Then, open the demo notebook Demo.ipynb, which provides an introduction to using ShowerPy.

2. Simulating Showers

As shown in the demo notebook, the CorsikaRunner class is used to generate the necessary simulations. If you’re running the demo on woodycap5 or woodycap6, no additional setup is required, as the CORSIKA executable points to a public installation.

3. Compiling CORSIKA

If you want to simulate showers locally, please first register as a new CORSIKA user. After registering, you will receive login credentials to download CORSIKA. Once downloaded, unpack the archive using:

tar -xzf corsika*

Installing Dependencies

To compile CORSIKA, you need to install GFortran on your machine.

Running the Configuration Tool

In the root of the extracted directory, run the following command:

./coconut -e

(The -e flag enters expert mode.)

You will then be prompted for different compile-time options. Select the following options in order, pressing Enter after each selection:

  1. Compiler Selection: 2 (compiler default)
  2. High-Energy Hadronic Interaction Model: 3 (QGSJETIII-01)
    -> You can also switch to a different model depending on your use case. Please note that when using EPOS, a modification to the input_template is required.
  3. Low-Energy Hadronic Interaction Model: 3 (URQMD 1.3cr)
  4. Date and time routine: 1 (automatic detection by configure)
  5. Detector Geometry: 2 (non-flat volume detector geometry)

Enabling Additional CORSIKA Program Options

Next, you will arrive at the selection for additional CORSIKA program options. Please type the following string into the prompt:

1b 8a 9a

These will configure the use of Konrad Bernlöhr's IACT routines (1b), the compilation of the PLOTSH script (8a), and the use of an external atmosphere profile (9a).

You will then proceed to configure these options:

  1. Particles at detector level not stored in IACT file: 1
  2. Photons counted only in step where emitted: 1
  3. Emission angle depending on wavelength: 2

After this, press Enter to compile the plottracks script (PLOTSH).

Then, press Enter again and confirm with yes to accept the selected CORSIKA program options.

Please Note:

  • If you are re-running coconut, the settings used for the previous compilation are cached. You can automatically select them by pressing Enter.
  • If you want to start fresh, you can disable cached options using ./coconut --no-cached -e.

Compilation

Finally, to begin the compilation process select f and press Enter again.

To test the successful compilation you can execute the binary ./run/corsika78000Darwin_QGSIII_urqmd. If you are greeted with the CORSIKA message, everything has compiled successfully.

4. Atmospheric profile

By default, the internal atmospheric profile is used. If you want to use an external, site-specific profile, you can specify this when configuring the simulation run (see demo notebook). For H.E.S.S. members and CTA members, such files (e.g., atmprof10.dat) are provided and are typically based on local balloon flight measurements.

About

This project provides a Python framework for running single-telescope CORSIKA simulations, allows users to parse the resulting particle track and Cherenkov photon information as pandas DataFrames, and generate visualizations of the simulated particle tracks and Cherenkov photon distributions.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published