Skip to content

Commit

Permalink
improve notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
joamatab committed Aug 6, 2023
1 parent a61a4b2 commit 0b489a8
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions docs/notebooks/11_sparameters_gratings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,23 @@
)
f = gt.plot_simulation(s)


# %%
def log(x):
return 20 * np.log10(x)


# %%
sp = gt.write_sparameters_grating_coupler(
c,
is_3d=False,
fiber_angle_deg=fiber_angle_deg,
fiber_xoffset=0,
filepath=PATH.sparameters / "gc_te1550.npz",
)

# %%
offsets = np.arange(-15, 6, 5)
offsets = np.arange(-5, 5 + 1, 5)
offsets

# %%
Expand All @@ -52,25 +67,21 @@
fiber_angle_deg=fiber_angle_deg,
fiber_xoffset=fiber_xoffset,
dirpath=PATH.sparameters,
filepath=PATH.sparameters
/ f"{c.name}_{fiber_angle_deg:.1f}deg_{fiber_xoffset:.1f}um.npz",
)
for fiber_xoffset in offsets
]
sps = gt.write_sparameters_grating_coupler_batch(jobs)


# %%
def log(x):
return 20 * np.log10(x)


# %%
for offset in offsets:
sp = gt.write_sparameters_grating_coupler(
c,
is_3d=False,
fiber_angle_deg=fiber_angle_deg,
fiber_xoffset=offset,
dirpath=PATH.sparameters,
filepath=PATH.sparameters / f"gc_{offset}.npz",
)
plt.plot(
sp["wavelengths"],
Expand Down

0 comments on commit 0b489a8

Please sign in to comment.