MSIS00Atmosphere#

class MCEq.geometry.density_profiles.MSIS00Atmosphere(location, season=None, doy=None, use_loc_altitudes=False)[source]#

Bases: EarthsAtmosphere

Wrapper class for a python interface to the NRLMSISE-00 model.

NRLMSISE-00 is an empirical model of the Earth’s atmosphere. It is available as a FORTRAN 77 code or as a verson traslated into C by Dominik Borodowski. Here a PYTHON wrapper has been used.

_msis#

NRLMSISE-00 python wrapper object handler

Parameters:
  • location (str) – see init_parameters()

  • season (str,optional) – months (January, February, etc.)

  • doy (int, optional) – day of year

Attributes Summary

max_X

Depth at altitude 0.

max_den

Density at altitude 0.

s_X2rho

Spline for conversion from depth to density.

s_h2X

Spline for conversion from altitude to depth.

s_lX2h

Spline for conversion from depth to altitude.

Methods Summary

X2h(X)

Returns the height above surface as a function of slant depth for currently selected zenith angle.

X2rho(X)

Returns the density \(\rho(X)\).

calculate_density_spline([n_steps])

Calculates and stores a spline of \(\rho(X)\).

gamma_cherenkov_air(h_cm)

Returns the Lorentz factor gamma of Cherenkov threshold in air (MeV).

get_density(h_cm)

Returns the density of air in g/cm**3.

get_temperature(h_cm)

Returns the temperature of air in K.

h2X(h)

Returns the depth along path as function of height above surface.

init_parameters(location, season, doy, ...)

Sets location and season in NRLMSISE-00.

moliere_air(h_cm)

Returns the Moliere unit of air for US standard atmosphere.

nref_rel_air(h_cm)

Returns the refractive index - 1 in air (density parametrization as in CORSIKA).

r_X2rho(X)

Returns the inverse density \(\frac{1}{\rho}(X)\).

set_doy(day_of_year)

Changes MSIS season by day of year.

set_h_obs(h_obs)

Set the elevation of the observation (detector) level in cm.

set_location(location)

Changes MSIS location by strings defined in _msis_wrapper.

set_location_coord(longitude, latitude)

Changes MSIS location by longitude, latitude in _msis_wrapper

set_season(month)

Changes MSIS location by month strings defined in _msis_wrapper.

set_theta(theta_deg)

Configures geometry and initiates spline calculation for \(\rho(X)\).

theta_cherenkov_air(h_cm)

Returns the Cherenkov angle in air (degrees).

update_parameters(**kwargs)

Updates parameters of the density model

Attributes Documentation

max_X#

Depth at altitude 0.

max_den#

Density at altitude 0.

s_X2rho#

Spline for conversion from depth to density.

s_h2X#

Spline for conversion from altitude to depth.

s_lX2h#

Spline for conversion from depth to altitude.

Methods Documentation

X2h(X)#

Returns the height above surface as a function of slant depth for currently selected zenith angle.

The spline s_lX2h is used, which was calculated or retrieved from cache during the set_theta() call.

Parameters:

X (float) – slant depth in g/cm**2

Returns:

height above surface in cm

Return type:

float h

X2rho(X)#

Returns the density \(\rho(X)\).

The spline s_X2rho is used, which was calculated or retrieved from cache during the set_theta() call.

Parameters:

X (float) – slant depth in g/cm**2

Returns:

\(\rho\) in cm**3/g

Return type:

float

calculate_density_spline(n_steps=2000)#

Calculates and stores a spline of \(\rho(X)\).

Parameters:

n_steps (int, optional) – number of \(X\) values to use for interpolation

Raises:

Exception – if set_theta() was not called before.

gamma_cherenkov_air(h_cm)#

Returns the Lorentz factor gamma of Cherenkov threshold in air (MeV).

get_density(h_cm)[source]#

Returns the density of air in g/cm**3.

Wraps around ctypes calls to the NRLMSISE-00 C library.

Parameters:

h_cm (float) – height in cm

Returns:

density \(\rho(h_{cm})\) in g/cm**3

Return type:

float

get_temperature(h_cm)[source]#

Returns the temperature of air in K.

Wraps around ctypes calls to the NRLMSISE-00 C library.

Parameters:

h_cm (float) – height in cm

Returns:

density \(T(h_{cm})\) in K

Return type:

float

h2X(h)#

Returns the depth along path as function of height above surface.

The spline s_X2rho is used, which was calculated or retrieved from cache during the set_theta() call.

Parameters:

h (float) – vertical height above surface in cm

Returns:

X slant depth in g/cm**2

Return type:

float

init_parameters(location, season, doy, use_loc_altitudes)[source]#

Sets location and season in NRLMSISE-00.

Translates location and season into day of year and geo coordinates.

Parameters:
  • location (str) – Supported are “SouthPole” and “Karlsruhe”

  • season (str) – months of the year: January, February, etc.

  • use_loc_altitudes (bool) – If to use default altitudes from location

moliere_air(h_cm)#

Returns the Moliere unit of air for US standard atmosphere.

nref_rel_air(h_cm)#

Returns the refractive index - 1 in air (density parametrization as in CORSIKA).

r_X2rho(X)#

Returns the inverse density \(\frac{1}{\rho}(X)\).

The spline s_X2rho is used, which was calculated or retrieved from cache during the set_theta() call.

Parameters:

X (float) – slant depth in g/cm**2

Returns:

\(1/\rho\) in cm**3/g

Return type:

float

set_doy(day_of_year)[source]#

Changes MSIS season by day of year.

Parameters:

day_of_year (int) –

  1. Jan.=0, 1.Feb=32

set_h_obs(h_obs)#

Set the elevation of the observation (detector) level in cm.

set_location(location)[source]#

Changes MSIS location by strings defined in _msis_wrapper.

Parameters:

location (str) – location as defined in NRLMSISE-00.

set_location_coord(longitude, latitude)[source]#

Changes MSIS location by longitude, latitude in _msis_wrapper

Parameters:
  • longitude (float) – longitude of the location with abs(longitude) <= 180

  • latitude (float) – latitude of the location with abs(latitude) <= 90

set_season(month)[source]#

Changes MSIS location by month strings defined in _msis_wrapper.

Parameters:

location (str) – month as defined in NRLMSISE-00.

set_theta(theta_deg)#

Configures geometry and initiates spline calculation for \(\rho(X)\).

If the option ‘use_atm_cache’ is enabled in the config, the function will check, if a corresponding spline is available in the cache and use it. Otherwise it will call calculate_density_spline(), make the function r_X2rho() available to the core code and store the spline in the cache.

Parameters:

theta_deg (float) – zenith angle \(\theta\) at detector

theta_cherenkov_air(h_cm)#

Returns the Cherenkov angle in air (degrees).

update_parameters(**kwargs)[source]#

Updates parameters of the density model

Parameters:
  • location_coord (tuple of str) – (longitude, latitude)

  • season (str) – months of the year: January, February, etc.

  • doy (int) – day of the year. ‘doy’ takes precedence over ‘season’ if both are set