optmat.gas.comparison#
The refractiveindex.info database, as a comparison source only.
A pinned snapshot of the database’s gas entries (CC0; see
data/external/refractiveindex_info/PROVENANCE.md) is converted to
data/external/refractiveindex_info.json by
tools/convert_refractiveindex_info.py.
This module reads that file. Its formula entries become models (kind “comparison”),
so the gallery can compare them with the curated data and the fits; its tabulated
entries are returned as arrays. Nothing here enters a fit: every value the database
takes from a paper is curated from the paper itself.
The formula types used by the gas entries, from the database’s documentation (lambda
in um): type 2, n^2 - 1 = C1 + sum C_{2i} lambda^2 / (lambda^2 - C_{2i+1}); type 5,
n = C1 + sum C_{2i} lambda^{C_{2i+1}}; type 6, n - 1 = C1 + sum C_{2i} /
(C_{2i+1} - lambda^-2).
Module Attributes
The refractiveindex.info-database commit the snapshot was taken from. |
Functions
Return the snapshot's formula entries as models, by name. |
|
Return the snapshot's tabulated entries. |
Classes
|
A refractiveindex.info formula entry as a polarizability model. |
|
A refractiveindex.info tabulated entry. |
- optmat.gas.comparison.COMMIT: Final = 'c5c2f188e848453def5970e347399d653df2ffc2'#
The refractiveindex.info-database commit the snapshot was taken from.
- class optmat.gas.comparison.DatabaseModel(gas, name, citation, wavelength_range, kind, formula_type='', coefficients=(), state=State(pressure=101325.0, temperature=273.15), *, status='user', status_reason='', modified=(), base='', intervals=())[source]#
Bases:
ModelA refractiveindex.info formula entry as a polarizability model.
- Attributes:
- formula_typestr
“formula 2”, “formula 5” or “formula 6”.
- coefficientstuple of float
C1, C2, ...as stored.- stateState
The entry’s stated conditions (0 degrees C and 1 atm where it states none).
- Its overrides are the coefficients and the intervals.
- INPUTS: ClassVar[tuple[str, ...]] = ('coefficients', 'intervals')#
The parameters
with_parameters()may change.
- class optmat.gas.comparison.TabulatedEntry(gas, name, references, state, wavelength, refractive_index)[source]#
Bases:
objectA refractiveindex.info tabulated entry.
- Attributes:
- gasGas
The species.
- namestr
refractiveindex.info/<gas>/<entry>.- referencesstr
The entry’s references, as stored (HTML).
- stateState
The entry’s stated conditions (0 degrees C and 1 atm where it states none).
- wavelengthnumpy.ndarray
Wavelengths, m (the database’s wavelengths are vacuum wavelengths).
- refractive_indexnumpy.ndarray
n.
- refractive_index: Float[ndarray, 'n']#
- wavelength: Float[ndarray, 'n']#
- optmat.gas.comparison.database_models()[source]#
Return the snapshot’s formula entries as models, by name.
- Returns:
- dict of str to DatabaseModel
Models named
refractiveindex.info/<gas>/<entry>.
Examples
>>> model = database_models()["refractiveindex.info/Ar/Bideau-Mehu"] >>> f"{float(model.refractivity(253.7e-9)) * 1e6:.1f}" '303.2'