uvex_transients.utils.cosmology.redshift_to_age#
- uvex_transients.utils.cosmology.redshift_to_age(z: float | NDArray[float64], cosmology: Cosmology | None = None) Quantity[source]#
Compute the age of the universe at a given redshift.
- Parameters:
z (
floatorarray-like) – Cosmological redshift.cosmology (~astropy.cosmology.FLRW, optional) – Cosmology used to evaluate the relation between redshift and cosmic age. If
None, the configured default cosmology is used.
- Returns:
Age of the universe at redshift
zwith units of time.- Return type:
~astropy.units.Quantity
Notes
This is equivalent to calling
cosmology.age(z)
from the Astropy cosmology API.
Examples
>>> redshift_to_age(1.0) <Quantity 5.8513433 Gyr>