Shower

class showermodel.shower.Shower(E=10000000.0, theta=0.0, alt=None, az=0.0, x0=0.0, y0=0.0, xi=0.0, yi=0.0, zi=None, prf_model='Greisen', X_max=None, X0_GH=None, lambda_GH=None, atmosphere=None, h0=0.0, h_top=None, N_steps=550, atm_model=1, rho_w_sl=7.5e-06, h_scale=2.0)

Bases: object

Object containing a discretization of a shower.

It includes the atmosphere, both the track and profile of the shower as well as its fluorescence and Cherenkov light production.

Use sm.Shower() to construct the default Shower object.

Parameters:
  • E (float, default 10000000) – Energy of the primary particle in MeV.

  • theta (float, default 0) – Zenith angle in degrees of the apparent position of the source.

  • alt (float, default None) – Altitude in degrees of the apparent position of the source. If None, theta is used. If given, theta is overwritten.

  • az (float, default 0) – Azimuth angle (from north, clockwise) in degrees of the apparent position of the source.

  • x0 (float, default 0) – East coordinate in km of shower impact point at ground.

  • y0 (float, default 0) – North coordinate in km of shower impact point at ground.

  • xi (float, default 0) – East coordinate in km of the first interaction point of the shower. If zi==None, xi and yi are ignored and the shower impacts at (x0, y0) on ground. If zi is given, x0 and y0 are ignored and the shower starts at (xi,yi,zi).

  • yi (float, default 0) – North coordinate in km of the first interaction point of the shower. If zi==None, xi and yi are ignored and the shower impacts at (x0, y0) on ground. If zi is given, x0 and y0 are ignored and the shower starts at (xi,yi,zi).

  • zi (float, default None) – Height in km of the first interaction point of the shower. If zi==None, xi and yi are ignored and the shower impacts at (x0, y0) on ground. If zi is given, x0 and y0 are ignored and the shower starts at (xi,yi,zi).

  • prf_model ('Greisen', 'Gaisser-Hillas' or DataFrame, default 'Greisen') – Profile model to be used. If ‘Greisen’, the Greisen function for electromagnetic showers is used. If ‘Gaisser-Hillas’, the Gaisser-Hillas function for hadron-induced showers is used. If a DataFrame is given, it should have two columns, the first one with the slant depth in g/cm2 and the second one with dE/dX in MeV.cm2/g..

  • X_max (float, default None) – Slant depth in g/cm^2 at shower maximum. If None and prf_model is ‘Greisen’ or ‘Gaisser-Hillas’, a typical value of X_max for gamma or proton showers is calculated from the radiation length lambda_r = 36.7 g/cm^2 and the critical energy E_c = 81 MeV.

  • X0_GH (float, default None) – X0 parameter in g/cm2 to be used when prf_model==’Gaisser- Hillas’. If None, a typical value for the input energy is used.

  • lambda_GH (float, default None) – Lambda parameter in g/cm2 to be used when prf_model==’Gaisser- Hillas’. If None, a typical value for the input energy is used.

  • atmosphere (Atmosphere, default None) – Atmosphere object to be used. If None, a new Atmosphere object is generated. If given, h0, h_top, N_steps, atm_model, rho_w_sl and h_scale are ignored.

  • h0 (float, default 0.0) – Ground level in km above sea level for the atmosphere discretization to be generated when atmosphere==None.

  • h_top (float or None, default None) – Upper limit in km above sea level for the atmosphere discretization to be generated when atmosphere==None. If h_top is None, the top level of the selected atmospheric model is taken.

  • N_steps (int, default 550) – Number of discretization steps for the atmosphere discretization to be generated when atmosphere==None.

  • atm_model (int or DataFrame, default 1) – Atmospheric model used when atmosphere==None. If an int value is given, atm_model is searched from either CORSIKA atmospheric models (from 1 to 29) or a file named atm_models.toml in the working directory containing user-defined models. If a DataFrame is given, it should have two columns, one labelled as h with height in km and other labelled as X_vert or P, depending on whether vertical depth in g/cm^2 or pressure in hPa is given.

  • rho_w_sl (float, default 7.5e-6) – Water-vapor density in g/cm^3 at sea level to calculate a simple exponential profile of water-vapor when atmosphere==None. Set to zero if dry air is assumed.

  • h_scale (float, default 2.0) – Scale height in km to be used in the water-vapor exponential profile when atmospere==None.

atmosphere

Atmosphere object that is used.

Type:

Atmosphere

h0

Ground level in km above sea level.

Type:

float

h_top

Top level of the atmosphere in km above sea level.

Type:

float

N_steps

Number of discretization steps.

Type:

int

h_step

Size of discretization step in km.

Type:

float

atm_model

Atmospheric model.

Type:

int or DataFrame

track

Track object that is generated.

Type:

Track

profile

Profile object that is generated.

Type:

Profile

E

Energy of the primary particle in MeV.

Type:

float

theta

Zenith angle in degrees of the apparent position of the source.

Type:

float

alt

Altitude in degrees of the apparent position of the source.

Type:

float

az

Azimuth angle (from north, clockwise) in degrees of the apparent position of the source.

Type:

float

x0, y0, z0

Coordinates in km of shower impact point at ground (z0=0). Set to None for ascending showers beginning at zi>0.

Type:

float or None

xi, yi, zi

Coordinates in km of the first interaction point of the shower.

Type:

float

prf_model
Type:

‘Greisen’, ‘Gaisser-Hillas’ or DataFrame.

X_max

Slant depth in g/cm^2 at shower maximum.

Type:

float

X0_GH

X0 parameter in g/cm2 for prf_model==’Gaisser-Hillas’.

Type:

float

lambda_GH

Lambda parameter in g/cm2 for prf_model==’Gaisser-Hillas’.

Type:

float

fluorescence

Fluorescence object that is generated.

Type:

Fluorescence

cherenkov

Cherenkov object that is generated.

Type:

Cherenkov

copy()

Copy a Shower object, but with optional changes.

Projection()

Make a Projection object containing the coordinates of a shower track relative to a telescope position.

Signal()

Make a Signal object containing the signal produced by the shower detected by a telescope.

Event()

Make an Event object containing the characteristics of the shower, an observatory and the signal produced by the shower in each telescope.

show_profile()

Show the shower profile, both number of charged particles and energy deposit, as a function of slant depth.

show_light_production()

Show the production of both Cherenkov and fluorescence photons as a function of slant depth.

show_projection()

Make a Projection object and show it.

show_signal()

Make a Signal object and show it.

show_geometry2D()

Show a 2D plot of the shower track and input telescope positions.

show_geometry3D()

Show a 3D plot of the shower track and input telescopes positions.

show_distribution()

Make a GridEvent object and show the distribution of photons per m^2 in a 1D or 2D plot.

See also

Atmosphere

DataFrame containing the atmosphere discretization.

Track

DataFrame containing a shower track discretization.

Profile

DataFrame containing a shower profile discretization.

Methods:
Shower.copy(**kwargs)

Copy a Shower object, but with optional changes.

Parameters:

**kwargs – Optional key arguments to be passed to the constructors of the different attributes of the Shower object.

Returns:

shower

Return type:

Shower

See also

Shower

Make a discretization of a shower.

Shower.Projection(telescope)

Obtain the coordinates of a shower track relative to a telescope position in both zenith and camera projection and determine the fraction of the track within the telescope field of view.

Parameters:

telescope (Telescope, mandatory) – Telescope object to be used.

Returns:

  • projection (Projection)

  • (ax1, ax2) (AxesSubplot)

See also

Projection.show

Shower.Signal(telescope, atm_trans=True, tel_eff=True, wvl_ini=290.0, wvl_fin=430.0, wvl_step=3.0)

Calculate the signal produced by the shower detected by a telescope.

Parameters:
  • telescope (Telescope, mandatory) – Telescope object to be used.

  • atm_trans (bool, default True) – Include the atmospheric transmission.

  • tel_eff (bool, default True) – Include the telescope efficiency. If False, 100% efficiency is assumed for a given wavelength interval.

  • wvl_ini (float, default 290) – Initial wavelength in nm of the interval to calculate the signal when tel_eff==False.

  • wvl_fin (float, default 430) – Final wavelength in nm of the interval to calculate the signal when tel_eff==False.

  • wvl_step (float, default 3) – Discretization step in nm of the interval to calculate the signal when tel_eff==False.

Returns:

signal

Return type:

Signal

Shower.Event(observatory, atm_trans=True, tel_eff=True, wvl_ini=290.0, wvl_fin=430.0, wvl_step=3.0)

Make an Event object containing the characteristics of a shower, an observatory and the signal produced by the shower in each telescope.

Parameters:
  • observatory (Observatory, mandatory) – Observatory object (may be a Grid object).

  • atm_trans (bool, default True) – Include the atmospheric transmission to calculate the signals.

  • tel_eff (bool, default True) – Include the telescope efficiency to calculate the signals. If False, 100% efficiency is assumed for a given wavelength interval.

  • wvl_ini (float, default 290) – Initial wavelength in nm of the interval to calculate the signal when tel_eff==False.

  • wvl_fin (float, default 430) – Final wavelength in nm of the interval to calculate the signal when tel_eff==False.

  • wvl_step (float, default 3) – Discretization step in nm of the interval to calculate the signal when tel_eff==False.

Returns:

event

Return type:

Event

Shower.show_profile()

Show the shower profile, both number of charged particles and energy deposit, as a function of slant depth.

Returns:

(ax1, ax2)

Return type:

AxesSubplot

Shower.show_light_production()

Show the production of both Cherenkov and fluorescence photons in the 290 - 430 nm range as a function of slant depth.

Returns:

(ax1, ax2)

Return type:

AxesSubplot

Shower.show_projection(telescope, shower_Edep=True, axes=True, max_theta=30.0, X_mark='X_max')

Make a Projection object and show it.

Parameters:
  • telescope (Telescope, mandatory) – Telescope object to be used.

  • shower_Edep (bool, default True) – Make the radii of the shower track points proportional to the energy deposited in each step length.

  • axes (bool, default True) – Show the axes of both frames of reference.

  • max_theta (float, default 30 degrees) – Maximum offset angle in degrees relative to the telescope pointing direction.

  • X_mark (float) – Reference slant depth in g/cm^2 of the shower track to be marked in the figure. If set to None, no mark is included. By default, the mark is placed at X_max.

Returns:

  • projection (Projection)

  • (ax1, ax2) (PolarAxesSubpot)

See also

Projection.show

Shower.show_signal(telescope, atm_trans=True, tel_eff=True, wvl_ini=290.0, wvl_fin=430.0, wvl_step=3.0)

Make a Signal object and show it.

Parameters:
  • telescope (Telescope) – Telescope object to be used.

  • atm_trans (bool, default True) – Include the atmospheric transmission.

  • tel_eff (bool, default True) – Include the telescope efficiency. If False, 100% efficiency is assumed for a given wavelength interval.

  • wvl_ini (float, default 290) – Initial wavelength in nm of the interval to calculate the signal when tel_eff==False.

  • wvl_fin (float, default 430) – Final wavelength in nm of the interval to calculate the signal when tel_eff==False.

  • wvl_step (float, default 3) – Discretization step in nm of the interval to calculate the signal when tel_eff==False.

Returns:

  • signal (Signal)

  • (ax1, ax2) (AxesSubplot)

Shower.show_geometry2D(observatory, x_min=-1.0, x_max=1.0, y_min=-1, y_max=1.0, X_mark='X_max', shower_Edep=True, tel_index=False)

Show the shower track together with the telescope positions in a 2D plot.

Parameters:
  • x_min (float, default -1) – Lower limit of the coordinate x in km.

  • x_max (float, default 1) – Upper limit of the coordinate x in km.

  • y_min (float, default -1) – Lower limit of the coordinate y in km.

  • y_max (float, default 1) – Upper limit of the coordinate y in km.

  • X_mark (float) – Reference slant depth in g/cm^2 of the shower track to be marked in the figure. By default, the mark is placed at X_max.

  • shower_Edep (bool, default True) – Make the radii of the shower track points proportional to the energy deposited in each step length.

  • tel_index (bool, default True) – Show the telescope indexes together the telescope position points.

Returns:

ax

Return type:

AxesSubplot

Shower.show_geometry3D(observatory, x_min=-1.0, x_max=1.0, y_min=-1, y_max=1.0, X_mark='X_max', shower_Edep=True, xy_proj=True, pointing=False)

Show the shower track together with the telescope positions in a 3D plot.

Parameters:
  • x_min (float, default -1) – Lower limit of the coordinate x in km.

  • x_max (float, default 1) – Upper limit of the coordinate x in km.

  • y_min (float, default -1) – Lower limit of the coordinate y in km.

  • y_max (float, default 1) – Upper limit of the coordinate y in km.

  • X_mark (float) – Reference slant depth in g/cm^2 of the shower track to be marked in the figure. By default, the mark is placed at X_max.

  • shower_Edep (bool, default True) – Make the radii of the shower track points proportional to the energy deposited in each step length.

  • xy_proj (bool, default True) – Show the xy projection of the shower track.

  • pointing (bool, default False) – Show the telescope axes.

Returns:

ax

Return type:

Axes3DSubplot

Shower.show_distribution(grid=None, telescope=None, tel_type='GridElement', x_c=0.0, y_c=0.0, z_c=0.0, size_x=2.0, size_y=2.0, N_x=10, N_y=10, theta=0.0, alt=None, az=0.0, atm_trans=True, tel_eff=False, wvl_ini=290.0, wvl_fin=430.0, wvl_step=3.0)

Make an Event from a Grid object and show the distribution of photons (or photoelectrons) per m^2 in an either 1D or 2D plot, depending on the grid dimensions.

Parameters:
  • grid (Grid or None, default None) – Grid object to generate the distribution. If None, a new Grid object is generated from the specified dimensions and the characteristics of the telescope. If given, telescope, size_x, size_y, N_x, N_y are not used.

  • telescope (Telescope, default None) – Telescope object to be used to construct the grid. If None, the given tel_type telescope is used.

  • tel_type (str, default 'GridElement') – Type of telescope to be used when telescope==None.

  • x_c (float, default 0) – East coordinate in km of the center of the grid.

  • y_c (float, default 0) – North coordinate in km of the center of the grid.

  • z_c (float, default 0) – Height of the grid in km above ground level.

  • size_x (float, defaut 2) – Size of the grid in km across the x direction.

  • size_y (float, default 2) – Size of the grid in km across the y direction.

  • N_x (int, default 10) – Number of cells across the x direction.

  • N_y (int, default 10) – Number of cells across the y direction.

  • theta (float, default 0) – Zenith angle in degrees of the telescope pointing directions.

  • alt (float, default None) – Altitude in degrees of the telescope pointing directions. If None, theta is used. If given, theta is overwritten.

  • az (float, default 0) – Azimuth angle (from north, clockwise) in degrees of the telescope pointing directions.

  • atm_trans (bool, default True) – Include the atmospheric transmission to transport photons.

  • tel_eff (bool, default False) – Include the telescope efficiency to calculate the signal. If False, 100% efficiency is assumed for a given wavelenght interval.

  • wvl_ini (float, default 290) – Initial wavelength in nm of the interval to calculate the signal when tel_eff==False.

  • wvl_fin (float, default 430) – Final wavelength in nm of the interval to calculate the signal when tel_eff==False.

  • wvl_step (float, default 3) – Discretization step in nm of the interval to calculate the signal when tel_eff==False.

Returns:

  • grid_event (Event)

  • ax (AxesSubplot) – If 1D grid.

  • (ax1, ax2, cbar) (AxesSubplot and Colorbar) – If 2D grid.