materials.base#
Base Material
This module defines the base class for materials. The base class provides methods to calculate the refractive index, extinction coefficient, and Abbe number of a material. Subclasses implement _calculate_n and _calculate_k; the public methods manage evaluation and optional caching.
Kramer Harrison, 2024
Classes
|
Base class for materials. |
- class BaseMaterial(propagation_model: BasePropagationModel | None = None)[source]#
Base class for materials.
This class defines the interface for material properties such as refractive index (n) and extinction coefficient (k). It also provides a method to calculate the Abbe number.
Subclasses implement _calculate_n and _calculate_k. Result caching is optional: override _cache_state only when all optical state can be tracked.
- Variables:
propagation_model – The model used to propagate rays through this material.
- Methods:
n(wavelength – float | be.ndarray) -> float | be.ndarray: Abstract method to calculate the refractive index at a given wavelength(s) in microns.
k(wavelength – float | be.ndarray) -> float | be.ndarray: Abstract method to calculate the extinction coefficient at a given wavelength(s) in microns.
abbe() -> float – Method to calculate the Abbe number of the material.
- P_ref(wavelength: float)[source]#
Calculate the relative partial dispersion at a reference wavelength.
The relative partial dispersion is defined as P_ref = (n_ref - n_D) / (n_F - n_C), where n_ref, n_D, n_F and n_C are the refractive indices at the reference wavelength, the D (587.5618 nm), F (486.1327 nm) and C (656.2725 nm) spectral lines, respectively.
- Parameters:
wavelength (float) – The reference wavelength in microns.
- PgF()[source]#
Calculate the partial dispersion between the F and C lines.
The partial dispersion is defined as PgF = (n_g - n_F) / (n_F - n_C), where n_g, n_F, and n_C are the refractive indices at g (435.8343 nm), F (486.1327 nm), and C (656.2725 nm) spectral lines, respectively.
- Returns:
The partial dispersion between the g and F lines.
- Return type:
- abbe() float[source]#
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:
- dPgF()[source]#
Calculate the deviation of the relative partial dispersion.
The deviation of the relative partial dispersion is defined as
dPgF = PgF - (0.6438 - 0.001682 Vd)
- Returns:
The deviation of the relative partial dispersion.
- Return type:
- classmethod from_dict(data)[source]#
Create a material from a dictionary representation.
This factory method first delegates to the appropriate subclass to create the material instance, then handles the deserialization of the propagation model.
- Parameters:
data (dict) – The dictionary representation of the material.
- Returns:
An instance of a specific material subclass created from the dictionary data.
- Return type:
- k(wavelength: float | be.ndarray, **kwargs) float | be.ndarray[source]#
Calculates the extinction coefficient at a given wavelength with caching.
- n(wavelength: float | be.ndarray, **kwargs) float | be.ndarray[source]#
Calculates the refractive index at a given wavelength with caching.