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

Adding prescription of Costanzi et al. 2013 for evaluating the halo mas function in nuCDM cosmologies #1185

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions pyccl/boltzmann.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ def get_camb_pk_lin(cosmo, *, nonlin=False):
except (KeyError, TypeError):
pass

# Get extra parameters to evaluate
# the halo mass function in cosmology with massive neutrinos
# using prescription by Costanzi et al. 2013(JCAP12(2013)012)
use_costanzi13 = False
try:
use_costanzi13 = cosmo["extra_parameters"]["use_costanzi13"]
except (KeyError, TypeError):
pass

# z sampling from CCL parameters
na = lib.get_pk_spline_na(cosmo.cosmo)
status = 0
Expand Down Expand Up @@ -151,8 +160,13 @@ def get_camb_pk_lin(cosmo, *, nonlin=False):
camb_res = camb.get_transfer_functions(cp)

def construct_Pk2D(camb_res, nonlin=False):
k, z, pk = camb_res.get_linear_matter_power_spectrum(
hubble_units=True, nonlinear=nonlin)
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)

# convert to non-h inverse units
k *= cosmo['h']
Expand Down
18 changes: 17 additions & 1 deletion pyccl/halos/halo_model_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,23 @@ def __call__(self, cosmo, M, a):
logM, sigM, dlns_dlogM = self._get_logM_sigM(
cosmo, M_use, a, return_dlns=True)

rho = (const.RHO_CRITICAL * cosmo['Omega_m'] * cosmo['h']**2)
# prescription by Costanzi et al. 2013(JCAP12(2013)012)
# to evaluate the halo mass function in nuCDM cosmology

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)

f = self._get_fsigma(cosmo, sigM, a, 2.302585092994046 * logM)
mf = f * rho * dlns_dlogM / M_use
if np.ndim(M) == 0:
Expand Down
Loading