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, N_ch_max=None, X0_GH=None, lambda_GH=None, atmosphere=None, **kwargs)

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) – Energy of the primary particle in MeV.

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

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

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

  • x0 (float) – East and north coordinates in km of shower impact point at ground.

  • y0 (float) – East and north coordinates in km of shower impact point at ground.

  • xi (float, default None) – East, north and height coordinates in km of the first interaction point of the shower. If given, x0 and y0 are ignored.

  • yi (float, default None) – East, north and height coordinates in km of the first interaction point of the shower. If given, x0 and y0 are ignored.

  • zi (float, default None) – East, north and height coordinates in km of the first interaction point of the shower. If given, x0 and y0 are ignored.

  • prf_model ('Greisen', 'Gaisser-Hillas' or DataFrame) – 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 with an energy deposit profile is input, it must have two columns with the slant depth in g/cm2 and dE/dX in MeV.cm2/g.

  • X_max (float) – 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 used. If None and a numerical energy deposit profile is input, lambda_r = 36.7 g/cm^2 is the radiation length E_c = 81 MeV is the critical energy.

  • X0_GH (float) – 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) – 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) – If None, a new Atmosphere object is generated.

  • **kwargs ({h0, h_top, N_steps, model}) – Options to construct the new Atmosphere object when atmosphere==None. If None, the default Atmosphere object is used.

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

model

CORSIKA atmospheric model. Presently either 1 or 17. More models to be implemented.

Type

int

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) – Telescope object to be used.

Returns

  • projection (Projection)

  • (ax1, ax2) (AxesSubplot)

See also

Projection.show

Shower.Signal(telescope, atm_trans=True, tel_eff=True, **kwargs)

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

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.

  • **kwargs ({wvl_ini, wvl_fin, wvl_step}) – These parameters will modify the wavelength interval when tel_eff==False. If None, the wavelength interval defined in the telescope is used.

Returns

signal

Return type

Signal

Shower.Event(observatory, atm_trans=True, tel_eff=True, **kwargs)

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) – Observatory object (may be a Grid object).

  • atm_trans (bool, default True) – Include the atmospheric transmision 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.

  • **kwargs ({wvl_ini, wvl_fin, wvl_step}) – These parameters will modify the wavelenght interval when tel_eff==False. If None, the wavelength interval defined in the telescope is used.

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_size=True, axes=True, max_theta=30.0, X_mark='X_max')

Make a Projection object and show it.

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

  • shower_size (bool, default True) – Make the radii of the shower track points proportional to the shower size.

  • 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 ma ked in the figure, default X_max. If X_mark=None, no mark is included.

Returns

  • projection (Projection)

  • (ax1, ax2) (PolarAxesSubpot)

See also

Projection.show

Shower.show_signal(telescope, atm_trans=True, tel_eff=True, **kwargs)

Make a Signal object and show it.

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

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

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

  • **kwargs ({wvl_ini, wvl_fin, wvl_step}) – These parameters will modify the wavelenght interval when tel_eff==False. If None, the wavelength interval defined in the telescope is used.

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_size=True, tel_index=False)

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

Parameters
  • x_min (float) – Lower limit of the coordinate x in km.

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

  • y_min (float) – Lower limit of the coordinate y in km.

  • y_max (float) – 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, default to X_max. If X_mark is set to None, no mark is included.

  • shower_size (bool, default True) – Make the radii of the shower track points proportional to the shower size.

  • 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_size=True, xy_proj=True, pointing=False)

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

Parameters
  • x_min (float) – Lower limit of the coordinate x in km.

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

  • y_min (float) – Lower limit of the coordinate y in km.

  • y_max (float) – 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, default to X_max. If X_mark is set to None, no mark is included.

  • shower_size (bool, default True) – Make the radii of the shower track points proportional to the shower size.

  • 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, x_c=0.0, y_c=0.0, z_c=0.0, theta=None, alt=None, az=None, size_x=2.0, size_y=2.0, N_x=10, N_y=10, atm_trans=True, tel_eff=False, **kwargs)

Make a GridEvent 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) – If None, a new Grid object is generated from the specificed dimensions and telescope characteristics. If given, {telescope, tel_type, …, N_x, N_y} are not used.

  • telescope (Telescope) – When grid==None. If telescope==None, the Grid object is constructed based on the default GridElement object.

  • x_c (float) – x coordinate in km of the center of the grid.

  • y_c (float) – y coordinate in km of the center of the grid.

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

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

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

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

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

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

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

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

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

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

  • **kwargs ({wvl_ini, wvl_fin, wvl_step}) – These parameters will modify the wavelenght interval when tel_eff==False. If None, the wavelength interval defined in the telescope is used.

Returns

  • grid_event (GridEvent)

  • ax (AxesSubplot) – If 1D grid.

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