redshift_temperature#

astropy.cosmology.units.redshift_temperature(cosmology=None, **atzkw)[source]#

Convert quantities between redshift and CMB temperature.

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

Parameters:
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).

**atzkw

keyword arguments for z_at_value()

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.K, cu.redshift_temperature(WMAP9))
<Quantity 3000.225 K>