-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMBLensed input PS shifts multipoles by 2 when using new CAMB-produced power spectra #212
Comments
Please provide fully executable example, possibly In a notebook which
contains plots
…On Tue, Feb 25, 2025, 16:40 JamesAmato ***@***.***> wrote:
The CMBLensed code appears to be misaligning power spectra. When it
calculates the intermediate cl_tebp_arr from a power spectrum produced
using CAMB, it has 0's for $\ell \in {0, 1, 2, 3}$. I believe it should
only have zero values for $\ell \in {0,1}$.
I looked into this further and believe I've found the cause of the issue
and propose a solution. I have another issue involving apply_delens that
is tangled with this; I'll need more feedback on that one.
Cause:
I think the code was written with the assumption that rows for $\ell=0$
and $\ell=1$ will not occur in CAMB's output text file. In the input file
used with c1, the first multipole is $\ell=2$. CAMB's documentation
<https://camb.readthedocs.io/en/latest/results.html#camb.results.CAMBdata.get_cmb_power_spectra>
states that output power spectra will have $\ell=0$ and $\ell=1$ rows.
Values in cl_tebp_arr are assigned beginning at index 2, pulling values
from the input data (cmb spectra) at index 0. Clearly this fails.
Solution:
I've attached a snippet ("snippet.txt") that can replace lines 290-338 of
pysm/src/pysm3/models/cmb.py. I can submit a pull request, but need to
resolve some confusion on a related issue. I've also attached a demo of the
snippet as an alternative ("CMBLensed_l0l1_min_repro_demo.txt"); it will
need two power spectra - one with rows for $\ell=0$ and $\ell=1$ and one
without.
snippet.txt
<https://github.com/user-attachments/files/18974729/snippet.txt>
CMBLensed_l0l1_min_repro_demo.txt
<https://github.com/user-attachments/files/18974724/CMBLensed_l0l1_min_repro_demo.txt>
—
Reply to this email directly, view it on GitHub
<#212>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC5Q4VYTZDRUQUBMNMC2FL2RUERXAVCNFSM6AAAAABX365ZSOVHI2DSMVQWIX3LMV43ASLTON2WKOZSHA3TSOBUGY3DCMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
[image: JamesAmato]*JamesAmato* created an issue (galsci/pysm#212)
<#212>
The CMBLensed code appears to be misaligning power spectra. When it
calculates the intermediate cl_tebp_arr from a power spectrum produced
using CAMB, it has 0's for $\ell \in {0, 1, 2, 3}$. I believe it should
only have zero values for $\ell \in {0,1}$.
I looked into this further and believe I've found the cause of the issue
and propose a solution. I have another issue involving apply_delens that
is tangled with this; I'll need more feedback on that one.
Cause:
I think the code was written with the assumption that rows for $\ell=0$
and $\ell=1$ will not occur in CAMB's output text file. In the input file
used with c1, the first multipole is $\ell=2$. CAMB's documentation
<https://camb.readthedocs.io/en/latest/results.html#camb.results.CAMBdata.get_cmb_power_spectra>
states that output power spectra will have $\ell=0$ and $\ell=1$ rows.
Values in cl_tebp_arr are assigned beginning at index 2, pulling values
from the input data (cmb spectra) at index 0. Clearly this fails.
Solution:
I've attached a snippet ("snippet.txt") that can replace lines 290-338 of
pysm/src/pysm3/models/cmb.py. I can submit a pull request, but need to
resolve some confusion on a related issue. I've also attached a demo of the
snippet as an alternative ("CMBLensed_l0l1_min_repro_demo.txt"); it will
need two power spectra - one with rows for $\ell=0$ and $\ell=1$ and one
without.
snippet.txt
<https://github.com/user-attachments/files/18974729/snippet.txt>
CMBLensed_l0l1_min_repro_demo.txt
<https://github.com/user-attachments/files/18974724/CMBLensed_l0l1_min_repro_demo.txt>
—
Reply to this email directly, view it on GitHub
<#212>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC5Q4VYTZDRUQUBMNMC2FL2RUERXAVCNFSM6AAAAABX365ZSOVHI2DSMVQWIX3LMV43ASLTON2WKOZSHA3TSOBUGY3DCMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Here's a notebook, showing the misalignment, the impact on maps produced from CAMB output power spectra, and a proposed solution. https://github.com/JamesAmato/pysm/blob/demo_issues/issue_212_demo.ipynb |
I found a far simpler approach, with two lines added in the Here's an example. When combined with Issue 213, a total of six lines need to be changed: two for 212, two for 213, and two for the intersection of them: Example. |
ok, thanks, can you please make a pull request with those changes? Actually I prefer 2 separate pull requests each with 1 notebook that tests just that issue. Also if you add a unit test in |
The CMBLensed code appears to be misaligning power spectra. When it calculates the intermediate$\ell \in {0, 1, 2, 3}$ . I believe it should only have zero values for $\ell \in {0,1}$ .
cl_tebp_arr
from a power spectrum produced using CAMB, it has 0's forI looked into this further and believe I've found the cause of the issue and propose a solution. I have another issue involving
apply_delens
that is tangled with this; I'll need more feedback on that one Issue 213.Cause:$\ell=0$ and $\ell=1$ will not occur in CAMB's output text file. In the input file used with $\ell=2$ . CAMB's documentation states that output power spectra will have $\ell=0$ and $\ell=1$ rows. Values in
I think the code was written with the assumption that rows for
c1
, the first multipole iscl_tebp_arr
are assigned beginning at index 2, pulling values from the inputdata
(cmb spectra) at index 0. Clearly this fails.Solution:$\ell=0$ and $\ell=1$ and one without.
I've attached a snippet ("snippet.txt") that can replace lines 290-338 of pysm/src/pysm3/models/cmb.py. I can submit a pull request, but need to resolve some confusion on a related issue. I've also attached a demo of the snippet as an alternative ("CMBLensed_l0l1_min_repro_demo.txt"); it will need two power spectra - one with rows for
snippet.txt
CMBLensed_l0l1_min_repro_demo.txt
The text was updated successfully, but these errors were encountered: