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

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

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

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

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>
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

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

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

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>
AttributeError: 'NoneType' object has no attribute 'deleteIndices'