ERROR in GetDist py: Plotting non-cosmomc contours

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Elisa Ferreira
Posts: 12
Joined: March 21 2014
Affiliation: McGill University

ERROR in GetDist py: Plotting non-cosmomc contours

Post by Elisa Ferreira » November 17 2015

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

Cosmo Xu
Posts: 4
Joined: March 19 2013
Affiliation: NJU/NAOC

ERROR in GetDist py: Plotting non-cosmomc contours

Post by Cosmo Xu » November 18 2015

see "Exception: parameter name not found: param1"

may be you need to check your parameter name file.

Elisa Ferreira
Posts: 12
Joined: March 21 2014
Affiliation: McGill University

ERROR in GetDist py: Plotting non-cosmomc contours

Post by Elisa Ferreira » November 24 2015

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

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

Re: ERROR in GetDist py: Plotting non-cosmomc contours

Post by Antony Lewis » November 25 2015

Try updating getdist to 0.2.5, and if it still doesn't work, attach a zip of your files.

Elisa Ferreira
Posts: 12
Joined: March 21 2014
Affiliation: McGill University

ERROR in GetDist py: Plotting non-cosmomc contours

Post by Elisa Ferreira » November 26 2015

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= ... sp=sharing

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

Re: ERROR in GetDist py: Plotting non-cosmomc contours

Post by Antony Lewis » November 26 2015

auto_BOSS_SDSS.paramnames seems to use parameter names that are not param1 and param2.

Elisa Ferreira
Posts: 12
Joined: March 21 2014
Affiliation: McGill University

ERROR in GetDist py: Plotting non-cosmomc contours

Post by Elisa Ferreira » November 27 2015

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

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

Re: ERROR in GetDist py: Plotting non-cosmomc contours

Post by Antony Lewis » November 27 2015

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.

Elisa Ferreira
Posts: 12
Joined: March 21 2014
Affiliation: McGill University

ERROR in GetDist py: Plotting non-cosmomc contours

Post by Elisa Ferreira » November 28 2015

It worked!!!
Thank you very very much, Antony!!!

Post Reply