Basic usage of the pyflation package

The pyflation package can be used independently of the scripts which run full first and second order calculations. If you have installed the package using the install command then it should be available by doing:

> import pyflation

in an interactive Python session. If you have not installed the package then make sure that the path where the pyflation directory is located has been added to the PYTHONPATH variable.

The most important module in the package is cosmomodels. This contains the classes which drive first and second order evolution. To run a first order simulation with the default settings first import the cosmomodels module:

> from pyflation import cosmomodels as c

Here the module is aliased as c for convenience. Then create a new first order model using the FOCanonicalTwoStage class:

> m = c.FOCanonicalTwoStage()

You can inspect the attributes and methods of m in the usual way by using dir(m) or tab completion in the iPython environment.

To begin the first order run use:


The results are stored in m.yresult in raw form for all time steps. The value of the first order perturbations for all time steps are also labelled as m.dp1.

Basic Usage of Scripts

Assuming you have followed the instructions in INSTALL.txt to install the program either system-wide, locally, or in a contained directory, you can create a new run directory using the script.

If you have used the install command, the script should be somewhere on your PATH. If not you will need to prefix the following commands with the path to the script. To create a new run in the directory $HOME/pyflation-runs and call the run mynewrun run the script with the following options:

$ -d $HOME/pyflation-runs -n mynewrun

The script should create the directory (and any parent ones needed) and set up the file structure inside. Change to the run directory and look inside. The directories applogs, qsublogs, qsubscripts and results are created automatically and the file is put inside the run directory. If you want the code to be copied in to the run directory please see the advanced options of the script.

The file inside the run directory contains user changeable settings. In particular the choice of potential and k range to be used in the scripts is made here. The python classes used for the different stages of the evolution can also be changed in this file.

The script files are descriptively named. To begin a first order perturbation calculation use For each script the –help option will show all the options available. Simple operation uses the defaults in for example:


will run the first order code and store the result in the file specified in, usually results/fo.hf5.

Table Of Contents

Previous topic


Next topic


This Page