redshift_hubble

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

Convert quantities between redshift and Hubble parameter and little-h.

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

Parameters:
cosmologyCosmology, python:str, or python: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 Hubble parameter and little-h unit.

Examples

>>> import astropy.units as u
>>> import astropy.cosmology.units as cu
>>> from astropy.cosmology import WMAP9
>>> z = 1100 * cu.redshift
>>> equivalency = cu.redshift_hubble(WMAP9)  # construct equivalency
>>> z.to(u.km / u.s / u.Mpc, equivalency)  
<Quantity 1565637.40154275 km / (Mpc s)>
>>> z.to(cu.littleh, equivalency)  
<Quantity 15656.37401543 littleh>