Atmosphere

class showermodel.atmosphere.Atmosphere(h0=0.0, h_top=None, N_steps=550, atm_model=1, rho_w_sl=7.5e-06, h_scale=2.0)

Bases: DataFrame

DataFrame containing an atmosphere discretization.

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

Parameters:
  • h0 (float, default 0.0) – Ground level in km above sea level.

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

  • N_steps (int, default 550) – Number of discretization steps.

  • atm_model (int or DataFrame, default 1) – Atmospheric model assuming dry air. If an int value is given, atm_model is searched either from 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. 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.

h

Column 0, height in km above sea level.

Type:

float

X_vert

Column 1, vertical depth in g/cm^2.

Type:

float

rho

Column 2, mass density in g/cm^3.

Type:

float

temp

Column 3, temperature in K.

Type:

float

P

Column 4, pressure in hPa.

Type:

float

P_w

Column 5, partial pressure of water vapor in hPa.

Type:

float

E_th

Column 6, Cherenkov energy threshold in MeV at 350 nm.

Type:

float

r_M

Column 7, Moliere radius in km.

Type:

float

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

Xv_total

Total vertical depth of the atmosphere.

Type:

float

atm_model

Atmospheric model assuming dry air.

Type:

int or DataFrame

info

Information about the atmospheric model. Set to df if atm_model is a DataFrame.

Type:

str

rho_w_sl

Water-vapor density in g/cm^3 at sea level.

Type:

float

h_scale

Scale height in km used in the water-vapor exponential profile.

Type:

float

h_to_Xv()

Get vertical depth from height.

h_to_rho()

Get mass density from height.

Xv_to_h()

Get height from vertical depth.

Xv_to_rho()

Get density from vertical depth.

Xv_to_P()

Calculate pressure from vertical depth assuming constant acceleration of gravity.

P_to_Xv()

Calculate vertical depth from pressure assuming constant acceleration of gravity.

Xv_rho_to_P_T()

Calculate pressure and temperature from vertical depth and mass density assuming constant acceleration of gravity and an ideal gas.

See also

Track

DataFrame containing a shower track discretization.

Profile

DataFrame containing a shower profile discretization.

Shower

Make a discretization of a shower.

Methods:
Atmosphere.h_to_Xv(h)

Get vertical depth in g/cm^2 from height in km above sea level.

Parameters:

h (float or array_like) – Height in km.

Returns:

Xv

Return type:

float or array_like

Atmosphere.h_to_rho(h)

Get mass density in g/cm^3 from height in km above sea level.

Parameters:

h (float or array_like) – Height in km.

Returns:

rho

Return type:

float or array_like

Atmosphere.Xv_to_h(Xv)

Get height in km above sea level from vertical depth in g/cm^2.

Parameters:

Xv (float or array_like) – Vertical depth in g/cm^2. If is outside the range of column X_vert, return None.

Returns:

h

Return type:

float or array_like

Atmosphere.Xv_to_rho(Xv)

Get mass density in in g/cm^3 from vertical depth in g/cm^2.

Parameters:

Xv (float or array_like) – Vertical depth in g/cm^2. If is outside the range of column X_vert, return None.

Returns:

rho

Return type:

float or array_like

Atmosphere.Xv_to_P(Xv)

Calculate pressure from vertical depth assuming constant acceleration of gravity.

Parameters:

Xv (float or array_like) – Vertical depth in g/cm^2.

Returns:

P

Return type:

float or array_like

Atmosphere.P_to_Xv(P)

Calculate vertical depth from pressure assuming constant acceleration of gravity.

Parameters:

P (float or array_like) – Pressure in hPa.

Returns:

Xv

Return type:

float or array_like

Atmosphere.Xv_rho_to_P_T(Xv, rho)

Calculate pressure and temperature from vertical depth and mass density assuming constant acceleration of gravity and an ideal gas.

Parameters:

Xv (float or array_like) – Vertical depth in g/cm^2.

Returns:

  • P (float or array_like)

  • T (float or array_like)