binny.cosmology.ccl_wrappers module#

PyCCL cosmology helpers for Binny.

This module provides small CCL-backed helpers for distances and volume weights. They are useful for LF-dependent redshift distributions and other cosmology-aware tomography extensions.

binny.cosmology.ccl_wrappers.comoving_radial_distance_mpc(cosmo: Cosmology, z: NDArray[float64]) → NDArray[float64]#

Return comoving radial distance in Mpc.

Parameters:
  • cosmo – PyCCL cosmology object.

  • z – Redshift value or array.

Returns:

Comoving radial distance in Mpc.

binny.cosmology.ccl_wrappers.comoving_volume_weight(cosmo: Cosmology, z: NDArray[float64]) → NDArray[float64]#

Return comoving volume element per redshift and steradian.

PyCCL’s comoving_volume_element returns the comoving volume element per unit scale factor and steradian,

\[\frac{dV}{da\,d\Omega}.\]

This helper converts it to a redshift weight using

\[\frac{dV}{dz\,d\Omega} = \left|\frac{dV}{da\,d\Omega}\right| \left|\frac{da}{dz}\right| = \left|\frac{dV}{da\,d\Omega}\right| a^2.\]
Parameters:
  • cosmo – PyCCL cosmology object.

  • z – Redshift value or array.

Returns:

Comoving volume element per redshift and steradian in Mpc^3.

binny.cosmology.ccl_wrappers.luminosity_distance_mpc(cosmo: Cosmology, z: NDArray[float64]) → NDArray[float64]#

Return luminosity distance in Mpc.

Parameters:
  • cosmo – PyCCL cosmology object.

  • z – Redshift value or array.

Returns:

Luminosity distance in Mpc.

binny.cosmology.ccl_wrappers.scale_factor_from_redshift(z: NDArray[float64]) → NDArray[float64]#

Return scale factor from redshift.

Parameters:

z – Redshift value or array.

Returns:

Scale factor values.

Raises:

ValueError – If any redshift is negative.