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
IMAGINE
Commits
73fdede5
Commit
73fdede5
authored
Nov 10, 2017
by
Theo Steininger
Browse files
create_ring_profile is no able to process incomplete, i.e. np.nan, data.
parent
8276ccc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
imagine/create_ring_profile.py
View file @
73fdede5
...
...
@@ -11,8 +11,12 @@ def create_ring_profile(input_map):
rings
=
hp
.
pix2ring
(
nside
,
np
.
arange
(
npix
))
-
1
rho
=
np
.
bincount
(
rings
)
averages
=
np
.
bincount
(
rings
,
weights
=
input_map
)
/
rho
mask
=
np
.
ones
([
npix
])
mask
[
np
.
isnan
(
input_map
)]
=
0
rho
=
np
.
bincount
(
rings
,
weights
=
mask
)
averages
=
np
.
bincount
(
rings
,
weights
=
np
.
nan_to_num
(
input_map
))
/
rho
# set profile for empty rings to 1
averages
[
np
.
isnan
(
averages
)]
=
1
result
=
averages
[
rings
]
...
...
Write
Preview
Supports
Markdown
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