redshift_distance¶

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.
 Parameters
 cosmology
Cosmology
,str
, orNone
, optional A cosmology realization or builtin 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.
 **atzkw
keyword arguments for
z_at_value()
 cosmology
 Returns
Equivalency
Equivalency between redshift and temperature.
Examples
>>> import astropy.units as u >>> import astropy.cosmology.units as cu >>> from astropy.cosmology import WMAP9
>>> z = 1100 * cu.redshift >>> z.to(u.Mpc, cu.redshift_distance(WMAP9, kind="comoving")) <Quantity 14004.03157418 Mpc>