Glass#
- class optika.materials.Glass(b1=0, b2=0, b3=0, c1=<Quantity 0. um2>, c2=<Quantity 0. um2>, c3=<Quantity 0. um2>)[source]#
Bases:
AbstractMaterialA transparent, refractive material whose index of refraction follows the three-term Sellmeier dispersion equation,
\[n^2(\lambda) = 1 + \frac{B_1 \lambda^2}{\lambda^2 - C_1} + \frac{B_2 \lambda^2}{\lambda^2 - C_2} + \frac{B_3 \lambda^2}{\lambda^2 - C_3},\]where \(\lambda\) is the vacuum wavelength of the light, and \(B_i\) (dimensionless) and \(C_i\) (square length) are the Sellmeier coefficients of the glass.
Unlike
VacuumandMirror, this material changes the index of refraction of a transmitted ray, so a curved surface made of it has optical power and bends light according to Snell’s law.Examples
Plot the index of refraction of N-BK7 and F2 glass across the visible spectrum.
import matplotlib.pyplot as plt import astropy.units as u import named_arrays as na import optika wavelength = na.linspace(380, 750, axis="wavelength", num=101) * u.nm glasses = { "N-BK7": optika.materials.Glass.n_bk7(), "F2": optika.materials.Glass.f2(), } fig, ax = plt.subplots(constrained_layout=True) for name, glass in glasses.items(): rays = optika.rays.RayVectorArray(wavelength=wavelength) na.plt.plot( wavelength, glass.index_refraction(rays), ax=ax, label=name, ) ax.set_xlabel(f"wavelength ({wavelength.unit:latex_inline})"); ax.set_ylabel("index of refraction"); ax.legend();
Attributes
The first dimensionless Sellmeier coefficient.
The second dimensionless Sellmeier coefficient.
The third dimensionless Sellmeier coefficient.
The first Sellmeier resonance (units of square length).
The second Sellmeier resonance (units of square length).
The third Sellmeier resonance (units of square length).
flag controlling whether this material reflects or transmits light
The array shape of this object.
the coordinate transformation between the global coordinate system and this object's local coordinate system
Methods
__init__([b1, b2, b3, c1, c2, c3])attenuation(rays)the attenuation coefficient of the given rays
efficiency(rays, normal)The fraction of light that passes through the interface.
f2()SCHOTT F2 flint glass (\(n_d \approx 1.6200\), \(V_d \approx 36.4\)).
index_refraction(rays)the index of refraction of this material for the given input rays
n_bk7()SCHOTT N-BK7 borosilicate crown glass (\(n_d \approx 1.5168\), \(V_d \approx 64.2\)).
to_string([prefix])Public-facing version of the
__repr__method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.Inheritance Diagram

- Parameters:
b1 (float | AbstractScalar)
b2 (float | AbstractScalar)
b3 (float | AbstractScalar)
c1 (Quantity | AbstractScalar)
c2 (Quantity | AbstractScalar)
c3 (Quantity | AbstractScalar)
- classmethod f2()[source]#
SCHOTT F2 flint glass (\(n_d \approx 1.6200\), \(V_d \approx 36.4\)).
- Return type:
- classmethod n_bk7()[source]#
SCHOTT N-BK7 borosilicate crown glass (\(n_d \approx 1.5168\), \(V_d \approx 64.2\)).
- Return type:
- attenuation(rays)[source]#
the attenuation coefficient of the given rays
- Parameters:
rays (RayVectorArray) – input rays to calculate the attenuation coefficient for
- Return type:
- efficiency(rays, normal)[source]#
The fraction of light that passes through the interface.
- Parameters:
rays (RayVectorArray) – the input rays to calculate the efficiency for
normal (AbstractCartesian3dVectorArray) – the vector perpendicular to the optical surface
- Return type:
- index_refraction(rays)[source]#
the index of refraction of this material for the given input rays
- Parameters:
rays (RayVectorArray) – input rays used to evaluate the index of refraction
- Return type:
- to_string(prefix=None)#
Public-facing version of the
__repr__method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.
- b1: float | AbstractScalar = 0#
The first dimensionless Sellmeier coefficient.
- b2: float | AbstractScalar = 0#
The second dimensionless Sellmeier coefficient.
- b3: float | AbstractScalar = 0#
The third dimensionless Sellmeier coefficient.
- c1: Quantity | AbstractScalar = <Quantity 0. um2>#
The first Sellmeier resonance (units of square length).
- c2: Quantity | AbstractScalar = <Quantity 0. um2>#
The second Sellmeier resonance (units of square length).
- c3: Quantity | AbstractScalar = <Quantity 0. um2>#
The third Sellmeier resonance (units of square length).