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: AbstractMaterial

A 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 Vacuum and Mirror, 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();
../_images/optika.materials.Glass_0_0.png

Attributes

b1

The first dimensionless Sellmeier coefficient.

b2

The second dimensionless Sellmeier coefficient.

b3

The third dimensionless Sellmeier coefficient.

c1

The first Sellmeier resonance (units of square length).

c2

The second Sellmeier resonance (units of square length).

c3

The third Sellmeier resonance (units of square length).

is_mirror

flag controlling whether this material reflects or transmits light

shape

The array shape of this object.

transformation

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

Inheritance diagram of optika.materials.Glass
Parameters:
classmethod f2()[source]#

SCHOTT F2 flint glass (\(n_d \approx 1.6200\), \(V_d \approx 36.4\)).

Return type:

Glass

classmethod n_bk7()[source]#

SCHOTT N-BK7 borosilicate crown glass (\(n_d \approx 1.5168\), \(V_d \approx 64.2\)).

Return type:

Glass

attenuation(rays)[source]#

the attenuation coefficient of the given rays

Parameters:

rays (RayVectorArray) – input rays to calculate the attenuation coefficient for

Return type:

int | float | complex | ndarray | Quantity | AbstractScalar

efficiency(rays, normal)[source]#

The fraction of light that passes through the interface.

Parameters:
Return type:

int | float | complex | ndarray | Quantity | AbstractScalar

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:

int | float | complex | ndarray | Quantity | AbstractScalar

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.

Parameters:

prefix (None | str) – an optional string, the length of which is used to calculate how much whitespace to add to the result.

Return type:

str

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).

property is_mirror: bool#

flag controlling whether this material reflects or transmits light

property shape: dict[str, int]#

The array shape of this object.

property transformation: None#

the coordinate transformation between the global coordinate system and this object’s local coordinate system