Skip to content
a basic numpy/scipy-based cosmology package for python
C Python JavaScript Shell
Find file
Latest commit f23ea37 @roban Added extension to README file name (ostly so github will display pre…

	renamed:    README -> README.rst



a cosmology package for Python

For documentation and installation instructions, see

CosmoloPy is released under the MIT software liscense (see LISCENSE).


Calculate the comoving distance to redshift 6.

>>> import cosmolopy.distance as cd
>>> cosmo = {'omega_M_0':0.3, 'omega_lambda_0':0.7, 'omega_k_0':0.0, 'h':0.72}
>>> d_co = cd.comoving_distance(6., **cosmo)
>>> print "Comoving distance to z=6 is %.1f Mpc" % (d_co)
Comoving distance to z=6 is 8017.8 Mpc


Python NumPy SciPy
For tests (optional):
nose matplotlib
For power spectrum calculation (needed for most of perturbation module):

Installation of Prerequisites under Ubuntu

> sudo apt-get install python-numpy python-scipy python-matplotlib > sudo apt-get install python-dev

Installation from PYPI

You can easily install the pacakge directly from the Python Package Index with easy_install or pip.

Run either:

> sudo easy_install cosmolopy


> sudo pip install cosmolopy

Installation from Source

If you've downloaded the source, install it by running

> sudo python install

If you have trouble compiling from source, it's probably the EH.power module (everything else is pure python). You can install without it by running:

> sudo python install


The prefered way to run all tests is:

> python nosetests --with-doctest

Or if you don't want to run the doctests:

> python nosetests

If you don't have nose:

> python test > python -m doctest cosmolopy/*.py
Something went wrong with that request. Please try again.