-
Notifications
You must be signed in to change notification settings - Fork 0
MontePython Contour Plotting
The home page for MontePython is (https://baudren.github.io/montepython.html). Guides for using MontePython are here and here and here.
Consider executing the steps below within a virtual environment. Montepython only works with python2. See the Virtual Environments page of this wiki.
Montepython requires numpy
, scipy
, and cython
to be installed in your environment:
$ pip install numpy
$ pip install scipy
$ pip install cython
$ pip install matplotlib
See the Installing Class page of this wiki.
Only version 3.0.0 of MontePython has worked reliably. Install that version (which is not the most recent) like so:
$ git clone --branch 3.0.0 git@github.com:brinckmann/montepython_public.git
$ cd montepython_public
$ python setup.py install
For whatever reason, you must uninstall pymultinest
for Montepython
to work correctly. Sure.
$ pip uninstall pymultinest
First, note that MontePython only seems to work properly using Python2. Put MCMC chains generated with MontePython in the folder /chains
. Then:
$ montepython_public-3.0/montepython/MontePython.py info chains/
Contours from a Fisher matrix can be plotted on top of chains. First, create a file with the name inv_fisher.mat
and place it in the same folder as your chains /chains
. inv_fisher.mat
should contain the inverse of the Fisher matrix you wish to plot contours for. The format of the file should be a single header line, beginning with #
and then a space,
, and then the name of each parameter as specified in the log.param
file separated by a tab. Below this line should be the inverse of the fisher matrix in a tab separated format. Then, to plot the contours:
$ montepython_public-3.0/montepython/MontePython.py info chains/ --plot-fisher --center-fisher
The --center-fisher
flag will center the ellipses on the maximum likelihood point of the underlying chains. Otherwise, MontePython will center the ellipses at the fiducial values specified in the log.param
file.
/n/dvorkin_lab/Light-Relics/Montepython_JBM/montepython_public-3.0/chains_no_relicfast/CMBS4_desi_DH_small_step/