coatings
Coatings Module
The coatings module contains classes for modeling optical coatings.
Kramer Harrison, 2024
Classes
Base class for coatings. |
|
A base class for polarized coatings. |
|
|
Represents a Fresnel coating for polarized light. |
|
Jones matrix generator for a thin-film stack. |
|
Represents a linear polarizer coating. |
|
Represents a linear retarder coating. |
|
A simple coating class that represents a coating with given transmittance and reflectance. |
|
Polarized coating that applies a thin-film stack to rays. |
- class BaseCoating[source]
Base class for coatings.
This class defines the basic structure and behavior of a coating.
- classmethod from_dict(data: dict[str, Any]) BaseCoating[source]
Creates a coating from a dictionary.
- Parameters:
data (dict) – The dictionary representation of the coating.
- Returns:
The coating created from the dictionary.
- Return type:
- interact(rays: RealRays, reflect: bool = False, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays[source]
Performs an interaction with the coating.
- Parameters:
rays (RealRays) – The rays incident on the coating.
reflect (bool, optional) – Flag indicating whether to perform reflection (True) or transmission (False). Defaults to False.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after the interaction.
- Return type:
rays (RealRays)
- abstract reflect(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays[source]
Abstract method to handle reflection interaction.
- Parameters:
rays (RealRays) – The rays incident on the coating.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after reflection.
- Return type:
- to_dict() dict[str, Any][source]
Converts the coating to a dictionary.
- Returns:
The dictionary representation of the coating.
- Return type:
dict
- abstract transmit(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays[source]
Abstract method to handle transmission interaction.
- Parameters:
rays (RealRays) – The rays incident on the coating.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after transmission.
- Return type:
- class BaseCoatingPolarized[source]
A base class for polarized coatings.
This class inherits from the BaseCoating class and the ABC (Abstract Base Class) module. Any subclass must implement the jones property to provide the Jones matrix model for the coating.
- classmethod from_dict(data: dict[str, Any]) BaseCoatingPolarized[source]
Creates a coating from a dictionary.
- Parameters:
data (dict) – The dictionary representation of the coating.
- Returns:
The coating created from the dictionary.
- Return type:
- interact(rays: RealRays, reflect: bool = False, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Performs an interaction with the coating.
- Parameters:
rays (RealRays) – The rays incident on the coating.
reflect (bool, optional) – Flag indicating whether to perform reflection (True) or transmission (False). Defaults to False.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after the interaction.
- Return type:
rays (RealRays)
- abstract property jones: BaseJones
The Jones matrix model associated with the coating.
- reflect(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays[source]
Reflects the rays off the coating.
- Parameters:
rays (RealRays) – The rays to be reflected.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after reflection.
- Return type:
- to_dict() dict[str, Any][source]
Converts the coating to a dictionary.
- Returns:
The dictionary representation of the coating.
- Return type:
dict
- transmit(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays[source]
Transmits the rays through the coating.
- Parameters:
rays (RealRays) – The rays to be transmitted.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after transmission through a surface.
- Return type:
- class FresnelCoating(material_pre: BaseMaterial, material_post: BaseMaterial)[source]
Represents a Fresnel coating for polarized light.
This class inherits from the BaseCoatingPolarized class and provides interaction functionality for polarized light with uncoated surfaces. In general, this updates ray intensities based on the Fresnel equations on a surface.
- material_pre
The material before the coating.
- Type:
str
- material_post
The material after the coating.
- Type:
str
- jones
The JonesFresnel object, which calculates the Jones matrices for given ray properties.
- Type:
- classmethod from_dict(data: dict[str, Any]) FresnelCoating[source]
Creates a coating from a dictionary.
- Parameters:
data (dict) – The dictionary representation of the coating.
- Returns:
The coating created from the dictionary.
- Return type:
- interact(rays: RealRays, reflect: bool = False, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Performs an interaction with the coating.
- Parameters:
rays (RealRays) – The rays incident on the coating.
reflect (bool, optional) – Flag indicating whether to perform reflection (True) or transmission (False). Defaults to False.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after the interaction.
- Return type:
rays (RealRays)
- property jones: JonesFresnel
The Jones matrix model associated with the coating.
- reflect(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Reflects the rays off the coating.
- Parameters:
rays (RealRays) – The rays to be reflected.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after reflection.
- Return type:
- to_dict() dict[str, Any][source]
Converts the coating to a dictionary.
- Returns:
The dictionary representation of the coating.
- Return type:
dict
- transmit(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Transmits the rays through the coating.
- Parameters:
rays (RealRays) – The rays to be transmitted.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after transmission through a surface.
- Return type:
- class JonesThinFilm(stack: ThinFilmStack)[source]
Jones matrix generator for a thin-film stack.
Builds diagonal Jones matrices in the s/p basis using thin-film r/t amplitude coefficients. Reflect or transmit selection mirrors JonesFresnel.
- Parameters:
stack – ThinFilmStack configured with incident/substrate and layers.
wavelength_nm – Optional wavelength override (nm); if None uses rays.w (µm)
converted.
aoi_override_rad – Optional AOI override (radians); if None uses computed AOI.
- calculate_matrix(rays: RealRays, reflect: bool = False, aoi: be.ndarray = None) be.ndarray[source]
Calculate the Jones matrix for the given rays.
- Parameters:
rays (RealRays) – Object representing the rays.
reflect (bool, optional) – Indicates whether the rays are reflected or not. Defaults to False.
aoi (be.ndarray, optional) – Array representing the angle of incidence. Defaults to None.
- Returns:
The calculated Jones matrix.
- Return type:
be.ndarray
- class PolarizerCoating(axis: tuple[float, float, float] | list[float] | be.ndarray = (1.0, 0.0, 0.0))[source]
Represents a linear polarizer coating.
- Parameters:
axis (tuple | list | be.ndarray) – A 3D vector representing the transmission axis in global coordinates. Defaults to [1.0, 0.0, 0.0] (horizontal).
- classmethod from_dict(data: dict[str, Any]) PolarizerCoating[source]
Creates a coating from a dictionary.
- interact(rays: RealRays, reflect: bool = False, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Performs an interaction with the coating.
- Parameters:
rays (RealRays) – The rays incident on the coating.
reflect (bool, optional) – Flag indicating whether to perform reflection (True) or transmission (False). Defaults to False.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after the interaction.
- Return type:
rays (RealRays)
- property jones: JonesLinearPolarizer
The Jones matrix model associated with the coating.
- reflect(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Reflects the rays off the coating.
- Parameters:
rays (RealRays) – The rays to be reflected.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after reflection.
- Return type:
- transmit(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Transmits the rays through the coating.
- Parameters:
rays (RealRays) – The rays to be transmitted.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after transmission through a surface.
- Return type:
- class RetarderCoating(retardance: float, axis: tuple[float, float, float] | list[float] | be.ndarray = (1.0, 0.0, 0.0))[source]
Represents a linear retarder coating.
- Parameters:
retardance (float) – The retardance of the coating in radians.
axis (tuple | list | be.ndarray) – A 3D vector representing the fast axis in global coordinates. Defaults to [1.0, 0.0, 0.0] (horizontal).
- classmethod from_dict(data: dict[str, Any]) RetarderCoating[source]
Creates a coating from a dictionary.
- interact(rays: RealRays, reflect: bool = False, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Performs an interaction with the coating.
- Parameters:
rays (RealRays) – The rays incident on the coating.
reflect (bool, optional) – Flag indicating whether to perform reflection (True) or transmission (False). Defaults to False.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after the interaction.
- Return type:
rays (RealRays)
- property jones: JonesLinearRetarder
The Jones matrix model associated with the coating.
- reflect(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Reflects the rays off the coating.
- Parameters:
rays (RealRays) – The rays to be reflected.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after reflection.
- Return type:
- transmit(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Transmits the rays through the coating.
- Parameters:
rays (RealRays) – The rays to be transmitted.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after transmission through a surface.
- Return type:
- class SimpleCoating(transmittance: float, reflectance: float = 0)[source]
A simple coating class that represents a coating with given transmittance and reflectance.
- Parameters:
transmittance (float) – The transmittance of the coating.
reflectance (float, optional) – The reflectance of the coating. Defaults to 0.
- transmittance
The transmittance of the coating.
- Type:
float
- reflectance
The reflectance of the coating.
- Type:
float
- absorptance
The absorptance of the coating, calculated as 1 - reflectance - transmittance.
- Type:
float
- reflect(rays
RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) -> RealRays: Reflects the rays based on the reflectance of the coating.
- transmit(rays
RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) -> RealRays: Transmits the rays based on the transmittance of the coating.
- classmethod from_dict(data: dict[str, Any]) SimpleCoating[source]
Creates a coating from a dictionary.
- Parameters:
data (dict) – The dictionary representation of the coating.
- Returns:
The coating created from the dictionary.
- Return type:
- interact(rays: RealRays, reflect: bool = False, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Performs an interaction with the coating.
- Parameters:
rays (RealRays) – The rays incident on the coating.
reflect (bool, optional) – Flag indicating whether to perform reflection (True) or transmission (False). Defaults to False.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after the interaction.
- Return type:
rays (RealRays)
- reflect(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays[source]
Reflects the rays based on the reflectance of the coating.
- Parameters:
rays (RealRays) – The rays incident on the coating.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after reflection.
- Return type:
- to_dict() dict[str, Any][source]
Converts the coating to a dictionary.
- Returns:
The dictionary representation of the coating.
- Return type:
dict
- transmit(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays[source]
Transmits the rays through the coating by multiplying their intensity with the transmittance.
- Parameters:
rays (RealRays) – The rays incident on the coating.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after transmission.
- Return type:
- class ThinFilmCoating(material_pre: BaseMaterial, material_post: BaseMaterial, layers: list[tuple[BaseMaterial, float, str | None]] | None = None)[source]
Polarized coating that applies a thin-film stack to rays.
This class mirrors FresnelCoating but uses a ThinFilmStack to compute the s/p amplitude coefficients and builds a Jones matrix per ray via JonesThinFilm.
- Parameters:
material_pre – Material before the stack (incident medium of the stack).
material_post – Material after the stack (substrate of the stack).
layers – Optional list of (material, thickness_nm, name) to build the stack.
- classmethod from_dict(data: dict[str, Any]) ThinFilmCoating[source]
Creates a coating from a dictionary.
- Parameters:
data (dict) – The dictionary representation of the coating.
- Returns:
The coating created from the dictionary.
- Return type:
- interact(rays: RealRays, reflect: bool = False, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Performs an interaction with the coating.
- Parameters:
rays (RealRays) – The rays incident on the coating.
reflect (bool, optional) – Flag indicating whether to perform reflection (True) or transmission (False). Defaults to False.
nx (be.ndarray, optional) – The x-component of the surface normal vectors.
ny (be.ndarray, optional) – The y-component of the surface normal vectors.
nz (be.ndarray, optional) – The z-component of the surface normal vectors.
- Returns:
The rays after the interaction.
- Return type:
rays (RealRays)
- property jones: JonesThinFilm
The Jones matrix model associated with the thin-film coating.
- reflect(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Reflects the rays off the coating.
- Parameters:
rays (RealRays) – The rays to be reflected.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after reflection.
- Return type:
- to_dict() dict[str, Any][source]
Converts the coating to a dictionary.
- Returns:
The dictionary representation of the coating.
- Return type:
dict
- transmit(rays: RealRays, nx: be.ndarray = None, ny: be.ndarray = None, nz: be.ndarray = None) RealRays
Transmits the rays through the coating.
- Parameters:
rays (RealRays) – The rays to be transmitted.
nx (be.ndarray, optional) – The x-component of the surface normal vector.
ny (be.ndarray, optional) – The y-component of the surface normal vector.
nz (be.ndarray, optional) – The z-component of the surface normal vector.
- Returns:
The updated rays after transmission through a surface.
- Return type: