pyccl.cls module

class pyccl.cls.CMBLensingTracer(cosmo, z_source)[source]

Bases: pyccl.cls.Tracer

A Tracer for CMB lensing.

Parameters:
  • cosmo (Cosmology) – Cosmology object.
  • z_source (float) – Redshift of source plane for CMB lensing.
class pyccl.cls.NumberCountsTracer(cosmo, has_rsd, dndz, bias, mag_bias=None)[source]

Bases: pyccl.cls.Tracer

A Tracer for galaxy number counts (galaxy clustering).

Parameters:
  • cosmo (Cosmology) – Cosmology object.
  • has_rsd (bool) – Flag for whether the tracer has a redshift-space distortion term.
  • dndz (tuple of arrays) – A tuple of arrays (z, N(z)) giving the redshift distribution of the objects. The units are arbitrary; N(z) will be normalized to unity.
  • bias (tuple of arrays) – A tuple of arrays (z, b(z)) giving the galaxy bias.
  • mag_bias (tuple of arrays, optional) – A tuple of arrays (z, s(z)) giving the magnification bias as a function of redshift. If None, the tracer is assumed to not have magnification bias terms. Defaults to None.
class pyccl.cls.Tracer(*args, **kwargs)[source]

Bases: object

A tracer of the matter density field.

Note

This class cannot be used directly. Use one of NumberCountsTracer, WeakLensingTracer or CMBLensingTracer instead.

This class contains all information describing the transfer functon of a tracer (e.g., galaxy density, lensing shear) of the matter distribution.

get_internal_function(cosmo, function, a)[source]

Method to evaluate any internal function of redshift for this tracer.

Parameters:
  • cosmo (Cosmology) – Cosmology object.
  • function (str) –

    Specifies which function to evaluate. Must be one of

    ’dndz’: number density ‘bias’: bias ‘mag_bias’: magnification bias ‘red_frac’: red fraction ‘ia_bias’: intrinsic alignment bias ‘lensing_win’: weak lensing window function ‘mag_win’: magnification window function
  • ( (a) – obj: float or array-like): list of scale factors at which to evaluate the function.
Returns:

Array of function values at the input scale factors.

class pyccl.cls.WeakLensingTracer(cosmo, dndz, ia_bias=None, red_frac=None)[source]

Bases: pyccl.cls.Tracer

A Tracer for weak lensing shear (galaxy shapes).

Parameters:
  • cosmo (Cosmology) – Cosmology object.
  • dndz (tuple of arrays) – A tuple of arrays (z, N(z)) giving the redshift distribution of the objects. The units are arbitrary; N(z) will be normalized to unity.
  • ia_bias (tuple of arrays, optional) – A tuple of arrays (z, b_IA(z)) giving the intrinsic alignment amplitude b_IA(z). If None, the tracer is assumped to not have intrinsic alignments. Defaults to None.
  • red_frac (tuple of arrays,, optional) – A tuple of arrays (z, f_red(z)) givng the red fraction of galaxies as a function of redshift. If None, then the tracer is assumed to not have a red fraction. Defaults to None.
pyccl.cls.angular_cl(cosmo, cltracer1, cltracer2, ell, l_limber=-1.0, l_logstep=1.05, l_linstep=20.0)[source]

Calculate the angular (cross-)power spectrum for a pair of tracers.

Parameters:
  • cosmo (Cosmology) – A Cosmology object.
  • cltracer2 (cltracer1,) – Tracer objects, of any kind.
  • ell (float or array_like) – Angular wavenumber(s) at which to evaluate the angular power spectrum.
  • l_limber (float) – Angular wavenumber beyond which Limber’s approximation will be used. Defaults to -1.
  • l_logstep (float) – logarithmic step in ell at low multipoles. Defaults to 1.05.
  • l_linstep (float) – linear step in ell at high multipoles. Defaults to 20.
Returns:

Angular (cross-)power spectrum values,

\(C_\ell\), for the pair of tracers, as a function of \(\ell\).

Return type:

float or array_like