bzip2 -d plc-1.0.tar.bz2; tar -xf plc-1.0.tar
cd plc-1.0
./waf configure --lapack_mkl=${MKLROOT} --lapack_mkl_version=10.3 --install_all_deps(you may need to change the options on this line depending on your installation; --install_all_deps may not be needed; see the .pdf document file in PLC..PATH/plc_1.0/plc_1.0 for options)
./waf install
export PLANCKLIKE=cliklike export CLIKPATH=PLC..PATH/plc_1.0/plc_1.0 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CLIKPATH/libInstead of the last item you can also use PLC's recommended source PLC..PATH/plc_1.0/bin/clik_profile.sh. While you're at it you can add CosmoMC's python path (for plotting and quite analysis of chains):
export PYTHONPATH=COSMOMC..PATH/python:$PYTHONPATH
ln -s PLC..PATH/plc_1.0 ./data/clik(CosmoMC will look for files in ./data/clik - e.g. "ls -d ./data/clik/*.clik" should show you the likelihood data you downloaded).
mpirun -np 2 ./cosmomc test.inito 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.
ln -s /scratch/planck/PLA ./PLAso that ./PLA/base is for example the head directory with the baseline model chains. 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 settings_planck_nominalWhen done it will tell you the commands needed to be run to reproduce the chains. But of course you don't need to do that, you have the chains already. You can now use the python/* scripts on the PLA directory, and they will know about the available data. Settings for the Planck parameter grid are in python/settings_planck_nominal.py.
Here p.omegam is a vector of parameter values, similar p.sigma8; chains.mean and chains.var sum the samples with the corresponding weights to calculate the result. The third argument of loadGridChain specifies any data added by importance sampling.import chains rootdir = r'./PLA/' chains = chains.loadGridChain(rootdir, 'base', 'planck_lowl_lowLike_highL', 'lensing') p = chains.getParams() derived = p.sigma8 * p.omegam ** 0.6 print 'mean, err = ', chains.mean(derived), chains.std(derived) print '95% limits: ', chains.twoTailLimits(derived, 0.95)
See python/chains.py for other simple functions you can use. Use GetDist if you want to reproduce Planck results: chains.py only does tail integrals, it does not check for skewness or calculate credible intervals for skewed distributions.
python python/runGridGetdist.py PLA --burn_removedThis may take a while. It generates a VERY large number of plotting files in PLA/plot_data for the entire grid. You can use optional parameters for runGridGetdist.py if you want to restrict to specific models; run python python/runGridGetdist.py to see the full list of options. For example if you are only interested in models with massive neutrinos using Planck data you could do
python python/runGridGetdist.py PLA --paramtag base_mnu --data planckGetdist generates .m scripts in each PLA/../../dist subfolder, which you can run in matlab. Or, now usually recommended, use the python scripts. You can use python python/makePlots.py PLA .. to make plots en masse. See batch1/outputs/makeGridPlots for examples.
You can also write your own short python scripts to plot things of interest; many examples are in batch1/outputs/ (note that these use planckStyle.py, which assumed your main grid directory is ./main not ./PLA, and needs output folders called outputs and plots). For example, assuming you've done runGridGetdist on the base planck and WMAP chains, you can do
python batch1/outputs/triangle_planckonly_vs_WMAP.pyto reproduce the figure above.
As an example python script not using planckStyle you can do
The legend overlaps a bit. You can do "import pylab *" and use standard matplotlib commands. Or you can try things like thisimport GetDistPlots g=GetDistPlots.GetDistPlotter('PLA/plot_data') g.settings.setWithSubplotSize(4) roots = ['base_nnu_mnu_planck_lowl_lowLike','base_nnu_mnu_planck_lowl_lowLike_highL','base_nnu_mnu_planck_lowl_lowLike_highL_post_BAO'] g.plot_2d(roots, param_pair=['mnu','nnu'], filled=True) g.add_legend(['Planck+WP','Planck+WP+highL','Planck+WP+highL+BAO'],legend_loc='upper right'); g.export('mnu_nnu.png')
Outputs of the two versions should look like this:import GetDistPlots g=GetDistPlots.GetDistPlotter('PLA/plot_data') g.settings.setWithSubplotSize(4) g.make_figure(xstretch=1.3) roots = ['base_nnu_mnu_planck_lowl_lowLike','base_nnu_mnu_planck_lowl_lowLike_highL','base_nnu_mnu_planck_lowl_lowLike_highL_post_BAO'] g.plot_2d(roots, param_pair=['mnu','nnu'], filled=True) g.add_legend(['Planck+WP','Planck+WP+highL','Planck+WP+highL+BAO'],legend_loc='upper right',colored_text=True); g.export('mnu_nnu2.png')