ManipulateGDS

class ManipulateGDS(import_path_gds, export_path_gds, import_cells=None, origin=(0, 0))

Bases: object

Class that will load a GDS file and perform actions such as making an array of the passed design (or a subsection of)

Inputs:

import_path_gds - Path to GDS file for import export_path_gds - Path to export GDS import_cells - (Optional) Cells to import (must be cells present in the passed GDS), defaults to all origin - (Defaults to (0,0)) Tuple containing relative origin to import the design

flatten_cells(cell_keys=None, export=False)

Takes cell_keys (or all cells by default) from a GdsLibrary object and flattens them as seperate layers to a single cell export object.

Inputs:
  • cell_keys - (Optional) List of cell names to extract from the passed GDS file

  • export - (Defaults to False) Choose whether to export the generated file, or just to operate on the design (default)

make_array_onChip(columns, rows, spacing=('50um', '50um'), chip_dimension=('20mm', '20mm'), export=True, export_path=None, use_cells=None, add_labels=False, label_string=None, label_offset=None, label_size=50)

Makes an array of a design input and exports it as a new GDS. Labels each arrayed structure.

Inputs:
  • columns - number of columns in the array

  • rows - number of rows in the array

  • spacing - (Defaults to (“50um”, “50um”)) Tuple containing x- and y-spacing of the array as strings with units

  • chip_dimension - (Defaults to (“20mm”, “20mm”)) Dimension of the chip on which to array the structure (WIP)

  • export - (Defaults to True) Choose whether to export the generated file (default), or just to operate on the design

  • export_path - (Optional) Export path (if different from self)

  • use_cells - (Optional) List of cells from the input GDS to include in the arrayed structure

  • add_label - (Defaults to False) Add a label beneath each arrayed structure (WIP)

  • label_string - (Optional) If None, defaults to R1C1, R1C2 etc. (R{row_index}C{column_index}). Otherwise, if a single string is passed, this will be printed with an incrementing number. Otherwise, a list corresponding in length to the total number of arrayed structures can be passed and will be printed along row 1 from left to right, then row 2 etc.

  • label_offset - (Optional) Describes how far beneath the origin for each array point the label is. Defaults to half of spacing in y. Can be passed as a string with units (e.g. 300um).

  • label_size - (Defaults to 50) Text size for the printed labels

Output:
  • cell_array - gdspy cell array containing arrayed structures