stencil.apodized_grating
apodized_grating(teeth_gaps, teeth_widths, width, taper_length, taper_width)Create an apodized grating.
Args
- teeth_gaps (float | Sequence[float]): Distance between adjacent grating teeth.
- teeth_widths (float | Sequence[float]): List of grating teeth width.
- width (float): Lateral grating width.
- taper_length (float): length of an optional linear taper ending at the grating.
- taper_width (float): width at the start of the linear taper.
Returns
list[Rectangle | Polygon]: Grating structures.
Note
Arguments teeth_gaps and teeth_widths can be a single number
or a sequence. The largest sequence among them will define the
number of teeth created. The smaller will be increased to the
largest length by repeating its last element.
Example
>>> # Grating with taper, constant widths and varying spacings>>> grating1 = pf.stencil.apodized_grating(... teeth_gaps=np.linspace(0.2, 0.4, 20),... teeth_widths=0.2,... width=10,... taper_length=30,... taper_width=0.5,... )>>> # Grating without taper, width and spacing variations>>> grating2 = pf.stencil.apodized_grating(... teeth_gaps=np.linspace(0.2, 0.4, 20),... teeth_widths=np.linspace(0.4, 0.1, 20),... width=10,... )>>> grating2 = [s.translate((50, 0)) for s in grating2]>>> component = pf.Component().add(*grating1, *grating2)