bilby.gw.cosmology.get_cosmology

bilby.gw.cosmology.get_cosmology(cosmology=None)[source]

Get an instance of a astropy.cosmology.FLRW subclass.

To avoid repeatedly instantiating the same class, test if it is the same as the last used cosmology.

Parameters:
cosmology: astropy.cosmology.FLRW, str, dict
Description of cosmology, one of:

None - Use DEFAULT_COSMOLOGY Instance of astropy.cosmology.FLRW subclass String with name of known Astropy cosmology, e.g., “Planck13”

Returns:
cosmo: astropy.cosmology.FLRW

Cosmology instance