## Extracting combined data using PLANCK chain in cosmic

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
kawon Lee
Posts: 5
Joined: June 03 2015
Affiliation: Sogang Univ.

### Extracting combined data using PLANCK chain in cosmic

I'm trying to extract the equation of state parameter (w , wa) distribution with 95 % limit from PLANCK chain.
I succeed to plot the distribution using a python code, /batch1/output/w_wa.py in cosmoMC.

I want to combine the plot with my calculation. Thus I need the distribution data.

I followed the page ,http://cosmologist.info/cosmomc/readme_ ... html#stats , but I can't figure out that.

Antony Lewis
Posts: 1636
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

### Re: Extracting combined data using PLANCK chain in cosmic

Usually you can just edit the plot script to add any additional lines/contours as needed (using standard matplotlib).

kawon Lee
Posts: 5
Joined: June 03 2015
Affiliation: Sogang Univ.

### Re: Extracting combined data using PLANCK chain in cosmic

In fact, I need to plot a mapping of some parameters in my model to (w0,wa) with its likelihood and draw contours of 95% and 68% on the parameter space. So I need to (w0,wa)- likelihood data.

Antony Lewis wrote:Usually you can just edit the plot script to add any additional lines/contours as needed (using standard matplotlib).

Antony Lewis
Posts: 1636
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

### Re: Extracting combined data using PLANCK chain in cosmic

From a plot script (with g being the plotter instance), you can get densities using e.g.

Code: Select all

samples = g.sampleAnalyser,samplesForRoot&#40;'chain_name'&#41;
density=samples.get2DDensity&#40;'x1','x2'&#41;
density.normalize&#40;&#41;
#you can then access density.P &#40;array of density values&#41;,
#with ranges defining points&#58; density.x and density.y &#40;arrays&#41;
#or interpolate to a value using density.Prob&#40;x,y&#41;
print&#40;'Density type&#58;', type&#40;density&#41;&#41;
print&#40;'Test values&#58;', density.x&#91;0&#93;, density.y&#91;0&#93;, density.P&#91;0,0&#93;, density.Prob&#40;0.2,0.5&#41;&#41;
This is assuming the as-yet-to-be-released May 2015 version, or the standalone GetDist (https://pypi.python.org/pypi/GetDist/)

kawon Lee
Posts: 5
Joined: June 03 2015
Affiliation: Sogang Univ.

### Re: Extracting combined data using PLANCK chain in cosmic

Recenly, I can get density using 'sampleAnalyser.get_density_grid' command.

samples = g.sampleAnalyser,samplesForRoot&#40;'chain_name'&#41;
print&#40;'Test values&#58;', density.x&#91;0&#93;, density.y&#91;0&#93;, density.P&#91;0,0&#93;, density.Prob&#40;0.2,0.5&#41;&#41;