Commit 469df51f authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixed dtype casting for weighting power in Spaces.

parent c14e91d9
Pipeline #12279 passed with stages
in 13 minutes and 6 seconds
......@@ -106,7 +106,7 @@ class GLSpace(Space):
def weight(self, x, power=1, axes=None, inplace=False):
nlon = self.nlon
nlat = self.nlat
vol = pyHealpix.GL_weights(nlat, nlon) ** power
vol = pyHealpix.GL_weights(nlat, nlon) ** np.float(power)
weight = np.array(list(itertools.chain.from_iterable(
itertools.repeat(x, nlon) for x in vol)))
......
......@@ -91,7 +91,7 @@ class HPSpace(Space):
def weight(self, x, power=1, axes=None, inplace=False):
weight = ((4 * np.pi) / (12 * self.nside**2))**power
weight = ((4 * np.pi) / (12 * self.nside**2)) ** np.float(power)
if inplace:
x *= weight
......
......@@ -198,7 +198,7 @@ class RGSpace(Space):
harmonic=self.harmonic)
def weight(self, x, power=1, axes=None, inplace=False):
weight = reduce(lambda x, y: x*y, self.distances)**power
weight = reduce(lambda x, y: x*y, self.distances) ** np.float(power)
if inplace:
x *= weight
result_x = x
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment