def draw(gap): ## ------------------------------------------------------------------ ## ## Define Cells ## ## ------------------------------------------------------------------ ## wg_cell = [] cavity_cell = [] gccell = [] del (wg_cell, cavity_cell, gccell) ## Cell containing the waveguides wg_cell = gdspy.Cell('WV' + str((n - 1) * (gap - gap0) / (gap1 - gap0))) ## Cell containing microrings cavity_cell = gdspy.Cell('DRING' + str((n - 1) * (gap - gap0) / (gap1 - gap0))) ## Cell containing bragg couplings gc = gdspy.GdsImport( 'GC_mod.gds', rename={'q': 'CPGRAT' + str((n - 1) * (gap - gap0) / (gap1 - gap0))}, layers={10158: 1158}) gccell = gc.extract('CPGRAT' + str((n - 1) * (gap - gap0) / (gap1 - gap0))) ## ------------------------------------------------------------------ ## ## Layer Specification ## ## ------------------------------------------------------------------ ## spec = {'layer': 37, 'datatype': 4} # Fully etched SOI: waveguide core spec2 = { 'layer': 37, 'datatype': 5 } # Fully etched SOI: waveguide cladding (trench around core) spec3 = { 'layer': 1158, 'datatype': 0 } # Area not to be filled with dummies (SOI,Poly or metal) ## ------------------------------------------------------------------ ## ## Objects Design ## ## ------------------------------------------------------------------ ## #------ Waveguide+taper -----------------------------------------------# waveguide = gdspy.Path(wg_w, (-sec_gap, 0)) waveguide.segment(sec_gap, '+x', **spec) waveguide.segment(r1 * (1 - 2 * sin(pi / 8.0)), '+x', **spec) waveguide.turn(r1, -pi / 8.0, max_points=4094, number_of_points=0.1, **spec) waveguide.turn(r1, pi / 8.0, max_points=4094, number_of_points=0.1, **spec) waveguide.turn(r1, pi / 8.0, max_points=4094, number_of_points=0.1, **spec) waveguide.turn(r1, -pi / 8.0, max_points=4094, number_of_points=0.1, **spec) waveguide.segment(r1 * (1 - 2 * sin(pi / 8.0)), '+x', **spec) waveguide.segment(sec_gap, '+x', **spec) #------ Coupled DRing -----------------------------------------------# pcavc = (waveguide.x - sec_gap - r1, waveguide.y - gap - 0.5 * wg_w - r1 * 2 * (1.5 - cos(pi / 8.0))) cav = coupled_ring(pcavc, r1, r2, gap, wg_w2M, wg_w2m, spec["layer"], spec["datatype"]) #------ Trench Arond waveguides -----------------------------------------------# waveguide2 = gdspy.Path(wg_w2, (-sec_gap, 0)) waveguide2.segment(sec_gap, '+x', **spec2) waveguide2.segment(r1 * (1 - 2 * sin(pi / 8.0)), '+x', **spec2) waveguide2.turn(r1, -pi / 8.0, max_points=4094, number_of_points=0.1, **spec2) waveguide2.turn(r1, pi / 8.0, max_points=4094, number_of_points=0.1, **spec2) waveguide2.turn(r1, pi / 8.0, max_points=4094, number_of_points=0.1, **spec2) waveguide2.turn(r1, -pi / 8.0, max_points=4094, number_of_points=0.1, **spec2) waveguide2.segment(r1 * (1 - 2 * sin(pi / 8.0)), '+x', **spec2) waveguide2.segment(sec_gap, '+x', **spec2) #------ Trench Arond coupled rings -----------------------------------------------# cav12 = gdspy.Rectangle((pcavc[0] - r1 - c_w2, pcavc[1] - r1 - c_w2), (pcavc[0] + r1 + c_w2, pcavc[1] + r1), **spec2) #+c_w2+2*c_w2 #nofillc=gdspy.Rectangle( (waveguide.x-sec_gap-r1-taper_l-r1-wg_w2,waveguide.y-gap-0.5*wg_w-r1*2*(1.5-cos(pi/8.0))-r1-wg_w2),(waveguide.x-sec_gap-r1-taper_l+r1+wg_w2,waveguide.y-gap-0.5*wg_w-r1*2*(1.5-cos(pi/8.0))+r1+wg_w2),**spec3) #nofillw=gdspy.Rectangle( (-bragg_offset,-bragg_nofill/2.0-bragg_nfoffset),(waveguide.x,waveguide.y+bragg_nofill/2.0-bragg_nfoffset),**spec3) ## ------------------------------------------------------------------ ## ## Adding Objects into Cells ## ## ------------------------------------------------------------------ ## wg_cell.add(waveguide) wg_cell.add( waveguide2 ) # Cell: Waveguide; Objects: waveguide+taper, waveguide trenching cavity_cell.add(cav) cavity_cell.add( cav12) # Cell: Cavity; Objects: coupled rings, ring trenching waveguidex = waveguide.x waveguidey = waveguide.y # --------- Taper sections --------------------------- # return (wg_cell, cavity_cell, gccell, waveguidex, waveguidey)
def draw(gap): ## ------------------------------------------------------------------ ## ## Define Cells ## ## ------------------------------------------------------------------ ## wg_cell = [] nofill_cell = [] cavity_cell = [] gccell = [] httiaucell = [] htnicrcell = [] del (wg_cell, nofill_cell, cavity_cell, gccell, httiaucell, htnicrcell) ## Cell containing the waveguides wg_cell = gdspy.Cell('WAVEGUIDES' + str(2 * n * (gap - gap0) / (gap0 + gap1))) ## Cell containing no fill area nofill_cell = gdspy.Cell('NOFILL' + str(2 * n * (gap - gap0) / (gap0 + gap1))) ## Cell containing microrings cavity_cell = gdspy.Cell('CAV' + str(2 * n * (gap - gap0) / (gap0 + gap1))) ## Cell containing bragg couplings gc = gdspy.GdsImport('GC_mod.gds', rename={ 'q': 'COUPLERGRATING' + str(2 * n * (gap - gap0) / (gap0 + gap1)) }, layers={10158: 1158}) gccell = gc.extract('COUPLERGRATING' + str(2 * n * (gap - gap0) / (gap0 + gap1))) ## Aligment Cell am = gdspy.GdsImport('aligment_mark.gds', rename={ 'Alignment_Mark': 'Alignment_Mark' + str(2 * n * (gap - gap0) / (gap0 + gap1)) }) amcell = am.extract('Alignment_Mark' + str(2 * n * (gap - gap0) / (gap0 + gap1))) ## NiCr Heater Cell nccell = gdspy.Cell('Heater_Ni_Cr' + str(2 * n * (gap - gap0) / (gap0 + gap1))) ## ------------------------------------------------------------------ ## ## Layer Specification ## ## ------------------------------------------------------------------ ## spec = {'layer': 37, 'datatype': 4} # Fully etched SOI: waveguide core spec2 = { 'layer': 37, 'datatype': 5 } # Fully etched SOI: waveguide cladding (trench around core) spec3 = { 'layer': 1158, 'datatype': 0 } # Area not to be filled with dummies (SOI,Poly or metal) spec4 = {'layer': 1, 'datatype': 0} # NiCr mask ## ------------------------------------------------------------------ ## ## Objects Design ## ## ------------------------------------------------------------------ ## #------ Waveguide+taper -----------------------------------------------# waveguide = gdspy.Path(wg_w, (-sec_gap, 0)) waveguide.segment(sec_gap, '+x', **spec) waveguide.segment(r1 * (1 - 2 * sin(pi / 8.0)), '+x', **spec) waveguide.turn(r1, -pi / 8.0, max_points=4094, number_of_points=0.1, **spec) waveguide.turn(r1, pi / 8.0, max_points=4094, number_of_points=0.1, **spec) waveguide.turn(r1, pi / 8.0, max_points=4094, number_of_points=0.1, **spec) waveguide.turn(r1, -pi / 8.0, max_points=4094, number_of_points=0.1, **spec) waveguide.segment(r1 * (1 - 2 * sin(pi / 8.0)), '+x', **spec) waveguide.segment(sec_gap, '+x', **spec) waveguide.segment(taper_l, '+x', final_width=taper_w, **spec) #------ No tilling region -----------------------------------------------# nofill = gdspy.Path(nofill_w, (waveguide.x - taper_l, waveguide.y)) nofill.segment(taper_l + taper_ii_l + iii_v_l / 2.0, '+x', **spec3) #------ Coupled Microrings -----------------------------------------------# r2 = (r1 - wg_w - 3.0 * gap / 2.0) / 2.0 pcavc = (waveguide.x - sec_gap - r1 - taper_l, waveguide.y - gap - 0.5 * wg_w - r1 * 2 * (1.5 - cos(pi / 8.0))) cav1 = gdspy.Round((pcavc[0], pcavc[1]), r1, r1 - wg_w, max_points=4094, number_of_points=0.1, **spec) cav2 = gdspy.Round((pcavc[0] + r2 + 0.5 * gap, pcavc[1]), r2, r2 - wg_w, max_points=4094, number_of_points=0.1, **spec) cav3 = gdspy.Round((pcavc[0] - r2 - 0.5 * gap, pcavc[1]), r2, r2 - wg_w, max_points=4094, number_of_points=0.1, **spec) #------ Trench Arond waveguides -----------------------------------------------# waveguide2 = gdspy.Path(wg_w2, (-sec_gap, 0)) waveguide2.segment(sec_gap, '+x', **spec2) waveguide2.segment(r1 * (1 - 2 * sin(pi / 8.0)), '+x', **spec2) waveguide2.turn(r1, -pi / 8.0, max_points=4094, number_of_points=0.1, **spec2) waveguide2.turn(r1, pi / 8.0, max_points=4094, number_of_points=0.1, **spec2) waveguide2.turn(r1, pi / 8.0, max_points=4094, number_of_points=0.1, **spec2) waveguide2.turn(r1, -pi / 8.0, max_points=4094, number_of_points=0.1, **spec2) waveguide2.segment(r1 * (1 - 2 * sin(pi / 8.0)), '+x', **spec2) waveguide2.segment(sec_gap, '+x', **spec2) waveguide2.segment(taper_l, '+x', **spec2) #------ Trench Arond coupled rings -----------------------------------------------# cav12 = gdspy.Rectangle((pcavc[0] - r1 - c_w2, pcavc[1] - r1 - c_w2), (pcavc[0] + r1 + c_w2, pcavc[1] + r1 + c_w2), **spec2) #nofillc=gdspy.Rectangle( (waveguide.x-sec_gap-r1-taper_l-r1-wg_w2,waveguide.y-gap-0.5*wg_w-r1*2*(1.5-cos(pi/8.0))-r1-wg_w2),(waveguide.x-sec_gap-r1-taper_l+r1+wg_w2,waveguide.y-gap-0.5*wg_w-r1*2*(1.5-cos(pi/8.0))+r1+wg_w2),**spec3) #nofillw=gdspy.Rectangle( (-bragg_offset,-bragg_nofill/2.0-bragg_nfoffset),(waveguide.x,waveguide.y+bragg_nofill/2.0-bragg_nfoffset),**spec3) #------ NiCr Heater -----------------------------------------------# nch = nicrheat(spec4['layer'], pcavc, r1, hw, hh, ang, sqr) #nch = gdspy.Rectangle( (pcavc[0]-r1-c_w2,pcavc[1]-r1-c_w2),(pcavc[0]+r1+c_w2,pcavc[1]+r1+c_w2),**spec4) ## ------------------------------------------------------------------ ## ## Adding Objects into Cells ## ## ------------------------------------------------------------------ ## wg_cell.add(waveguide) wg_cell.add( waveguide2 ) # Cell: Waveguide; Objects: waveguide+taper, waveguide trenching nofill_cell.add(nofill) #Cell: No fill; Objects: No tilling region cavity_cell.add(cav1) cavity_cell.add(cav2) cavity_cell.add(cav3) cavity_cell.add( cav12) # Cell: Cavity; Objects: coupled rings, ring trenching nccell.add(nch) waveguidex = waveguide.x waveguidey = waveguide.y # --------- Taper sections --------------------------- # return (wg_cell, cavity_cell, gccell, nofill_cell, waveguidex, waveguidey, amcell, nccell)
# -*- coding: cp1252 -*- import os import numpy import gdspy import imecsetup as ims from numpy import * print('Using gdspy module version ' + gdspy.__version__) name = (os.path.abspath(os.path.dirname(os.sys.argv[0]))) + os.sep + 'rezende_heaters_v1' ## ------------------------------------------------------------------ ## ## IMPORT ## ## ------------------------------------------------------------------ ## gdsii = gdspy.GdsImport('rezende_heaters_pad_TiAu.gds') tiau_cell = gdsii.extract('Ti_Au') ## ------------------------------------------------------------------ ## ## DEFINITIONS ## ## ------------------------------------------------------------------ ## # Define boolean operations subtraction = lambda p1, p2: p1 and not p2 sum = lambda p1, p2: p1 or p2 intersection = lambda p1, p2: p1 and p2 ##-------------------------------------------------------------## ## PARAMETERS ##-------------------------------------------------------------## wg_w = 0.65 # waveguide width [um]
import os import numpy import gdspy import imecsetup as ims from numpy import * print('Using gdspy module version ' + gdspy.__version__) name = (os.path.abspath(os.path.dirname(os.sys.argv[0]))) + os.sep + 'rezende_full_final_v3' ##-------------------------------------------------------------## ## PARAMETERS ##-------------------------------------------------------------## d= 2200 # distance btw layouts [um] gdsii1 = gdspy.GdsImport('rezende_ughent_ribs_final_5_mod.gds') c1=gdsii1.extract('COMB1') gdsii2 = gdspy.GdsImport('rezende_ughent_crings_v_finalmod_.gds') c2=gdsii2.extract('COMB2') tog =gdspy.Cell('REZENDE_FULL') tog.add(gdspy.CellReference(c1,origin=(0,0))) tog.add(gdspy.CellReference(c2,origin=(d,0))) ## ------------------------------------------------------------------ ## ## OUTPUT ## ## ------------------------------------------------------------------ ## ## Output the layout to a GDSII file (default to all created cells). ## Set the units we used to micrometers and the precision to nanometers.
import numpy import gdspy import imecsetup as ims from numpy import * print('Using gdspy module version ' + gdspy.__version__) name = (os.path.abspath(os.path.dirname( os.sys.argv[0]))) + os.sep + 'rezende_full_final' ##-------------------------------------------------------------## ## PARAMETERS ##-------------------------------------------------------------## d = 2200 # distance btw layouts [um] gdsii1 = gdspy.GdsImport('rezende_ughent_ribs_final_2.gds') c1 = gdsii1.extract('COMB1') gdsii2 = gdspy.GdsImport('rezende_ughent_crings_v_final.gds') c2 = gdsii2.extract('COMB2') tog = gdspy.Cell('REZENDE_FULL') tog.add(gdspy.CellReference(c1, origin=(0, 0))) tog.add(gdspy.CellReference(c2, origin=(d, 0))) ## ------------------------------------------------------------------ ## ## OUTPUT ## ## ------------------------------------------------------------------ ## ## Output the layout to a GDSII file (default to all created cells). ## Set the units we used to micrometers and the precision to nanometers.
# Set the units we used to micrometers and the precision to nanometers. gdspy.gds_print('tutorial.gds', unit=1.0e-6, precision=1.0e-9) # ------------------------------------------------------------------ # # IMPORT # ------------------------------------------------------------------ # # Import the file we just created, and extract the cell 'POLYGONS'. To # avoid naming conflict, we will rename all cells. gdsii = gdspy.GdsImport('tutorial.gds', rename={ 'POLYGONS': 'IMPORT_POLY', 'PATHS': 'IMPORT_PATHS', 'OPERATIONS': 'IMPORT_OPER', 'SLICE': 'IMPORT_SLICE', 'REFS': 'IMPORT_REFS', 'TRANS': 'IMPORT_TRANS' }, layers={ 1: 7, 2: 8, 3: 9 }) # Now we extract the cells we want to actually include in our current # structure. Note that the referenced cells will be automatically # extracted as well. gdsii.extract('IMPORT_REFS') # ------------------------------------------------------------------ # # VIEWER # ------------------------------------------------------------------ #
## Set the units we used to micrometers and the precision to nanometers. gdspy.gds_print('tutorial.gds', unit=1.0e-6, precision=1.0e-9) ## ------------------------------------------------------------------ ## ## IMPORT ## ------------------------------------------------------------------ ## ## Import the file we just created, and extract the cell 'POLYGONS'. To ## avoid naming conflict, we will rename all cells. gdsii = gdspy.GdsImport('tutorial.gds', rename={ 'POLYGONS': 'IMPORT_POLY', 'PATHS': 'IMPORT_PATHS', 'BOOLEAN': 'IMPORT_BOOL', 'SLICE': 'IMPORT_SLICE', 'REFS': 'IMPORT_REFS' }, layers={ 1: 7, 2: 8, 3: 9 }) ## Now we extract the cells we want to actually include in our current ## structure. Note that the referenced cells will be automatically ## extracted as well. gdsii.extract('IMPORT_REFS') ## ------------------------------------------------------------------ ## ## VIEWER ## ------------------------------------------------------------------ ##
def draw(gap): ## ------------------------------------------------------------------ ## ## Define Cells ## ## ------------------------------------------------------------------ ## wg_cell = [] nofill_cell = [] cavity_cell = [] gccell = [] del (wg_cell,nofill_cell,cavity_cell,gccell) ## Cell containing the waveguides wg_cell = gdspy.Cell('WAVEGUIDES'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## Cell containing no fill area nofill_cell = gdspy.Cell('NOFILL'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## Cell containing microrings cavity_cell = gdspy.Cell('CAV'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## Cell containing bragg couplings gc = gdspy.GdsImport('GC_mod.gds', rename={'q': 'COUPLERGRATING'+ str(2*n*(gap-gap0)/(gap0+gap1))}, layers={10158: 1158}) gccell = gc.extract('COUPLERGRATING'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## Aligment Cell am = gdspy.GdsImport('aligment_mark.gds', rename={'Alignment_Mark': 'Alignment_Mark'+ str(2*n*(gap-gap0)/(gap0+gap1))}) amcell = am.extract('Alignment_Mark'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## ------------------------------------------------------------------ ## ## Layer Specification ## ## ------------------------------------------------------------------ ## spec = {'layer': 37, 'datatype': 4} # Fully etched SOI: waveguide core spec2 = {'layer': 37, 'datatype': 5} # Fully etched SOI: waveguide cladding (trench around core) spec3 = {'layer': 1158, 'datatype': 0} # Area not to be filled with dummies (SOI,Poly or metal) ## ------------------------------------------------------------------ ## ## Objects Design ## ## ------------------------------------------------------------------ ## #------ Waveguide+taper -----------------------------------------------# waveguide = gdspy.Path(wg_w, (-sec_gap,0)) waveguide.segment(sec_gap,'+x',**spec) waveguide.segment(r1*(1-2*sin(pi/8.0)),'+x',**spec) waveguide.turn(r1, -pi/8.0,max_points=4094,number_of_points=0.1, **spec) waveguide.turn(r1, pi/8.0,max_points=4094,number_of_points=0.1, **spec) waveguide.turn(r1, pi/8.0,max_points=4094,number_of_points=0.1, **spec) waveguide.turn(r1, -pi/8.0,max_points=4094,number_of_points=0.1, **spec) waveguide.segment(r1*(1-2*sin(pi/8.0)),'+x',**spec) waveguide.segment(sec_gap,'+x',**spec) waveguide.segment(taper_l,'+x',final_width= taper_w,**spec) ## ------------------------------------------------------------------ ## ## Adding Objects into Cells ## ## ------------------------------------------------------------------ ## wg_cell.add(waveguide) waveguidex=waveguide.x waveguidey=waveguide.y # --------- Taper sections --------------------------- # return (wg_cell,waveguidex,waveguidey)
del (wg_cell,nofill_cell,cavity_cell,gccell,httiaucell,htnicrcell) ## Cell containing the waveguides wg_cell = gdspy.Cell('WAVEGUIDES'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## Cell containing no fill area nofill_cell = gdspy.Cell('NOFILL'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## Cell containing microrings cavity_cell = gdspy.Cell('CAV'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## Cell containing bragg couplings gc = gdspy.GdsImport('GC_mod.gds', rename={'q': 'COUPLERGRATING'+ str(2*n*(gap-gap0)/(gap0+gap1))}, layers={10158: 1158}) gccell = gc.extract('COUPLERGRATING'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## Aligment Cell am = gdspy.GdsImport('aligment_mark.gds', rename={'Alignment_Mark': 'Alignment_Mark'+ str(2*n*(gap-gap0)/(gap0+gap1))}) amcell = am.extract('Alignment_Mark'+ str(2*n*(gap-gap0)/(gap0+gap1))) ## NiCr Heater Cell nccell = gdspy.Cell('Heater_Ni_Cr'+ str(2*n*(gap-gap0)/(gap0+gap1)))