Commit 73fdede5 authored by Theo Steininger's avatar Theo Steininger

create_ring_profile is no able to process incomplete, i.e. np.nan, data.

parent 8276ccc3
......@@ -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]
......
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