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

1024

zetta

1021

exa

1018

peta

1015

tera

1012

giga

109

mega

106

kilo

103

hecto

102

deka

101

deci

101

centi

102

milli

103

micro

106

nano

109

pico

1012

femto

1015

atto

1018

zepto

1021

Non-SI ratios

ppm

106 parts per million

ppb

109 parts per billion

ppt

1012 parts per trillion

Binary prefixes

kibi, KiB

210

mebi, MiB

220

gibi

230

tebi

240

pebi

250

exbi

260

zebi

270

yobi

280

KB

103

MB

106

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