pyccl.halos.pk_2pt module
- pyccl.halos.pk_2pt.halomod_power_spectrum(cosmo, hmc, k, a, prof, *, prof2=None, prof_2pt=None, p_of_k_a=None, get_1h=True, get_2h=True, smooth_transition=None, suppress_1h=None, extrap_pk=False)[source]
Computes the halo model power spectrum for two quantities defined by their respective halo profiles. The halo model power spectrum for two profiles \(u\) and \(v\) is:
\[P_{u,v}(k,a) = I^0_2(k,a|u,v) + I^1_1(k,a|u)\,I^1_1(k,a|v)\,P_{\rm lin}(k,a)\]where \(P_{\rm lin}(k,a)\) is the linear matter power spectrum, \(I^1_1\) is defined in the documentation of
I_1_1()
, and \(I^0_2\) is defined in the documentation ofI_0_2()
.- Parameters:
cosmo (
Cosmology
) – a Cosmology object.hmc (
HMCalculator
) – a halo model calculator.k (
float
or array) – comoving wavenumber in Mpc^-1.a (
float
or array) – scale factor.prof (
HaloProfile
) – halo profile.prof2 (
HaloProfile
) – a second halo profile. IfNone
,prof
will be used asprof2
.prof_2pt (
Profile2pt
) – a profile covariance object returning the the two-point moment of the two profiles being correlated. IfNone
, the default second moment will be used, corresponding to the products of the means of both profiles.p_of_k_a (
Pk2D
) – a Pk2D object to be used as the linear matter power spectrum. IfNone
, the power spectrum stored within cosmo will be used.get_1h (
bool
) – ifFalse
, the 1-halo term (i.e. the first term in the first equation above) won’t be computed.get_2h (
bool
) – ifFalse
, the 2-halo term (i.e. the second term in the first equation above) won’t be computed.smooth_transition (
callable
orNone
) – Modify the halo model 1-halo/2-halo transition region via a time-dependent function \(\alpha(a)\), defined as in HMCODE-2020: \(P(k,a)= (P_{1h}^{\alpha(a)}(k)+P_{2h}^{\alpha(a)}(k))^{1/\alpha}\). IfNone
the extra factor is just 1.suppress_1h (
callable
orNone
) –Suppress the 1-halo large scale contribution by a time- and scale-dependent function \(k_*(a)\), defined as in HMCODE-2020: \(1/[1+(k_*(a)/k)^4]\). If
None
the standard 1-halo term is returned with no damping.extrap_pk (
bool
) – Whether to extrapolatep_of_k_a
in casea
is out of its support. If`False`
, and the queried values are out of bounds, an error is raised.
- Returns:
integral values evaluated at each combination of
k
anda
. The shape of the output will be(N_a, N_k)
whereN_k
andN_a
are the sizes ofk
anda
respectively. Ifk
ora
are scalars, the corresponding dimension will be squeezed out on output.- Return type:
(
float
or array)
- pyccl.halos.pk_2pt.halomod_Pk2D(cosmo, hmc, prof, *, prof2=None, prof_2pt=None, p_of_k_a=None, get_1h=True, get_2h=True, lk_arr=None, a_arr=None, extrap_order_lok=1, extrap_order_hik=2, smooth_transition=None, suppress_1h=None, extrap_pk=False)[source]
Returns a
Pk2D
object containing the halo-model power spectrum for two quantities defined by their respective halo profiles. Seehalomod_power_spectrum()
for more details about the actual calculation.- Parameters:
cosmo (
Cosmology
) – a Cosmology object.hmc (
HMCalculator
) – a halo model calculator.prof (
HaloProfile
) – halo profile.prof2 (
HaloProfile
) – a second halo profile. IfNone
,prof
will be used asprof2
.prof_2pt (
Profile2pt
) – a profile covariance object returning the the two-point moment of the two profiles being correlated. IfNone
, the default second moment will be used, corresponding to the products of the means of both profiles.p_of_k_a (
Pk2D
) – a Pk2D object to be used as the linear matter power spectrum. IfNone
, the power spectrum stored within cosmo will be used.get_1h (
bool
) – ifFalse
, the 1-halo term (i.e. the first term in the first equation above) won’t be computed.get_2h (
bool
) – ifFalse
, the 2-halo term (i.e. the second term in the first equation above) won’t be computed.a_arr (array) – an array holding values of the scale factor at which the halo model power spectrum should be calculated for interpolation. If
None
, the internal values used by cosmo will be used.lk_arr (array) – an array holding values of the natural logarithm of the wavenumber (in units of Mpc^-1) at which the halo model power spectrum should be calculated for interpolation. If
None
, the internal values used by cosmo will be used.extrap_order_lok (
int
) – extrapolation order to be used on k-values below the minimum of the splines. SeePk2D
.extrap_order_hik (
int
) – extrapolation order to be used on k-values above the maximum of the splines. SeePk2D
.smooth_transition (
callable
orNone
) –Modify the halo model 1-halo/2-halo transition region via a time-dependent function \(\alpha(a)\), defined as in HMCODE-2020: \(P(k,a)= (P_{1h}^{\alpha(a)}(k)+P_{2h}^{\alpha(a)}(k))^{1/\alpha}\). If
None
the extra factor is just 1.suppress_1h (
callable
orNone
) –Suppress the 1-halo large scale contribution by a time- and scale-dependent function \(k_*(a)\), defined as in HMCODE-2020: \(1/[1+(k_*(a)/k)^4]\). If
None
the standard 1-halo term is returned with no damping.extrap_pk (
bool
) – Whether to extrapolatep_of_k_a
in casea
is out of its support. If`False`
, and the queried values are out of bounds, an error is raised.
- Returns:
halo model power spectrum.
- Return type: