CosmoMC and GetDist with Planck Likelihood and Chains

Note: Planck 2015 likelihoods are not yet available (not sooner than mid-March), only the 2013 version. The Planck 2015 chains are however now available.

The Planck likelihood code (PLC/clik) and parameter chains are available from the Planck Legacy Archive.

Using the Planck 2013 likelihood with CosmoMC

Here I assume you have installed CosmoMC in a directory called COSMOMC..PATH, and will install the Planck likelihood code in a directory called PLC..PATH. Note you need to use ifort 14 or higher to build CosmoMC, so make sure you have that configured before you start. A set of .ini files are supplied in ./batch1 which set up standards for Planck runs. Location of data files is set in CAMspec_ACTSPT_defaults, CAMspec_defaults depending on what you want to use. You can try
mpirun -np 2 ./cosmomc test.ini
to see if things are being loaded and start running OK.

Note that the "highL" (ACT/SPT) likelihood file is not included in the first PLC download; hopefully it will be added soon. Meanwhile you can follow the instructions on the Planck likelihood download page for how to make it from the ACT/SPT download.

Using Planck 2015 Chains

Planck provide a set of parameter chains produced by CosmoMC, available for download here; see description.

You can use CosmoMC's python scripts and getdist to analyse and make plots from them. Check you have set the PYTHONPATH as described at the top of the Python readme.

Then download and extract all the chain data. Make a symbolic link from ./cosmomc/PLA to the location of the chains, e.g.

ln -s PLA..PATH ./PLA
so that ./PLA/base is for example the head directory with the baseline model chains (and PLA..PATH is the full path that you extracted the contents of the download to). For the program to know about the structure of the grid you first need to initialize it for the location you have installed in. Do
python python/makeGrid.py PLA
You can now use python, grid and plotting scripts on the PLA directory, and they will know about the available data. Grid configuration settings for the Planck parameter grid are in PLA/config/.

If you download multiple Planck 2015 chain bundles, extract them to the same location so new folders are just merged over the existing ones and run makeGrid.py again, then plotting scripts etc will find all the results. If you want to use the +BKP tensor chains, download and add them last, so the config folder matches that in the BKP download.

You can also configure the plotting scripts to use the PLA location as the default_grid_root (esp. if you want to run or adapt sample plot scripts under batch2/outputs/). Make a text file called python/getdist/config.ini and add setting lines as required,e.g.

default_grid_root =  PLA..PATH
cache_dir = PLA..PATH/cache
output_base_dir=
Setting use_plot_data = F means that you do not need to run getdist first, anything needed for plotting will be calculated on the fly. The cache_dir is used to cache python-format chains, which makes loading them much faster after the first time. By default, plots go into ./outputs directory under cosmomc. You can se the output_base_dir to another location is where plot output (e.g. pdf) files are put by default (in output_base_dir/outputs).

Plotting

You can use the GetDist GUI to load the PLA folder location and then open and plot chains as you wish. Or you can write your own python scripts to plot things of interest; many examples are in batch2/outputs/. Make sure you have set up your python/getdist/config.ini as described above with default file location.

For example, to run the sample scripts, you can do

python batch2/outputs/lensonly_direction.py
to reproduce one of the figures in the lensing paper. (assuming you downloaded and installed the full PLA chain grid; default output location is ./outputs).

For instructions on writing plotting scripts, or how to calculate new derived parameters, see the plotting and analysis scripts readme.