ERROR in GetDist py: Plotting non-cosmomc contours
-
- Posts: 13
- Joined: March 21 2014
- Affiliation: McGill University
ERROR in GetDist py: Plotting non-cosmomc contours
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
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
ERROR in GetDist py: Plotting non-cosmomc contours
see "Exception: parameter name not found: param1"
may be you need to check your parameter name file.
may be you need to check your parameter name file.
-
- Posts: 13
- Joined: March 21 2014
- Affiliation: McGill University
ERROR in GetDist py: Plotting non-cosmomc contours
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
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
-
- Posts: 1943
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: ERROR in GetDist py: Plotting non-cosmomc contours
Try updating getdist to 0.2.5, and if it still doesn't work, attach a zip of your files.
-
- Posts: 13
- Joined: March 21 2014
- Affiliation: McGill University
ERROR in GetDist py: Plotting non-cosmomc contours
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
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
-
- Posts: 1943
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: ERROR in GetDist py: Plotting non-cosmomc contours
auto_BOSS_SDSS.paramnames seems to use parameter names that are not param1 and param2.
-
- Posts: 13
- Joined: March 21 2014
- Affiliation: McGill University
ERROR in GetDist py: Plotting non-cosmomc contours
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
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
-
- Posts: 1943
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: ERROR in GetDist py: Plotting non-cosmomc contours
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.
if you turn off adaptive smoothing scale (e.g. set smooth_scale_2D =0.3) you should get a plot.
-
- Posts: 13
- Joined: March 21 2014
- Affiliation: McGill University
ERROR in GetDist py: Plotting non-cosmomc contours
It worked!!!
Thank you very very much, Antony!!!
Thank you very very much, Antony!!!