MCres package

Submodules

MCres.FakeSampler module

class MCres.FakeSampler.FakeSampler(flatchain, flatlnprobability)

Bases: object

MCres.MCres module

class MCres.MCres.MCres(sampler, paramstr=None, nwalker=None, niters=None, burnInIts=None, **kwargs)

Bases: object

Sampler can be the emcee sampler or a path to a ‘*.res.fits’ file paramstr is a list of (unique) string keywords that relate to each free parameter fitted in the emcee simulation. If left None, it will be set automatically to p1, p2, etc. nwalker, nwalker, burnInIts are the emcee MCMC simulation parameters

MCmap(param_x, param_y, bin_x=50, bin_y=50, cmap='jet', cm_min=None, cm_max=None, axescolor='w', polar=False, showmax=True, **kwargs)

Return a 2D histogram of the MC chain, showing the walker density per bin

Pbmap(param_x, param_y, bin_x=50, bin_y=50, cmap='jet', cm_min=None, cm_max=None, axescolor='w', polar=False, showmax=True, **kwargs)

Return a 2D histogram of the MC chain, showing the best loglikelihood per bin

addfilter(param, v_min=None, v_max=None)

Apply a filter on a parameter

best
bounds
chain2D
chainraw2D
corner(raw=False, bins=50, quantiles=[0.16, 0.5, 0.84], **kwargs)

Plot pretty corners for the whole simulation

delfilters()

Remove all visualization filters applied to the data

filters
fitparam(plot=False, params=[], perbin=131, q=[0.16, 0.84], best=0.5)

Fit all or specific parameter with a gaussian, because everything is gaussian

remfilter(ind)

Remove one visualization filter, of index ind in the filters list

save(name, clobber=False, append=False)
wrap(param, center=3.141592653589793, cycle=6.283185307179586)

MCres.load module

MCres.load.load(filename)

MCres.version module

Module contents

Easy stuff to process MCMC emcee results

class MCres.MCres(sampler, paramstr=None, nwalker=None, niters=None, burnInIts=None, **kwargs)

Bases: object

Sampler can be the emcee sampler or a path to a ‘*.res.fits’ file paramstr is a list of (unique) string keywords that relate to each free parameter fitted in the emcee simulation. If left None, it will be set automatically to p1, p2, etc. nwalker, nwalker, burnInIts are the emcee MCMC simulation parameters

MCmap(param_x, param_y, bin_x=50, bin_y=50, cmap='jet', cm_min=None, cm_max=None, axescolor='w', polar=False, showmax=True, **kwargs)

Return a 2D histogram of the MC chain, showing the walker density per bin

Pbmap(param_x, param_y, bin_x=50, bin_y=50, cmap='jet', cm_min=None, cm_max=None, axescolor='w', polar=False, showmax=True, **kwargs)

Return a 2D histogram of the MC chain, showing the best loglikelihood per bin

addfilter(param, v_min=None, v_max=None)

Apply a filter on a parameter

best
bounds
chain2D
chainraw2D
corner(raw=False, bins=50, quantiles=[0.16, 0.5, 0.84], **kwargs)

Plot pretty corners for the whole simulation

delfilters()

Remove all visualization filters applied to the data

filters
fitparam(plot=False, params=[], perbin=131, q=[0.16, 0.84], best=0.5)

Fit all or specific parameter with a gaussian, because everything is gaussian

remfilter(ind)

Remove one visualization filter, of index ind in the filters list

save(name, clobber=False, append=False)
wrap(param, center=3.141592653589793, cycle=6.283185307179586)
class MCres.FakeSampler(flatchain, flatlnprobability)

Bases: object

MCres.load(filename)