synthesizer.cosmology

A module containing helper functions for cosmology calculations.

This module mainly interfaces with astropy.cosmology and provides helpful wrappers and importantly cached functions for hot path cosmology calculations.

The module is explicitly tested against, and supports, the following astropy cosmology models:

  • FLRW (base class)

  • FlatLambdaCDM (flat ΛCDM model)

  • wCDM (constant dark energy equation of state)

  • FlatwCDM (flat version of wCDM)

  • w0waCDM (time-varying dark energy equation of state)

  • Flatw0waCDM (flat version of w0waCDM)

  • wpwaCDM (pivot redshift parameterization)

  • FlatwpwaCDM (flat version of wpwaCDM)

  • w0wzCDM (redshift derivative parameterization)

  • Flatw0wzCDM (flat version of w0wzCDM)

Functions

synthesizer.cosmology.get_angular_diameter_distance(cosmo, redshift)[source]

Get the angular diameter distance for a given redshift and cosmology.

This function is cached to improve performance on repeated calls with the same parameters, i.e. the lru_cache will return the previously computed value if the same redshift is requested again with the same cosmology.

Parameters:
  • cosmo (astropy.cosmology.FLRW) – An instance of an astropy cosmology.

  • redshift (float) – The redshift for which to compute the angular diameter distance.

Returns:

The angular diameter distance in Mpc.

Return type:

unyt_quantity

synthesizer.cosmology.get_luminosity_distance(cosmo, redshift)[source]

Get the luminosity distance for a given redshift and cosmology.

This function is cached to improve performance on repeated calls with the same parameters, i.e. the lru_cache will return the previously computed value if the same redshift is requested again with the same cosmology.

Parameters:
  • cosmo (astropy.cosmology.FLRW) – An instance of an astropy cosmology.

  • redshift (float) – The redshift for which to compute the luminosity distance.

Returns:

The luminosity distance in Mpc.

Return type:

unyt_quantity