Convert basic chain files into getdist chain format for g.triangle_plot

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Dournac Fabien
Posts: 74
Joined: May 18 2019
Affiliation: IRAP
Contact:

Convert basic chain files into getdist chain format for g.triangle_plot

Post by Dournac Fabien » June 05 2022

Hello,

I need to convert a simple text file where each row corresponds to an accepted proposal of 9 parameters values.
I have 3703 rows of each one consisted of 9 values (I put this file in attachment) and I would like to convert it in order to
be able to plot with g.triangle_plot function.

I tried with a simple example where I have the chain file " final_array.txt ".

At the simple execution of this small script " plot_chains.py " :

Code: Select all

#!/opt/intel/oneapi/intelpython/latest/bin/python

import matplotlib as plt
from getdist import plots, loadMCSamples

BD_samples = loadMCSamples("/Users/fab/final_array.txt")
g = plots.get_subplot_plotter(width_inch=8)
g.triangle_plot(BD_samples)
g.export("./chains_final.pdf")
 


I get the following error :

Code: Select all

Traceback (most recent call last):
  File "/Users/fab/plot_chains.py", line 24, in <module>
    BD_samples = loadMCSamples("/Users/fab/final_array.txt")
  File "/opt/intel/oneapi/intelpython/latest/lib/python3.9/site-packages/getdist/mcsamples.py", line 100, in loadMCSamples
    raise IOError('No chains found: ' + file_root)
OSError: No chains found: /Users/fab/final_array.txt
What have I got to do to load my chains file and get a triangle plot ?

I think that must add more informations on this chains file but don't know for the moment.

Any help is welcome, I remind this chains file " final_array.txt " is attached (just under .gz format, so you can do a :

Code: Select all

$ gunzip final_array.txt.gz
Regards
Attachments
final_array.txt.gz
(349.55 KiB) Downloaded 71 times

Dournac Fabien
Posts: 74
Joined: May 18 2019
Affiliation: IRAP
Contact:

Re: Convert basic chain files into getdist chain format for g.triangle_plot

Post by Dournac Fabien » June 05 2022

If I modify in the plot script :

Code: Select all

BD_samples = loadMCSamples("/Users/fab/final_array")
I get the following errors :

Code: Select all

Removed no burn in
Traceback (most recent call last):
  File "/Users/fab/plot_chains.py", line 24, in <module>
    BD_samples = loadMCSamples("/Users/fab/final_array")
  File "/opt/intel/oneapi/intelpython/latest/lib/python3.9/site-packages/getdist/mcsamples.py", line 101, in loadMCSamples
    samples.readChains(files)
  File "/opt/intel/oneapi/intelpython/latest/lib/python3.9/site-packages/getdist/mcsamples.py", line 478, in readChains
    self.deleteFixedParams()
  File "/opt/intel/oneapi/intelpython/latest/lib/python3.9/site-packages/getdist/chains.py", line 1504, in deleteFixedParams
    self.paramNames.deleteIndices(fixed)
AttributeError: 'NoneType' object has no attribute 'deleteIndices'
It seems that some informations on this chains file are missing, doesn't it ?

Thanks in advance.

Post Reply