CosmoFit.cosmology.DistanceIntegrator

class CosmoFit.cosmology.DistanceIntegrator(cosmology, zmax=5.0, ngrid=None, interpolator='hermite')[source]

Bases: object

Fast evaluator for the dimensionless comoving distance.

The integral

χ(z) = ∫ dz / E(z)

is computed only once on a dense redshift grid and subsequently evaluated through a monotonic PCHIP interpolation.

Parameters:
  • cosmology (Cosmology) – Cosmological model.

  • zmax (float, optional) – Maximum redshift of the interpolation grid.

  • ngrid (int, optional) – Number of grid points. If None, an adaptive grid size is automatically selected.

  • interpolator (str, optional) – Interpolation method. Currently only “hermite” is implemented.

__init__(cosmology, zmax=5.0, ngrid=None, interpolator='hermite')[source]
Parameters:

Methods

__init__(cosmology[, zmax, ngrid, interpolator])

chi(z)

Evaluate the dimensionless comoving distance.

prepare(zmax[, ngrid])

Prepare the integration grid.

rebuild()

Recompute the chi(z) interpolation table from the current state of the associated cosmology.