From 91f23311063ac16d4d5684ac6f214aa2486a42af Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Wed, 18 Nov 2015 02:50:11 +0300 Subject: [PATCH] Resample: simplify code --- latticeInterpolatorUtil.py | 2 +- latticeResample.py | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/latticeInterpolatorUtil.py b/latticeInterpolatorUtil.py index 363be1a..391721a 100644 --- a/latticeInterpolatorUtil.py +++ b/latticeInterpolatorUtil.py @@ -9,7 +9,7 @@ class InterpolateF: self.XPoints = XPoints self.YPoints = YPoints if XPoints is not None: - self.recompute + self.recompute() def recompute(self): '''call before using value(), if changing sample values via attributes''' diff --git a/latticeResample.py b/latticeResample.py index 03ae88b..be59420 100644 --- a/latticeResample.py +++ b/latticeResample.py @@ -107,24 +107,15 @@ class LatticeResample(latticeBaseFeature.LatticeFeature): prevQ = Q # constuct function objects - interpolations = [] #container to receive all active interpolation function objects if posIsInterpolate: FX = LIU.InterpolateF(IArray,XArray) - interpolations.append(FX) FY = LIU.InterpolateF(IArray,YArray) - interpolations.append(FY) FZ = LIU.InterpolateF(IArray,ZArray) - interpolations.append(FZ) if oriIsInterpolate: FQs = [] for iQ in [0,1,2,3]: FQs.append(LIU.InterpolateF(IArray,QArrays[iQ])) - interpolations.extend(FQs) - # recompute function objects - for F in interpolations: - F.recompute() - # initialize output containers and loop variables outputPlms = [] #list of placements