physics.units

Various units-related things

This module has a soft dependency on the pint units library. Please import this module only conditionally or only if you can accept a pint dependency.

FwmuMixin()

Mixing for frequency/wavelength/wavenumber neutrality

SRF(f, W)

Respresents a spectral response function

density(p, T[, R])

Wrapper around typhon.physics.atmosphere.density().

planck_f(f, T)

Planck law expressed in frequency.

radiance_units

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2).

specrad_frequency_to_planck_bt(L, f)

Convert spectral radiance per frequency to brightness temperature

specrad_wavenumber2frequency(specrad_wavenum)

Convert spectral radiance from per wavenumber to per frequency

ureg

The unit registry stores the definitions and relationships between units.

physics.units.constants

Collection of physical constants and conversion factors.

The magnitudes of the defined constants are taken from typhon.constants.

This module adds units defined with pint’s UnitRegistry..

Physical constants

g

Earth standard gravity

h

Planck constant

k

Boltzmann constant

c

Speed of light

N_A

Avogadro constant

R

Universal gas constant

molar_mass_dry_air

Molar mass for dry air

molar_mass_water

Molar mass for water vapor

gas_constant_dry_air

Gas constant for dry air

gas_constant_water_vapor

Gas constant for water vapor

Mathematical constants

golden

Golden ratio

SI prefixes

yotta

\(10^{24}\)

zetta

\(10^{21}\)

exa

\(10^{18}\)

peta

\(10^{15}\)

tera

\(10^{12}\)

giga

\(10^{9}\)

mega

\(10^{6}\)

kilo

\(10^{3}\)

hecto

\(10^{2}\)

deka

\(10^{1}\)

deci

\(10^{-1}\)

centi

\(10^{-2}\)

milli

\(10^{-3}\)

micro

\(10^{-6}\)

nano

\(10^{-9}\)

pico

\(10^{-12}\)

femto

\(10^{-15}\)

atto

\(10^{-18}\)

zepto

\(10^{-21}\)

Non-SI ratios

ppm

\(10^{-6}\) parts per million

ppb

\(10^{-9}\) parts per billion

ppt

\(10^{-12}\) parts per trillion

Binary prefixes

kibi, KiB

\(2^{10}\)

mebi, MiB

\(2^{20}\)

gibi

\(2^{30}\)

tebi

\(2^{40}\)

pebi

\(2^{50}\)

exbi

\(2^{60}\)

zebi

\(2^{70}\)

yobi

\(2^{80}\)

KB

\(10^3\)

MB

\(10^6\)

Earth characteristics

earth_mass

Earth mass

earth_radius

Earth radius

atm

Standard atmosphere

physics.units.tools

Miscellaneous unit-aware tools

UnitsAwareDataArray(data, coords, dims, ...)

Like xarray.DataArray, but transfers units