astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v0.3 »
- Cosmological Calculations (`astropy.cosmology`) »
- set_current

# set_current

`astropy.cosmology.core.``set_current`(cosmo)

  Set the current cosmology.

  Call this with an empty string (‘’) to get a list of the strings that map to available pre-defined cosmologies.

  Warning

  `set_current` is the only way to change the current cosmology at runtime! The current cosmology can also be read from an option in the astropy configuration file when astropy.cosmology is first imported. However, any subsequent changes to the cosmology configuration option using `ConfigurationItem.set` at run-time will not update the current cosmology.

  Parameters:

  cosmo : str or `Cosmology` instance

  > The cosmology to use.

  See also

  `get_current`
    returns the currently-set cosmology