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.
This method returns a list of layer numbers where numpts is larger than 1.
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
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.
Returns the material dictionary
loadFromFolder
(material_folder)Loads materials from folder
setBGandSub
(background, substrate)Sets the background and substrate materials.
Attributes
The background material for the region above the 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:
- 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:
- 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:
- 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
- getLayerCladMatNum(layer_num: int) → int | None
Returns cladding material number for the layer number. Returns none if the layer number does not exist
- getLayerCladMatObj(layer_num: int) → Material | None
Returns cladding material object for the layer number. Returns none if the layer number does not exist
- getLayerMaterialNum(layer_num: int) → int | None
Returns material number for the layer number. Returns none if the layer number does not exist
- getLayerMaterialObj(layer_num: int) → Material | None
Returns material object for the layer number. Returns none if the layer number does not exist
- 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