default_cosmology

class astropy.cosmology.default_cosmology[source]

Bases: astropy.utils.state.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

Methods Summary

get()

Get the current science state value.

get_cosmology_from_string(arg)

Return a cosmology instance from a string.

set(value)

Set the current science state value.

validate(value)

Validate the value and convert it to its native type, if necessary.

Methods Documentation

classmethod get()

Get the current science state value.

static get_cosmology_from_string(arg)[source]

Return a cosmology instance from a string.

classmethod set(value)

Set the current science state value.

classmethod validate(value)[source]

Validate the value and convert it to its native type, if necessary.