pyOptiShared.PortInfo.PortInfo

class pyOptiShared.PortInfo.PortInfo(lines: list | tuple, layer_number: int = 1, orientation: int = 0, mode_number: int = 0, buffer: float | list[float] = [0.0, 0.0], offset: list[float] = [0.0, 0.0], zminmax: tuple = (0.0, 1000.0), name='o#')

Bases: object

This class is used to define all the information related to a single port.

Parameters:
  • lines (list | tuple) – A list of cut points defined as tuple (x,y) for GDS files or (x,y,z) for STL files. These points define the location of a port in a layout.

  • layer_number (int, optional) – The number of the layer where the port exists. Defaults to 1.

  • orientation (int, optional) – The orientation of the port [180,0,90,270]. Defaults to 0.

  • mode_number (int, optional) – The index of the mode excited through the port. Defaults to 0.

  • buffer (float | list[float], optional) – Defines the buffers around the port (regions inside the cladd) so the mode solver sees what surrounds the cut. Defaults to [0.0,0.0].

  • offset (list[float], optional) – defines the offsets of the port in x and y as a list. Defaults to [0.0,0.0].

  • zminmax (tuple, optional) – Defines the minimum and maximum z that the port spans. Defaults to (0.0,1000.0).

Methods

GetPointsList()

Gets the list of points that constructs the port cuts.

GetPortsRecord()

Returns a dictionary of the port layer number and the coressponding cut points in this layer.

SetZminMax([zminmax])

update(lines[, layer_number, offsets, zminmax])

Use to update the definition of a port.

GetPointsList() list[tuple]

Gets the list of points that constructs the port cuts.

Returns:

A list of points that constructs the port cuts.

Return type:

list[tuple]

GetPortsRecord() dict[int, list]

Returns a dictionary of the port layer number and the coressponding cut points in this layer.

Returns:

A dictionary of the port layer number and the coressponding cut points in this layer.

Return type:

dict[int,list]

update(lines: list | tuple, layer_number: int = 1, offsets=[0.0, 0.0], zminmax: tuple = (0.0, 1000.0))

Use to update the definition of a port. Useful to add another cut on the same layer or on another layer if the port spans multiple layers.

Parameters:
  • lines (list | tuple) – A list of cut points defined as tuple (x,y) for GDS files or (x,y,z) for STL files. These points define the location of a port in a layout.

  • layer_number (int, optional) – The number of the layer where the port exists. Defaults to 1.

  • offset (list[float], optional) – defines the offsets of the port in x and y as a list. Defaults to [0.0,0.0].

  • zminmax (tuple, optional) – Defines the minimum and maximum z that the port spans. Defaults to (0.0,1000.0).