Home Forums Nazca Get annotation locations from GDS

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7073
    Edgars
    Participant

    Hello,

    I am having trouble extracting the annotation location from a gds file I load. I currently have a device dictionary (Device_dictionary) which holds all cellnames (keys) in the gds. Then I load the cell based on cellname and can get the annotation location, however, the annotations are then in the cell coordinates. Is there a way to load all annotations in gds file and get their coordinates?

    import nazca as nd
    for key in Device_dictionary:
        device = nd.load_gds(filename='my_file.gds', cellname=key)
        for ii in range(len(device.annotations)):
            print(device.annotations[ii][0].x) # print x coordinate of annotation
            print(device.annotations[ii][0].y) # print x coordinate of annotation

    Bests,
    Edgars

    #7078
    Xaveer
    Moderator

    Dear Edgars,

    I think the following should do what you want, or, at least, point you in the right direction.

    import nazca as nd
    gds = nd.load_gds(filename='my_file.gds', topcellsonly=False, asdict=False)
    for params in nd.cell_iter(gds, revisit=True):
      if params.cell_start:
        name = params.cell.cell_name
          for name not in Device_dictionary:
            continue
          # get cell's translation (pointer) and flip w.r.t. cell_top
          pointer, flip = params.transflip_glob
          for annot, xy in params.iters['annotation']:
            if flip:
              p = nd.Pointer(xy[0], -xy[1])
            else:
              p = nd.Pointer(*xy)
            # add pin position in the cell to the cell translation.
            print(name, pointer.copy().move_ptr(p).xya())

    Xaveer

    • This reply was modified 1 month, 1 week ago by Xaveer.
    • This reply was modified 1 month ago by Katarzyna.
    • This reply was modified 1 month ago by Katarzyna.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.