From ab4466ccdd29fcf52ffe611973ca7a76bac518b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sun, 26 Feb 2017 04:50:15 +0200 Subject: [PATCH] initialize T-matrix to zeros when reading from file Former-commit-id: a0ce0680a296a019cc254361261a3fceddeec668 --- qpms/qpms_p.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qpms/qpms_p.py b/qpms/qpms_p.py index e457798..3141ffd 100644 --- a/qpms/qpms_p.py +++ b/qpms/qpms_p.py @@ -1097,7 +1097,7 @@ def loadScuffTMatrices(fileName): # type indices first, so we want a shape (len(freqs), 2, nelem, 2, nelem) as in the older code. # Second, M-waves come first, so they have now 0-valued index, and E-waves have 1-valued index, # which we want to be inverted. - TMatrices = np.empty((len(freqs),2,nelem,2,nelem),dtype=complex) + TMatrices = np.zeros((len(freqs),2,nelem,2,nelem),dtype=complex) for inc_type in [0,1]: for outc_type in [0,1]: TMatrices[:,1-outc_type,:,1-inc_type,:] = TMatrices_tmp_real[:,:,outc_type,:,inc_type]+1j*TMatrices_tmp_imag[:,:,outc_type,:,inc_type]