Skip to content
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

Bug in sigmasqr function in power.py #109

Open
ethlau opened this issue Feb 14, 2023 · 1 comment
Open

Bug in sigmasqr function in power.py #109

ethlau opened this issue Feb 14, 2023 · 1 comment

Comments

@ethlau
Copy link

ethlau commented Feb 14, 2023

The followling line in sigmasqr function in power.py,

y = romb(int_sigma, np.log10(kmin), np.log10(kmax), divmax=7)

Shouldn't the np.log10 function be np.log instead, since the integrand function int_sigma takes log of k, not log10 of k?

def int_sigma(logk):
    k = np.exp(logk)
    x = k * R
    w = 3.0 * (np.sin(x) - x * np.cos(x)) / (x * x * x)
    pk = transfer_fn(cosmo, k, **kwargs) ** 2 * primordial_matter_power(cosmo, k)
    return k * (k * w) ** 2 * pk

@EiffL
Copy link
Member

EiffL commented Feb 15, 2023

Hi @ethlau, no I don't think that causes any bugs np.log10(kmin) and np.log10(kmax) are just rough integration bounds, they shouldn't have an impact on the result of the computation. Up to a redefinition of this kmin and kmax values, it shouldn't affect the result.

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

No branches or pull requests

2 participants