Skip to content

Conversation

@HTJense
Copy link
Member

@HTJense HTJense commented Sep 17, 2025

Should address #119 . Instead of loading and simply trimming the array, we create an empty array and fill it out entry-wise before trimming it to the desired lmin-lmax range.

Before fix:

>>> l, ps = pspy_utils.ps_lensed_theory_to_dict("cl_camb.dat", "Dl", lmax = 500, start_at_zero=False)
>>> l.shape
(500,)
>>> ps["TT"].shape
(500,)
>>> l, ps = pspy_utils.ps_lensed_theory_to_dict("cl_camb.dat", "Dl", lmax = 500, start_at_zero=True)
>>> l.shape
(502,)
>>> ps["TT"].shape
(502,)

After fix:

>>> l, ps = pspy_utils.ps_lensed_theory_to_dict("cl_camb.dat", "Dl", lmax = 500, start_at_zero=False)
>>> l.shape
(498,)
>>> ps["TT"].shape
(498,)
>>> l, ps = pspy_utils.ps_lensed_theory_to_dict("cl_camb.dat", "Dl", lmax = 500, start_at_zero=True)
>>> l.shape
(500,)
>>> ps["TT"].shape
(500,)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant