From 1d9c9644ee6d243e0674b452c765bd6121ca9d2a Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Thu, 1 Aug 2019 23:17:13 -0700 Subject: [PATCH] input shouldn't be sliced with expanded slices --- fdfd_tools/waveguide_mode.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fdfd_tools/waveguide_mode.py b/fdfd_tools/waveguide_mode.py index 398f2eb..2db9d68 100644 --- a/fdfd_tools/waveguide_mode.py +++ b/fdfd_tools/waveguide_mode.py @@ -479,7 +479,9 @@ def expand_wgmode_e(E: field_t, slices_exp[axis] = slice(E[0].shape[axis]) slices_exp = (slice(3), *slices_exp) - Ee[slices_exp] = phase_E * numpy.array(E)[slices_Exp] + slices_in = tuple(slice(3), *slices) + + Ee[slices_exp] = phase_E * numpy.array(E)[slices_in] return Ee