joseki.profiles.util

Utility module.

Functions

air_molar_mass_from_mass_fraction(y)

Compute the air molar mass from the of air constituents mass fractions.

molar_mass(molecules)

number_density(p, t)

Compute air number density from air pressure and air temperature.

utcnow([isoformat])

Module Contents

joseki.profiles.util.air_molar_mass_from_mass_fraction(y)[source]

Compute the air molar mass from the of air constituents mass fractions.

Parameters:

y (xarray.DataArray) – Mass fraction as a function of molecule (m) and altitude (z).

Returns:

Air molar mass as a function of altitude (z).

Return type:

xarray.DataArray

Notes

The air molar mass is computed according to the following equation:

\[m_{\mathrm{air}} (z) = \left( \sum_{\mathrm{M}} \frac{ y_{\mathrm{M}} (z) }{ m_{\mathrm{M}} } \right)^{-1}\]

where:

  • \(y_{\mathrm{M}} (z)\) is the mass fraction of molecule M at altitude \(z\),

  • \(m_{\mathrm{M}}\) is the molar mass of molecule M.

joseki.profiles.util.molar_mass(molecules)[source]
Parameters:

molecules (List[str])

Return type:

xarray.DataArray

joseki.profiles.util.number_density(p, t)[source]

Compute air number density from air pressure and air temperature.

Parameters:
Returns:

Number density.

Return type:

pint.Quantity

Notes

The air number density is computed according to the ideal gas law:

\[n = \frac{p}{k_B T}\]

where \(p\) is the air pressure, \(k_B\) is the Boltzmann constant, and \(T\) is the air temperature.

joseki.profiles.util.utcnow(isoformat=True)[source]
Parameters:

isoformat (bool)