CosmoCoffee Forum Index CosmoCoffee

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

ERROR in GetDist py: Plotting non-cosmomc contours
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
Elisa Ferreira



Joined: 21 Mar 2014
Posts: 12
Affiliation: McGill University

PostPosted: November 17 2015  Reply with quote

Hello,

I am trying to plot some contour plots from files created by cosmomc together with some files that are not from cosmomc using the python GetDist plotter.

The file is a single file (only one chain) and has the structure as in the cosmomc ones: weight likelihood param1 param2
I also have a paramname file that gives param1 param_1
param2 param_2
and a .ranges file.

When I try to plot those, I get the error:

WARNING:root:outlier fraction 0.00595632031767
Traceback (most recent call last):
File "test_da_dh.py", line 6, in <module>
g.plot_2d(samples, ['param1', 'param2'], filled=True)
File "/Users/elisaferreira/Desktop/GetDist−0.2.0/getdist/plots.py", line 646, in plot_2d
param_pair = self.get_param_array(roots[0], param_pair or [param1, param2])
File "/Users/elisaferreira/Desktop/GetDist−0.2.0/getdist/plots.py", line 809, in get_param_array
return self.paramNamesForRoot(root).parsWithNames(in_params, error=True, renames=renames)
File "/Users/elisaferreira/Desktop/GetDist−0.2.0/getdist/paramnames.py", line 119, in parsWithNames
else: res.append(self.parWithName(name, error, renames))
File "/Users/elisaferreira/Desktop/GetDist−0.2.0/getdist/paramnames.py", line 106, in parWithName
if error: raise Exception("parameter name not found: " + name)
Exception: parameter name not found: param1

I don't know what could be the problem. Any ideas?

Thank you very much,
Elisa
Back to top
View user's profile  
Cosmo Xu



Joined: 19 Mar 2013
Posts: 4
Affiliation: NJU/NAOC

PostPosted: November 18 2015  Reply with quote

see "Exception: parameter name not found: param1"

may be you need to check your parameter name file.
Back to top
View user's profile  
Elisa Ferreira



Joined: 21 Mar 2014
Posts: 12
Affiliation: McGill University

PostPosted: November 24 2015  Reply with quote

Thank you for your answer, Cosmo Xu.

I only have two parameters, so my paramnames file is basically like this:
param1 param_1
param2 param_2

Is this wrong? I thought this was enough.

Thanks,
Elisa
Back to top
View user's profile  
Antony Lewis



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

PostPosted: November 25 2015  Reply with quote

Try updating getdist to 0.2.5, and if it still doesn't work, attach a zip of your files.
Back to top
View user's profile [ Hidden ] Visit poster's website
Elisa Ferreira



Joined: 21 Mar 2014
Posts: 12
Affiliation: McGill University

PostPosted: November 26 2015  Reply with quote

Hello Antony,

Thank you very much for your help. I got the 0.2.5 version and still was not able to produce the plots. Maybe the problem is something different than that.

I am sending attached my files so you can take a look. I am able to plot the contour in python (as you can see in the folder "without_getdist/" in the files I sent. However, I want to plot this together with some Models that I ran with cosmomc. In the chains folder I have the model I ran with cosmomc "Model1_Planck" and also "auto_BOSS_SDSS". I can produce the plots from Model1 perfectly, but when I try to plot the contour in auto_BOSS_SDSS I get the error I showed before.

If you have some time to take a look or anyone else, I would appreciate immensely.

Thank you very much,
Elisa Ferreira

PS: If you are not being able to see the files I uploaded, please find them at https://drive.google.com/folderview?id=0B6kmRVU_enn3XzUycjdEZFV6Z2s&usp=sharing
Back to top
View user's profile  
Antony Lewis



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

PostPosted: November 26 2015  Reply with quote

auto_BOSS_SDSS.paramnames seems to use parameter names that are not param1 and param2.
Back to top
View user's profile [ Hidden ] Visit poster's website
Elisa Ferreira



Joined: 21 Mar 2014
Posts: 12
Affiliation: McGill University

PostPosted: November 27 2015  Reply with quote

Hi Antony,

I apologize for this mistake. I changed the names param 1 and param 2 to their proper names DHrd234 and DArd234. Everything should run ok if I try to plot those two parameters, right!? I cannot make the contour plot for them.

I only changed the name so I could show that I can plot the contour for them for my COSMOMC chains (the Model1 chains) but not for the single chain auto_BOSS_SDSS that was generated outside COSMOMC.

Thanks for the help again and I am sorry for the confusion.
Elisa Ferreira
Back to top
View user's profile  
Antony Lewis



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

PostPosted: November 27 2015  Reply with quote

When I try a 2D plot with GetDist Gui I get an exception in the 2d plotter. This is probably because they don't look like samples, the last column is only a few particular discrete values.

if you turn off adaptive smoothing scale (e.g. set smooth_scale_2D =0.3) you should get a plot.
Back to top
View user's profile [ Hidden ] Visit poster's website
Elisa Ferreira



Joined: 21 Mar 2014
Posts: 12
Affiliation: McGill University

PostPosted: November 28 2015  Reply with quote

It worked!!!
Thank you very very much, Antony!!!
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.