Welcome to c2raytools’s documentation!

About c2raytools

c2raytools is a Python module for reading and analyzing data files produced by C2Ray and CubeP3M. In addition to providing a Python interface for reading data and converting to physically meaningful units, it provides functions for calculating derived quantities such as brightness temperature and statistics such as power spectra. There are also functions for converting data to redshift space and to produce lightcone boxes.

Installation

First, download the necessary files from GitHub. You can do this easily by running the command:

>>> git clone https://github.com/hjens/c2raytools

Then cd into the newly created directory run the setup.py script to install it:

>>> python setup.py install

This will install the package to your default Python directory. You may have to add a sudo before the command. If you do not have write permission to this directory, you can install c2raytools to some custom directory as such:

>>> python setup.py install --home=~/mydir

In this case, you have to make sure the directory you are installing to is in your PYTHONPATH.

Updating to the latest version

All updates to c2raytools are published on GitHub. To update your installation to the latest version, first cd into the directory where you first downloaded c2raytools, and run:

>>> git pull origin

Then run the setup.py scipt again, in the same way as before. If you deleted the downloaded files, you can update by simply repeating the installation procedure as described above.

Notes for users of older versions

c2raytools used to be organized into several smaller sub-packages (all the file classes where in the files module, for instance). This is no longer the case. Most older code can be converted simply by removing the extra module name. For example, change:

>>> myfile = c2t.files.XfracFile(filename)

to

>>> myfile = c2t.XfracFile(filename)

Dependencies

c2raytools requires numpy and scipy to work. To visualize data, matplotlib is needed. The FITS reading/saving routines require pyfits

Indices and tables