Cosmomc Grids and Plotting with Python

The latest CosmoMC versions add a set of tools for generating and analysing grids of parameter runs using CosmoMC and GetDist, plus a variety of utility scripts and plotting functions.

See the ./python directory for scripts (python 2.7+). Most can be run without arguments to show a list of possible input parameters.

Grids of models

A description for a grid of models is given in a python settings file. You will also need to produce a submission script for your machine. Edit the job_script file as appropriate for your machine, and if necessary the submitJob function in python/jobQueue.py. Covmats for Planck are in planck_covmats folder, linked by default for grid runs.

Grid run scripts include:

Once you have generated the chains using CosmoMC you can analyse them. Run python/runGridGetdist.py to run getdist over grid of models, and generating parameter constraints and files for plotting. Other scripts you can then use include Most scripts have standardized input parameters to restrict to subsets of grid items, e.g. filtering by importance sampling run, no importance sampling, or specific item name (pattern match).

Plotting scripts

GetDistPlots.py is used in your own scripts for plots from getdist outputs. Add ./python to your $PYTHONPATH to use this from scripts elsewhere. See Planck grid readme for examples.

Analysis scripts

Currently most analysis is done by GetDist. You can however use chains.py to read in chain files and do simple calculations (e.g. mean and variance of derived parameters). See Planck grid readme for a simple example.

Other scripts

Multi-purpose use and utility scripts include