astropy.cosmology.units.redshift_distance(cosmology=None, kind='comoving', **atzkw)[source]

Convert quantities between redshift and distance.

Care should be taken to not misinterpret a relativistic, gravitational, etc redshift as a cosmological one.

cosmologyCosmology, str, or None, optional

A cosmology realization or built-in cosmology’s name (e.g. ‘Planck18’). If None, will use the default cosmology (controlled by default_cosmology).

kind{‘comoving’, ‘lookback’, ‘luminosity’} or None, optional

The distance type for the Equivalency. Note this does NOT include the angular diameter distance as this distance measure is not monotonic.


keyword arguments for z_at_value()


Equivalency between redshift and temperature.


>>> import astropy.units as u
>>> import astropy.cosmology.units as cu
>>> from astropy.cosmology import WMAP9
>>> z = 1100 * cu.redshift
>>>, cu.redshift_distance(WMAP9, kind="comoving"))  
<Quantity 14004.03157418 Mpc>