LayerSequence#
- class optika.materials.LayerSequence(layers)[source]#
Bases:
AbstractLayerSequenceAn explicit sequence of layers.
Examples
Plot a Si/Cr/Zr stack of layers
import matplotlib.pyplot as plt import astropy.units as u import astropy.visualization import optika # Define the layer stack layers = optika.materials.LayerSequence([ optika.materials.Layer( chemical="Si", thickness=10 * u.nm, kwargs_plot=dict( color="tab:blue", alpha=0.5, ), ), optika.materials.Layer( chemical="Cr", thickness=5 * u.nm, kwargs_plot=dict( color="tab:orange", alpha=0.5, ), ), optika.materials.Layer( chemical="Zr", thickness=15 * u.nm, kwargs_plot=dict( color="tab:green", alpha=0.5, ), ), ]) # Plot the layer stack with astropy.visualization.quantity_support() as qs: fig, ax = plt.subplots(constrained_layout=True) layers.plot(ax=ax) ax.set_axis_off() ax.autoscale_view()
Attributes
The interface profile on the left side of this layer.
This object interpreted as an instance of
LayerSequence.A sequence of layers.
The array shape of this object.
The thickness of this layer.
Methods
__init__(layers)n(wavelength)The index of refraction on the left side of the layer.
plot([x, z, width, ax])Plot this layer.
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.transfer(wavelength, direction, polarized_s, n)Compute the index of refraction, internal propagation direction, transfer matrix, and where the transfer matrix is valid for this layer, which propagates the electric field from the left side of the layer to the right side.
Inheritance Diagram

- Parameters:
layers (Sequence[AbstractLayer])
- n(wavelength)[source]#
The index of refraction on the left side of the layer.
- Parameters:
wavelength (Quantity | AbstractScalar) – The wavelength of the incident light in vacuum
- Return type:
- plot(x=<Quantity 0. nm>, z=<Quantity 0. nm>, width=<Quantity 10. nm>, ax=None, **kwargs)[source]#
Plot this layer.
- Parameters:
x (Quantity) – The horizontal offset of the plotted layer
z (Quantity) – The vertical offset of the plotted layer.
width (Quantity) – The horizontal width of the plotted layer.
ax (None | Axes) – The matplotlib axes instance on which to plot the layer.
kwargs – Additional keyword arguments to pass into.
- 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.
- transfer(wavelength, direction, polarized_s, n, where=True)[source]#
Compute the index of refraction, internal propagation direction, transfer matrix, and where the transfer matrix is valid for this layer, which propagates the electric field from the left side of the layer to the right side.
- Parameters:
wavelength (Quantity | AbstractScalar) – The wavelength of the incident light in vacuum.
direction (float | AbstractScalar) – The component of the incident light’s propagation direction in the medium before this layer antiparallel to the surface normal.
polarized_s (bool | AbstractScalar) – If
True, the incident light is \(s\)-polarized. IfFalse, the incident light is \(p\)-polarized.n (float | AbstractScalar) – The complex index of refraction of the medium before this layer.
where (bool | AbstractScalar) – The boolean mask that should be applied to the transfer matrix.
Truewhere the transfer matrix is invertible.
- Return type:
tuple[AbstractScalar, AbstractScalar, Cartesian2dMatrixArray, AbstractScalar]
- property interface: None | AbstractInterfaceProfile#
The interface profile on the left side of this layer.
- property layer_sequence: LayerSequence#
This object interpreted as an instance of
LayerSequence.
- layers: Sequence[AbstractLayer] = <dataclasses._MISSING_TYPE object>#
A sequence of layers.
- property thickness: Quantity | AbstractScalar#
The thickness of this layer.