From 2c91ea249f87dc9572480f26dc37f563965e85b7 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 7 Aug 2019 01:00:57 -0700 Subject: [PATCH] Fix wgmode expansion --- meanas/fdfd/waveguide_mode.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/meanas/fdfd/waveguide_mode.py b/meanas/fdfd/waveguide_mode.py index 7fab6e6..b6a66de 100644 --- a/meanas/fdfd/waveguide_mode.py +++ b/meanas/fdfd/waveguide_mode.py @@ -436,16 +436,15 @@ def expand_wgmode_e(E: field_t, phase_E = numpy.exp(iphi * r_E).reshape(a_shape) # Expand our slice to the entire grid using the phase factors - Ee = numpy.zeros_like(E) + E_expanded = numpy.zeros_like(E) slices_exp = list(slices) slices_exp[axis] = slice(E.shape[axis + 1]) slices_exp = (slice(None), *slices_exp) - slices_in = tuple(slice(None), *slices) + slices_in = (slice(None), *slices) - Ee[slices_exp] = phase_E * numpy.array(E)[slices_in] - - return Ee + E_expanded[slices_exp] = phase_E * numpy.array(E)[slices_in] + return E_expanded