Cosmology

class astropy.cosmology.Cosmology(*args, **kwargs)[source]

Bases: object

Base-class for all Cosmologies.

Parameters
*args

Arguments into the cosmology; used by subclasses, not this base class.

namepython:str or python:None (optional, keyword-only)

The name of the cosmology.

**kwargs

Arguments into the cosmology; used by subclasses, not this base class.

Notes

Class instances are static – you cannot (and should not) change the values of the parameters. That is, all of the attributes above are read only.

Attributes Summary

name

Methods Summary

clone(**kwargs)

Returns a copy of this object with updated parameters, as specified.

Attributes Documentation

name

Methods Documentation

clone(**kwargs)[source]

Returns a copy of this object with updated parameters, as specified.

This cannot be used to change the type of the cosmology, so clone() cannot be used to change between flat and non-flat cosmologies. If no modifications are requested, then a reference to this object is returned.

Returns
newcosmoCosmology subclass instance

A new instance of this class with updated parameters as specified.

Examples

To make a copy of the Planck13 cosmology with a different matter density (Om0): and a new name:

>>> from astropy.cosmology import Planck13
>>> newcosmo = Planck13.clone(name="Modified Planck 2013", Om0=0.35)