optmat.materials#
The materials the curated records name.
Every dataset belongs to one material: a gas, a glass or a crystal. The core knows only
what a material is (its id, name, kind, formula and optical symmetry), read from
data/materials.toml; what a medium needs beyond that (a gas’s electron count and
equation of state, a solid’s models) lives in that medium’s subpackage (TC-318).
A material’s id is the directory of its extracted files,
data/values/<family>/<id>/. An anisotropic crystal lists the axes a dataset’s
parameters.axis may take (o and e for a uniaxial crystal).
Module Attributes
The registry of materials. |
|
The kinds of material. |
Functions
|
Return the id of the material |
|
Return the registered material |
Return every registered material, by id. |
Classes
|
What a material is. |
- optmat.materials.KINDS: Final[tuple[str, ...]] = ('gas', 'ion', 'glass', 'crystal', 'metal')#
The kinds of material.
- optmat.materials.MATERIALS_FILE: Final = PosixPath('/home/docs/checkouts/optmat/checkouts/7/src/optmat/data/materials.toml')#
The registry of materials.
- class optmat.materials.Material(id, name, kind, formula, optics, axes, aliases)[source]#
Bases:
objectWhat a material is.
- Attributes:
- idstr
The id records use, and the directory of the material’s files.
- namestr
A descriptive name.
- kind{“gas”, “ion”, “glass”, “crystal”, “metal”}
The kind of medium; an
ionis a gas-phase ion, whose data (its polarizability, for the ionisation rates) never enter a gas’s models. Ametalis a solid whose index is complex throughout (TC-543).- formulastr
The chemical formula, or an empty string (a multicomponent glass).
- optics{“isotropic”, “uniaxial”, “biaxial”}
The optical symmetry.
- axestuple of str
The axes a dataset’s
parameters.axismay name; empty when isotropic.- aliasestuple of str
Other names that
as_material()accepts.
- optmat.materials.as_material(name)[source]#
Return the id of the material
namenames.- Parameters:
- namestr
An id or an alias, e.g.
"SiO2"or"fused silica".
- Returns:
- str
The material’s id.
- Raises:
- OptmatError
If
namenames no registered material.
Examples
>>> as_material("fused silica") 'SiO2'