def getSystematicAverageTableLines(jobItem1, jobItem2): # if you have two versions of the likelihood with the same data, and don't know which is right, # this just crudely adds the samples with equal weight per likelihood samps1 = loadMCSamples(jobItem1.chainRoot, jobItem=jobItem1, settings=batch.getdist_options) samps2 = loadMCSamples(jobItem2.chainRoot, jobItem=jobItem2, settings=batch.getdist_options) samps = samps1.getCombinedSamplesWithSamples(samps2) if False: import planckStyle as s g = s.getSubplotPlotter() g.plots_1d([samps, samps1, samps2], params=params.list(), legend_labels=['Combined', texEscapeText(jobItem1.name), texEscapeText(jobItem2.name)]) g.export('joint_' + jobItem1.name) return getTableLines(samps.getMargeStats())
def getSystematicAverageTableLines(jobItem1, jobItem2): # if you have two versions of the likelihood with the same data, and don't know which is right, # this just crudely adds the samples with equal weight per likelihood samps1 = loadMCSamples(jobItem1.chainRoot, jobItem=jobItem1, settings=batch.getdist_options) samps2 = loadMCSamples(jobItem2.chainRoot, jobItem=jobItem2, settings=batch.getdist_options) samps = samps1.getCombinedSamplesWithSamples(samps2) if False: import planckStyle as s g = s.getSubplotPlotter() g.plots_1d([samps, samps1, samps2], params=params.list(), legend_labels=[ 'Combined', texEscapeText(jobItem1.name), texEscapeText(jobItem2.name) ]) g.export('joint_' + jobItem1.name) return getTableLines(samps.getMargeStats())
import planckStyle as s g = s.getSubplotPlotter() roots = ['base_Alens_plikHM_TT_lowl_lowE', 'base_Alens_plikHM_TTTEEE_lowl_lowE', 'base_plikHM_TTTEEE_lowl_lowE', 'base_Alens_CamSpecHM_TTTEEE_lowl_lowE'] for i, root in enumerate(roots): samples = g.getSamples(root) p = samples.getParams() samples.addDerived(p.rmsdeflect ** 2, 'vardeflect', label=r'$\langle |\nabla\phi|^2\rangle\,[{\rm arcmin}^2]$') roots[i] = samples yparams = [u'Alens', u'vardeflect'] xparams = [u'omegabh2', u'omegach2', 'ns', u'H0', u'omegam', u'sigma8'] g.rectangle_plot(xparams, yparams, roots=roots, ymarkers=[1, None], filled=[True] * 3 + [False], colors=g.settings.solid_colors[:3] + ['k'], ls=['-'] * 3 + ['--'], legend_labels=[s.planckTT + r' ($\Lambda{\rm CDM}+A_L$)', s.planckall + r' ($\Lambda{\rm CDM}+A_L$)', s.planckall + r' ($\Lambda{\rm CDM}$)']) g.export()
import planckStyle as s g = s.getSubplotPlotter(subplot_size=2) g.settings.solid_colors = [('#8CD3F5', '#006FED'), ('#F7BAA6', '#E03424'), ('#B1B1B1', '#515151'), 'g'] roots = [] roots.append('base_DESlens_lenspriors_BAO') roots.append('base_lensing_lenspriors_BAO') roots.append('base_DESlens_lenspriors_lensing_BAO') roots.append('base_plikHM_TTTEEE_lowl_lowE') params = [u'H0', u'omegam', u'sigma8'] g.triangle_plot(roots, params, filled=True, legend_labels=[ 'DES lensing+BAO', r'$\textit{Planck}$ lensing+BAO', r'(DES+$\textit{Planck}$) lensing + BAO', s.planckall ]) g.export()
import planckStyle as s for dat in ['plikHM', 'CamSpecHM']: g = s.getSubplotPlotter(subplot_size=2) roots = [] roots.append('base_%s_EE_lowE_BAO' % dat) roots.append('base_%s_TE_lowE' % dat) roots.append('base_%s_TT_lowl_lowE' % dat) roots.append('base_%s_TTTEEE_lowl_lowE' % dat) xparams = [u'omegabh2', u'omegach2', u'theta', u'tau', u'ns', 'logA'] yparams = [u'H0', u'omegam', u'sigma8'] labels = [s.datalabel[s.defdata_EE] + '+BAO', s.datalabel[s.defdata_TE], s.datalabel[s.defdata_TT], s.planckall] filled = True # ranges = {'omegabh2':} g.rectangle_plot(xparams, yparams, roots=roots, filled=filled, legend_labels=labels) if dat == 'CamSpecHM': for int, ax1, ax in zip(ints, axs, g.subplots.reshape(-1)): ax.set_xlim(int[0]) ax.set_ylim(int[1]) ax.set_yticks(ax1.get_yticks()) ax.set_xticks(ax1.get_xticks()) axs = g.subplots.reshape(-1) ints = [[ax.xaxis.get_view_interval(), ax.yaxis.get_view_interval()] for ax in g.subplots.reshape(-1)] ax = g.get_axes_for_params('omegabh2', 'omegam') print ax,g.get_axes_for_params('omegam', 'omegab2') if ax: ax.set_yticks([0.28, 0.30, 0.32, 0.34, 0.36]) g.export(tag='' if dat == 'plikHM' else dat)
import os, sys here = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.normpath(os.path.join(here, './python'))) import planckStyle as s from pylab import * from getdist import plots, MCSamples import getdist print('Version: ', getdist.__version__) import GetDistPlots import planckStyle g = planckStyle.getSubplotPlotter(chain_dir='./chains') #g = planckStyle.getSinglePlotter(width_inch=5, chain_dir = './chains') roots = ['Horn_GP_prior+JLA+BAO'] params = [u'binw1', u'binw2', u'binw3', u'binw4', u'H0', u'omegam', u'omegal'] #params = [u'omegam', u'omegal'] #param_3d = 'H0' g.settings.solid_contour_palefactor = 0.8 g.triangle_plot(roots, params, filled=[True], legend_labels=['Horn\_prior+JLA+BAO\_9.83'], legend_loc='upper right') #g.triangle_plot(roots, params, plot_3d_with_param=param_3d ,filled=[False], legend_labels=['Horn\_prior+JLA+BAO\_13'], legend_loc='upper right')