pyccl.covariances module
- pyccl.covariances.angular_cl_cov_cNG(cosmo, tracer1, tracer2, *, ell, t_of_kk_a, tracer3=None, tracer4=None, ell2=None, fsky=1.0, integration_method='qag_quad')[source]
Calculate the connected non-Gaussian covariance for a pair of angular power spectra \(C_{\ell_1}^{ab}\) and \(C_{\ell_2}^{cd}\), between two pairs of tracers (\((a,b)\) and \((c,d)\)).
Specifically, it computes:
\[{\rm Cov}_{\rm cNG}(\ell_1,\ell_2)=\frac{1}{4\pi f_{\rm sky}} \int \frac{d\chi}{\chi^6} \tilde{\Delta}^a_{\ell_1}(\chi) \tilde{\Delta}^b_{\ell_1}(\chi) \tilde{\Delta}^c_{\ell_2}(\chi) \tilde{\Delta}^d_{\ell_2}(\chi)\, \bar{T}_{abcd}\left[\frac{\ell_1+1/2}{\chi}, \frac{\ell_2+1/2}{\chi}, a(\chi)\right]\]where \(\Delta^x_\ell(\chi)\) is the transfer function for tracer \(x\) (see Eq. 39 in the CCL note), and \(\bar{T}_{abcd}(k_1,k_2,a)\) is the isotropized connected trispectrum of the four tracers (see the documentation of the
Tk3D
class for details).- Parameters:
cosmo (
Cosmology
) – A Cosmology object.tracer1 (
Tracer
) – a Tracer object.tracer2 (
Tracer
) – a second Tracer object.ell (
float
or array) – Angular wavenumber(s) at which to evaluate the first dimension of the angular power spectrum covariance.t_of_kk_a (
Tk3D
) – 3D connected trispectrum.tracer3 (
Tracer
) – a Tracer object. IfNone
,tracer1
will be used instead.tracer4 (
Tracer
) – a Tracer object. IfNone
,tracer2
will be used instead.ell2 (
float
or array) – Angular wavenumber(s) at which to evaluate the second dimension of the angular power spectrum covariance. IfNone
,ell
will be used instead.fsky (
float
) – sky fraction.integration_method (
str
) – integration method to be used for the Limber integrals. Possibilities:'qag_quad'
(GSL’s qag method backed up by quad when it fails) and'spline'
(the integrand is splined and then integrated analytically).
- Returns:
2D array containing the connected non-Gaussian Angular power spectrum covariance \({\rm Cov}_{\rm cNG}(\ell_1,\ell_2)\), for the four input tracers, as a function of \(\ell_1\) and \(\ell_2\). The ordering is such that
out[i2, i1] = Cov(ell2[i2], ell[i1])
.- Return type:
(
float
or array)
- pyccl.covariances.sigma2_B_disc(cosmo, a_arr=None, *, fsky=1.0, p_of_k_a='delta_matter:delta_matter')[source]
Returns the variance of the projected linear density field over a circular disc covering a sky fraction fsky as a function of scale factor. This is given by
\[\sigma^2_B(z) = \int_0^\infty \frac{k\,dk}{2\pi} P_L(k,z)\,\left[\frac{2J_1(k R(z))}{k R(z)}\right]^2,\]where \(R(z)\) is the corresponding radial aperture as a function of redshift. This quantity can be used to compute the super-sample covariance (see
angular_cl_cov_SSC()
).- Parameters:
cosmo (
Cosmology
) – a Cosmology object.a_arr (
float
, array orNone
) – an array of scale factor values at which to evaluate the projected variance. IfNone
, a default sampling will be used.fsky (
float
) – sky fraction.p_of_k_a (
Pk2D
orstr
) – Linear power spectrum to use. Defaults to the internal linear power spectrum fromcosmo
.
- Returns:
Tuple containing
a_arr (array): an array of scale factor values at which the projected variance has been evaluated. Only returned if
a_arr
isNone
on input.sigma2_B (
float
or array): projected variance.
- pyccl.covariances.sigma2_B_from_mask(cosmo, a_arr=None, *, mask_wl=None, p_of_k_a='delta_matter:delta_matter')[source]
Returns the variance of the projected linear density field, given the angular power spectrum of the footprint mask and scale factor. This is given by
\[\sigma^2_B(z) = \frac{1}{\chi^2(z)}\sum_\ell P_L\left(\frac{\ell+\frac{1}{2}}{\chi(z)},z\right)\, \sum_{m=-\ell}^\ell W^A_{\ell m} {W^B}^*_{\ell m},\]where \(W^A_{\ell m}\) and \(W^B_{\ell m}\) are the spherical harmonics decomposition of the footprint masks of fields A and B, normalized by their area. This quantity can be used to compute the super-sample covariance (see
angular_cl_cov_SSC()
).- Parameters:
cosmo (
Cosmology
) – a Cosmology object.a_arr (
float
, array orNone
) – an array of scale factor values at which to evaluate the projected variance.mask_wl (array) – Array with the angular power spectrum of the masks. The power spectrum should be given at integer multipoles, starting at \(\ell=0\). The power spectrum is normalized as \({\tt mask\_wl}=\sum_m W^A_{\ell m} {W^B}^*_{\ell m}\). It is the responsibility of the user to the provide the mask power out to sufficiently high ell for their required precision.
p_of_k_a (
Pk2D
orstr
) – Linear power spectrum to use. Defaults to the internal linear power spectrum from cosmo.
- Returns:
Tuple containing
a_arr (array): an array of scale factor values at which the projected variance has been evaluated. Only returned if
a_arr
isNone
on input.sigma2_B (
float
or array): projected variance.
- pyccl.covariances.angular_cl_cov_SSC(cosmo, tracer1, tracer2, *, ell, t_of_kk_a, tracer3=None, tracer4=None, ell2=None, sigma2_B=None, fsky=1.0, integration_method='qag_quad')[source]
Calculate the super-sample contribution to the connected non-Gaussian covariance for a pair of power spectra \(C_{\ell_1}^{ab}\) and \(C_{\ell_2}^{cd}\), between two pairs of tracers (\((a,b)\) and \((c,d)\)).
Specifically, it computes:
\[{\rm Cov}_{\rm SSC}(\ell_1,\ell_2)= \int \frac{d\chi}{\chi^4} \tilde{\Delta}^a_{\ell_1}(\chi) \tilde{\Delta}^b_{\ell_1}(\chi) \tilde{\Delta}^c_{\ell_2}(\chi) \tilde{\Delta}^d_{\ell_2}(\chi)\, \bar{T}_{abcd}\left[\frac{\ell_1+1/2}{\chi}, \frac{\ell_2+1/2}{\chi}, a(\chi)\right]\]where \(\Delta^x_\ell(\chi)\) is the transfer function for tracer \(x\) (see Eq. 39 in the CCL note), and \(\bar{T}_{abcd}(k_1,k_2,a)\) is the isotropized connected trispectrum of the four tracers (see the documentation of the
Tk3D
class for details).- Parameters:
cosmo (
Cosmology
) – A Cosmology object.tracer1 (
Tracer
) – a Tracer object.tracer2 (
Tracer
) – a second Tracer object.ell (
float
or array) – Angular wavenumber(s) at which to evaluate the first dimension of the angular power spectrum covariance.t_of_kk_a (
Tk3D
) – 3D connected trispectrum.tracer3 (
Tracer
) – a Tracer object. IfNone
,tracer1
will be used instead.tracer4 (
Tracer
) – a Tracer object. IfNone
,tracer2
will be used instead.ell2 (
float
or array) – Angular wavenumber(s) at which to evaluate the second dimension of the angular power spectrum covariance. IfNone
,ell
will be used instead.sigma2_B (
tuple
orNone
) – A tuple of arrays (a, sigma2_B(a)) containing the variance of the projected matter overdensity over the footprint as a function of the scale factor. IfNone
, a compact circular footprint will be assumed covering a sky fractionfsky
.fsky (
float
) – sky fraction.integration_method (
str
) – integration method to be used for the Limber integrals. Possibilities:'qag_quad'
(GSL’s qag method backed up by quad when it fails) and'spline'
(the integrand is splined and then integrated analytically).
- Returns:
2D array containing the super-sample Angular power spectrum covariance \({\rm Cov}_{\rm SSC}(\ell_1,\ell_2)\), for the four input tracers, as a function of \(\ell_1\) and \(\ell_2\). The ordering is such that
out[i2, i1] = Cov(ell2[i2], ell[i1])
.- Return type:
(
float
or array)