materials.abbe
Abbe Material
This module defines a material based on the refractive index and Abbe number.
It provides support for both d-line (587.56 nm) and e-line (546.07 nm)
definitions.
Models:
1. “polynomial”: A polynomial fit to glass data (Legacy, D-line only).
2. “buchdahl”: A Buchdahl 3-term model with LASSO-derived coefficients.
Kramer Harrison, 2024
Classes
-
class AbbeMaterial(n, abbe, model=None)[source]
Represents a material based on the refractive index and Abbe number.
This class serves as a wrapper around specific model implementations.
Currently supported models:
- ‘polynomial’: The legacy polynomial fit (Default, deprecated).
- ‘buchdahl’: The new Buchdahl 3-term model (Recommended).
- Parameters:
n (float) – The refractive index of the material at 587.56 nm (n_d).
abbe (float) – The Abbe number of the material (V_d).
model (str, optional) – The model to use. Defaults to “polynomial”.
Valid options are “polynomial” and “buchdahl”.
- Variables:
index (float) – The refractive index of the material at 587.56 nm.
abbe (float) – The Abbe number of the material.
model_name (str) – The name of the model being used.
model (AbbeModel) – The underlying model instance.
-
property abbe
The model’s live Abbe number in its reference-line convention.
-
classmethod from_dict(data)[source]
Creates a material from a dictionary representation.
-
property index
The model’s live reference-line refractive index.
-
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
-
model: AbbeModel
-
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
-
to_dict()[source]
Returns a dictionary representation of the material.
-
class AbbeMaterialE(n, abbe)[source]
Represents a material based on the refractive index and Abbe number at e-line.
This class uses a Buchdahl 3-term model fitted to e-line (546.07 nm) data.
- Parameters:
-
- Variables:
index (float) – The refractive index of the material at 546.07 nm.
abbe (float) – The Abbe number of the material (V_e).
model (BuchdahlEModel) – The underlying model instance.
-
property abbe
The model’s live Abbe number in its reference-line convention.
-
classmethod from_dict(data)[source]
Creates a material from a dictionary representation.
-
property index
The model’s live reference-line refractive index.
-
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
-
model: AbbeModel
-
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
-
to_dict()[source]
Returns a dictionary representation of the material.
-
class AbbeModel[source]
Abstract base class for Abbe number based material models.
-
abstractmethod predict_k(wavelength: float | be.ndarray) → float | be.ndarray[source]
Predicts the extinction coefficient at a given wavelength.
-
abstractmethod predict_n(wavelength: float | be.ndarray) → float | be.ndarray[source]
Predicts the refractive index at a given wavelength.
-
class AbbePolynomialModel(index: float, abbe: float)[source]
Legacy polynomial model for Abbe materials (d-line).
This model uses a polynomial fit to glass data from the Schott catalog.
It corresponds to the original implementation of AbbeMaterial.
-
predict_k(wavelength: float | be.ndarray) → float | be.ndarray[source]
Predicts the extinction coefficient at a given wavelength.
-
predict_n(wavelength: float | be.ndarray) → float | be.ndarray[source]
Predicts the refractive index at a given wavelength.
-
class BuchdahlDModel(index, abbe)[source]
Buchdahl model for d-line (587.56 nm) materials.
-
ALPHA = 2.5
-
V1_COEFFS = [0.00416, 4.462559, 2.32666, 0.00233, -0.003697, -4.697604]
-
V2_COEFFS = [0.066434, -7.636396, 12.597434, -0.037014, 5.551013]
-
V3_COEFFS = [-0.032218, 2.230357, -103.318994, -0.009654, 1.934983]
-
WAVE_REF = 0.5875618
-
predict_k(wavelength: float | be.ndarray) → float | be.ndarray
Predicts the extinction coefficient at a given wavelength.
-
predict_n(wavelength: float | be.ndarray) → float | be.ndarray
Predicts the refractive index at a given wavelength.
-
class BuchdahlEModel(index, abbe)[source]
Buchdahl model for e-line (546.07 nm) materials.
-
ALPHA = 2.5
-
WAVE_REF = 0.546074
-
predict_k(wavelength: float | be.ndarray) → float | be.ndarray
Predicts the extinction coefficient at a given wavelength.
-
predict_n(wavelength: float | be.ndarray) → float | be.ndarray
Predicts the refractive index at a given wavelength.
-
class BuchdahlModel(index, abbe)[source]
Base class for Buchdahl 3-term models.
-
ALPHA = 2.5
-
abstract property WAVE_REF: float
Reference wavelength in microns.
-
predict_k(wavelength: float | be.ndarray) → float | be.ndarray[source]
Predicts the extinction coefficient at a given wavelength.
-
predict_n(wavelength: float | be.ndarray) → float | be.ndarray[source]
Predicts the refractive index at a given wavelength.