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

Costanzi et al. 2013 prescription on halo mass function with massive neutrinos #1179

Open
vittoriodx7 opened this issue May 9, 2024 · 0 comments

Comments

@vittoriodx7
Copy link

In my recent cosmological analysis using pyCCL it came out during peer review that Costanzi et al. 2013 (https://ui.adsabs.harvard.edu/abs/2013JCAP...12..012C/abstract) prescription has to be used in the presence of massive neutrinos when computing the halo mass function.

I had edited a local version of pyCCL by:

in halos/halo_model_base.py at line 196, rho = (const.RHO_CRITICAL * cosmo['Omega_m'] * cosmo['h']**2) should become:

        use_costanzi13=False
        try:
            use_costanzi13=cosmo["extra_parameters"]["use_costanzi13"]
        except (KeyError, TypeError):
            pass
        if not use_costanzi13:
            rho = (const.RHO_CRITICAL * cosmo['Omega_m'] * cosmo['h']**2)
        else:
            rho = (const.RHO_CRITICAL * (cosmo['Omega_c'] + cosmo['Omega_b']) * cosmo['h']**2)

and in boltzmann.py I suggest inserting at line 37:

use_costanzi13=False
    try:
        use_costanzi13=cosmo["extra_parameters"]["use_costanzi13"]
    except (KeyError, TypeError):
        pass

and then line 154, the CAMB call to get the power spectrum should become:

        if not use_costanzi13:
            k, z, pk = camb_res.get_linear_matter_power_spectrum(
            hubble_units=True, nonlinear=nonlin)
        else:
            k, z, pk = camb_res.get_linear_matter_power_spectrum(var1='delta_nonu', var2='delta_nonu', hubble_units=True, nonlinear=nonlin)

In this way if a user does not want to use it the code is unchanged, but if a user wants to use it they can pass it as an extra parameter in the call to pyccl.cosmology, e.g.:

pyccl.Cosmology(..., extra_parameters={"use_costanzi13": True})
to allow this prescription to take place.

I therefore suggest this easy to do and backward compatible edit to the code to made available, if possible.

Thanks,
Vittorio

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

1 participant