Code Monkey home page Code Monkey logo

cosmolopy's Introduction

CosmoloPy

a cosmology package for Python

For documentation and installation instructions, see http://roban.github.com/CosmoloPy/

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

Example

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

Prerequisites

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

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

Or:

> sudo pip install cosmolopy

Installation from Source

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

> sudo python setup.py 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 setup_alt.py install

Testing

The prefered way to run all tests is:

> python setup.py nosetests --with-doctest

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

> python setup.py nosetests

If you don't have nose:

> python setup.py test > python -m doctest cosmolopy/*.py

cosmolopy's People

Contributors

roban avatar lavaux avatar

Watchers

James Cloos avatar  avatar

Forkers

asvo-tao

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.