Fix one-multipole shift in the pseudo-Cℓ Gaussian covariance theory - #372
Closed
cailmdaley wants to merge 1 commit into
Closed
cailmdaley wants to merge 1 commit into
cailmdaley wants to merge 1 commit into
Conversation
NaMaster arrays for fields built with lmax=b_lmax run over l = 0..b_lmax with index equal to l. The iNKA covariance built its fiducial C_l (and pixel window) on l = 1..lmax, so the theory at l landed at index l-1: every input multipole was shifted down by one (41% at l=2, 14% at l=3, ~2-3% at l=5-20, 1% at l=100 for a Planck18 single-bin spectrum). Add pseudo_cl.pixelised_theory_cl, which evaluates a theory C_l on NaMaster's l = 0..b_lmax grid (zero at l < 2) times pw^2(l), and use it in calculate_pseudo_cl_eb_cov with the shared pseudo_cl_geometry. It also takes the single-bin "W1xW1" entry from cs_util's get_theo_c_ell, which returns a dict keyed by bin pair; the covariance method raised TypeError without it. Label the coupled-spectrum ell row in the GLASS mock pseudo-Cl helpers as 0..lmax-1, matching compute_coupled_cell. Tests pin the l <-> index convention against NaMaster's own coupling and smoke-test the covariance method end to end on the synthetic catalog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sachaguer
requested changes
Oct 2, 2026
sachaguer
left a comment
Contributor
There was a problem hiding this comment.
Same comment as for the pixel window function PR. This is already done in a previous of my PR in the extent to tomography. Future PRs should source from the feature/sp_validation-extent-to-tomo or merge the latter first to develop. Note that some open PRs for real space and leakage are still opened and plug to this branch.
Collaborator
Author
|
Ok closing this, we should get the API change merged ASAP if it is holding back ~most other PRs |
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug.
calculate_pseudo_cl_eb_covbuilt the fiducial C_ℓ and the pixel window on ℓ = 1..lmax. NaMaster's arrays for fields built withlmax=b_lmax(noise bias, coupling matrix,gaussian_covarianceinputs) run over ℓ = 0..b_lmax, with index = ℓ. So the theory at ℓ was fed in at ℓ−1. For a single-bin Planck18 spectrum the input was 41% too high at ℓ=2, 14% too high at ℓ=3, about 2–3% low at ℓ=5–20, and 1% low at ℓ=100.Separately, the method raised
TypeErroron develop: cs_util'sget_theo_c_ellnow returns a dict keyed by bin pair.Fix.
pseudo_cl.pixelised_theory_cl(cl_of_ell, nside, b_lmax)returns pw²(ℓ)·C_ℓ on ℓ = 0..b_lmax, with zeros below ℓ=2. The covariance method uses it withpseudo_cl_geometryand takes the"W1xW1"entry.compute_coupled_cell. Only the label changes.Verified in the CI container (NaMaster 3.0.1):
test_pseudo_cl.py+test_sacc_writers.py: 29 passed. Ruff is clean.This applies cleanly alongside #366, which adds the pixel window to the bandpower windows.
🤖 Generated with Claude Code