Skip to content

Commit

Permalink
covNG: added all terms. 1h with galaxy bias. Probably not good enough.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosggarcia committed Nov 22, 2024
1 parent 02a8308 commit 13f2bff
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions tjpcov/covariance_fourier_cNG.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# import healpy as hp
import numpy as np
import pyccl as ccl
import warnings

from .covariance_builder import CovarianceFourier

Expand Down Expand Up @@ -125,13 +126,7 @@ def get_covariance_block(
fsky = np.mean(masks[1] * masks[2] * masks[3] * masks[4])

# Tk3D = b1*b2*b3*b4 * T_234h (NFW) + T_1h (HOD)



tkk = ccl.halos.halomod_trispectrum_1h(cosmo, hmc, np.exp(lk_arr),
a_arr, prof=nfw)

tkk += ccl.halos.halomod_trispectrum_2h_22(cosmo, hmc, np.exp(lk_arr),
tkk = ccl.halos.halomod_trispectrum_2h_22(cosmo, hmc, np.exp(lk_arr),
a_arr, prof=nfw)

tkk += ccl.halos.halomod_trispectrum_2h_13(cosmo, hmc, np.exp(lk_arr),
Expand All @@ -140,15 +135,27 @@ def get_covariance_block(
tkk += ccl.halos.halomod_trispectrum_3h(cosmo, hmc, np.exp(lk_arr),
a_arr, prof=nfw)

# tkk *= bias1 * bias2 * bias3 * bias4

tkk += ccl.halos.halomod_trispectrum_4h(cosmo, hmc, np.exp(lk_arr),
a_arr, prof=nfw)


# TODO: Use HOD for the 1h term when using galaxy clustering
tkk += ccl.halos.halomod_trispectrum_1h(cosmo, hmc, np.exp(lk_arr),
a_arr, prof=nfw)

tkk *= bias1 * bias2 * bias3 * bias4

# TODO: Commented out for now to avoid having to specify HOD params
# tkk += halomod_trispectrum_4h(cosmo, hmc, np.exp(lk_arr), a_arr,
# prof=prof,
# prof2=prof2,
# prof3=prof3,
# prof4=prof4,
# p_of_k_a=None)
s = self.io.get_sacc_file()
isnc = []
for i in range(1, 5):
isnc[i] = (s.tracers[tr[i]].quantity == "galaxy_density") or (
"lens" in tr[i]
)
if any(isnc):
warnings.warn("Using linear galaxy bias with 1h term. This should "
"be checked. HOD version need implementation.")

tk3D = ccl.tk3d.Tk3D(a_arr=a_arr, lk_arr=lk_arr, tkk_arr=tkk)

Expand Down

0 comments on commit 13f2bff

Please sign in to comment.