Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
ce37ce7c
Commit
ce37ce7c
authored
Sep 28, 2016
by
Jait Dixit
Browse files
Fix distance_array in HPSpace and GLSpace
parent
4ec189ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty/spaces/gl_space/gl_space.py
View file @
ce37ce7c
...
...
@@ -155,12 +155,13 @@ class GLSpace(Space):
def
distance_array
(
self
,
distribution_strategy
):
dists
=
arange
(
start
=
0
,
stop
=
self
.
shape
[
0
],
dtype
=
np
.
float128
,
start
=
0
,
stop
=
self
.
shape
[
0
],
distribution_strategy
=
distribution_strategy
)
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
...
...
nifty/spaces/hp_space/hp_space.py
View file @
ce37ce7c
...
...
@@ -172,7 +172,7 @@ class HPSpace(Space):
dists: distributed_data_object
"""
dists
=
arange
(
start
=
0
,
stop
=
self
.
shape
[
0
],
dtype
=
np
.
float128
,
start
=
0
,
stop
=
self
.
shape
[
0
],
distribution_strategy
=
distribution_strategy
)
...
...
@@ -181,7 +181,8 @@ class HPSpace(Space):
dists
=
dists
.
apply_scalar_function
(
lambda
x
:
np
.
arccos
(
np
.
dot
(
hp
.
pix2vec
(
self
.
nside
,
int
(
x
)),
center_vec
))
center_vec
)),
dtype
=
np
.
float
)
return
dists
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment