materials.material
Material
This module contains the Material class, which represents a generic material used in the Optiland system. This class identifies the correct material given the material name and (optionally) the reference, which is generally the manufacturer name or the author name. This is the primary material class used to define the optical properties of a material (or glass) in Optiland.
Kramer Harrison, 2024
Classes
|
Represents a generic material used in the Optiland system. |
- class Material(name: str, reference: str | None = None, robust_search: bool | None = None, min_wavelength: float | None = None, max_wavelength: float | None = None, propagation_model=None, *, catalog: str | None = None, match_policy: MatchPolicy = MatchPolicy.WARN)[source]
Represents a generic material used in the Optiland system. This class identifies the correct material given the material name and (optionally) the reference, which is generally the manufacturer name or the author name.
Note
The material database is stored in the file catalog_nk.csv in the database directory. This contains the names, references, and filenames of the materials.
- Parameters:
name (str) – The name of the material to search for.
reference (str, optional) – The reference for the material, typically the manufacturer or author name. This helps disambiguate materials with similar names. Defaults to None.
robust_search (bool | None, optional) – Deprecated. Use
match_policyinstead.Truemaps toMatchPolicy.BEST;Falsemaps toMatchPolicy.STRICT. Passing this argument emits aDeprecationWarning. Defaults to None.min_wavelength (float, optional) – Minimum wavelength in microns for filtering materials based on their valid range. Defaults to None.
max_wavelength (float, optional) – Maximum wavelength in microns for filtering materials based on their valid range. Defaults to None.
catalog (str, optional) – Manufacturer catalog to restrict lookup to (e.g.
"schott","ohara"). Keyword-only. Defaults to None.match_policy (MatchPolicy, optional) – Controls fuzzy-match behavior.
"warn"(default) emitsOptilandMaterialWarningon fuzzy match;"best"silently takes the best match;"strict"raisesValueErroron any non-exact match. Keyword-only.
- name
The name of the material.
- Type:
str
- reference
The reference for the material.
- Type:
str
- abbe() float
Calculate the Abbe number (Vd) of the material.
The Abbe number is a measure of the material’s dispersion, defined as Vd = (n_d - 1) / (n_F - n_C), where n_d, n_F, and n_C are the refractive indices at the Fraunhofer d (587.5618 nm), F (486.1327 nm), and C (656.2725 nm) spectral lines, respectively.
- Returns:
The Abbe number of the material.
- Return type:
float
- classmethod from_dict(data)[source]
Creates a material from a dictionary representation.
- Parameters:
data (dict) – The dictionary representation of the material.
- Returns:
The material created from the dictionary.
- Return type:
- k(wavelength: float | be.ndarray, **kwargs) float | be.ndarray
Calculates the extinction coefficient at a given wavelength with caching.
- Parameters:
wavelength (float | be.ndarray) – The wavelength(s) of light in microns. Can be a float, numpy array, or torch tensor.
**kwargs – Additional keyword arguments for calculation.
- Returns:
The extinction coefficient at the given wavelength(s).
- Return type:
float | be.ndarray
- n(wavelength: float | be.ndarray, **kwargs) float | be.ndarray
Calculates the refractive index at a given wavelength with caching.
- Parameters:
wavelength (float | be.ndarray) – The wavelength(s) of light in microns. Can be a float, numpy array, or torch tensor.
**kwargs – Additional keyword arguments for calculation (e.g., temperature).
- Returns:
The refractive index at the given wavelength(s).
- Return type:
float | be.ndarray