Skip to content

Commit

Permalink
Merge pull request #964 from simbilod/terminator
Browse files Browse the repository at this point in the history
waveguide termination component
  • Loading branch information
joamatab committed Dec 7, 2022
2 parents 96a2fab + c614935 commit b8b3374
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gdsfactory/components/taper_cross_section.py
Expand Up @@ -72,6 +72,6 @@ def taper_cross_section(
# x2 = gf.partial(rib, width=2.5)
# c = taper_cross_section_linear(x1, x2)

# c = taper_cross_section()
c = taper_cross_section_sine()
c = taper_cross_section(gf.cross_section.strip, gf.cross_section.rib)
# c = taper_cross_section_sine()
c.show(show_ports=True)
54 changes: 54 additions & 0 deletions gdsfactory/components/terminator.py
@@ -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)

0 comments on commit b8b3374

Please sign in to comment.