basic – Some basic tools
delens – analytic calculation for delensing
- cmblensplus.basic.delens.lintemplate(lmax, elmin, elmax, klmin, klmax, CE, Cm, WE, Wm, gtype='p')
- Estimate of lensing template B-mode power spectrum (Wiener filters as inputs) - Args:
- lmax (int):
- Maximum multipole of output spectrum 
- elmin/elmax (int):
- Minimum/Maximum multipole of E-modes 
- klmin/klmax (int):
- Minimum/Maximum multipole of lensing potential or kappa 
- CE[l] (double):
- Power spectrum of E-mode, with bounds (0:dlmax) 
- Cp[l] (double):
- Power spectrum of lensing pontential, with bounds (0:dlmax) 
- WE[l] (double):
- Wiener filter of E-mode, with bounds (0:dlmax) 
- Wp[l] (double):
- Wiener filter of lensing potential, with bountd (0:dlmax) 
 
- Args(optional):
- gtype (str):
- specify type of the input Cp, p (default) or k. 
 
- Returns:
- CB[l] (double):
- Lensing B-mode power spectrum, with bounds (0:lmax) 
 
 
- cmblensplus.basic.delens.lensingbb(lmax, dlmin, dlmax, CE, Cp)
- Lensing B-mode power spectrum as a convolution of ClEE and Clpp - Args:
- lmax (int):
- Maximum multipole of output spectrum 
- dlmin (int):
- Minimum multipole of E and lensing for delensing 
- dlmax (int):
- Maximum multipole of E and lensing for delensing 
- CE[l] (double):
- Power spectrum of E-mode, with bounds (0:dlmax) 
- Cp[l] (double):
- Power spectrum of lensing pontential, with bounds (0:dlmax) 
 
- Returns:
- CB[l] (double):
- Lensing B-mode power spectrum, with bounds (0:lmax) 
 
 
- cmblensplus.basic.delens.delensbias_dom(lmax, dlmin, dlmax, CE, CB, Cp, NP1, NP2, Ag)
- Dominant term of the delensing bias in the B-mode internal delensing - Args:
- lmax (int):
- Maximum multipole of output spectrum 
- dlmin (int):
- Minimum multipole of E and lensing for delensing 
- dlmax (int):
- Maximum multipole of E and lensing for delensing 
- CE[l] (double):
- Power spectrum of E-mode, with bounds (0:dlmax) 
- CB[l] (double):
- Power spectrum of B-mode, with bounds (0:dlmax) 
- Cp[l] (double):
- Power spectrum of lensing pontential, with bounds (0:dlmax) 
- NP1[l] (double):
- Pol. noise spectrum for lensing reconstruction, with bounds (0:dlmax) 
- NP2[l] (double):
- Pol. noise spectrum for B-mode to be delensed, with bounds (0:dlmax) 
- Ag[l] (double):
- Lensing reconstruction noise, with bounds (0:dlmax) 
 
- Returns:
- DB[l] (double):
- Lensing B-mode power spectrum, with bounds (0:lmax) 
 
 
bispec – analytic calculation of bispectrum
- cmblensplus.basic.bispec.cl_flat(cpmodel, z, dz, zs, lmax, k, pk0, pktype='T12', cltype='kk', dNdz=None, wdel=None)
- Compute flat-sky lensing power spectrum analytically - Args:
- cpmodel (str):
- cosmological parameter model (model0, modelw, or modelp) 
- z[zn] (double):
- redshift points for the z-integral 
- dz[zn] (double):
- interval of z 
- zs[2] (double):
- two source redshifts 
- lmin/lmax (int):
- minimum/maximum multipoles of the bispectrum 
- k[kn] (double):
- k for the matter power spectrum in unit of [h/Mpc] 
- pk0[kn] (double):
- the linear matter power spectrum at z=0 in unit of [Mpc^3/h^3] 
 
- Args(optional):
- pktype (str):
- fitting formula for the matter power spectrum (Lin, S02 or T12) 
- cltype (str):
- kk, gk, or gg 
- dNdz[zn] (double):
- redshift distribution of galaxy, only used when cltype includes g 
- wdel[zn,l] (double):
- modified chi-kernel function for z-cleaning at l=0 to lmax 
 
- Returns:
- cl[l] (double):
- power spectrum from LSS contributions at [lmin,lmax] 
 
 
- cmblensplus.basic.bispec.bispeclens(shap, cpmodel, model, z, dz, zs, lmin, lmax, k, pk0, lan=0.0, kan=0.0, pktype='T12', ltype='', btype='kkk', dNdz=None, wdel=None)
- Compute lensing bispectrum analytically - Args:
- shap (str):
- shape of the bispectrum (equi, fold, sque, or isos) 
- cpmodel (str):
- cosmological parameter model (model0, modelw, or modelp) 
- model (str):
- fitting formula of the matter bispectrum (LN=linear, SC=SC03, GM=Gil-Marin+12, 3B=3-shape-bispectrum, or RT=Takahashi+19) 
- z[zn] (double):
- redshift points for the z-integral 
- dz[zn] (double):
- interval of z 
- zs[3] (double):
- source redshifts 
- lmin/lmax (int):
- minimum/maximum multipoles of the bispectrum 
- k[kn] (double):
- k for the matter power spectrum in unit of [h/Mpc] 
- pk0[kn] (double):
- the linear matter power spectrum at z=0 in unit of [Mpc^3/h^3] 
 
- Args(optional):
- lan, kan (double):
- parameters for the modified gravity extension, default to lan=kan=1 (GR) 
- pktype (str):
- fitting formula for the matter power spectrum (Lin=Linear, S02=Smith et al. 2002 or T12=Takahashi et al. 2012), default to T12 
- ltype (str):
- fullsky correction (full) or not 
- btype (str):
- bispectrum type, i.e., kkk (lens-lens-lens), gkk (density-lens-lens), ggk (density-density-lens), or ggg (density-density-density) 
- dNdz[zn] (double):
- redshift distribution of galaxy, only used when btype includes g 
- wdel[zn,l] (double):
- modified chi-kernel function by z-cleaning at l=0 to lmax 
 
- Returns:
- bl0[l] (double):
- lensing bispectrum from LSS contributions at [lmin,lmax] 
- bl1[l] (double):
- lensing bispectrum from post-Born contributions at [lmin,lmax] 
 
 
- cmblensplus.basic.bispec.bispeclens_bin(shap, cpmodel, model, z, dz, zs, lmin, lmax, bn, k, pk0, lan=0.0, kan=0.0, pktype='T12', btype='kkk', dNdz=None, wdel=None)
- Compute binned lensing bispectrum analytically - Args:
- shap (str):
- shape of the bispectrum (equi, fold, sque, or isos) 
- cpmodel (str):
- cosmological parameter model (model0, modelw, or modelp) 
- model (str):
- fitting formula of the matter bispectrum (LN=linear, SC=SC03, GM=Gil-Marin+12, 3B=3-shape-bispectrum, or RT=Takahashi+19) 
- z[zn] (double):
- redshift points for the z-integral 
- dz[zn] (double):
- interval of z 
- zs[3] (double):
- source redshifts 
- lmin/lmax (int):
- minimum/maximum multipoles of the bispectrum 
- bn (int):
- number of multipole bins 
- k[kn] (double):
- k for the matter power spectrum in unit of [h/Mpc] 
- pk0[kn] (double):
- the linear matter power spectrum at z=0 in unit of [Mpc^3/h^3] 
 
- Args(optional):
- lan, kan (double):
- parameters for the modified gravity extension, default to lan=kan=1 (GR) 
- pktype (str):
- fitting formula for the matter power spectrum (Lin, S02 or T12) 
- btype (str):
- bispectrum type, i.e., kkk (lens-lens-lens), gkk (density-lens-lens), ggk (density-density-lens), or ggg (density-density-density) 
- dNdz[zn] (double):
- redshift distribution of galaxy, only used when btype includes g 
- wdel[zn,l] (double):
- modified chi-kernel function by z-cleaning at l=0 to lmax 
 
- Returns:
- bc[bn] (double):
- multipole bin centers 
- bl0[bn] (double):
- binned lensing bispectrum from LSS contributions 
- bl1[bn] (double):
- binned lensing bispectrum from post-Born contributions 
 
 
- cmblensplus.basic.bispec.bispeclens_snr(cpmodel, model, z, dz, zs, lmin, lmax, cl, k, pk0, pktype='T12', btype='kkk', dNdz=None, cgg=None, ro=100, wdel=None)
- Compute SNR of lensing bispectrum analytically - Args:
- cpmodel (str):
- cosmological parameter model (model0, modelw, or modelp) 
- model (str):
- fitting formula of the matter bispectrum (LN=linear, SC=SC03, GM=Gil-Marin+12, 3B=3-shape-bispectrum, or RT=Takahashi+19) 
- z[zn] (double):
- redshift points for the z-integral 
- dz[zn] (double):
- interval of z 
- zs[3] (double):
- source redshifts 
- lmin/lmax (int):
- minimum/maximum multipoles of the bispectrum 
- cl[l] (int):
- observed angular power spectrum at 0<=l<=lmax 
- k[kn] (double):
- k for the matter power spectrum in unit of [h/Mpc] 
- pk0[kn] (double):
- the linear matter power spectrum at z=0 in unit of [Mpc^3/h^3] 
 
- Args(optional):
- pktype (str):
- fitting formula for the matter power spectrum (Lin, S02 or T12) 
- btype (str):
- bispectrum type, i.e., kkk (lens-lens-lens), gkk (density-lens-lens), ggk (density-density-lens), or ggg (density-density-density) 
- dNdz[zn] (double):
- redshift distribution of galaxy, only used when btype includes g 
- wdel[zn,l] (double):
- modified chi-kernel function by z-cleaning at l=0 to lmax 
- cgg[l] (double):
- observed galaxy spectrum 
- ro (int):
- output progress for every “ro” multipoles (ro=100, default) 
 
- Returns:
- snr[2] (double):
- total SNR amd LSS-only SNR 
 
 
- cmblensplus.basic.bispec.bispeclens_gauss_bin(shap, bn, lmin, lmax, cl)
- Compute binned bispectrum analytically for the quadratic gaussian model - Args:
- shap (str):
- shape of the bispectrum (equi, fold, sque, or isos) 
- bn (int):
- number of multipole bins 
- lmin/lmax (int):
- minimum/maximum multipoles of the bispectrum 
- cl[l] (double):
- the power spectrum at [0:lmax+1] 
 
- Returns:
- bc[bn] (double):
- multipole bin centers 
- bl[bn] (double):
- binned bispectrum 
 
 
- cmblensplus.basic.bispec.zpoints(zmin, zmax, zn, zspace=1)
- Precomputing interpolation points for z - Args:
- zmin/zmax (double):
- minimum/maximum redshifts 
- zn (int):
- number of redshifts 
 
- Args(optional):
- zspace (int):
- type of spacing. 0 for linear and 1 for gauss-legendre. 
 
- Returns:
- z[zn] (double):
- redshifts 
- dz[zn] (double):
- redshift intervals 
 
 
- cmblensplus.basic.bispec.skewspeclens(cpmodel, model, z, dz, zs, ols, lmin, lmax, k, pk0, theta=0.0, pktype='T12', btype='kkk', pb=True, Om=0.3, H0=70.0, w0=-1.0, wa=0.0, mnu=0.06, ns=0.965, verbose=True, dNdz=None, wdel=None)
- Compute skew spectrum using a matter bispectrum fitting formula (Xl1,Yl2,Yl3) - Args:
- cpmodel (str):
- cosmological parameter model (model0, modelw, modelp, or input) 
- model (str):
- fitting formula of the matter bispectrum (LN=linear, SC=SC03, GM=Gil-Marin+12, 3B=3-shape-bispectrum, or RT=Takahashi+19) 
- z[zn] (double):
- redshift points for the z-integral 
- dz[zn] (double):
- interval of z 
- zs[2] (double):
- source redshifts where zs[2] is used for the squared map 
- lmin/lmax (int):
- minimum/maximum multipoles of alms included in the skew spectrum 
- ols[bn] (int):
- output multipoles to be computed for skew spectrum 
- k[kn] (double):
- k for the matter power spectrum [h/Mpc] 
- pk0 (double):
- the linear matter power spectrum at z=0 [Mpc^3/h^3] 
 
- Args(optional):
- pktype (str):
- fitting formula for the matter power spectrum (Lin, S02 or T12) 
- btype (str):
- bispectrum type, i.e., kkk (lens-lens^2), gkk (density-lens^2), kgg (lens-density^2), or ggg (density-density^2) 
- dNdz[zn] (double):
- redshift distribution of galaxy, only used when btype includes g 
- theta (double):
- kappa map resolution in arcmin 
- pb (bool):
- with post-Born correction or not (default=True) 
- verbose (bool):
- output messages 
- wdel[zn,l] (double):
- modified chi-kernel function by z-cleaning at l=0 to lmax 
 
- Returns:
- skew[3,2,l] (double):
- skew-spectrum (S0, S1, S2) from LSS and PB contributions, separately 
 
 
galaxy – tools for galaxy z distribution
- cmblensplus.basic.galaxy.dndz_sf(z, a, b, zm=0, z0=0)
- A model of galaxy z distribution - Args:
- z[zn] (double):
- redshifts at which dNdz is returned 
- a, b (double):
- shape parameters of Schechter-like galaxy distribution 
 
- Args(optional):
- zm (double):
- mean redshift, default to 0 
- z0 (double):
- a parameter relevant to zm, default to 0. Either zm or z0 has to be specified. 
 
- Returns:
- dndz[zn] (double):
- galaxy z distribution 
 
 
- cmblensplus.basic.galaxy.photoz_error(z, zi, zn=None, sigma=0.03, zbias=0.0)
- Photo-z error on z distribution which is multiplied to original galaxy z distribution. See Eq.(13) of arXiv:1103.1118 for details. - Args:
- z[zn] (double):
- redshifts at which photoz error function is returned 
- zi[2] (double):
- z-bin edges 
- sigma (double):
- a parameter of photo-z error which is given by, sigma x (1+z) 
- zbias (double):
- photo-z mean bias 
 
- Returns:
- pz[zn] (double):
- photoz error function 
 
 
- cmblensplus.basic.galaxy.zbin(zn, a, b, zm=0, z0=0, verbose=False)
- Computing z-interval of z-bin so that number of galaxies at each z-bin is equal - Args:
- zn (int):
- number of z-bins 
- a, b (double):
- shape parameters of Schechter-like galaxy distribution 
 
- Args(optional):
- zm (double):
- mean redshift, default to 0 
- z0 (double):
- a parameter relevant to zm, default to 0. Either zm or z0 has to be specified. 
- verbose (bool):
- output messages (default to True) 
 
- Returns:
- zb[zn+1] (double):
- z-intervals 
 
 
- cmblensplus.basic.galaxy.frac(zn, zb, a, b, zm, zbias=0.0, sigma=0.0, verbose=False)
- Computing z-interval of z-bin so that number of galaxies at each z-bin is equal - Args:
- zn (int):
- number of z-bins 
- a, b (double):
- shape parameters of Schechter-like galaxy distribution 
- zm (double):
- mean redshift 
- zb[zn+1] (double):
- z-intervals 
 
- Args(optional):
- verbose (bool):
- output messages (default to True) 
- zbias (double):
- constant bias to true photo-z 
- sigma (double):
- uncertaines of photo-z 
 
- Returns:
- nfrac[zn] (double):
- fraction of galaxy number at each bin, defined by int_zi^zi+1 dz N(z)/int dz N(z) 
 
 
cosmofuncs – tools for cosmology related functions
- cmblensplus.basic.cosmofuncs.hubble(z, H0=70.0, Om=0.3, Ov=0.7, w0=-1.0, wa=0.0, divc=False)
- Compute the expansion rate in unit of 1/Mpc, H/c, or in unit of km/s/Mpc, H. - Args:
- z[zn] (double):
- Redshifts at which H is computed 
 
- Args(optional):
- H0 (double):
- The current value of hubble parameter in km/s/Mpc, default to 70 km/s/Mpc 
- Om (double):
- The current value of Omega_matter, default to 0.3 
- Ov (double):
- The current value of Omega_Dark-energy, default to 0.7 
- w0, wa (double):
- The EoS of Dark Energy, default to w0=-1 and wa=0. 
- divc (bool):
- Divide H by c or not, default to False. 
 
- Returns:
- Hz[zn] (double):
- The expansion rate, H(z), divided by c or not. 
 
 
- cmblensplus.basic.cosmofuncs.dhubble_dz(z, H0=70.0, Om=0.3, Ov=0.7, w0=-1.0, wa=0.0)
- Compute dH(z)/dz. - Args:
- z[zn] (double):
- Redshifts at which dH/dz is computed 
 
- Args(optional):
- H0 (double):
- The current value of hubble parameter in km/s/Mpc, default to 70 km/s/Mpc 
- Om (double):
- The current value of Omega_matter, default to 0.3 
- Ov (double):
- The current value of Omega_Dark-energy, default to 0.7 
- w0, wa (double):
- The EoS of Dark Energy, default to w0=-1 and wa=0. 
 
- Returns:
- dHdz[zn] (double):
- The derivative of the expansion rate, dH(z)/dz. 
 
 
- cmblensplus.basic.cosmofuncs.dist2z(rz, H0=70.0, Om=0.3, Ov=0.7, w0=-1.0, wa=0.0)
- Compute redshift as a function of comoving distance - Args:
- rz[zn] (double):
- Comoving distance [Mpc] 
 
- Args(optional):
- H0 (double):
- The current value of hubble parameter in km/s/Mpc, default to 70 km/s/Mpc 
- Om (double):
- The current value of Omega_matter, default to 0.3 
- Ov (double):
- The current value of Omega_Dark-energy, default to 0.7 
- w0, wa (double):
- The EoS of Dark Energy, default to w0=-1 and wa=0. 
 
- Returns:
- z[zn] (double):
- Redshift 
 
 
- cmblensplus.basic.cosmofuncs.dist_comoving(z, H0=70.0, Om=0.3, Ov=0.7, w0=-1.0, wa=0.0)
- Compute comoving distance as a function of z - Args:
- z[zn] (double):
- Redshift 
 
- Args(optional):
- H0 (double):
- The current value of hubble parameter in km/s/Mpc, default to 70 km/s/Mpc 
- Om (double):
- The current value of Omega_matter, default to 0.3 
- Ov (double):
- The current value of Omega_Dark-energy, default to 0.7 
- w0, wa (double):
- The EoS of Dark Energy, default to w0=-1 and wa=0. 
 
- Returns:
- rz[zn] (double):
- Comoving distance [Mpc] 
 
 
- cmblensplus.basic.cosmofuncs.dist_luminosity(z, H0=70.0, Om=0.3, Ov=0.7, w0=-1.0, wa=0.0)
- Compute luminosity distance as a function of z - Args:
- z[zn] (double):
- Redshift 
 
- Args(optional):
- H0 (double):
- The current value of hubble parameter in km/s/Mpc, default to 70 km/s/Mpc 
- Om (double):
- The current value of Omega_matter, default to 0.3 
- Ov (double):
- The current value of Omega_Dark-energy, default to 0.7 
- w0, wa (double):
- The EoS of Dark Energy, default to w0=-1 and wa=0. 
 
- Returns:
- DLz[zn] (double):
- Luminosity distance [Mpc] 
 
 
- cmblensplus.basic.cosmofuncs.growth_factor(z, H0=70.0, Om=0.3, Ov=0.7, w0=-1.0, wa=0.0, normed=False)
- Compute analytic linear growth factor D(z) as a function of z - Args:
- z[zn] (double):
- Redshift 
 
- Args(optional):
- H0 (double):
- The current value of hubble parameter in km/s/Mpc, default to 70 km/s/Mpc 
- Om (double):
- The current value of Omega_matter, default to 0.3 
- Ov (double):
- The current value of Omega_Dark-energy, default to 0.7 
- w0, wa (double):
- The EoS of Dark Energy, default to w0=-1 and wa=0. 
- normed (bool):
- If True, D(z=0)=1. Otherwise, the normalization is defined so that D(z)=a in the pure matter universe, Om(a)=1. 
 
- Returns:
- Dz[zn] (double):
- Growth factor 
 
 
- cmblensplus.basic.cosmofuncs.growth_rate(z, H0=70.0, Om=0.3, Ov=0.7, w0=-1.0, wa=0.0)
- Compute linear growth rate f(z) = dlnD/dlna as a function of z - Args:
- z[zn] (double):
- Redshift 
 
- Args(optional):
- H0 (double):
- The current value of hubble parameter in km/s/Mpc, default to 70 km/s/Mpc 
- Om (double):
- The current value of Omega_matter, default to 0.3 
- Ov (double):
- The current value of Omega_Dark-energy, default to 0.7 
- w0, wa (double):
- The EoS of Dark Energy, default to w0=-1 and wa=0. 
 
- Returns:
- fz[zn] (double):
- Growth rate 
 
 
- cmblensplus.basic.cosmofuncs.nz_gw(z, Cz, Hz, ntype='CH06', dotn0=1e-06, Tobs=3.0)
- Distribution function of NS-NS merger events per redshift (dN/dz) at z - Args:
- z (double):
- redshift 
- Cz (double):
- comoving distance 
- Hz (double):
- expansion rate 
 
- Args(optional):
- ntype (str):
- type of dotn functional form, i.e, CH06 (default) or none. 
- dotn0 (double):
- current merger-rate 
- Tobs (double):
- total observation time 
 
- Returns:
- nz (double):
- distribution function at z 
 
 
- cmblensplus.basic.cosmofuncs.drate_dz(z, ntype='CH06')
flat – cross-check tools for flat-sky normalization
- cmblensplus.basic.flat.alxy(qest, qtype, lmax, rlmin, rlmax, fC, W1, W2, gln=100, gle=1e-14, lxcut=0)
- Compute flat-sky quadratic estimator normalization CAUTION: This code interpolates the input Cl at the non-integer multipole by simply Cl(int(ell)) which leads to a small discrepancy in the normalization computed from the FFT-based method (which uses linear interpolation) and from this code. It is desireble to use the FFT-based normalization if you want to normalize the simulation results. - Args:
- qest (str):
- estimator combination (TT, TE, TB, EE, EB, or BB) 
- qtype (str):
- estimator type (lensing, patchytau) 
- lmax (double):
- output maximum multipole 
- rlmax/rlmin (double):
- input CMB multipole range for reconstruction 
- fC[rlmax] (double):
- power spectrum in the numerator 
 - :W1/W2[rlmax] : inverse of the observed power spectrum 
- Args(optional):
- gln (int):
- number of the GL integration points 
- lxcut (int):
- multipole cut in x-direction, |l_x| < lx 
- gle (double):
- convergence parameter for the GL integration 
 
- Returns:
- Ag/Ac[l] (double):
- normalization for even and odd estimator pairs 
 
 
- cmblensplus.basic.flat.alxy_asym(qest, qtype, lmax, rlmin, rlmax, fC, AA, BB, AB, gln=100, gle=1e-14, lxcut=0)
- cmblensplus.basic.flat.bbxy(lmax, rlmin, rlmax, XX, YY, weight='lensing', gln=100, gle=1e-14)
wigner_funcs – Wigner 3j symbols
- cmblensplus.basic.wigner_funcs.wigner_3j(l2, l3, m2, m3)
- Compute wigner3j for all possible l1 where w3j = (j1,j2,j3/m1,m2,m3) - Args:
- shap (str):
- shape of the bispectrum (equi, fold, sque, or isos) 
- cpmodel (str):
- cosmological parameter model (model0, modelw, or modelp) 
- model (str):
- fitting formula of the matter bispectrum (LN=linear, SC=SC03, GM=Gil-Marin+12, 3B=3-shape-bispectrum, or RT=Takahashi+19) 
- z[zn] (double):
- redshift points for the z-integral 
- zn (int):
- number of redshifts for the z-integral 
- dz[zn] (double):
- interval of z 
- zs[3] (double):
- source redshifts 
- lmin/lmax (int):
- minimum/maximum multipoles of the bispectrum 
- k[kn] (double):
- k for the matter power spectrum 
- pk0 (double):
- the linear matter power spectrum at z=0 
- kn (int):
- size of k 
 
- Returns:
- bl0[l] (double):
- lensing bispectrum from LSS contributions at [lmin,lmax] 
- bl1[l] (double):
- lensing bispectrum from post-Born contributions at [lmin,lmax]