Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Correlation_3d function uses Mpc/h as its unit? #1247

@MeloDi-23

Description

@MeloDi-23

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()

Image

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 $\xi$, or maybe there are other problems / bugs leading to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions