pyOptiShared.LayerInfo.LayerStack
- class pyOptiShared.LayerInfo.LayerStack
Bases:
objectA class to manage a list of layers and material objects.
It contains a layer property that corresponds to a dictionary of
LayerInfoobjects, where the keys are the internal layer numbers.Methods
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
Returns background and substrate material objects
Returns background and substrate material numbers
GetLayer(layer_num)Return a LayerInfo() object corresponding to the layer number layr_num.
GetLayerCladMatNum(layer_number)Returns cladding material number for the layer number.
GetLayerCladMatObj(layer_number)Returns cladding material object for the layer number.
GetLayerMaterialNum(layer_number)Returns material number for the layer number.
GetLayerMaterialObj(layer_number)Returns material object for the layer number.
GetLayerOffsetFunc(layer_number)Returns the side wall offset function of a particular layer number in the layer stack.
GetLayerShapeInfo([layer_number])GetLayerThickness(layer_number)Returns the thickness of a particular layer number in the layer stack.
GetLayerZmax(layer_number)Finds the layer with the layer_number and return its Zmax.
GetLayerZmin(layer_number)Finds the layer with the layer_number and return its Zmin.
Returns the thicknesses of each layer
This method returns a list of layer numbers where numpts is larger than 1.
Returns material library
Returns the material dictionary
Returns the minimum value of Zmin within all layers in the layer stack.
Returns the total thickness of the layer stack
Returns the minimum and maximum z values of the layer stack
LoadFromFolder(material_folder)Loads materials from folder
SetBGandSub(background[, substrate, ...])Sets the background and substrate materials.
Show([filename, width, height])Displays the layer stack configuration.
Attributes
The background material for the region above the substrate.
layerslayers_zminmaxThe substrate material.
substrate_zmax- AddLayer(number: int, material: str | Material, cladding: str | Material | None = None, thickness: float = 0.0, zmin: float = 0.0, 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
- 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:
- GetLayerCladMatNum(layer_number: int) → int | None
Returns cladding material number for the layer number. Returns none if the layer number does not exist
- GetLayerCladMatObj(layer_number: int) → Material | None
Returns cladding material object for the layer number. Returns none if the layer number does not exist
- GetLayerMaterialNum(layer_number: int) → int | None
Returns material number for the layer number. Returns none if the layer number does not exist
- GetLayerMaterialObj(layer_number: int) → Material | None
Returns material object for the layer number. Returns none if the layer number does not exist
- GetLayerOffsetFunc(layer_number: int) → Callable
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 function.
- 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:
- GetLayerZmax(layer_number: int | int64) → float
Finds the layer with the layer_number and return its Zmax.
- 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 ends.
- Return type:
Zmax (float)
- GetLayerZmin(layer_number: int | int64) → float
Finds the layer with 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)
- GetLayersThickness() → dict
Returns the thicknesses of each layer
- Returns:
A dict where the key is the layer number and the value is the thickness.
- Return type:
- 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:
- GetMaterialLib() → MaterialLibrary
Returns material library
- Returns:
Material library object
- Return type:
- 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:
- 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 = None, substrate_zmax: float = 0.0)
Sets the background and substrate materials. If material names are used, the material must already exist in the library
- 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.