pyOptiShared.LayerInfo.LayerStack

class pyOptiShared.LayerInfo.LayerStack

Bases: object

A class to manage a list of layers and material objects.

It contains a layer property that corresponds to a dictionary of LayerInfo objects, where the keys are the internal layer numbers.

Methods

GetLayer(layer_num)

Return a LayerInfo() object corresponding to the layer number layr_num.

GetLayerOffsetFunc(layer_number)

Returns the side wall offset function of a particular layer number in the layer stack.

GetLayerThickness(layer_number)

Returns the thickness of a particular layer number in the layer stack.

GetLayerZmin(layer_number)

Finds the layer_number and return its Zmin.

GetLayersWithTol()

This method returns a list of layer numbers where numpts is larger than 1.

GetMinZmin()

Returns the minimum value of Zmin within all layers in the layer stack.

GetTotalThickness()

Returns the total thickness of the layer stack

GetZBounds()

Returns the minimum and maximum z values of the layer stack

Show([filename, width, height])

Displays the layer stack configuration.

addLayer(number, material, cladding, ...[, ...])

Adds a new layer to the list.

addMaterial(material)

Adds a new material to the list of materials

addMaterialLayer(zmin, thicknes, material)

Add a material layer with uniform thickness

getLayerCladMatNum(layer_num)

Returns cladding material number for the layer number.

getLayerCladMatObj(layer_num)

Returns cladding material object for the layer number.

getLayerMaterialNum(layer_num)

Returns material number for the layer number.

getLayerMaterialObj(layer_num)

Returns material object for the layer number.

getMaterialMap()

Returns the material dictionary

loadFromFolder(material_folder)

Loads materials from folder

setBGandSub(background, substrate)

Sets the background and substrate materials.

Attributes

background

The background material for the region above the substrate.

substrate

The substrate material.

GetLayer(layer_num: int) LayerInfo

Return a LayerInfo() object corresponding to the layer number layr_num. If the layer is not found it raises a ValueError.

Parameters:

layer_num (int) – Number of the layer of interest.

Raises:

ValueError – Raised if no layer is found with the same layer_num.

Returns:

The LayerInfo() object with layer number layer_num.

Return type:

LayerInfo

GetLayerOffsetFunc(layer_number: int) float

Returns the side wall offset function of a particular layer number in the layer stack.

Parameters:

znLayerNum (int) – Layer number in the layer stack.

Raises:

ValueError – In case the layer_number is not found in the LayerStack.

Returns:

Sidewall offset calculation method.

Return type:

sw_func (Callable)

GetLayerThickness(layer_number: int) float

Returns the thickness of a particular layer number in the layer stack.

Parameters:

znLayerNum (int) – Layer number in the layer stack.

Raises:

ValueError – In case the layer_number is not found in the LayerStack.

Returns:

Thickness of the layer.

Return type:

layer_thickness (float)

GetLayerZmin(layer_number: int | int64) float

Finds the layer_number and return its Zmin.

Parameters:

layer_number (int) – Layer number in the layer stack.

Raises:

ValueError – In case the layer_number is not found in the LayerStack.

Returns:

Value where the layer thickness start.

Return type:

zmin (float)

GetLayersWithTol() list

This method returns a list of layer numbers where numpts is larger than 1.

Returns:

List of layer numbers with more than 1 numpts.

Return type:

list

GetMinZmin()

Returns the minimum value of Zmin within all layers in the layer stack.

GetTotalThickness() float

Returns the total thickness of the layer stack

Returns:

Total thickness of the layer stac

Return type:

float

GetZBounds() tuple[float, float]

Returns the minimum and maximum z values of the layer stack

Returns:

Minimum and maximum z values of the layer stack

Return type:

tuple[float, float]

Show(filename: str = None, width=7.5, height=3)

Displays the layer stack configuration.

Parameters:

filename (str, optional) – Enables image export to formats supported by matplotlib. For more information, visit the matplotlib documentation.

addLayer(number: int, material: str | Material, cladding: str | Material, thickness: float, zmin: float, name: str = None, sideWallAng: float = 0, sideWallFunct: Callable | None = None, fabtol: float = 0.1, numpts: int = 1)

Adds a new layer to the list. This function will throw an error if the layer number is already in use.

Parameters:
  • name (str) – Layer name

  • number (int) – Unique layer number.

  • material (str | Material) – Material name or material object

  • cladding (str | Material) – Material name or material object for cladding

  • thickness (float) – Layer thickness (um)

  • zmin (float) – Starting point of the layer

  • sideWallAng (float, optional) – Sidewall angle in degrees. Defaults to 0.

  • sideWallFunct (Callable | None, optional) – Sidewall function. Defaults to None.

  • fabtol (float, optional) – Fabrication tolerence. Defaults to 0.1.

  • numpts (int, optional) – Number of points. Defaults to 1.

addMaterial(material: Material)

Adds a new material to the list of materials

Parameters:

material (Material) – Material object. It can be ConstMaterial, ExperimentalMaterial or SellmeierMaterial.

addMaterialLayer(zmin: float, thicknes: float, material: str | Material)

Add a material layer with uniform thickness

Parameters:
  • zmin (float) – Layer start position

  • thicknes (float) – Layer thickness

  • material (str | Material) – Layer Material

getLayerCladMatNum(layer_num: int) int | None

Returns cladding material number for the layer number. Returns none if the layer number does not exist

Parameters:

layer_num (int) – Layer number

Returns:

Cladding material number

Return type:

int|None

getLayerCladMatObj(layer_num: int) Material | None

Returns cladding material object for the layer number. Returns none if the layer number does not exist

Parameters:

layer_num (int) – Layer number

Returns:

Cladding material object

Return type:

Material|None

getLayerMaterialNum(layer_num: int) int | None

Returns material number for the layer number. Returns none if the layer number does not exist

Parameters:

layer_num (int) – Layer number

Returns:

Material number

Return type:

int|None

getLayerMaterialObj(layer_num: int) Material | None

Returns material object for the layer number. Returns none if the layer number does not exist

Parameters:

layer_num (int) – Layer number

Returns:

Material object

Return type:

Material|None

getMaterialMap() dict[int, Material]

Returns the material dictionary

Returns:

Material dictionary

Return type:

dict[int,Material]

loadFromFolder(material_folder: str)

Loads materials from folder

Parameters:

material_folder (str) – Path to older including material definitions

setBGandSub(background: str | Material, substrate: str | Material)

Sets the background and substrate materials. If material names are used, the material must already exist in the library

Parameters:
  • background (str | Material) – Bacground material name or a material object

  • substrate (str | Material) – Substrate material name or a material object

property background: Material

The background material for the region above the substrate.

Returns:

The background material object.

Return type:

Material

property substrate: Material

The substrate material.

Returns:

The substrate material object.

Return type:

Material