astropy/astropy — pull request #322 by aconley314 (2012-07-23 19:02:28+00:00)
Title: Modified cosmology routines to handle dark energy equation of state

The routines in cosmology have been modified to handle the most commonly used
form for the dark energy equation of state (Linder 2003):

w(z) = w0 + wa z/(1+z)

Because calling it .Ol for w != -1 sounds a little silly, the the FRLWCosmology.Ol parameter
has been renamed to .Ode. To keep backwards compatibility, __getattr__ and __setattr__
have been added so that things like

cosmology.Ol = 0.5

still work -- that is, the above actually sets cosmology.Ode. As a beneficial side effect,
setting .Om or .Ode now also updates the curvature (.Ok) on the fly:
>>> import astropy.cosmology
>>> cos = astropy.cosmology.get_current()
>>> print cos
WMAP7(H0=70.4, Om=0.272, Ode=0.728, Ok=0)
>>> cos.Om = 0.3
>>> print cos
WMAP7(H0=70.4, Om=0.3, Ode=0.728, Ok=-0.028)

The old tests in cosmology/tests all pass.