-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SSC covariance using halo model response (#855)
* SSC, tk3d Co-authored-by: Tilman Troester <tilman.troester@gmail.com>
- Loading branch information
1 parent
14cb88a
commit e287373
Showing
20 changed files
with
1,609 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
3.5827589908e-18 2.1933032306e-18 1.0195609562e-18 3.9498025255e-19 1.5006849349e-19 5.8863418831e-20 1.9539477848e-20 4.6939126814e-21 8.3192018555e-22 1.1336282393e-22 | ||
2.1933032306e-18 1.4768783335e-18 7.3887186615e-19 2.9525366302e-19 1.0947282832e-19 4.3019749519e-20 1.5489453850e-20 4.1033885830e-21 7.7985249459e-22 1.1248585689e-22 | ||
1.0195609562e-18 7.3887186615e-19 3.9390130562e-19 1.6323203150e-19 5.9907638875e-20 2.3173464828e-20 8.7427311235e-21 2.5079467781e-21 5.0782251995e-22 7.6922542286e-23 | ||
3.9498025255e-19 2.9525366302e-19 1.6323203150e-19 6.9629693452e-20 2.5603803143e-20 9.6882447681e-21 3.7135387390e-21 1.1204304046e-21 2.3665509805e-22 3.6995745170e-23 | ||
1.5006849349e-19 1.0947282832e-19 5.9907638875e-20 2.5603803143e-20 9.5379183119e-21 3.5923698595e-21 1.3497466983e-21 4.0830265040e-22 8.7423838992e-23 1.3831025304e-23 | ||
5.8863418831e-20 4.3019749519e-20 2.3173464828e-20 9.6882447681e-21 3.5923698595e-21 1.3879675434e-21 5.2023575248e-22 1.5198271589e-22 3.1713716352e-23 4.9275462171e-24 | ||
1.9539477848e-20 1.5489453850e-20 8.7427311235e-21 3.7135387390e-21 1.3497466983e-21 5.2023575248e-22 2.0461796895e-22 6.1623620544e-23 1.2919437394e-23 2.0071723283e-24 | ||
4.6939126814e-21 4.1033885830e-21 2.5079467781e-21 1.1204304046e-21 4.0830265040e-22 1.5198271589e-22 6.1623620544e-23 2.0168158521e-23 4.4820186218e-24 7.2448013820e-25 | ||
8.3192018555e-22 7.7985249459e-22 5.0782251995e-22 2.3665509805e-22 8.7423838992e-23 3.1713716352e-23 1.2919437394e-23 4.4820186218e-24 1.0537038760e-24 1.7683998813e-25 | ||
1.1336282393e-22 1.1248585689e-22 7.6922542286e-23 3.6995745170e-23 1.3831025304e-23 4.9275462171e-24 2.0071723283e-24 7.2448013820e-25 1.7683998813e-25 3.0411198865e-26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
2.984599475985548089e+00 | ||
6.646579196058059580e+00 | ||
1.480165608984571257e+01 | ||
3.296267396196881094e+01 | ||
7.340650722647497162e+01 | ||
1.634732458115384190e+02 | ||
3.640481355925554681e+02 | ||
8.107200928842213443e+02 | ||
1.805440008465850724e+03 | ||
4.020639987560632562e+03 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import os | ||
|
||
import numpy as np | ||
|
||
import pyccl as ccl | ||
|
||
|
||
def test_ssc_WL(): | ||
# Compare against Benjamin Joachimi's code. An overview of the methodology | ||
# is given in appendix E.2 of 2007.01844. | ||
data_dir = os.path.join(os.path.dirname(__file__), "data/covariances/") | ||
|
||
h = 0.7 | ||
cosmo = ccl.Cosmology(Omega_c=0.25, Omega_b=0.05, h=h, n_s=0.97, | ||
sigma8=0.8, m_nu=0.0) | ||
|
||
mass_def = ccl.halos.MassDef200m() | ||
hmf = ccl.halos.MassFuncTinker10(cosmo, | ||
mass_def=mass_def) | ||
hbf = ccl.halos.HaloBiasTinker10(cosmo, | ||
mass_def=mass_def) | ||
nfw = ccl.halos.HaloProfileNFW(ccl.halos.ConcentrationDuffy08(mass_def), | ||
fourier_analytic=True) | ||
hmc = ccl.halos.HMCalculator(cosmo, hmf, hbf, mass_def) | ||
|
||
n_z = 100 | ||
|
||
n_k = 200 | ||
k_min = 1e-4 | ||
k_max = 1e2 | ||
|
||
a = np.linspace(1/(1+6), 1, n_z) | ||
k = np.geomspace(k_min, k_max, n_k) | ||
|
||
tk3D = ccl.halos.halomod_Tk3D_SSC(cosmo=cosmo, hmc=hmc, | ||
prof1=nfw, | ||
prof2=nfw, | ||
prof12_2pt=None, | ||
normprof1=True, normprof2=True, | ||
lk_arr=np.log(k), a_arr=a, | ||
use_log=True) | ||
|
||
z, nofz = np.loadtxt(os.path.join(data_dir, "ssc_WL_nofz.txt"), | ||
unpack=True) | ||
WL_tracer = ccl.WeakLensingTracer(cosmo, (z, nofz)) | ||
|
||
ell = np.loadtxt(os.path.join(data_dir, "ssc_WL_ell.txt")) | ||
|
||
fsky = 0.05 | ||
|
||
sigma2_B = ccl.sigma2_B_disc(cosmo, a=a, fsky=fsky) | ||
cov_ssc = ccl.covariances.angular_cl_cov_SSC(cosmo, | ||
cltracer1=WL_tracer, | ||
cltracer2=WL_tracer, | ||
ell=ell, tkka=tk3D, | ||
sigma2_B=(a, sigma2_B), | ||
fsky=None) | ||
var_ssc_ccl = np.diag(cov_ssc) | ||
off_diag_1_ccl = np.diag(cov_ssc, k=1) | ||
|
||
cov_ssc_bj = np.loadtxt(os.path.join(data_dir, "ssc_WL_cov_matrix.txt")) | ||
|
||
# At large scales, CCL uses a different convention for the Limber | ||
# approximation. This factor accounts for this difference | ||
ccl_limber_shear_fac = np.sqrt((ell-1)*ell*(ell+1)*(ell+2))/(ell+1/2)**2 | ||
cov_ssc_bj_corrected = cov_ssc_bj * np.outer(ccl_limber_shear_fac**2, | ||
ccl_limber_shear_fac**2) | ||
var_bj = np.diag(cov_ssc_bj_corrected) | ||
off_diag_1_bj = np.diag(cov_ssc_bj_corrected, k=1) | ||
|
||
assert np.all(np.fabs(var_ssc_ccl/var_bj - 1) < 3e-2) | ||
assert np.all(np.fabs(off_diag_1_ccl/off_diag_1_bj - 1) < 3e-2) | ||
assert np.all(np.fabs(cov_ssc/cov_ssc_bj_corrected - 1) < 3e-2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.