Skip to content

Commit 0a8b215

Browse files
fix[microwave]: fix column vs row-major order in antenna_amps and taper for consistent amplitude scaling
1 parent 39fe01e commit 0a8b215

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tidy3d/plugins/microwave/array_factor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ def _antenna_locations(self) -> ArrayLike:
789789
y = (np.arange(self.array_size[1]) - (self.array_size[1] - 1) / 2) * self.spacings[1]
790790
z = (np.arange(self.array_size[2]) - (self.array_size[2] - 1) / 2) * self.spacings[2]
791791

792-
X, Y, Z = np.meshgrid(x, y, z)
792+
X, Y, Z = np.meshgrid(x, y, z, indexing="ij")
793793

794794
return np.transpose([X.ravel(), Y.ravel(), Z.ravel()])
795795

@@ -810,6 +810,7 @@ def _antenna_amps(self) -> ArrayLike:
810810

811811
else:
812812
amps = self.taper.amp_multipliers(self.array_size)
813+
813814
return np.ravel(amps)
814815

815816
amps_per_dim = [
@@ -829,7 +830,7 @@ def _antenna_phases(self) -> ArrayLike:
829830
np.arange(self.array_size[dim]) * self.phase_shifts[dim] for dim in range(3)
830831
]
831832

832-
phase_shifts_grid = np.meshgrid(*phase_shifts_per_dim)
833+
phase_shifts_grid = np.meshgrid(*phase_shifts_per_dim, indexing="ij")
833834

834835
return np.ravel(sum(p for p in phase_shifts_grid))
835836

0 commit comments

Comments
 (0)