uvex_transients.utils.cosmology.age_to_redshift#

uvex_transients.utils.cosmology.age_to_redshift(age: Quantity, cosmology: Cosmology | None = None) → Quantity[source]#

Compute the redshift corresponding to a given cosmic age.

Parameters:
  • age (~astropy.units.Quantity) – Age of the universe.

  • cosmology (~astropy.cosmology.FLRW, optional) – Cosmology used to perform the inversion. If None, the configured default cosmology is used.

Returns:

Redshift corresponding to the provided cosmic age, as a dimensionless ~astropy.units.Quantity (see astropy.cosmology.z_at_value()).

Return type:

Quantity

Notes

This function numerically inverts the cosmological age relation using astropy.cosmology.z_at_value().

Examples

>>> import astropy.units as u
>>> age_to_redshift(5 * u.Gyr)
<Quantity 1.23764714 redshift>