diff --git a/nifty_core.py b/nifty_core.py index 9f282cd4b1743d73abd2ef906e1bb619782e1517..3be8e1d8b3f6db864273fa0b3d8385f9fea0159a 100644 --- a/nifty_core.py +++ b/nifty_core.py @@ -9612,7 +9612,7 @@ class projection_operator(operator): x : valid field band : int, *optional* Projection band whereon to project. (default: None) - bandsup: list of integers, *optional* + bandsup: {integer, list/array of integers}, *optional* List of projection bands whereon to project and which to sum up. The `band` keyword is prefered over `bandsup`. (default: None) @@ -9631,8 +9631,11 @@ class projection_operator(operator): return Px elif(bandsup is not None): - bandsup = [int(bb) for bb in bandsup if -1<bb<self.bands()] - if(bandsup==[]): + if(np.isscalar(bandsup)): + bandsup = np.arange(int(bandsup),dtype=np.int) + else: + bandsup = np.array(bandsup,dtype=np.int) + if(np.any(bandsup>self.bands()-1))or(np.any(bandsup<0)): raise ValueError(about._errors.cstring("ERROR: invalid input.")) Px = field(self.domain,val=None,target=x.target) for bb in bandsup: diff --git a/nifty_power.py b/nifty_power.py index 17a03a117a299a493b30c0d86d648cfecd57b0ad..70be305dc94fe20afe7556326488a2b85f332382 100644 --- a/nifty_power.py +++ b/nifty_power.py @@ -41,7 +41,7 @@ """ from __future__ import division -from scipy.interpolate import interp1d as ip ## +from scipy.interpolate import interp1d as ip ## conflicts with sphinx's autodoc #import numpy as np from nifty.nifty_core import * import smoothing as gs