Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #964 from simbilod/terminator
waveguide termination component
- Loading branch information
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from __future__ import annotations | ||
|
||
from typing import List, Optional | ||
|
||
import gdsfactory as gf | ||
from gdsfactory.component import Component | ||
from gdsfactory.components.taper_cross_section import taper_cross_section | ||
from gdsfactory.cross_section import CrossSection, strip | ||
from gdsfactory.types import LayerSpec | ||
|
||
|
||
@gf.cell | ||
def terminator( | ||
length: Optional[float] = 50, | ||
input_xs: Optional[CrossSection] = strip, | ||
tapered_xs: Optional[CrossSection] = None, | ||
tapered_width: float = 2.0, | ||
doping_layers: List[LayerSpec] = ["NPP"], | ||
**kwargs, | ||
) -> gf.Component: | ||
"""Doped narrow taper to terminate waveguides. | ||
Args: | ||
length: distance between input and narrow tapered end. | ||
input_xs: input cross-section. | ||
tapered_xs: cross-section at the end of the termination (by default, input_xs with width 200 nm) | ||
tapered_width: width of the default cross-section at the end of the termination (by default, 200 nm). Only used if tapered_xs is not None | ||
doping_layers: doping layers to superimpose on the taper. Default N++. | ||
**kwargs: taper_cross_section arguments | ||
""" | ||
c = Component() | ||
|
||
tapered_xs = tapered_xs if tapered_xs else gf.partial(input_xs, width=tapered_width) | ||
|
||
taper = c << gf.get_component( | ||
taper_cross_section, | ||
length=length, | ||
cross_section1=input_xs, | ||
cross_section2=tapered_xs, | ||
**kwargs, | ||
) | ||
|
||
for layer in doping_layers: | ||
c << gf.components.bbox(bbox=taper.bbox, layer=layer) | ||
|
||
c.add_port(name="o1", port=taper.ports["o1"]) | ||
|
||
return c | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
c = terminator() | ||
c.show(show_ports=True) |