Beispiel #1
0
 def define_ports(self, ports):
     angle = angle_deg(self.end_position, self.start_position)
     if isinstance(self.start_port, InOpticalPort):
         ports += [OutOpticalPort(position = self.start_position, wg_definition = self.start_wg_def, angle = (angle + 180.0)%360.0), 
                  InOpticalPort(position = self.end_position, wg_definition = self.end_wg_def, angle = angle)]
     else:
         ports += [InOpticalPort(position = self.start_position, wg_definition = self.start_wg_def, angle = (angle + 180.0)%360.0), 
                  OutOpticalPort(position = self.end_position, wg_definition = self.end_wg_def, angle = angle)]
     return ports
Beispiel #2
0
 def define_ports(self, ports):
     ports += [
         InOpticalPort(position=self.input.position,
                       angle=(self.input.angle + 180) % 360.0,
                       wg_definition=self.input.wg_definition),
         OutOpticalPort(position=self.output.position,
                        angle=(self.output.angle + 180) % 360.0,
                        wg_definition=self.output.wg_definition),
     ]
     return ports
Beispiel #3
0
 def define_ports(self, ports):
     for wd, y in zip(self.input_wg_definitions, self.input_y_positions):
         ports += InOpticalPort(wg_definition=wd,
                                position=(0.0, y),
                                angle=180.0)
     for wd, y in zip(self.output_wg_definitions, self.output_y_positions):
         ports += OutOpticalPort(wg_definition=wd,
                                 position=(self.length, y),
                                 angle=0.0)
     return ports
Beispiel #4
0
 def define_ports(self, ports):
     ports += [
         InOpticalPort(position=self.start_point,
                       wg_definition=self.wg_definition,
                       angle=self.start_angle + 180.0),
         OutOpticalPort(position=self.end_point,
                        wg_definition=self.wg_definition,
                        angle=self.end_angle)
     ]
     return ports
Beispiel #5
0
 def define_ports(self, ports):
     a = self.angles_deg()
     ports += [
         InOpticalPort(position=self[0],
                       angle=a[0] + 180.0,
                       wg_definition=self.input_port.wg_definition),
         OutOpticalPort(position=self[-1],
                        angle=a[-2],
                        wg_definition=self.input_port.wg_definition)
     ]
     return ports
Beispiel #6
0
 def define_ports(self, P):
     if not self.aperture_in is None:
         for p in self.aperture_in.ports.transform_copy(
                 self.transformation_in):
             P += InOpticalPort(position=p.position,
                                angle=p.angle_deg,
                                wg_definition=p.wg_definition)
     if not self.aperture_out is None:
         for p in self.aperture_out.ports.transform_copy(
                 self.transformation_out):
             P += OutOpticalPort(position=p.position,
                                 angle=p.angle_deg,
                                 wg_definition=p.wg_definition)
     return P
Beispiel #7
0
 def define_ports(self, ports):
     from ipkiss.plugins.photonics.port.port import InOpticalPort, OutOpticalPort
     if len(self.shape) == 0:
         self.ports = []
         return
     ports += [
         InOpticalPort(position=self.shape[0],
                       angle=angle_deg(self.shape[0], self.shape[1]),
                       wg_definition=self.definition()),
         OutOpticalPort(position=self.shape[-1],
                        angle=angle_deg(self.shape[-1], self.shape[-2]),
                        wg_definition=self.definition())
     ]
     return ports
Beispiel #8
0
 def define_ports(self, prts):
     prts += [
         InOpticalPort(position=(-2.0, 0.0),
                       wg_definition=self.wg_definition,
                       angle=180.0),
         OutOpticalPort(position=(self.bend_radius, self.bend_radius +
                                  0.5 * self.wg_definition.wg_width),
                        wg_definition=self.wg_definition,
                        angle=90.0),
         OutOpticalPort(position=(self.bend_radius, -self.bend_radius -
                                  0.5 * self.wg_definition.wg_width),
                        wg_definition=self.wg_definition,
                        angle=-90.0)
     ]
     return prts
Beispiel #9
0
 def define_ports(self, ports):
     angle = angle_deg(self.end_position, self.start_position)
     ports += [InOpticalPort(wg_definition = self.start_wg_def, position = self.start_position, angle=(angle + 180.0)%360.0), 
              OutOpticalPort(wg_definition = self.end_wg_def, position = self.end_position, angle = angle)]
     return ports