Esempio n. 1
0
File: add_gc.py Progetto: tvt173/ubc
def add_gc(
    component=waveguide,
    component_name=None,
    layer_label=LAYER.LABEL,
    grating_coupler=gc_te1550,
    bend_factory=bend_circular,
    straight_factory=waveguide,
    taper_factory=taper_factory,
    route_filter=connect_strip,
    gc_port_name="W0",
    get_input_labels_function=get_input_labels,
    with_align_ports=False,
):
    c = pp.routing.add_io_optical(
        component=component,
        component_name=component_name,
        bend_factory=bend_factory,
        straight_factory=straight_factory,
        route_filter=route_filter,
        grating_coupler=grating_coupler,
        layer_label=layer_label,
        taper_factory=taper_factory,
        gc_port_name=gc_port_name,
        get_input_labels_function=get_input_labels_function,
        with_align_ports=with_align_ports,
    )
    c = rotate(c, -90)
    return c
Esempio n. 2
0
def gc_tm1550():
    c = import_gds("ebeam_gc_tm1550")
    c = rotate(component=c, angle=180)
    c.polarization = "tm"
    c.wavelength = 1550
    auto_rename_ports(c)
    return c
Esempio n. 3
0
def gc_te1550_broadband():
    c = import_gds("ebeam_gc_te1550_broadband")
    c = rotate(component=c, angle=180)
    c.polarization = "te"
    c.wavelength = 1550
    auto_rename_ports(c)
    return c
def add_electrical_pads(component: Component, rotation=180, **kwargs):
    """add compnent with top electrical pads and routes
    Args:
        component: Component,
        pad_spacing: float = 150.,
        pad: Callable = pad,
        fanout_length: Optional[int] = None,
        max_y0_optical: None = None,
        waveguide_separation: float = 4.0,
        bend_radius: float = 0.1,
        connected_port_list_ids: None = None,
        n_ports: int = 1,
        excluded_ports: List[Any] = [],
        pad_indices: None = None,
        route_filter: Callable = connect_elec_waypoints,
        port_name: str = "W",
        pad_rotation: int = -90,
        x_pad_offset: int = 0,
        port_labels: None = None,
        select_ports: Callable = select_electrical_ports,

    """

    c = Component(f"{component.name}_pad")
    cr = rotate(component, rotation)

    elements, pads, _ = route_pad_array(
        component=cr,
        **kwargs,
    )

    c << cr
    for e in elements:
        c.add(e)
    for e in pads:
        c.add(e)

    for pname, p in cr.ports.items():
        if p.port_type == "optical":
            c.add_port(pname, port=p)

    return c.rotate(angle=-rotation)
Esempio n. 5
0
File: add_gc.py Progetto: tvt173/ubc
def gc_te1550():
    c = import_gds("ebeam_gc_te1550")
    c = rotate(c, 180)
    c.polarization = "te"
    c.wavelength = 1550
    return c
Esempio n. 6
0
            )
            for i, pad in zip(pad_indices, pads)
        ]

    io_pad_lines += [pads[:]]

    if connected_port_list_ids:
        ordered_ports = [component.ports[i] for i in connected_port_list_ids]

    for pads in io_pad_lines:
        for i in range(N):
            p0 = pads[i].ports[port_name]
            p1 = ordered_ports[i]
            elements += [routing_method(p0, p1, bend_radius=bend_radius)]

    return elements, io_pad_lines, y0_optical


if __name__ == "__main__":
    from pp.rotate import rotate

    c = pp.c.mzi2x2(with_elec_connections=True)
    c = rotate(c, 180)

    elements, pads, _ = route_pad_array(c, fanout_length=100)
    for e in elements:
        c.add(e)
    for e in pads:
        c.add(e)
    pp.show(c)
Esempio n. 7
0
def get_route2individual_gratings(component,
                                  optical_io_spacing=50,
                                  grating_coupler=grating_coupler_te,
                                  straight_factory=waveguide,
                                  min_input2output_spacing=230,
                                  optical_routing_type=2,
                                  **kwargs):
    """ Returns component I/O for optical testing with single input and oputput fibers (no fiber array)

    Args:
        component: to add grating couplers
        optical_io_spacing: between grating couplers
        grating_coupler:
        straight_factory
        min_input2output_spacing: so opposite fibers do not touch
        optical_routing_type: 0, 1, 2

    .. plot::
      :include-source:

       import pp
       from pp.routing import add_io_optical
       from pp.routing import get_route2individual_gratings

       c = pp.c.mmi1x2()
       cc = add_io_optical(c, get_route_factory=get_route2individual_gratings)
       pp.plotgds(cc)
    """
    grating_coupler = pp.call_if_func(grating_coupler)
    if component.xsize + 2 * grating_coupler.xsize < min_input2output_spacing:
        fanout_length = (min_input2output_spacing - component.xsize -
                         2 * grating_coupler.xsize) / 2
    else:
        fanout_length = None

    west_ports = [
        p for p in component.get_optical_ports() if p.name.startswith("W")
    ]
    east_ports = [
        p for p in component.get_optical_ports() if not p.name.startswith("W")
    ]

    # add west input grating couplers
    component.ports = {p.name: p for p in west_ports}
    component = component.rotate(90)

    elements_east, io_grating_lines_east, _ = get_route2fiber_array(
        component=component,
        with_align_ports=False,
        optical_io_spacing=optical_io_spacing,
        fanout_length=fanout_length,
        grating_coupler=grating_coupler,
        optical_routing_type=optical_routing_type,
        **kwargs)
    component = rotate(component, angle=-90)

    component.ports = {p.name: p for p in east_ports}
    component = rotate(component, angle=-90)
    elements_west, io_grating_lines_west, _ = get_route2fiber_array(
        component=component,
        with_align_ports=False,
        optical_io_spacing=optical_io_spacing,
        fanout_length=fanout_length,
        grating_coupler=grating_coupler,
        **kwargs)
    for e in elements_west:
        elements_east.append(e.rotate(180))

    for io in io_grating_lines_west[0]:
        io_grating_lines_east.append(io.rotate(180))

    return elements_east, io_grating_lines_east, None