Commit 4d143aa3 authored by Theo Steininger's avatar Theo Steininger

Fixed a bug in create_ring_profile

parent ea8d0693
......@@ -9,10 +9,10 @@ def create_ring_profile(input_map):
npix = input_map.shape[0]
nside = hp.npix2nside(npix)
rings = hp.pix2ring(nside, np.arange(npix))
rings = hp.pix2ring(nside, np.arange(npix)) - 1
rho = np.bincount(rings)[1:]
averages = np.bincount(rings, weights=input_map)[1:]/rho
rho = np.bincount(rings)
averages = np.bincount(rings, weights=input_map)/rho
result = averages[rings]
......
......@@ -8,12 +8,14 @@ from imagine.create_ring_profile import create_ring_profile
class EnsembleLikelihood(Likelihood):
def __init__(self, observable_name, measured_data,
data_covariance_operator):
data_covariance_operator, profile=None):
self.observable_name = observable_name
self.measured_data = measured_data
self.data_covariance_operator = data_covariance_operator
self.profile = create_ring_profile(
if profile is None:
profile = create_ring_profile(
self.measured_data.val.get_full_data())
self.profile = profile
def __call__(self, observable):
field = observable[self.observable_name]
......
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