CosmoCoffee Forum Index CosmoCoffee

 
 FAQFAQ   SearchSearch  MemberlistSmartFeed   MemberlistMemberlist    RegisterRegister 
   ProfileProfile   Log inLog in 
Arxiv New Filter | Bookmarks & clubs | Arxiv ref/author:

Data points for the curve of n_s-r contour diagram
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
Jack Sparrow



Joined: 12 May 2016
Posts: 14
Affiliation: HK

PostPosted: June 06 2017  Reply with quote

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!
Back to top
View user's profile  
Antony Lewis



Joined: 23 Sep 2004
Posts: 1277
Affiliation: University of Sussex

PostPosted: June 06 2017  Reply with quote

use get2DDensity

http://getdist.readthedocs.io/en/latest/mcsamples.html#getdist.mcsamples.MCSamples.get2DDensity
Back to top
View user's profile [ Hidden ] Visit poster's website
Jack Sparrow



Joined: 12 May 2016
Posts: 14
Affiliation: HK

PostPosted: June 06 2017  Reply with quote

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!!
Back to top
View user's profile  
Antony Lewis



Joined: 23 Sep 2004
Posts: 1277
Affiliation: University of Sussex

PostPosted: June 07 2017  Reply with quote

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

http://getdist.readthedocs.io/en/latest/densities.html#getdist.densities.Density2D

Or just call density(x,y) to get an interpolated table as your preferred values (Density2D inherits from RectBivariateSpline).
Back to top
View user's profile [ Hidden ] Visit poster's website
Jack Sparrow



Joined: 12 May 2016
Posts: 14
Affiliation: HK

PostPosted: June 07 2017  Reply with quote

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!
Back to top
View user's profile  
Display posts from previous:   
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software All times are GMT + 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group. Sponsored by WordWeb online dictionary and dictionary software.