-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
In the doc of pyccl, it says:
All units are non-h-inverse (e.g., Mpc as opposed to Mpc/h).
but it seems that correlation_3d is using Mpc/h as its length unit.
Python version: 3.12.2
pyccl version: 3.2
import numpy as np
import matplotlib.pyplot as plt
import pyccl as ccl
from colossus.cosmology import cosmology as colcosmology
from astropy import cosmology
cosmo = cosmology.Planck18
cclcosmo = ccl.Cosmology(Omega_c=cosmo.Ode0, Omega_b=cosmo.Om0, h=cosmo.h,
n_s=0.965, sigma8=0.81, Neff=cosmo.Neff, Omega_g=cosmo.Ogamma0)
colcosmo = colcosmology.setCosmology('planck18')
rp = np.geomspace(3, 200, 50) # Mpc/h
z = 0
xi = ccl.correlation_3d(cclcosmo, a=1./(1+z), r=rp/cclcosmo['h'], p_of_k_a='delta_matter:delta_matter')
# ccl uses Mpc unit
xi2 = colcosmo.correlationFunction(rp, z)
# colossus uses Mpc/h unit
plt.plot(rp, xi, label='ccl')
plt.plot(rp, xi2, '--', label='colossus')
plt.xlabel(r'$r_p[h^{-1}Mpc$]')
plt.ylabel(r'$\xi$')
plt.legend()
plt.loglog()In this case, I compare the correlation function between ccl and colossus, and they don't agree with each other(You can check the position of BAO signal from the figuure). I guess this is bcause correlation_3d actually uses Mpc/h unit in the calculation, resulting a smaller
Metadata
Metadata
Assignees
Labels
No labels