Reference#

constants#

Constants module.

As much as possible, constants’ names are chosen to be as close as possible to the notations used in [NNU76].

Notes

Constants’ values are evaluated in the following set of units: * length: meter * time: second * mass: kilogram * temperature: kelvin * quantity of matter: mole

Note the following derived units: * 1 Pa = 1 kg * m^-1 * s^-2 * 1 Joule = 1 kg * m^2 * s^-2

ussa1976.constants.A = {'Ar': 4.487e+20, 'H': 3.305e+21, 'He': 1.7e+21, 'O': 6.986e+20, 'O2': 4.863e+20}#

Thermal diffusion coefficients [m * s^-1].

ussa1976.constants.ALPHA = {'Ar': 0.0, 'H': -0.25, 'He': -0.4, 'N2': 0.0, 'O': 0.0, 'O2': 0.0}#

Thermal diffusion constants above 86 km [dimensionless].

ussa1976.constants.AR_7 = 1.3514e+18#

Argon number density at altitude Z7 [m^-3].

ussa1976.constants.B = {'Ar': 0.87, 'H': 0.5, 'He': 0.691, 'O': 0.75, 'O2': 0.75}#

Thermal diffusion constants [dimensionless].

ussa1976.constants.BETA = 1458000.0#

\(\beta\) constant in eq. 51 of [NNU76] [kg * m^-1 * s^-1 * K^-0.5].

ussa1976.constants.F = {'Ar': 0.00934, 'CH4': 2e-06, 'CO2': 0.000314, 'H2': 5e-07, 'He': 5.24e-06, 'Kr': 1.14e-06, 'N2': 0.78084, 'Ne': 1.818e-05, 'O2': 0.209476, 'Xe': 8.7e-08}#

Sea level volume fractions below 86 km [dimensionless].

ussa1976.constants.G0 = 9.80665#

Sea level gravity [m / s^-2].

ussa1976.constants.GAMMA = 1.4#

Ratio of specific heat of air at constant pressure to the specific heat of air at constant volume [dimensionless].

ussa1976.constants.H: ndarray[Any, dtype[float64]] = array([    0.  , 11000.  , 20000.  , 32000.  , 47000.  , 51000.  ,        71000.  , 84852.05])#

Geopotential altitudes of the layers’ boundaries (below 86 km) [m].

ussa1976.constants.HE_7 = 758170000000000.0#

Helium number density at altitude Z7 [m^-3].

Notes

Assumes typo at page 13.

ussa1976.constants.H_11 = 80000000000.0#

Hydrogen number density at altitude Z7 [m^-3].

ussa1976.constants.K = 1.380622e-23#

Boltzmann constant [J * K^-1].

ussa1976.constants.K_7 = 120.0#

Eddy diffusion coefficients [m^2 * s^-1].

ussa1976.constants.LAMBDA = 1.875e-05#

\(\lambda\) constant in eq. 32 of [NNU76] [m^-1].

ussa1976.constants.LK: ndarray[Any, dtype[float64]] = array([-0.0065,  0.    ,  0.001 ,  0.0028,  0.    , -0.0028, -0.002 ])#

Temperature gradients in the seven layers (below 86 km) [K * m^-1].

ussa1976.constants.LK7 = 0.0#

Temperature gradient in the 8th layer [K * m^-1].

ussa1976.constants.LK9 = 0.012#

Temperature gradient in the 10th layer [K * m^-1].

ussa1976.constants.M = {'Ar': 0.039948, 'CH4': 0.01604303, 'CO2': 0.04400995, 'H': 0.00100797, 'H2': 0.00201594, 'He': 0.0040026, 'Kr': 0.0838, 'N2': 0.0280134, 'Ne': 0.020183, 'O': 0.01599939, 'O2': 0.0319988, 'Xe': 0.1313}#

Molar masses of the individual species [kg * mole^-1].

ussa1976.constants.M0 = 0.028964425278793997#

Sea level mean air molar mass [kg * mole^-1].

ussa1976.constants.N2_7 = 1.129794e+20#

Molecular nitrogen number density at altitude Z7 [m^-3].

ussa1976.constants.NA = 6.022169e+23#

Avogadro number [mole^-1].

ussa1976.constants.O2_7 = 3.030898e+19#

Molecular oxygen number density at altitude Z7 [m^-3].

ussa1976.constants.O_7 = 8.6e+16#

Atomic oxygen number density at altitude Z7 [m^-3].

ussa1976.constants.P0 = 101325.0#

Pressure at sea level [Pa].

ussa1976.constants.PHI = 720000000000.0#

Vertical air particles flux [m^2 * s^-1].

ussa1976.constants.Q1 = {'Ar': 9.434079e-14, 'He': -2.457369e-13, 'O': -5.809644e-13, 'O2': 1.366212e-13}#

Vertical transport constants above 86 km [m^-3].

ussa1976.constants.Q2 = {'Ar': 0.0, 'He': 0.0, 'O': -3.416248e-12, 'O2': 0.0}#

Vertical transport constants above 86 km [m^-3].

ussa1976.constants.R = 8.31432#

Universal gas constant [J * K^-1 * mole^-1].

ussa1976.constants.R0 = 6356766.0#

Effective Earth radius [m].

ussa1976.constants.S = 110.4#

Sutherland constant in eq. 51 of [NNU76] [K].

ussa1976.constants.SIGMA = 3.65e-10#

Mean effective collision diameter [m].

ussa1976.constants.T0 = 288.15#

Temperature at sea level [K].

ussa1976.constants.T10 = 360.0#

Temperature at altitude Z10 [K].

ussa1976.constants.T11 = 999.2356#

Temperature at altitude Z11 [K].

ussa1976.constants.T7 = 186.8673#

Temperature at altitude Z7 [K].

ussa1976.constants.T9 = 240.0#

Temperature at altitude Z9 [K].

ussa1976.constants.TINF = 1000.0#

Exospheric temperature [K].

ussa1976.constants.U1 = {'Ar': 86000.0, 'He': 86000.0, 'O': 56903.11, 'O2': 86000.0}#

Vertical transport constants above 86 km [m].

ussa1976.constants.U2 = {'O': 97000.0}#

Vertical transport constants above 86 km [m].

ussa1976.constants.W1 = {'Ar': 8.333333e-14, 'He': 6.666667e-13, 'O': 2.70624e-14, 'O2': 8.333333e-14}#

Vertical transport constants above 86 km [m^-3].

ussa1976.constants.W2 = {'O': 5.008765e-13}#

Vertical transport constants above 86 km [m^-3].

ussa1976.constants.Z10 = 120000.0#

Top altitude of the 10th layer [m].

ussa1976.constants.Z12 = 1000000.0#

Top altitude of the 12nd layer [m].

ussa1976.constants.Z7 = 86000.0#

Top altitude of the 7th layer [m].

ussa1976.constants.Z8 = 91000.0#

Top altitude of the 8th layer [m].

ussa1976.constants.Z9 = 110000.0#

Top altitude of the 9th layer [m].

core#

U.S. Standard Atmosphere 1976 thermophysical model.

The U.S. Standard Atmosphere 1976 model [NNU76] divides the atmosphere into two altitude regions:

  1. the low-altitude region, from 0 to 86 kilometers

  2. the high-altitude region, from 86 to 1000 kilometers.

A number of computational functions hereafter are specialised for one or the other altitude region and is valid only in that altitude region, not in the other. Their name include a low_altitude or a high_altitude part to reflect that they are valid only in the low altitude region and high altitude region, respectively.

ussa1976.core.compute(z=array([0.00e+00, 5.00e+01, 1.00e+02, ..., 9.90e+05, 9.95e+05, 1.00e+06]), variables=None)#

Compute U.S. Standard Atmosphere 1976 data set on specified altitude grid.

Parameters:
  • z (ndarray) – Altitude [m].

  • variables (list, optional) – Names of the variables to compute.

Returns:

Data set holding the values of the different atmospheric variables.

Return type:

Dataset

Raises:

ValueError – When altitude is out of bounds, or when variables are invalid.

ussa1976.core.compute_gravity(z)#

Compute gravity.

Parameters:

z (ndarray) – Altitude [m].

Returns:

Gravity [m * s^-2].

Return type:

ndarray

ussa1976.core.compute_high_altitude(data_set, mask=None, inplace=False)#

Compute U.S. Standard Atmosphere 1976 in high-altitude region.

Parameters:
  • data_set (Dataset) – Data set to compute.

  • mask (DataArray, optional) – Mask to select the region of the data set to compute. By default, the mask selects the entire data set.

  • inplace (bool, default False) – If True, modifies data_set in place, else returns a copy of data_set.

Returns:

If inplace is True, returns nothing, else returns a copy of data_set.

Return type:

Dataset

ussa1976.core.compute_levels_temperature_and_pressure_low_altitude()#

Compute temperature and pressure at low-altitude region’ levels.

Returns:

Levels temperatures [K] and pressures [Pa].

Return type:

tuple of arrays

ussa1976.core.compute_low_altitude(data_set, mask=None, inplace=False)#

Compute U.S. Standard Atmosphere 1976 in low-altitude region.

Parameters:
  • data_set (Dataset) – Data set to compute.

  • mask (DataArray, optional) – Mask to select the region of the data set to compute. By default, the mask selects the entire data set.

  • inplace (bool, default False) – If True, modifies data_set in place, else returns a copy of data_set.

Returns:

If inplace is True, returns nothing, else returns a copy of data_set.

Return type:

Dataset

ussa1976.core.compute_mean_molar_mass_high_altitude(z)#

Compute mean molar mass in high-altitude region.

Parameters:

z (ndarray) – Altitude [m].

Returns:

Mean molar mass [kg/mole].

Return type:

ndarray

ussa1976.core.compute_number_densities_high_altitude(altitudes)#

Compute number density of individual species in high-altitude region.

Parameters:

altitudes (ndarray) – Altitudes [m].

Returns:

Number densities of the individual species and total number density at the given altitudes.

Return type:

DataArray

Notes

A uniform altitude grid is generated and used for the computation of the integral as well as for the computation of the number densities of the individual species. This gridded data is then interpolated at the query altitudes using a linear interpolation scheme in logarithmic space.

ussa1976.core.compute_pressure_low_altitude(h, pb, tb)#

Compute pressure in low-altitude region.

Parameters:
  • h (ndarray) – Geopotential height [m].

  • pb (ndarray) – Levels pressure [Pa].

  • tb (ndarray) – Levels temperature [K].

Returns:

Pressure [Pa].

Return type:

ndarray

ussa1976.core.compute_pressure_low_altitude_non_zero_gradient(h, hb, pb, tb, lkb)#

Compute pressure in low-altitude non-zero temperature gradient region.

Parameters:
  • h (ndarray) – Geopotential height [m].

  • hb (float) – Geopotential height at the bottom of the layer [m].

  • pb (float) – Pressure at the bottom of the layer [Pa].

  • tb (float) – Temperature at the bottom of the layer [K].

  • lkb (float) – Temperature gradient in the layer [K * m^-1].

Returns:

Pressure [Pa].

Return type:

ndarray

ussa1976.core.compute_pressure_low_altitude_zero_gradient(h, hb, pb, tb)#

Compute pressure in low-altitude zero temperature gradient region.

Parameters:
  • h (ndarray) – Geopotential height [m].

  • hb (float) – Geopotential height at the bottom of the layer [m].

  • pb (float) – Pressure at the bottom of the layer [Pa].

  • tb (float) – Temperature at the bottom of the layer [K].

Returns:

Pressure [Pa].

Return type:

ndarray

ussa1976.core.compute_temperature_gradient_high_altitude(z)#

Compute temperature gradient in high-altitude region.

Parameters:

z (ndarray) – Altitude [m].

Returns:

Temperature gradient [K/m].

Return type:

ndarray

ussa1976.core.compute_temperature_high_altitude(z)#

Compute temperature in high-altitude region.

Parameters:

z (ndarray) – Altitude [m].

Returns:

Temperature [K].

Return type:

ndarray

ussa1976.core.compute_temperature_low_altitude(h, tb)#

Compute temperature in low-altitude region.

Parameters:
  • h (ndarray) – Geopotential height [m].

  • tb (ndarray) – Levels temperature [K].

Returns:

Temperature [K].

Return type:

ndarray

ussa1976.core.eddy_diffusion_coefficient(z)#

Compute Eddy diffusion coefficient in high-altitude region.

Parameters:

z (ndarray) – Altitude [m].

Returns:

Eddy diffusion coefficient [m^2 * s^-1].

Return type:

ndarray

Notes

Valid in the altitude region \(86 \leq z \leq 150\) km.

ussa1976.core.f_above_115_km(g, t, dt_dz, mi, alpha)#

Evaluate function \(f\) above 115 km altitude.

Evaluate the function \(f\) defined by equation (36) in [NNU76] in the altitude region \(115\) \(\lt z \leq 1000\) km.

Parameters:
  • g (ndarray) – Gravity at the different altitudes [m * s^-2].

  • t (ndarray) – Temperature at the different altitudes [K].

  • dt_dz (ndarray) – Temperature gradient at the different altitudes [K * m^-1].

  • mi (float) – Species molar masses [kg * mole^-1].

  • alpha (float) – Alpha thermal diffusion constant [dimensionless].

Returns:

Function \(f\) at the different altitudes.

Return type:

ndarray

ussa1976.core.f_below_115_km(g, t, dt_dz, m, mi, alpha, d, k)#

Evaluate function \(f\) below 115 km altitude.

Evaluates the function \(f\) defined by equation (36) in [NNU76] in the altitude region \(86\) km \(\leq z \leq 115\) km.

Parameters:
  • g (ndarray) – Gravity values at the different altitudes [m * s^-2].

  • t (ndarray) – Temperature values at the different altitudes [K].

  • dt_dz (ndarray) – Temperature gradient values at the different altitudes [K * m^-1].

  • m (ndarray) – Molar mass [kg * mole^-1].

  • mi (float) – Species molar masses [kg * mole^-1].

  • alpha (float) – Alpha thermal diffusion constant [dimensionless].

  • d (ndarray) – Thermal diffusion coefficient values at the different altitudes [m^2 * s^-1].

  • k (ndarray) – Eddy diffusion coefficient values at the different altitudes [m^2 * s^-1].

Returns:

Function \(f\) at the different altitudes.

Return type:

ndarray

ussa1976.core.init_data_set(z)#

Initialise data set.

Parameters:

z (ndarray) – Altitudes [m].

Returns:

Initialised data set.

Return type:

Dataset

ussa1976.core.log_interp1d(x, y)#

Compute linear interpolation of \(y(x)\) in logarithmic space.

Parameters:
  • x (ndarray) – 1-D array of real values.

  • y (ndarray) – N-D array of real values. The length of y along the interpolation axis must be equal to the length of x.

Returns:

Interpolating function.

Return type:

callable()

ussa1976.core.tau_function(z_grid, below_500=True)#

Compute \(\tau\) function.

Compute integral given by equation (40) in [NNU76] at each point of an altitude grid.

Parameters:
  • z_grid (ndarray) – Altitude grid (values sorted by ascending order) to use for integration [m].

  • below_500 (bool, default True) – True if altitudes in z_grid are lower than 500 km, False otherwise.

Returns:

Integral evaluations [dimensionless].

Return type:

ndarray

Notes

Valid for 150 km \(\leq z \leq\) 500 km.

ussa1976.core.thermal_diffusion_coefficient(nb, t, a, b)#

Compute thermal diffusion coefficient values in high-altitude region.

Parameters:
  • nb (ndarray) – Background number density [m^-3].

  • t (ndarray) – Temperature [K].

  • a (float) – Thermal diffusion constant \(a\) [m^-1 * s^-1].

  • b (float) – Thermal diffusion constant \(b\) [dimensionless].

Returns:

Thermal diffusion coefficient [m^2 * s^-1].

Return type:

ndarray

ussa1976.core.thermal_diffusion_term(s, z_grid, g, t, dt_dz, m, d, k)#

Compute thermal diffusion term of given species in high-altitude region.

Parameters:
  • s (str) – Species.

  • z_grid (ndarray) – Altitude grid [m].

  • g (ndarray) – Gravity values on the altitude grid [m * s^-2].

  • t (ndarray) – Temperature values on the altitude grid [K].

  • dt_dz (ndarray) – Temperature gradient values on the altitude grid [K * m^-1].

  • m (ndarray) – Values of the mean molar mass on the altitude grid [kg * mole^-1].

  • d (ndarray) – Molecular diffusion coefficient values on the altitude grid, for altitudes strictly less than 115 km [m^2 * s^-1].

  • k (ndarray) – Eddy diffusion coefficient values on the altitude grid, for altitudes strictly less than 115 km [m^2 * s^-1].

Returns:

Thermal diffusion term [m^-1].

Return type:

ndarray

ussa1976.core.thermal_diffusion_term_atomic_oxygen(z_grid, g, t, dt_dz, d, k)#

Compute oxygen thermal diffusion term in high-altitude region.

Parameters:
  • z_grid (ndarray) – Altitude grid [m].

  • g (ndarray) – Gravity values on the altitude grid [m * s^-2].

  • t (ndarray) – Temperature values on the altitude grid [K].

  • dt_dz (ndarray) – Temperature values gradient on the altitude grid [K * m^-1].

  • d (ndarray) – Thermal diffusion coefficient on the altitude grid [m^2 * s^-1].

  • k (ndarray) – Eddy diffusion coefficient values on the altitude grid [m^2 * s^-1].

Returns:

Thermal diffusion term [-1].

Return type:

ndarray

ussa1976.core.to_altitude(h)#

Convert geopotential height to (geometric) altitude.

Parameters:

h (ndarray) – Geopotential altitude [m].

Returns:

Altitude [m].

Return type:

ndarray

ussa1976.core.to_geopotential_height(z)#

Convert altitude to geopotential height.

Parameters:

z (ndarray) – Altitude [m].

Returns:

Geopotential height [m].

Return type:

ndarray

ussa1976.core.velocity_term(s, z_grid)#

Compute velocity term of a given species in high-altitude region.

Parameters:
  • s (str) – Species.

  • z_grid (ndarray) – Altitude grid [m].

Returns:

Velocity term [m^-1].

Return type:

ndarray

Notes

Not valid for atomic oxygen. See velocity_term_atomic_oxygen().

ussa1976.core.velocity_term_atomic_oxygen(grid)#

Compute velocity term of atomic oxygen in high-altitude region.

Parameters:

grid (ndarray) – Altitude grid [m].

Returns:

Velocity term [m^-1].

Return type:

ndarray

ussa1976.core.velocity_term_hump(z, q1, q2, u1, u2, w1, w2)#

Compute transport term.

Compute the transport term given by equation (37) in [NNU76].

Parameters:
  • z (ndarray) – Altitude [m].

  • q1 (float) – Q constant [m^-3].

  • q2 (float) – q constant [m^-3].

  • u1 (float) – U constant [m].

  • u2 (float) – u constant [m].

  • w1 (float) – W constant [m^-3].

  • w2 (float) – w constant [m^-3].

Returns:

Transport term [m^-1].

Return type:

ndarray

Notes

Valid in the altitude region: 86 km \(\leq z \leq\) 150 km.

ussa1976.core.velocity_term_no_hump(z, q1, u1, w1)#

Compute transport term.

Compute the transport term given by equation (37) in [NNU76] where the second term is zero.

Parameters:
  • z (ndarray) – Altitude.

  • q1 (float) – Q constant [m^-3].

  • u1 (float) – U constant [m].

  • w1 (float) – W constant [m^-3].

Returns:

Transport term [m^-1].

Return type:

ndarray

Notes

Valid in the altitude region \(86\) km \(\leq z \leq 150\) km.

ussa1976#

Command-line interface.