Extracting combined data using PLANCK chain in cosmic

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

Extracting combined data using PLANCK chain in cosmic

Post by kawon Lee » June 09 2015

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

Post by Antony Lewis » June 09 2015

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

Post by kawon Lee » June 10 2015

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

Post by Antony Lewis » June 10 2015

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

Code: Select all

samples = g.sampleAnalyser,samplesForRoot('chain_name')
density=samples.get2DDensity('x1','x2')
density.normalize()
#you can then access density.P (array of density values), 
#with ranges defining points: density.x and density.y (arrays)
#or interpolate to a value using density.Prob(x,y)
print('Density type:', type(density))
print('Test values:', density.x[0], density.y[0], density.P[0,0], density.Prob(0.2,0.5))
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

Post by kawon Lee » August 12 2015

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

Thanks to your help.
Antony Lewis wrote:From a plot script (with g being the plotter instance), you can get densities using e.g.

Code: Select all

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

Post Reply