optmat.gas.air#

Air as a propagation model: the sum of its constituents (OEP 1, section 4.4).

For a named composition of mole fractions x_s the air polarizability is the sum of its constituents’ recommended models,

alpha_air(omega) = sum_s x_s alpha_s(omega),

so that it is consistent with the populations a propagation code carries, has a frequency derivative, and needs no second source. A refractometric formula of air (Ciddor’s, Edlen’s, Borzsonyi et al.’s) is an independent source, and serves as its validator.

The named compositions come from CIPM-2007 (optmat.gas.composition): "dry air (N2, O2, Ar)" (the default, and the air of the Raman response), "dry air (N2, O2)" (the argon-free reduction) and "dry air (CIPM-2007)", all twelve constituents, renormalised by their printed sum, 1 - 2.9e-6.

The number density of air comes from CoolProp’s pseudo-pure dry air (Lemmon et al. 2000), which holds the unlike-pair interactions: the constituents’ partial-pressure densities are 1.9e-4 lower at 1 bar and 294 K. The pair terms of the index itself are OEP 4’s; here Lorentz-Lorenz takes none.

Module Attributes

DEFAULT_AIR

The default air: CIPM-2007's N2, O2 and Ar, renormalised.

AIR_COMPOSITIONS

The named compositions an air model is built for; "dry air" is the default.

ABSORPTION_THRESHOLD_M

Transparency: the mixture's smoothed absorption below this, m^-1 (OEP 3, sec.

ALPHA_FRACTION

The mixture's tolerance in alpha: this fraction of its statistical one-sigma.

GVD_FRACTION

Its tolerance in D_2: this fraction of the larger of |D_2| and its electronic terms' |D_2|.

MIN_WIDTH_CM

A widened interval that adds a piece narrower than this, cm^-1, is not kept.

Functions

air_model([name])

Return the air model of a named composition.

Classes

AirModel(name, constituents, models, ...[, ...])

A named composition of air as a dispersion model.

optmat.gas.air.ABSORPTION_THRESHOLD_M: Final = 0.1#

Transparency: the mixture’s smoothed absorption below this, m^-1 (OEP 3, sec. 4).

optmat.gas.air.AIR_COMPOSITIONS: Final = ('dry air (N2, O2, Ar)', 'dry air (N2, O2)', 'dry air (CIPM-2007)')#

The named compositions an air model is built for; "dry air" is the default.

optmat.gas.air.ALPHA_FRACTION: Final = 0.1#

The mixture’s tolerance in alpha: this fraction of its statistical one-sigma.

class optmat.gas.air.AirModel(name, constituents, models, equation_of_state, wavelength_range, intervals, *, status='user', status_reason='', modified=(), base='')[source]#

Bases: Identified

A named composition of air as a dispersion model.

It has the interface of a gas dispersion model (Model): the complex polarizability per molecule of air, its frequency derivative, the index at a state, the qualified intervals and an identity. It is bound to its constituents’ models, whose digests enter its own.

Attributes:
namestr

The composition’s name.

constituentstuple of Constituent

The constituents and their mole fractions, summing to one.

modelstuple of Model

Each constituent’s recommended dispersion model, in the same order.

equation_of_stateEquationOfState

The pseudo-pure dry air’s (Lemmon et al. 2000).

wavelength_rangetuple of float

The envelope of intervals, m.

intervalstuple of tuple of float

The intersection of the constituents’ qualified intervals, widened across a trace constituent’s gaps where the mixture passes OEP 3’s checks (Q13), m.

statusstr

validated.

EVALUATES_THROUGH: ClassVar[tuple[str, ...]] = ('optmat.gas.lorentz_lorenz',)#
EVALUATION_VERSION: ClassVar[int] = 1#
IDENTITY_KIND: ClassVar[str] = 'gas_refractive'#
complex_polarizability(wavelength, *, warn=True)[source]#

Return the complex polarizability per molecule of air.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m; inf is the static limit.

warnbool, optional

Warn (ModelRangeWarning) outside every one of intervals; True by default.

Returns:
numpy.ndarray

sum_s x_s alpha_s, C m^2/V (complex).

Raises:
ArgumentError

If a wavelength is zero or negative.

Examples

>>> from optmat.constants import AU_POLARIZABILITY
>>> air = air_model()
>>> f"{float(air.complex_polarizability(800e-9).real / AU_POLARIZABILITY):.3f}"
'11.591'
constituents: tuple[Constituent, ...]#
dpolarizability_domega(wavelength, *, warn=True)[source]#

Return the frequency derivative of the polarizability per molecule.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

warnbool, optional

Warn outside the intervals; True by default.

Returns:
numpy.ndarray

sum_s x_s d alpha_s / d omega, C m^2 V^-1 s (complex).

Raises:
ArgumentError

If a wavelength is zero or negative.

equation_of_state: EquationOfState#
intervals: tuple[tuple[float, float], ...]#
models: tuple[Model, ...]#
name: str#
polarizability(wavelength, *, warn=True)[source]#

Return the real polarizability per molecule of air.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

warnbool, optional

Warn outside the intervals; True by default.

Returns:
numpy.ndarray

C m^2/V.

Raises:
ArgumentError

If a wavelength is zero or negative.

refractive_index(wavelength, state=State(pressure=101325.0, temperature=273.15), *, ideal=False, warn=True)[source]#

Return the complex refractive index of air at a state.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

stateState, optional

Pressure and temperature; 0 degrees C and 1 atm by default.

idealbool, optional

Use the ideal-gas density instead of the pseudo-pure dry air’s.

warnbool, optional

Warn outside the intervals; True by default.

Returns:
numpy.ndarray

n, complex.

Raises:
ArgumentError

If a wavelength is zero or negative.

refractivity(wavelength, state=State(pressure=101325.0, temperature=273.15), *, ideal=False, warn=True)[source]#

Return n - 1 of air at a state, through Lorentz-Lorenz.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

stateState, optional

Pressure and temperature; 0 degrees C and 1 atm by default.

idealbool, optional

Use the ideal-gas density instead of the pseudo-pure dry air’s.

warnbool, optional

Warn outside the intervals; True by default.

Returns:
numpy.ndarray

The refractivity n - 1, without pair terms (OEP 4’s).

Raises:
ArgumentError

If a wavelength is zero or negative.

wavelength_range: tuple[float, float]#
optmat.gas.air.DEFAULT_AIR: Final = 'dry air (N2, O2, Ar)'#

The default air: CIPM-2007’s N2, O2 and Ar, renormalised.

optmat.gas.air.GVD_FRACTION: Final = 0.01#

Its tolerance in D_2: this fraction of the larger of |D_2| and its electronic terms’ |D_2|.

optmat.gas.air.MIN_WIDTH_CM: Final = 50.0#

A widened interval that adds a piece narrower than this, cm^-1, is not kept.

optmat.gas.air.air_model(name='dry air (N2, O2, Ar)')[source]#

Return the air model of a named composition.

Parameters:
namestr, optional

One of AIR_COMPOSITIONS; "dry air" is DEFAULT_AIR, as for the Raman response.

Returns:
AirModel

The composition’s model, one per name.

Raises:
OptmatError

For another name.

Examples

>>> air_model().identity.name
'air/dry air (N2, O2, Ar)'
>>> len(air_model("dry air (CIPM-2007)").constituents)
12