Clone wiki

cosmosis / demos / Demo10

Demo 10: Comparing Smith and Takahashi non-linear corrections, sampling over sigma_8

In this demo we will run cosmoSIS to compare two different non-linear corrections to the matter power spectrum, the Smith and Takahashi versions of the the halofit module (each taken from different versions of camb). The pipeline is based on Demo 6 using CFHTLenS likelihoods and the grid sampler.

Instead of sampling over the primordial power spectrum amplitude, A_s, in this case we will sample over a measure of the late time amplitude measure sigma_8. We'll also demonstrate how to use environment variables in ini files to reduce the number of files you need to copy around.


There are two commands to run, one for each version of Halofit:

HALOFIT="halofit" cosmosis demos/demo10.ini
HALOFIT="halofit_takahashi" cosmosis demos/demo10.ini

We are setting the environment variable HALOFIT to either “halofit” or “halofit_takahashi” depending on which non-linear correction we are using in each run.

We run the post-process command on the two outputs at once to generate joint plots:

postprocess output/demo10_halofit.txt output/demo10_halofit_takahashi.txt -o plots -p demo10 --tweaks demos/

This will create two plots, including a one dimensional likelihood plot over sigma8 showing both corrections named plots/demo10_cosmological_parameters--sigma8_input.png.



The Smith correction is described in Smith et al. (2003) and is implemented by the halofit module. The Takahashi correction is described in Takahashi et al. (2012) and is implemented by the halofit_takahashi module.

In the demo10.ini file the list of modules now reads:

modules = consistency camb sigma8_rescale ${HALOFIT} load_nz shear_shear 2pt cfhtlens 

consistency, camb, load_nz, shear_shear, 2pt, and cfhtlens are all as described in Demo 6.

sigma8_rescale is a new module. It allows us to sample over sigma8 instead of A_s, and is run directly after camb to modify the latter's outputs. We do this by setting in the values10.ini file a fiducial value for A_s for CAMB to use, and a new parameter sigma8_input for the rescaling:

A_s = 2.1e-9
sigma8_input = 0.67 0.7 0.87

The ${HALOFIT} module is replaced with the environment variable, which we set to either “halofit” or “halofit_takahashi” before running. Both modules are allocated separate sections in the demo10.ini file. The same syntax is used in the output section of demo10.ini, which now reads:


This results in two output text files being created, even though only one configuration file exists.

The post-processing script takes two arguments, one for each output file. The resulting plots each contain two curves corresponding to the two non-linear corrections. The sigma8 likelihood plot shows the two corrections overlapping over most of their sigma8 range but peaking at slightly different values.

A tweaks file named is also called during postprocess to add a legend and y axis label to these plots - plot tweaks are described in detail in Demo 8.