default_cosmology#
- class astropy.cosmology.default_cosmology[source]#
Bases:
ScienceState
The default cosmology to use.
To change it:
>>> from astropy.cosmology import default_cosmology, WMAP7 >>> with default_cosmology.set(WMAP7): ... # WMAP7 cosmology in effect ... pass
Or, you may use a string:
>>> with default_cosmology.set('WMAP7'): ... # WMAP7 cosmology in effect ... pass
To get the default cosmology:
>>> default_cosmology.get() FlatLambdaCDM(name='Planck18', H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.30966, ...
Methods Summary
get
()Get the current science state value.
set
(value)Set the current science state value.
validate
(value)Return a Cosmology given a value.
Methods Documentation
- classmethod get()#
Get the current science state value.
- classmethod set(value)#
Set the current science state value.