brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
93 stars 77 forks source link

Issue for mock CMB likelihoods with OnlyTT and LensingExtraction or Bmodes #284

Closed brinckmann closed 1 year ago

brinckmann commented 2 years ago

There's a problem with the OnlyTT flag when the LensingExtraction flag is used. At line 1584 the following should be added (properly indented so it's within the elif at line 1575):

if self.OnlyTT:
    Cov_obs = np.array([
        [self.Cl_fid[0, l], 0.*self.Cl_fid[self.index_tp, l]],
        [cltd_fid, cldd_fid]])
    Cov_the = np.array([
        [cl['tt'][l]+self.noise_T[l],  0.*math.sqrt(l*(l+1.))*cl['tp'][l]],
        [cltd,  cldd+self.Nldd[l]]])
else:

with the Cov_obs and Cov_the block afterwards (1585-1592) properly indented so it's inside the else. I'll probably also and a clarifying and not self.LensingExtraction on line 1595, although this is not needed from a coding perspective.

OnlyTT also wouldn't work with Bmodes. A fix similar to the one for TT + lensing would work. I might add this (although then the "OnlyTT" name doesn't really make sense), or at least add a warning.

Also mentioned in issue #283.

dchooper commented 1 year ago

I have implemented this bugfix, it will be included in MP v3.6.0 (coming soon!). Thanks for pointing it out!