Skip to content

Commit

Permalink
Added sample component: 2x2 optical switch
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafacc committed Oct 3, 2020
1 parent 2bbee30 commit 7db7dfc
Show file tree
Hide file tree
Showing 20 changed files with 720,381 additions and 0 deletions.
19 changes: 19 additions & 0 deletions opics/libs/ebeam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,22 @@ def __init__(self, f=f, height= 220e-9, width= 500e-9, OID=1):
self.componentID = "Ebeam_Y"


class Switch(componentModel):
"""2x2 tunable optical switch component. Useful for switching the input optical power between two output ports.
"""
cls_attrs = {"power": 0}
valid_OID = [1]
ports = 4
def __init__(self, f=f, power = 0e-3, OID = 1):
data_folder=datadir / "2x2_switch"
filename="2x2_switch.xml"

LUT_attrs_ = deepcopy(self.cls_attrs)
LUT_attrs_["power"] = power
super().__init__(f, data_folder, filename, 4, "switch_sparam", **LUT_attrs_)
if(OID in self.valid_OID):
self.s = self.load_sparameters(data_folder, filename)
else:
self.s = np.zeros((self.f.shape[0], self.ports, self.ports))
self.componentID = "Ebeam_switch"
74 changes: 74 additions & 0 deletions opics/libs/ebeam/data/2x2_switch/2x2_switch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<lumerical_lookup_table name="index_table" version="1.0">
<association>
<design>
<value name="power" type="double">0</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_0.dat;2x2_switch_0.npz</value>
</extracted>
</association>
<association>
<design>
<value name="power" type="double">0.003</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_3.dat;2x2_switch_3.npz</value>
</extracted>
</association>
<association>
<design>
<value name="power" type="double">0.006</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_6.npz;2x2_switch_6.dat</value>
</extracted>
</association>
<association>
<design>
<value name="power" type="double">0.009</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_9.dat;2x2_switch_9.npz</value>
</extracted>
</association>
<association>
<design>
<value name="power" type="double">0.012</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_12.dat;2x2_switch_12.npz</value>
</extracted>
</association>
<association>
<design>
<value name="power" type="double">0.015</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_15.npz;2x2_switch_15.dat</value>
</extracted>
</association>
<association>
<design>
<value name="power" type="double">0.018</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_18.npz;2x2_switch_18.dat</value>
</extracted>
</association>
<association>
<design>
<value name="power" type="double">0.021</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_21.npz;2x2_switch_21.dat</value>
</extracted>
</association>
<association>
<design>
<value name="power" type="double">0.025</value>
</design>
<extracted>
<value name="switch_sparam" type="string">2x2_switch_25.dat;2x2_switch_25.npz</value>
</extracted>
</association>
</lumerical_lookup_table>
Loading

0 comments on commit 7db7dfc

Please sign in to comment.