Commit ce37ce7c authored by Jait Dixit's avatar Jait Dixit
Browse files

Fix distance_array in HPSpace and GLSpace

parent 4ec189ad
...@@ -155,12 +155,13 @@ class GLSpace(Space): ...@@ -155,12 +155,13 @@ class GLSpace(Space):
def distance_array(self, distribution_strategy): def distance_array(self, distribution_strategy):
dists = arange( dists = arange(
start=0, stop=self.shape[0], dtype=np.float128, start=0, stop=self.shape[0],
distribution_strategy=distribution_strategy distribution_strategy=distribution_strategy
) )
dists = dists.apply_scalar_function( dists = dists.apply_scalar_function(
lambda x: self._distance_array_helper(divmod(int(x), self.nlon)) lambda x: self._distance_array_helper(divmod(int(x), self.nlon)),
dtype=np.float
) )
return dists return dists
......
...@@ -172,7 +172,7 @@ class HPSpace(Space): ...@@ -172,7 +172,7 @@ class HPSpace(Space):
dists: distributed_data_object dists: distributed_data_object
""" """
dists = arange( dists = arange(
start=0, stop=self.shape[0], dtype=np.float128, start=0, stop=self.shape[0],
distribution_strategy=distribution_strategy distribution_strategy=distribution_strategy
) )
...@@ -181,7 +181,8 @@ class HPSpace(Space): ...@@ -181,7 +181,8 @@ class HPSpace(Space):
dists = dists.apply_scalar_function( dists = dists.apply_scalar_function(
lambda x: np.arccos(np.dot(hp.pix2vec(self.nside, int(x)), lambda x: np.arccos(np.dot(hp.pix2vec(self.nside, int(x)),
center_vec)) center_vec)),
dtype=np.float
) )
return dists return dists
......
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