Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix grating coupler simulation #539

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions gplugins/tidy3d/get_simulation_grating_coupler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from gdsfactory.technology import DerivedLayer, LayerStack, LogicalLayer
from gdsfactory.typings import CrossSectionSpec, LayerSpecs

from gplugins.common.base_models.component import move_polar_rad_copy
from gplugins.tidy3d.materials import get_medium


Expand Down Expand Up @@ -427,11 +426,7 @@ def get_simulation_grating_coupler(
+ box_thickness
)
waveguide_port_size = [size_x, size_y, size_z]

xy_shifted = move_polar_rad_copy(
np.array(port.dcenter), angle=np.deg2rad(angle), length=port_waveguide_offset
)
waveguide_port_center = [xy_shifted[0], xy_shifted[1], (size_z) / 2]
waveguide_port_center = [-sim_size[0] / 2 + port_waveguide_offset, 0, 0]

waveguide_monitor = td.ModeMonitor(
center=waveguide_port_center,
Expand Down Expand Up @@ -466,7 +461,7 @@ def get_simulation_grating_coupler(

# Define Gaussian beam source
gaussian_beam = td.GaussianBeam(
size=(td.inf, td.inf, 0),
size=(fiber_mfd, td.inf, 0),
center=[fiber_port_x, 0, fiber_z],
source_time=td.GaussianPulse(freq0=freq0, fwidth=fwidth),
angle_theta=np.deg2rad(-fiber_angle_deg),
Expand Down
Loading