optmat.conditions#
States (pressure and temperature) and air-to-vacuum wavelengths.
Measurements are reported at, or reduced to, a stated pressure and temperature (“0
degrees C and 760 Torr”, “15 degrees C and 1 atm”, “1 bar and 0 degrees C”); this module
holds the state and the named states. What a state implies for a medium (the number
density of a gas, optmat.gas.eos) belongs to that medium’s subpackage.
Pressures here are in pascals, like everything else in the package.
Much of the older literature (Leonard 1974, Cuthbertson) gives wavelengths in standard
air (15 degrees C, 101 325 Pa); vacuum_wavelength_from_standard_air() converts
them with Edlen’s 1966 dispersion formula for standard air. Solids measured by minimum
deviation in room air give an index relative to that air; air_refractivity()
gives its refractivity at the room’s temperature and pressure.
Module Attributes
The version of this module's evaluation code, in the identity of every model that evaluates through it; raised whenever the code changes its output (OEP 1, section 4.8). |
|
0 degrees C and 1 atm (760 Torr): the "STP" or "NTP" of most refractivity papers. |
|
0 degrees C and 1 bar: Borzsonyi et al. (2008) and Luna's normalisation. |
|
15 degrees C and 1 atm: the atmospheric-science convention (He et al. 2021). |
|
20 degrees C and 1 atm: the frequency-comb measurements (Zhang et al. 2008). |
Functions
|
Return |
|
Return |
Convert wavelengths measured in standard air to vacuum wavelengths. |
Classes
|
A thermodynamic state: a pressure and a temperature. |
- optmat.conditions.EVALUATION_VERSION: Final = 1#
The version of this module’s evaluation code, in the identity of every model that evaluates through it; raised whenever the code changes its output (OEP 1, section 4.8).
- optmat.conditions.ONE_ATM_0C: Final = State(pressure=101325.0, temperature=273.15)#
0 degrees C and 1 atm (760 Torr): the “STP” or “NTP” of most refractivity papers.
- optmat.conditions.ONE_ATM_15C: Final = State(pressure=101325.0, temperature=288.15)#
15 degrees C and 1 atm: the atmospheric-science convention (He et al. 2021).
- optmat.conditions.ONE_ATM_20C: Final = State(pressure=101325.0, temperature=293.15)#
20 degrees C and 1 atm: the frequency-comb measurements (Zhang et al. 2008).
- optmat.conditions.ONE_BAR_0C: Final = State(pressure=100000.0, temperature=273.15)#
0 degrees C and 1 bar: Borzsonyi et al. (2008) and Luna’s normalisation.
- class optmat.conditions.State(pressure, temperature)[source]#
Bases:
objectA thermodynamic state: a pressure and a temperature.
- Attributes:
- pressurefloat
Absolute pressure in Pa, > 0.
- temperaturefloat
Temperature in K, > 0.
- Raises:
- StateError
If either value is not finite and positive.
Examples
>>> State(101325.0, 273.15).pressure 101325.0
- optmat.conditions.air_refractivity(vacuum_wavenumber, state)[source]#
Return
n - 1of dry air at a temperature and pressure, from Edlen 1966.Edlen’s Eq. (12) (Metrologia 2, 71 (1966), p. 78) scales the standard-air refractivity by the density factor of dry air,
(n - 1)_tp = p (n - 1)_s / 720.775 * [1 + p (0.817 - 0.0133 t) 1e-6] / (1 + 0.0036610 t), withtin degrees C andpin torr, for 5 to 30 degrees C. It returnsstandard_air_refractivity()at 15 degrees C and 760 torr. Water vapour and a CO2 content other than 0.03 % are not included (Edlen’s corrections for them are some 1e-7 at room conditions).- Parameters:
- vacuum_wavenumberarray_like or float
Vacuum wavenumber
1 / lambda_vacin m^-1 (roughly 200 nm to 2 um, the range of the standard-air formula).- stateState
The air’s pressure (Pa) and temperature (K); the formula is stated for 5 to 30 degrees C and laboratory pressures.
- Returns:
- numpy.ndarray
n - 1of the air, the shape of the input.
Examples
>>> f"{float(air_refractivity(1 / 800e-9, ONE_ATM_20C)):.4e}" '2.7033e-04'
- optmat.conditions.standard_air_refractivity(vacuum_wavenumber)[source]#
Return
n - 1of standard air from Edlen’s 1966 formula.Standard air is dry air with 0.03 % CO2 at 15 degrees C and 101 325 Pa. The formula is
1e8 (n - 1) = 8342.13 + 2406030 / (130 - s^2) + 15997 / (38.9 - s^2)withsthe vacuum wavenumber in um^-1 (B. Edlen, Metrologia 2, 71 (1966)).- Parameters:
- vacuum_wavenumberarray_like or float
Vacuum wavenumber
1 / lambda_vacin m^-1; the formula is fitted over roughly 200 nm to 2 um.
- Returns:
- numpy.ndarray
n - 1of standard air, the shape of the input.
Examples
>>> f"{float(standard_air_refractivity(1 / 546.2e-9)):.4e}" '2.7790e-04'
- optmat.conditions.vacuum_wavelength_from_standard_air(air_wavelength)[source]#
Convert wavelengths measured in standard air to vacuum wavelengths.
Solves
lambda_vac = n(lambda_vac) lambda_airwithstandard_air_refractivity()by fixed-point iteration; the refractivity changes by ~1e-10 per iteration after the first, so four iterations reach double precision.- Parameters:
- air_wavelengtharray_like or float
Wavelength in standard air, m.
- Returns:
- numpy.ndarray
Vacuum wavelength, m, the shape of the input.
Examples
>>> f"{float(vacuum_wavelength_from_standard_air(546.0740e-9)) * 1e9:.4f}" '546.2258'