From cbab332c34d41dc0e57a8177f795f639286878aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 16 May 2018 21:04:15 +0300 Subject: [PATCH] loading tmatrices from the new scuff-tmatrix versions Former-commit-id: fe8b6c63e859ea18cf3415deee38258aa7bde50c --- qpms/tmatrices.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/qpms/tmatrices.py b/qpms/tmatrices.py index 7546595..ce1eaee 100644 --- a/qpms/tmatrices.py +++ b/qpms/tmatrices.py @@ -146,22 +146,34 @@ def parity_yy(lmax): def _scuffTMatrixConvert_EM_01(EM): #print(EM) if (EM == b'E'): - return 0 - elif (EM == b'M'): return 1 + elif (EM == b'M'): + return 0 else: return None -def loadScuffTMatrices(fileName, normalisation = 1): +def loadScuffTMatrices(fileName, normalisation = 1, version = 'old'): """ TODO doc + + version describes version of scuff-em. It is either 'old' or 'new' """ + oldversion = (version == 'old') μm = 1e-6 table = np.genfromtxt(fileName, - converters={1: _scuffTMatrixConvert_EM_01, 4: _scuffTMatrixConvert_EM_01}, - dtype=[('freq', '