Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/esheldon/cosmology
Some code for calculating cosmological distances
https://github.com/esheldon/cosmology
Last synced: 11 days ago
JSON representation
Some code for calculating cosmological distances
- Host: GitHub
- URL: https://github.com/esheldon/cosmology
- Owner: esheldon
- Created: 2011-03-30T14:10:29.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2016-08-08T14:23:16.000Z (over 8 years ago)
- Last Synced: 2024-10-19T20:49:52.795Z (19 days ago)
- Language: Python
- Homepage:
- Size: 38.1 KB
- Stars: 14
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A python package to calculate cosmological distances in a FRW metric.
Description
-----------A package to calculate cosmological distances. The workhorse is a class Cosmo
that wraps and the underlying C code. The geometry can be non-flat.In order to take advantage of the speed of the underlying C code, you should,
if at all possible, send numpy arrays to the methods rather than repeatedly
call the python methods.Installation
------------```bash
python setup.py install --prefix=/some/path
```Examples
--------```python
import cosmology
c=cosmology.Cosmo()# comoving distance to z=0.5
c.Dc(0.0, 0.5)# angular diameter distance between z=0.5 and z=0.9
c.Da(0.5, 0.9)# luminosity distance between z=0.2 and a sequence of redshifts
c.Dl(0.2, [0.3, 0.4, 0.5])# new cosmology
c=cosmology.Cosmo(H0=70.0, omega_m=0.25)# inverse critical density for lensing, lens at 0.2 and
# source at 0.3
c.sigmacritinv(0.2, 0.3)
```Tests
----------```python
import cosmology
cosmology.test()
```TODO
----
- Add equation of state
- Add *evolving* equation of state.