import planckStyle as s
import pylab as plt

g = s.getSinglePlotter()

g.plot_3d('base_omegak_plikHM_TTTEEE_lowl_lowE', ['omegak', 'omegam', 'H0'],
          alpha_samples=True)

plt.axvline(0, c='k', ls='--', color='gray', alpha=0.5, lw=0.7)

g.add_2d_contours('base_omegak_plikHM_TTTEEE_lowl_lowE',
                  'omegak',
                  'omegam',
                  filled=False,
                  ls='--',
                  color='k')

g.add_2d_contours('base_omegak_plikHM_TTTEEE_lowl_lowE_lensing',
                  'omegak',
                  'omegam',
                  filled=False,
                  ls='-',
                  color='g')

# g.add_2d_contours('base_omegak_plikHM_TTTEEE_lowl_lowE_BAO_post_lensing','omegak','omegam',filled=True, alpha=0.85)

g.add_2d_contours('base_omegak_plikHM_TTTEEE_lowl_lowE_BAO_post_lensing',
                  'omegak',
                  'omegam',
                  filled=True,
                  color='purple',
import planckStyle as s
from pylab import *

g = s.getSinglePlotter(plot_data='/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/ede/edepar1/plot_data/')

import GetDistPlots, os
#g=GetDistPlots.GetDistPlotter('/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik9/wwa/plot_data/')
g.settings.setWithSubplotSize(2.0000)
g.settings.param_names_for_labels = '/home/pettorin/codici/git/cosmomcplanck/chains/paper/ede/edepar1/edepar1_lowTEB_plikTT.paramnames'
g.settings.legend_frac_subplot_margin=0.1

#ranges = [-2.1, 1, 0., 1.]

outdir='/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/ede/edepar1/figures/'
#labels=[s.planckTT,'+lensing',s.planckall, '+lensing','+BAO+HST+JLA' ]

roots = ['','_BAO_JLA_HSTlow', '_WL', '_RSD','_RSD_WL']

roots = ['edepar1_lowTEB_plikTT'+root for root in roots]


labels=['Planck', 'Planck + BSH', 'Planck + WL',  'Planck + RSD', 'Planck + WL + RSD']

g.settings.solid_colors=[('#8CD3F5', '#006FED'), ('#F7BAA6', '#E03424'), ('#D1D1D1', '#A1A1A1'), 'g', 'c', 'm']


# Planck: #00007f, -
# Planck + priority1: #008AE6, .
# Planck + WL: g (green), :
# Planck + RSD: #808080, --
# Planck + WL + RSD: #E03424, : -.
Exemple #3
0
import planckStyle as s
from pylab import *
import numpy as np
import GetDistPlots, os
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib import rc, font_manager
from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
grid, savefig, show


outdir='/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/ede/edepar3/figures/'
g = s.getSinglePlotter(plot_data='/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/ede/edepar3/plot_data/')
g.settings.setWithSubplotSize(4.0000)
n_groups = 4

# Values for TT
redshift = (1./0.1, 1./0.02, 1./0.005, 1./0.001 )
width = (1,1,1,1)
limit2 = (0.0360, 0.0198, 0.0150, 0.0118) #prior on a1dn1

bar_width = (0.6,3.1,11,52)

# Values for WL + RSD
redshift_RSD_WL = (1./0.1, 1./0.02, 1./0.005, 1./0.001 )
redshift_RSD_WL = map(sum,zip(redshift_RSD_WL,bar_width))   #shift just for plotting
limit2_RSD_WL = (0.0381, 0.0208, 0.0158, 0.0131)


# Values for TTTEEE + BSH
redshift_TTTEEE = (1./0.1, 1./0.02, 1./0.005, 1./0.001 )
Exemple #4
0
import planckStyle as s
from pylab import *

g=s.getSinglePlotter(ratio=1)

roots = ['base_nnu_yhe_planck_lowl_lowLike_highL', 'base_nnu_planck_lowl_lowLike_highL']


g.plot_2d(roots, param_pair=['nnu','thetastar'], filled=True,lims=[1.0, 6.0, 1.036, 1.047])

nnu = g.param_latex_label(roots[0], 'nnu')
yhe = g.param_latex_label(roots[0], 'yheused')

g.add_legend([ s.LCDM + '+'+nnu+'+'+ yhe,s.LCDM+ '+'+nnu],legend_loc='upper right',colored_text=True);

text(1.2, 1.0365, s.WPhighL, color='#000000', fontsize=g.settings.legend_fontsize)

g.export('neff_thetas')
Exemple #5
0
import planckStyle as s
from pylab import *

g = s.getSinglePlotter()


ranges = [0, 22, 0.76, 0.93]
pair = ['zrei', 'sigma8']

g.newPlot()
g.make_figure(1, xstretch=1.3)


dataroots = [s.defdata_TTonly, s.defdata_allNoLowE, s.defdata_allNoLowE + '_lensing', s.defdata_allNoLowE + '_lensing_BAO']
roots = [g.getRoot('', x) for x in dataroots]

g.plot_2d(roots, param_pair=pair, filled=True, lims=ranges)


legends = [s.planckTT, s.NoLowLE, r'+lensing', r'+BAO']
g.add_x_marker(6.5, ls='-')

c = 'gray'
one = array([1, 1])
fill_between([0, 6.5], one * 0.7, one * 1, facecolor=c, alpha=0.1, edgecolor=c, lw=0)

# g.add_2d_contours(g.getRoot('', s.defdata_TTonly + '_reion_BAO'), param_pair=pair, ls='-', color='red')

# g.add_text(s.planckall, 0.96, 0.18, color='olive')
# g.add_text(s.planckall + '+lensing', 0.96, 0.12, color='midnightblue')
Exemple #6
0
import os, sys
here = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.normpath(os.path.join(here, '../python/')))
from matplotlib.backends.backend_pgf import FigureCanvasPgf
from matplotlib.backend_bases import register_backend
register_backend('pdf', FigureCanvasPgf)
import planckStyle as s
from pylab import *

#g = s.getSinglePlotter(plot_data='plot_data/')

import GetDistPlots

import planckStyle

g = planckStyle.getSinglePlotter(chain_dir='./chains', ratio=.7)

roots = ['BAO_ddt', 'union_ddt', 'BAO+union_ddt']
g.settings.solid_contour_palefactor = 0.8
g.plot_2d(roots,
          'omegam',
          'sigma8',
          filled=[True, True, False],
          colors=['#FFB300', '#8E001C',
                  'black'])  #, lims=[0.25, 0.45, 0.6, 1.1])#0.6, 0.9])
labels = [r'BAO', 'SN', 'BAO+SN']

g.add_legend(labels, legend_loc='upper left', fontsize='small')
#, colored_text=True);

#plt.show()
Exemple #7
0
import planckStyle as s
from matplotlib.pyplot import *

g = s.getSinglePlotter()

ranges = [0.246, 0.37, 0.73, 0.965]
pair = ['omegam', 'sigma8']

if False:
    for TT in [False, True]:
        g.newPlot()
        if not TT:
            basedat = s.defdata_allNoLowE
            basedatname = s.NoLowLE
            allname = s.planckall
            fname = 'Planckall'
        else:
            basedat = s.defdata_TTonly
            basedatname = s.planckTT
            fname = 'PlanckTT'
            allname = s.planckTTlowTEB

        roots = [
            g.getRoot('', basedat),
            g.getRoot('', basedat + '_lensing'),
            g.getRoot('', basedat + '_lensing_BAO')
        ]

        legends = [basedatname, '+lensing', '+BAO']
        g.plot_2d(roots, param_pair=pair, filled=True, lims=ranges)
Exemple #8
0
import planckStyle as s
from matplotlib.pyplot import *
import getdist

g = s.getSinglePlotter(chain_dir=[getdist.default_grid_root, r'C:\Tmp\Planck\KiDs', r'C:\Tmp\Planck\2017\fsig8'])

ranges = [0.2, 0.35, 0.6, 1.05]
#ranges = [0.2, 0.55, 0.4, 1.05]

pair = ['omegam', 'sigma8']

omm = np.arange(0.05, 0.7, 0.01)
s.plotBounds(omm, s.planck_lensing)

#g.plot_2d('kids450fiducial', param_pair=pair, filled=True, lims=ranges)

samples = g.sampleAnalyser.samplesForRoot('kids450fiducial', settings={'ignore_rows':0.3, 'max_scatter_points':4000})
p=samples.getParams()
samples.filter((p.A < 2.5)*(p.A > 1.7) )

s8samples = g.sampleAnalyser.samplesForRoot('fsigma-vel-theta', settings={'ignore_rows':0.3})


if False: #testing putting in Jacobian
    # print s8samples.PCA(['omegam', 'H0', 'theta'], 'LLL', 'theta')
    def jacobian(H0, omegam, sigma8):
        #assume theta \propto omm^a*H0^b
        # sigma8^2 \propto As Omegam^(1.5) H0^(3.5)
        a = 0.15
        b = 0.4
        map =np.zeros((3,3))
Exemple #9
0
import planckStyle as s
import pylab as plt

for with_KIDS in [True, False]:

    g = s.getSinglePlotter(
        chain_dir=[r'C:\Tmp\Planck\KiDs', r'C:\Tmp\Planck\2017\Dec17'])
    roots = []
    roots.append('base_DESlens_DESpriors')
    roots.append('base_lensing_DESpriors')
    roots.append('base_DESlens_DESpriors_lensing')
    # roots.append('base_DES')
    roots.append('base_' + s.defdata_all)
    g.plot_2d(roots, [u'omegam', u'sigma8'], filled=True, shaded=False)
    g.add_2d_contours('base_DES_DESpriors', u'omegam', u'sigma8', ls='--')

    if with_KIDS:
        g.add_2d_contours('KiDS_lcdm_DESpriors',
                          u'omegam',
                          u'sigma8',
                          ls=':',
                          color='black',
                          alpha=0.5)
        g.add_legend([
            'DES lensing', r'$\textit{Planck}$ lensing',
            r'DES lensing+$\textit{Planck}$ lensing', s.planckall,
            r'DES joint', 'KiDS-450'
        ],
                     align_right=True)
        plt.ylim(None, 1.29)
        g.export(tag='with_KIDS')
Exemple #10
0
from setup_matplotlib import *
from matplotlib.ticker import MaxNLocator
from matplotlib.patches import Rectangle, FancyBboxPatch

import planckStyle as s
from pylab import *
import numpy as np
import GetDistPlots, os
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib import rc, font_manager
from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
     grid, savefig, show

outdir='/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/pca/plots/'
g = s.getSinglePlotter(plot_data='/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/pca/4bins/')
g.settings.setWithSubplotSize(4.0000)

# Load data
wt  = np.loadtxt('/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/pca/pythoncode/4bins/output/weights.txt')
pca = np.loadtxt('/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/pca/pythoncode/4bins/output/w_reconstructed.txt')

#f = plt.figure()
#ax = f.add_subplot(1,1,1)
#col = 'blue'
#z0 = pca[:,0] # lower limit
#z1 = pca[:,2] # upper limit
#w0 = pca[:,3] # mean w
#dw = pca[:,4]
#for j in range(len(z0)-1):
#    llc = (z0[j],w0[j]-2.*dw[j]) # lower left corner
Exemple #11
0
from matplotlib.ticker import MaxNLocator
from matplotlib.patches import Rectangle, FancyBboxPatch

import planckStyle as s
from pylab import *
import numpy as np
import GetDistPlots, os
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib import rc, font_manager
from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
     grid, savefig, show

outdir = '/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/pca/plots/'
g = s.getSinglePlotter(
    plot_data=
    '/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/pca/4bins/'
)
g.settings.setWithSubplotSize(4.0000)

# Load data
wt = np.loadtxt(
    '/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/pca/pythoncode/4bins/output/weights.txt'
)
pca = np.loadtxt(
    '/home/pettorin/codici/cosmomc_plots/output_getdist/clik/clik10/pca/pythoncode/4bins/output/w_reconstructed.txt'
)

#f = plt.figure()
#ax = f.add_subplot(1,1,1)
#col = 'blue'
#z0 = pca[:,0] # lower limit
Exemple #12
0
import planckStyle as s
from matplotlib.pyplot import *
import getdist

g = s.getSinglePlotter(chain_dir=[
    getdist.default_grid_root, r'C:\Tmp\Planck\KiDs',
    r'C:\Tmp\Planck\2017\fsig8'
])

ranges = [0.2, 0.35, 0.6, 1.05]
#ranges = [0.2, 0.55, 0.4, 1.05]

pair = ['omegam', 'sigma8']

omm = np.arange(0.05, 0.7, 0.01)
s.plotBounds(omm, s.planck_lensing)

#g.plot_2d('kids450fiducial', param_pair=pair, filled=True, lims=ranges)

samples = g.sampleAnalyser.samplesForRoot('kids450fiducial',
                                          settings={
                                              'ignore_rows': 0.3,
                                              'max_scatter_points': 4000
                                          })
p = samples.getParams()
samples.filter((p.A < 2.5) * (p.A > 1.7))

s8samples = g.sampleAnalyser.samplesForRoot('fsigma-vel-theta',
                                            settings={'ignore_rows': 0.3})

if False:  #testing putting in Jacobian