pyccl.halos.profiles.profile_base module
- class pyccl.halos.profiles.profile_base.HaloProfile(self, *, mass_def, concentration=None, is_number_counts=False)[source]
Bases:
CCLAutoReprThis class implements functionality associated to halo profiles. You should not use this class directly. Instead, use one of the subclasses implemented in CCL for specific halo profiles, or write your own subclass.
HaloProfileclasses contain methods to compute halo profiles in real (3D) and Fourier spaces, as well as other projected (2D) quantities.A minimal implementation of a
HaloProfilesubclass should contain a method_realthat returns the real-space profile as a function of cosmology, comoving radius, mass and scale factor. The default functionality in the baseHaloProfileclass will then allow the automatic calculation of the Fourier-space and projected profiles, as well as the cumulative mass density, based on the real-space profile using FFTLog to carry out fast Hankel transforms. See the CCL note for details. Alternatively, you can implement a_fouriermethod for the Fourier-space profile, and all other quantities will be computed from it. It is also possible to implement specific versions of any of these quantities if one wants to avoid the FFTLog calculation.- property is_number_counts
If
True, this profile represents source-count overdensities, normalised by the mean number density within their survey window function. This must be propagated when estimated super-sample effects in the covariance matrix.
- get_normalization(cosmo=None, a=None, *, hmc=None)[source]
Profiles may be normalized by an overall function of redshift (or scale factor). This function may be cosmology-dependent and often comes from integrating certain halo properties over mass. This method returns this normalizing factor. For example, to get the normalized profile in real space, one would call the
real()method, and then divide the result by the value returned by this method.- Parameters:
cosmo (
Cosmology) – a Cosmology object.a (
float) – scale factor.hmc (
HMCalculator) – a halo model calculator object.
- Returns:
normalization factor of this profile.
- Return type:
- update_precision_fftlog(**kwargs)
Update the precision of FFTLog for the Hankel transforms.
- Parameters:
padding_lo_fftlog (
float) – Factor by which the minimum scale is multiplied to avoid aliasing. Default: 0.1.padding_hi_fftlog (
float) – Factor by which the maximum scale is multiplied to avoid aliasing. Default: 10.n_per_decade (
float) – Samples per decade for the Hankel transforms. Default: 100.extrapol ({'linx_liny', 'linx_logy'}) – Extrapolation type when FFTLog has narrower output support. Default
'linx_liny'.padding_lo_extra (
float) – Additional minimum scale padding for double Hankel transforms, used when computing 2D projected and cumulative profiles. In these, the first transform goes from 3D real space to Fourier, and the second transform goes from Fourier to 2D real space. Default: 0.1.padding_hi_extra (
float) – Aspadding_lo_extrafor the maximum scale. Default: 10.large_padding_2D (
bool) – Overridepadding_xx_extrain the intermediate transform, and usepadding_xx_fftlog. The default is False.plaw_fourier (
float) – FFTLog pre-whitens its arguments (makes them flatter) to avoid aliasing. Theplaw_fourierparameter describes the tilt of the profile, \(P(r) \propto r^{\mathrm{tilt}}\), for standard 3D transforms. Default: -1.5plaw_fourier_projected (
float) – Asplaw_fourierfor 2D transforms (when computing 2D projected or cumulative profiles. Default: -1.0.
- real(cosmo, r, M, a)[source]
Returns the 3D real-space value of the profile as a function of cosmology, radius, halo mass and scale factor.
- Parameters:
- Returns:
halo profile. The shape of the output will be (N_M, N_r) where N_r and N_m are the sizes of r and M respectively. If r or M are scalars, the corresponding dimension will be squeezed out on output.
- Return type:
(
floator array)
- fourier(cosmo, k, M, a)[source]
Returns the Fourier-space value of the profile as a function of cosmology, wavenumber, halo mass and scale factor.
\[\rho(k)=\frac{1}{2\pi^2} \int dr\, r^2\, \rho(r)\, j_0(k r)\]- Parameters:
- Returns:
Fourier-space profile. The shape of the output will be
(N_M, N_k)whereN_kandN_mare the sizes ofkandMrespectively. IfkorMare scalars, the corresponding dimension will be squeezed out on output.- Return type:
(
floator array)
- projected(cosmo, r_t, M, a)[source]
Returns the 2D projected profile as a function of cosmology, radius, halo mass and scale factor.
\[\Sigma(R)= \int dr_\parallel\, \rho(\sqrt{r_\parallel^2 + R^2})\]- Parameters:
- Returns:
projected profile. The shape of the output will be (N_M, N_r) where N_r and N_m are the sizes of r and M respectively. If r or M are scalars, the corresponding dimension will be squeezed out on output.
- Return type:
(
floator array)
- cumul2d(cosmo, r_t, M, a)[source]
Returns the 2D cumulative surface density as a function of cosmology, radius, halo mass and scale factor.
\[\Sigma(<R)= \frac{2}{R^2} \int dR'\, R'\, \Sigma(R')\]- Parameters:
- Returns:
cumulative surface density. The shape of the output will be
(N_M, N_r)whereN_randN_mare the sizes ofrandMrespectively. IfrorMare scalars, the corresponding dimension will be squeezed out on output.- Return type:
(
floator array)
- convergence(cosmo, r, M, *, a_lens, a_source)[source]
Returns the convergence as a function of cosmology, radius, halo mass and the scale factors of the source and the lens.
\[\kappa(R) = \frac{\Sigma(R)}{\Sigma_{\rm crit}},\]where \(\Sigma(R)\) is the 2D projected surface mass density (see
projected()), and \(\Sigma_{\rm crit}\) is the critical surface density (seesigma_critical()).- Parameters:
- Returns:
convergence \(\kappa\). The shape of the output will be
(N_M, N_r)whereN_randN_mare the sizes ofrandMrespectively. IfrorMare scalars, the corresponding dimension will be squeezed out on output.- Return type:
(
floator array)
- shear(cosmo, r, M, *, a_lens, a_source)[source]
Returns the shear (tangential) as a function of cosmology, radius, halo mass and the scale factors of the source and the lens.
\[\gamma(R) = \frac{\Delta\Sigma(R)}{\Sigma_{\mathrm{crit}}} = \frac{\overline{\Sigma}(< R) - \Sigma(R)}{\Sigma_{\mathrm{crit}}},\]where \(\overline{\Sigma}(< R)\) is cumulative surface density (see
cumul2d()), \(\Sigma(R)\) is the projected 2D density (seeprojected()), and \(\Sigma_{\rm crit}\) is the critical surface density (seesigma_critical()).- Parameters:
- Returns:
shear \(\gamma\). The shape of the output will be
(N_M, N_r)whereN_randN_mare the sizes ofrandMrespectively. IfrorMare scalars, the corresponding dimension will be squeezed out on output.- Return type:
(
floator array)
- reduced_shear(cosmo, r, M, *, a_lens, a_source)[source]
Returns the reduced shear as a function of cosmology, radius, halo mass and the scale factors of the source and the lens.
\[g_t (R) = \frac{\gamma(R)}{(1 - \kappa(R))},\]where \(\gamma(R)\) is the shear and \(\kappa(R)\) is the convergence.
- Parameters:
- Returns:
reduced shear \(g_t\). The shape of the output will be
(N_M, N_r)whereN_randN_mare the sizes ofrandMrespectively. IfrorMare scalars, the corresponding dimension will be squeezed out on output.- Return type:
(
floator array)
- magnification(cosmo, r, M, a_lens, a_source)[source]
Returns the magnification for input parameters.
\[\mu(R) = \frac{1}{\left[(1 - \kappa(R))^2 - \vert \gamma(R) \vert^2 \right]]},\]where \(\gamma(R)\) is the shear and \(\kappa(R)\) is the convergence (see
shear()andconvergence()).- Parameters:
- Returns:
magnification \(\mu\). The shape of the output will be
(N_M, N_r)whereN_randN_mare the sizes ofrandMrespectively. IfrorMare scalars, the corresponding dimension will be squeezed out on output.- Return type:
(
floator array)
- class pyccl.halos.profiles.profile_base.HaloProfileMatter(self, *, mass_def, concentration=None, is_number_counts=False)[source]
Bases:
HaloProfileBase for matter halo profiles.
- get_normalization(cosmo, a, *, hmc=None)[source]
Returns the normalization of all matter overdensity profiles, which is simply the comoving matter density.
- Parameters:
cosmo (
Cosmology) – a Cosmology object.a (
float) – scale factor.hmc (
HMCalculator) – a halo model calculator object.
- Returns:
normalization factor of this profile.
- Return type:
- class pyccl.halos.profiles.profile_base.HaloProfilePressure(self, *, mass_def, concentration=None, is_number_counts=False)[source]
Bases:
HaloProfileBase for pressure halo profiles.
- class pyccl.halos.profiles.profile_base.HaloProfileCIB(self, *, mass_def, concentration=None, is_number_counts=False)[source]
Bases:
HaloProfileBase for CIB halo profiles.