grating¶
- photonforge.stencil.grating(period, num_periods, width, fill_factor=0.5, taper_length=0, taper_width=0)¶
Create a linear grating.
- Parameters:
period (float) – Grating period (distance between adjacent teeth centers).
num_periods (int) – Number of grating periods.
width (float) – Lateral grating width.
fill_factor (float | str | Expression) – Ratio between the grating teeth and the grating period. An string parametrized by
"u"
or a expression of a single parameter (varied from 0 to 1) can be used to vary the fill factor along the grating.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:
Grating structures.
- Return type:
# Grating with taper
grating1 = grating(period=0.6, num_periods=20, width=10, taper_length=30, taper_width=0.5)
# Apodized grating
grating2 = grating(period=0.6, num_periods=25, width=10, fill_factor="0.8 - 1.2 * (1 - u) * u")