diff --git a/nifty5/domains/log_rg_space.py b/nifty5/domains/log_rg_space.py index 4cd66c03009bd46784ff8bab3220341b6591e573..3384c9dd062823ad4dd9bce3381edafe553ba973 100644 --- a/nifty5/domains/log_rg_space.py +++ b/nifty5/domains/log_rg_space.py @@ -50,6 +50,8 @@ class LogRGSpace(StructuredDomain): self._bindistances = tuple(bindistances) self._t_0 = tuple(t_0) + if min(self._bindistances) <= 0: + raise ValueError('Non-positive bindistances encountered') self._dim = int(reduce(lambda x, y: x*y, self._shape)) self._dvol = float(reduce(lambda x, y: x*y, self._bindistances)) diff --git a/nifty5/domains/power_space.py b/nifty5/domains/power_space.py index f6c357fd34dfcd7dfd6f28d68d89f25f81fd2645..d200ce1b9f2c76251c4decc7bbcc500d2a8be2cf 100644 --- a/nifty5/domains/power_space.py +++ b/nifty5/domains/power_space.py @@ -165,6 +165,8 @@ class PowerSpace(StructuredDomain): if binbounds is not None: binbounds = tuple(binbounds) + if min(binbounds) < 0: + raise ValueError('Negative binbounds encountered') key = (harmonic_partner, binbounds) if self._powerIndexCache.get(key) is None: diff --git a/nifty5/domains/rg_space.py b/nifty5/domains/rg_space.py index 02d4f106da9af7137632e8c738efe7bb8f4e9cc3..4fd3829a4a73639045047336e5106227c3461059 100644 --- a/nifty5/domains/rg_space.py +++ b/nifty5/domains/rg_space.py @@ -54,6 +54,8 @@ class RGSpace(StructuredDomain): if np.isscalar(shape): shape = (shape,) self._shape = tuple(int(i) for i in shape) + if min(self._shape) < 0: + raise ValueError('Negative number of pixels encountered') if distances is None: if self.harmonic: @@ -66,6 +68,8 @@ class RGSpace(StructuredDomain): temp = np.empty(len(self.shape), dtype=np.float64) temp[:] = distances self._distances = tuple(temp) + if min(self._distances) <= 0: + raise ValueError('Non-positive distances encountered') self._dvol = float(reduce(lambda x, y: x*y, self._distances)) self._size = int(reduce(lambda x, y: x*y, self._shape))