Data points for the curve of ns-r contour diagram

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Jack Sparrow
Posts: 14
Joined: May 12 2016
Affiliation: HK

Data points for the curve of n_s-r contour diagram

Post by Jack Sparrow » June 06 2017

When we use getdist to plot the contour diagram, we can get the curves. Does anybody know how to extract the data points of the curve? I want to use these points for some other purpose.

Actually, I want to get the experimental data points on ns-r diagram. Can anybody help me?

Thanks a lot!


Jack Sparrow
Posts: 14
Joined: May 12 2016
Affiliation: HK

Data points for the curve of n_s-r contour diagram

Post by Jack Sparrow » June 06 2017

Thank you! Antony Lewis!

Yes, I use the following command

density=samples.get2DDensity('ns','r')
density.normalize()

But how can I output these into a txt file? And what is the structure or meaning of data in density? Sorry for my very poor knowledge in python. I will be very grateful if you can help me more!!

Thanks!!

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

Re: Data points for the curve of n_s-r contour diagram

Post by Antony Lewis » June 07 2017

You can access x, y and P elements of Density2D directly, as set in the class constructor:

http://getdist.readthedocs.io/en/latest ... .Density2D

Or just call density(x,y) to get an interpolated table as your preferred values (Density2D inherits from RectBivariateSpline).

Jack Sparrow
Posts: 14
Joined: May 12 2016
Affiliation: HK

Data points for the curve of n_s-r contour diagram

Post by Jack Sparrow » June 07 2017

Thank you! Finally, I get the output data with 256*256 data points. But When I plotted them by myself, it seems to be very unsmooth, highly distorted? How can I get the similar figure as the getdistGUI displays? I mean, can I get exactly the data used in the getdistGUI curve?

Thanks!

Post Reply