How to use get_summary method in prospector

Best Python code snippet using prospector_python

COBAYA_CONTOURS_DES3YR_UNBIN.py

Source:COBAYA_CONTOURS_DES3YR_UNBIN.py Github

copy

Full Screen

...35label_Chap, begin_Chap, legend_Chap = get_info(Chap.__name__)36#### PLOTS FOR DIFFERENT MODELS - NOTE PARAMS ARE SAVED AS: MODEL_PARAM - BESIDES FLCDM/LCDM37### FLCDM - Used as a Scatter point on some plots38c.add_chain(FLCDM_COBAYA_CHAIN, parameters=label_FLCDM, linewidth=2.0, name="FLCDM", kde=1.5, color="blue").configure(summary=True, shade_alpha=0.2,statistics="max")39fom = c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][1]40fomp = c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][2]-c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][1]41fomm = c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][1]-c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][0]42c.remove_chain('FLCDM')43### LCDM PLOT & points which is sometimes used as a scatter point on some plots44fig, ax = plt.subplots(1, 1)45c.add_chain(LCDM_COBAYA_CHAIN, parameters=label_LCDM, linewidth=2.0, name="LCDM", kde=1.5, color="red",num_free_params=2).configure(summary=True, shade_alpha=0.2,statistics="max")46om = c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][1]47omp = c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][2]-c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][1]48omm = c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][1]-c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][0]49ol = c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][1]50olp =c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][2]-c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][1]51olm =c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][1]-c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][0]52c.plotter.plot_contour(ax,r'$\Omega_m$', r'$\Omega_{\Lambda}$')53ax.scatter(fom, 1-fom, marker = 'D', s = 50, c='black', label = r'Flat $\Lambda$')54ax.text(1.15,0.55,'$\Omega_m = %10.5s\pm{%10.5s}$' %(om,omp), family='serif',color='black',rotation=0,fontsize=12,ha='right') 55ax.text(1.15,0.4,'$\Omega_{\Lambda} = %10.5s\pm{%10.5s}$' %(ol,olp), family='serif',color='black',rotation=0,fontsize=12,ha='right')56ax.set_xlabel(r'$\Omega_m$', fontsize = 18)57ax.set_ylabel(r'$\Omega_{\Lambda}$', fontsize = 18) 58#ax.set_xlim(0,1.2)59#ax.set_ylim(0.48,1.06)60plt.minorticks_on()61ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")62ax.legend(loc='upper right',frameon=False,fontsize=12)63plt.close()64#plt.show()65c.remove_chain('LCDM')66### FwCDM PLOT67name = FwCDM.__name__68c.add_chain(FwCDM_COBAYA_CHAIN[200:], parameters=label_FwCDM, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_FwCDM)).configure(summary=True, shade_alpha=0.2,statistics="max")69# Gets best fit and plus/minus error70FwCDM_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]71FwCDM_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]72FwCDM_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]73FwCDM_w = c.analysis.get_summary(chains=name)[r'$\omega$'][1]74FwCDM_wp =c.analysis.get_summary(chains=name)[r'$\omega$'][2]-c.analysis.get_summary(chains=name)[r'$\omega$'][1]75FwCDM_wm =c.analysis.get_summary(chains=name)[r'$\omega$'][1]-c.analysis.get_summary(chains=name)[r'$\omega$'][0]76fig, ax = plt.subplots(1, 1)77# Unique to this plot - plotting FLCDM best fit param78ax.scatter(fom, -1, marker = 'D', s = 50, c='black', label = r'Flat $\Lambda$')79# Selectings which params to plot and on what axis80c.plotter.plot_contour(ax, *label_FwCDM) 81# Unique to FwCDM model82ax.text(0.12,-1.75,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(FwCDM_om,FwCDM_omp,FwCDM_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 83ax.text(0.12,-1.75-0.15,'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(FwCDM_w,FwCDM_wp,FwCDM_wm), family='serif',color='black',rotation=0,fontsize=12,ha='left')84ax.set_xlabel(r'$\Omega_m$', fontsize = 18)85ax.set_ylabel(r'$\omega$', fontsize = 18)86# Plot limits87#ax.set_xlim(0.20,0.5)88#ax.set_ylim(0.48,1.06)89plt.minorticks_on()90ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")91ax.legend(loc='upper right',frameon=False,fontsize=12)92plt.close()93#plt.show()94c.remove_chain('FwCDM')95### wCDM PLOT96name = wCDM.__name__97c.add_chain(wCDM_COBAYA_CHAIN[1000:], parameters=label_wCDM, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_wCDM)).configure(summary=True, shade_alpha=0.2,statistics="max")98# Gets best fit and plus/minus error 99wCDM_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]100wCDM_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]101wCDM_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]102wCDM_ol = c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][1]103wCDM_olp = c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][1]104wCDM_olm = c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][0]105wCDM_o = c.analysis.get_summary(chains=name)[r'$\omega$'][1]106wCDM_op =c.analysis.get_summary(chains=name)[r'$\omega$'][2]-c.analysis.get_summary(chains=name)[r'$\omega$'][1]107wCDM_omi =c.analysis.get_summary(chains=name)[r'$\omega$'][1]-c.analysis.get_summary(chains=name)[r'$\omega$'][0]108fig, ax = plt.subplots(1, 1)109# Selectings which params to plot and on what axis110c.plotter.plot_contour(ax, r'$\Omega_m$', r"$\omega$")111# Unique to this plot - plotting LCDM best fit param112ax.scatter(om, -1, marker = 'X', s = 60, c='red', label = r'$\Lambda$')113# Unique to model114ax.text(1.1,-1.65,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(wCDM_om,wCDM_omp,wCDM_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 115ax.text(1.1,-1.65-0.13,'$\Omega_{\Lambda} = %10.5s^{%10.5s}_{%10.5s}$' %(wCDM_ol,wCDM_olp,wCDM_olm), family='serif',color='black',rotation=0,fontsize=12,ha='right')116ax.text(1.1,-1.65-0.26,'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(wCDM_o,wCDM_op,wCDM_omi), family='serif',color='black',rotation=0,fontsize=12,ha='right')117ax.set_xlabel(r'$\Omega_m$', fontsize = 18)118ax.set_ylabel(r'$\omega$', fontsize = 18)119# Plot limits120#ax.set_xlim(0.20,0.6)121#ax.set_ylim(-2,-0.5)122#ax.set_xticklabels(['0.2','','0.3','','0.4','','0.5','','0.6'])123#ax.set_yticklabels(['','-1.8','','-1.4','','-1.0','','-0.6'])124plt.minorticks_on()125ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")126ax.legend(loc='upper right',frameon=False,fontsize=12)127plt.close()128c.remove_chain('wCDM')129### Fwa PLOT130name = Fwa.__name__131# The actualchain this code is about132c.add_chain(Fwa_COBAYA_CHAIN[1000:], parameters=label_Fwa, linewidth=2.0, name=name, kde=1.5, color="blue",num_free_params=len(begin_Fwa)).configure(summary=True, shade_alpha=0.2,statistics="max")133# Gets best fit and plus/minus error 134Fwa_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]135Fwa_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]136Fwa_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]137Fwa_o0 = c.analysis.get_summary(chains=name)['$w_0$'][1]138Fwa_o0p = c.analysis.get_summary(chains=name)['$w_0$'][2]-c.analysis.get_summary(chains=name)['$w_0$'][1]139Fwa_o0m = c.analysis.get_summary(chains=name)['$w_0$'][1]-c.analysis.get_summary(chains=name)['$w_0$'][0]140Fwa_oa = c.analysis.get_summary(chains=name)['$w_a$'][1]141Fwa_oap =c.analysis.get_summary(chains=name)['$w_a$'][2]-c.analysis.get_summary(chains=name)['$w_a$'][1]142Fwa_oam =c.analysis.get_summary(chains=name)['$w_a$'][1]-c.analysis.get_summary(chains=name)['$w_a$'][0]143fig, ax = plt.subplots(1, 1)144# Selectings which params to plot and on what axis145c.plotter.plot_contour(ax, '$w_0$', '$w_a$') 146# Unique to model147ax.text(-1.85,-7,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_om,Fwa_omp,Fwa_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 148ax.text(-1.85,-7-1,'$\omega_0 = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_o0,Fwa_o0p,Fwa_o0m), family='serif',color='black',rotation=0,fontsize=12,ha='left')149ax.text(-1.85,-7-2,'$\omega_{a} = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_oa,Fwa_oap,Fwa_oam), family='serif',color='black',rotation=0,fontsize=12,ha='left')150ax.set_xlabel(r'$\omega_0$', fontsize = 18)151ax.set_ylabel(r'$\omega_a$', fontsize = 18)152# Plot limits153#ax.set_xlim(-2,0)154#ax.set_ylim(-3,2)155#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])156plt.minorticks_on()157ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")158ax.legend(loc='upper right',frameon=False,fontsize=12)159#plt.show()160plt.close()161c.remove_chain('Fwa')162### Fwz PLOT163name = Fwz.__name__164# The actual chain this code is about165c.add_chain(Fwz_COBAYA_CHAIN[500:], parameters=label_Fwz, linewidth=2.0, name=name, kde=1.5, color="blue",num_free_params=len(begin_Fwz)).configure(summary=True, shade_alpha=0.2,statistics="max")166# Gets best fit and plus/minus error 167Fwz_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]168Fwz_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]169Fwz_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]170Fwz_o0 = c.analysis.get_summary(chains=name)['$w_0$'][1]171Fwz_o0p = c.analysis.get_summary(chains=name)['$w_0$'][2]-c.analysis.get_summary(chains=name)['$w_0$'][1]172Fwz_o0m = c.analysis.get_summary(chains=name)['$w_0$'][1]-c.analysis.get_summary(chains=name)['$w_0$'][0]173Fwz_oz = c.analysis.get_summary(chains=name)['$w_z$'][1]174Fwz_ozp =c.analysis.get_summary(chains=name)['$w_z$'][2]-c.analysis.get_summary(chains=name)['$w_z$'][1]175Fwz_ozm =c.analysis.get_summary(chains=name)['$w_z$'][1]-c.analysis.get_summary(chains=name)['$w_z$'][0]176fig, ax = plt.subplots(1, 1)177# Selectings which params to plot and on what axis178c.plotter.plot_contour(ax,'$w_0$', '$w_z$') 179# Unique to model180ax.text(-1.85,-7,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_om,Fwz_omp,Fwz_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 181ax.text(-1.85,-7-1,'$\omega_0 = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_o0,Fwz_o0p,Fwz_o0m), family='serif',color='black',rotation=0,fontsize=12,ha='left')182ax.text(-1.85,-7-2,'$\omega_{z} = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_oz,Fwz_ozp,Fwz_ozm), family='serif',color='black',rotation=0,fontsize=12,ha='left')183ax.set_xlabel(r'$\omega_0$', fontsize = 18)184ax.set_ylabel(r'$\omega_z$', fontsize = 18)185# Plot limits186#ax.set_xlim(-2,0)187#ax.set_ylim(-3,2)188#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])189plt.minorticks_on()190ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")191ax.legend(loc='upper right',frameon=False,fontsize=12)192#plt.show()193plt.close()194c.remove_chain('Fwz')195### IDE1 PLOT196### FGCHAP PLOT 197c.add_chain(FGChap_COBAYA_CHAIN[200:], parameters=[r'$A$', r'$\alpha$'], linewidth=2.0, name="FGChap", kde=1.5, color="red",num_free_params=2, num_eff_data_points=20).configure(summary=True, shade_alpha=0.2,statistics="max")198FGChap_A = c.analysis.get_summary(chains="FGChap")[r'$A$'][1]199FGChap_Ap = c.analysis.get_summary(chains="FGChap")[r'$A$'][2]-c.analysis.get_summary(chains="FGChap")[r'$A$'][1]200FGChap_Am = c.analysis.get_summary(chains="FGChap")[r'$A$'][1]-c.analysis.get_summary(chains="FGChap")[r'$A$'][0]201FGChap_a = c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][1]202FGChap_ap =c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][2]-c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][1]203FGChap_am =c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][1]-c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][0]204fig, ax = plt.subplots(1, 1)205ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)206ok = 1- (om+ol)207ax.scatter(1-fom, 0, marker = 'D', s = 50, c='black', label = r'Flat $\Lambda$', zorder = 2)208c.plotter.plot_contour(ax,r'$A$', r'$\alpha$')209ax.text(0.91,-0.59,r'$A = %10.5s^{%10.5s}_{%10.5s}$' %(FGChap_A,FGChap_Ap,FGChap_Am), family='serif',color='black',rotation=0,fontsize=16,ha='right') 210ax.text(0.91,-0.59-0.3,r'$\alpha = %10.5s^{%10.5s}_{%10.5s}$' %(FGChap_a,FGChap_ap,FGChap_am), family='serif',color='black',rotation=0,fontsize=16,ha='right')211#ax.text(0.86,-0.5-0.4,r'$X=\Lambda CDM$ Best Fit', family='serif',color='black',rotation=0,fontsize=12,ha='right')212ax.set_xlabel(r'$A$', fontsize = 18)213ax.set_ylabel(r'$\alpha$', fontsize = 18) 214ax.tick_params(axis='x', labelsize=12)215ax.tick_params(axis='y', labelsize=12)216ax.set_xlim(0.5,0.92)217ax.set_ylim(-1,2)218ax.set_xticklabels(['','0.55','','0.65','','0.75','','0.85',''])219plt.minorticks_on()220ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")221ax.legend(loc='upper left',frameon=False,fontsize=16)222#plt.show()223plt.close()224c.remove_chain('FGChap')225#c.plotter.plot(figsize="COLUMN", chains=['FGChap'],filename='FGChap_TEST' ) 226#c.plotter.plot(figsize="COLUMN", chains=['LCDM'],filename='LCDM_TEST' ) 227#print(c.comparison.comparison_table(caption="Model comparisons!"))228### CHAP PLOT 229c.add_chain(Chap_COBAYA_CHAIN[500:], parameters=[r'$A$', r'$\Omega_{K}$'], linewidth=2.0, name="Chap", kde=1.5, color="red",num_free_params=2, num_eff_data_points=20).configure(summary=True, shade_alpha=0.2,statistics="max")230Chap_A = c.analysis.get_summary(chains="Chap")[r'$A$'][1]231Chap_Ap = c.analysis.get_summary(chains="Chap")[r'$A$'][2]-c.analysis.get_summary(chains="Chap")[r'$A$'][1]232Chap_Am = c.analysis.get_summary(chains="Chap")[r'$A$'][1]-c.analysis.get_summary(chains="Chap")[r'$A$'][0]233Chap_ok = c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][1]234Chap_okp =c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][2]-c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][1]235Chap_okm =c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][1]-c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][0]236fig, ax = plt.subplots(1, 1)237#ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)238c.plotter.plot_contour(ax, r'$\Omega_{K}$',r'$A$')239ax.text(0.78,0.3,r'$A = %10.5s^{%10.5s}_{%10.5s}$' %(Chap_A,Chap_Ap,Chap_Am), family='serif',color='black',rotation=0,fontsize=12,ha='right') 240ax.text(0.78,0.3-0.08,r'$\Omega_{K} = %10.5s^{%10.5s}_{%10.5s}$' %(Chap_ok,Chap_okp,Chap_okm), family='serif',color='black',rotation=0,fontsize=12,ha='right')241ax.set_ylabel(r'$A$', fontsize = 18)242ax.set_xlabel(r'$\Omega_{K}$', fontsize = 18) 243ax.set_ylim(0.15,1.025)244ax.set_xlim(-0.85,0.85)245plt.minorticks_on()246ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")247ax.legend(loc='upper left',frameon=False,fontsize=12)248#plt.show()249plt.close()250c.remove_chain('Chap')251### GCHAP PLOT 252c.add_chain(GChap_COBAYA_CHAIN[2000:], parameters=[r"$A$",r"$\alpha$",r"$\Omega_{K}$"], linewidth=2.0, name="GChap", kde=1.5, color="red",num_free_params=2).configure(summary=True, shade_alpha=0.2,statistics="max")253GChap_A = c.analysis.get_summary(chains="GChap")[r'$A$'][1]254GChap_Ap = c.analysis.get_summary(chains="GChap")[r'$A$'][2]-c.analysis.get_summary(chains="GChap")[r'$A$'][1]255GChap_Am = c.analysis.get_summary(chains="GChap")[r'$A$'][1]-c.analysis.get_summary(chains="GChap")[r'$A$'][0]256GChap_ok = c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][1]257GChap_okp =c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][2]-c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][1]258GChap_okm =c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][1]-c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][0]259GChap_a = c.analysis.get_summary(chains="GChap")[r"$\alpha$"][1]260GChap_ap =c.analysis.get_summary(chains="GChap")[r"$\alpha$"][2]-c.analysis.get_summary(chains="GChap")[r"$\alpha$"][1]261GChap_am =c.analysis.get_summary(chains="GChap")[r"$\alpha$"][1]-c.analysis.get_summary(chains="GChap")[r"$\alpha$"][0]262fig, ax = plt.subplots(1, 1)263ax.scatter(1-(om/(1-ok)), 0, marker = 'X', s = 60, c='red', label = r'$\Lambda$', zorder = 3)264ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)265c.plotter.plot_contour(ax, r'$A$',r"$\alpha$")266ax.text(0.51,1.5 ,r'$A = %10.5s^{%10.5s}_{%10.5s}$' %(GChap_A,GChap_Ap,GChap_Am), family='serif',color='black',rotation=0,fontsize=12,ha='left') 267ax.text(0.51,1.5-0.25,r'$\alpha = %10.5s^{%10.5s}_{%10.5s}$' %(GChap_a,GChap_ap,GChap_am), family='serif',color='black',rotation=0,fontsize=12,ha='left')268ax.text(0.51,1.5-0.5,r'$\Omega_{K} = %10.5s^{%10.5s}_{%10.5s}$' %(GChap_ok,GChap_okp,GChap_okm), family='serif',color='black',rotation=0,fontsize=12,ha='left')269ax.set_xlabel(r'$A$', fontsize = 18)270ax.set_ylabel(r"$\alpha$", fontsize = 18) 271ax.set_ylim(-1,2.0)272ax.set_xlim(0.5,1)273plt.minorticks_on()274ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")275ax.legend(loc='upper left',frameon=False,fontsize=12)276plt.show()277#plt.close()278c.remove_chain('GChap')279exit()280### FCa PLOT 281c.add_chain(FCa_COBAYA_CHAIN[500:], parameters=[r"$\Omega_m$",r"$q$",r"$n$"], linewidth=2.0, name="FCa", kde=1.5, color="red",num_free_params=3).configure(summary=True, shade_alpha=0.2,statistics="max")282FCa_om = c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][1]283FCa_omp = c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][2]-c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][1]284FCa_omm = c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][1]-c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][0]285FCa_q = c.analysis.get_summary(chains="FCa")[r"$q$"][1]286FCa_qp =c.analysis.get_summary(chains="FCa")[r"$q$"][2]-c.analysis.get_summary(chains="FCa")[r"$q$"][1]287FCa_qm =c.analysis.get_summary(chains="FCa")[r"$q$"][1]-c.analysis.get_summary(chains="FCa")[r"$q$"][0]288FCa_n = c.analysis.get_summary(chains="FCa")[r"$n$"][1]289FCa_np =c.analysis.get_summary(chains="FCa")[r"$n$"][2]-c.analysis.get_summary(chains="FCa")[r"$n$"][1]290FCa_nm =c.analysis.get_summary(chains="FCa")[r"$n$"][1]-c.analysis.get_summary(chains="FCa")[r"$n$"][0]291fig, ax = plt.subplots(1, 1)292ax.scatter(1, 0, marker = 'x', s = 70, c='black', zorder = 3)293ax.axvline(1,color = 'k', ls = ':', linewidth=1, zorder = 1)294c.plotter.plot_contour(ax, r"$q$",r"$n$")295ax.text(2.9,-2.23,r'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(FCa_om,FCa_omp,FCa_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right')296ax.text(2.9,-2.23-0.3,r'$q = %10.5s^{%10.5s}_{%10.5s}$' %(FCa_q,FCa_qp,FCa_qm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 297ax.text(2.9,-2.23-0.6,r'$n = %10.5s^{%10.5s}_{%10.5s}$' %(FCa_n,FCa_np,FCa_nm), family='serif',color='black',rotation=0,fontsize=12,ha='right')298ax.set_xlabel(r'$q$', fontsize = 18)299ax.set_ylabel(r"$n$", fontsize = 18) 300ax.set_ylim(-3,0.5)301ax.set_xlim(0.1,3)302plt.minorticks_on()303ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")304ax.legend(loc='upper left',frameon=False,fontsize=12)305#plt.show()306plt.close()307c.remove_chain('FCa')308### Fwa PLOT309name = Fwa.__name__310# The actualchain this code is about311c.add_chain(Fwa_COBAYA_CHAIN[1000:], parameters=label_Fwa, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_Fwa)).configure(summary=True, shade_alpha=0.2,statistics="max")312# Gets best fit and plus/minus error 313Fwa_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]314Fwa_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]315Fwa_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]316Fwa_o0 = c.analysis.get_summary(chains=name)['$w_0$'][1]317Fwa_o0p = c.analysis.get_summary(chains=name)['$w_0$'][2]-c.analysis.get_summary(chains=name)['$w_0$'][1]318Fwa_o0m = c.analysis.get_summary(chains=name)['$w_0$'][1]-c.analysis.get_summary(chains=name)['$w_0$'][0]319Fwa_oa = c.analysis.get_summary(chains=name)['$w_a$'][1]320Fwa_oap =c.analysis.get_summary(chains=name)['$w_a$'][2]-c.analysis.get_summary(chains=name)['$w_a$'][1]321Fwa_oam =c.analysis.get_summary(chains=name)['$w_a$'][1]-c.analysis.get_summary(chains=name)['$w_a$'][0]322fig, ax = plt.subplots(1, 1)323# Selectings which params to plot and on what axis324c.plotter.plot_contour(ax, '$w_0$', '$w_a$') 325# Unique to model326ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)327ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)328ax.text(-4.4,-6,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_om,Fwa_omp,Fwa_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 329ax.text(-4.4,-6-1.5,'$\omega_0 = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_o0,Fwa_o0p,Fwa_o0m), family='serif',color='black',rotation=0,fontsize=12,ha='left')330ax.text(-4.4,-6-3,'$\omega_{a} = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_oa,Fwa_oap,Fwa_oam), family='serif',color='black',rotation=0,fontsize=12,ha='left')331ax.set_xlabel(r'$\omega_0$', fontsize = 18)332ax.set_ylabel(r'$\omega_a$', fontsize = 18)333# Plot limits334ax.set_xlim(-4.7,-0.2)335#ax.set_ylim(-10,10)336#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])337plt.minorticks_on()338ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")339ax.legend(loc='upper right',frameon=False,fontsize=12)340#plt.show()341plt.close()342c.remove_chain('Fwa')343### Fwz PLOT344name = Fwz.__name__345# The actual chain this code is about346c.add_chain(Fwz_COBAYA_CHAIN[1000:], parameters=label_Fwz, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_Fwz)).configure(summary=True, shade_alpha=0.2,statistics="max")347# Gets best fit and plus/minus error 348Fwz_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]349Fwz_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]350Fwz_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]351Fwz_o0 = c.analysis.get_summary(chains=name)['$w_0$'][1]352Fwz_o0p = c.analysis.get_summary(chains=name)['$w_0$'][2]-c.analysis.get_summary(chains=name)['$w_0$'][1]353Fwz_o0m = c.analysis.get_summary(chains=name)['$w_0$'][1]-c.analysis.get_summary(chains=name)['$w_0$'][0]354Fwz_oz = c.analysis.get_summary(chains=name)['$w_z$'][1]355Fwz_ozp =c.analysis.get_summary(chains=name)['$w_z$'][2]-c.analysis.get_summary(chains=name)['$w_z$'][1]356Fwz_ozm =c.analysis.get_summary(chains=name)['$w_z$'][1]-c.analysis.get_summary(chains=name)['$w_z$'][0]357fig, ax = plt.subplots(1, 1)358# Selectings which params to plot and on what axis359c.plotter.plot_contour(ax,'$w_0$', '$w_z$') 360# Unique to model361ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)362ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)363ax.text(-4.6,-6,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_om,Fwz_omp,Fwz_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 364ax.text(-4.6,-6-1.5,'$\omega_0 = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_o0,Fwz_o0p,Fwz_o0m), family='serif',color='black',rotation=0,fontsize=12,ha='left')365ax.text(-4.6,-6-3,'$\omega_{z} = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_oz,Fwz_ozp,Fwz_ozm), family='serif',color='black',rotation=0,fontsize=12,ha='left')366ax.set_xlabel(r'$\omega_0$', fontsize = 18)367ax.set_ylabel(r'$\omega_z$', fontsize = 18)368# Plot limits369ax.set_xlim(-4.7,0.3)370#ax.set_ylim(-3,2)371#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])372plt.minorticks_on()373ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")374ax.legend(loc='upper right',frameon=False,fontsize=12)375#plt.show()376plt.close()377c.remove_chain('Fwz')378### IDE1 PLOT379name = IDE1.__name__380# The actual chain this code is about381c.add_chain(IDE1_COBAYA_CHAIN[1000:], parameters=label_IDE1, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_IDE1)).configure(summary=True, shade_alpha=0.2,statistics="max")382# Gets best fit and plus/minus error 383IDE1_om = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]384IDE1_omp = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]385IDE1_omm = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][0]386IDE1_ol = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]387IDE1_olp = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]388IDE1_olm = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][0]389IDE1_w = c.analysis.get_summary(chains=name)[r"$\omega$"][1]390IDE1_wp =c.analysis.get_summary(chains=name)[r"$\omega$"][2]-c.analysis.get_summary(chains=name)[r"$\omega$"][1]391IDE1_wm =c.analysis.get_summary(chains=name)[r"$\omega$"][1]-c.analysis.get_summary(chains=name)[r"$\omega$"][0]392IDE1_e = c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]393IDE1_ep =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][2]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]394IDE1_em =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][0]395fig, ax = plt.subplots(1, 1)396# Selectings which params to plot and on what axis397c.plotter.plot_contour(ax,r"$\omega$", r"$\varepsilon$") 398# Unique to model399ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)400ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)401ax.text(0,-0.225,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(IDE1_om,IDE1_omp,IDE1_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 402ax.text(0,-0.225-0.075,r'$\Omega_x = %10.5s^{%10.5s}_{%10.5s}$' %(IDE1_ol,IDE1_olp,IDE1_olm), family='serif',color='black',rotation=0,fontsize=12,ha='right')403ax.text(0,-0.225-0.15,r'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(IDE1_w,IDE1_wp,IDE1_wm), family='serif',color='black',rotation=0,fontsize=12,ha='right')404ax.text(0,-0.225-0.225,r'$\varepsilon = %10.5s^{%10.5s}_{%10.5s}$' %(IDE1_e,IDE1_ep,IDE1_em), family='serif',color='black',rotation=0,fontsize=12,ha='right')405ax.set_xlabel(r"$\omega$", fontsize = 18)406ax.set_ylabel(r"$\varepsilon$", fontsize = 18)407# Plot limits408ax.set_xlim(-2.0,0.05)409ax.set_ylim(-0.5,0.5)410#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])411plt.minorticks_on()412ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")413ax.legend(loc='upper right',frameon=False,fontsize=12)414#plt.show()415plt.close()416c.remove_chain('IDE1')417### IDE2 PLOT418name = IDE2.__name__419# The actual chain this code is about420c.add_chain(IDE2_COBAYA_CHAIN[500:], parameters=label_IDE2, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_IDE1)).configure(summary=True, shade_alpha=0.2,statistics="max")421# Gets best fit and plus/minus error 422IDE2_om = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]423IDE2_omp = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]424IDE2_omm = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][0]425IDE2_ol = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]426IDE2_olp = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]427IDE2_olm = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][0]428IDE2_w = c.analysis.get_summary(chains=name)[r"$\omega$"][1]429IDE2_wp =c.analysis.get_summary(chains=name)[r"$\omega$"][2]-c.analysis.get_summary(chains=name)[r"$\omega$"][1]430IDE2_wm =c.analysis.get_summary(chains=name)[r"$\omega$"][1]-c.analysis.get_summary(chains=name)[r"$\omega$"][0]431IDE2_e = c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]432IDE2_ep =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][2]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]433IDE2_em =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][0]434fig, ax = plt.subplots(1, 1)435# Selectings which params to plot and on what axis436c.plotter.plot_contour(ax,r"$\omega$", r"$\varepsilon$") 437# Unique to model438ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)439ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)440ax.text(1.9,-0.225,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(IDE2_om,IDE2_omp,IDE2_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 441ax.text(1.9,-0.225-0.075,r'$\Omega_x = %10.5s^{%10.5s}_{%10.5s}$' %(IDE2_ol,IDE2_olp,IDE2_olm), family='serif',color='black',rotation=0,fontsize=12,ha='right')442ax.text(1.9,-0.225-0.15,r'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(IDE2_w,IDE2_wp,IDE2_wm), family='serif',color='black',rotation=0,fontsize=12,ha='right')443ax.text(1.9,-0.225-0.225,r'$\varepsilon = %10.5s^{%10.5s}_{%10.5s}$' %(IDE2_e,IDE2_ep,IDE2_em), family='serif',color='black',rotation=0,fontsize=12,ha='right')444ax.set_xlabel(r"$\omega$", fontsize = 18)445ax.set_ylabel(r"$\varepsilon$", fontsize = 18)446# Plot limits447ax.set_xlim(-5.0,2)448ax.set_ylim(-0.5,0.5)449#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])450plt.minorticks_on()451ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")452ax.legend(loc='upper right',frameon=False,fontsize=12)453plt.show()454#plt.close()455c.remove_chain('IDE2')456### IDE4 PLOT457name = IDE4.__name__458# The actual chain this code is about459c.add_chain(IDE4_COBAYA_CHAIN[500:], parameters=label_IDE4, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_IDE1)).configure(summary=True, shade_alpha=0.2,statistics="max")460# Gets best fit and plus/minus error 461IDE4_om = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]462IDE4_omp = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]463IDE4_omm = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][0]464IDE4_ol = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]465IDE4_olp = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]466IDE4_olm = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][0]467IDE4_w = c.analysis.get_summary(chains=name)[r"$\omega$"][1]468IDE4_wp =c.analysis.get_summary(chains=name)[r"$\omega$"][2]-c.analysis.get_summary(chains=name)[r"$\omega$"][1]469IDE4_wm =c.analysis.get_summary(chains=name)[r"$\omega$"][1]-c.analysis.get_summary(chains=name)[r"$\omega$"][0]470IDE4_e = c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]471IDE4_ep =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][2]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]472IDE4_em =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][0]473fig, ax = plt.subplots(1, 1)474# Selectings which params to plot and on what axis475c.plotter.plot_contour(ax,r"$\omega$", r"$\varepsilon$") 476# Unique to model477ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)478ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)479ax.text(1.9,-0.225,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(IDE4_om,IDE4_omp,IDE4_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 480ax.text(1.9,-0.225-0.075,r'$\Omega_x = %10.5s^{%10.5s}_{%10.5s}$' %(IDE4_ol,IDE4_olp,IDE4_olm), family='serif',color='black',rotation=0,fontsize=12,ha='right')481ax.text(1.9,-0.225-0.15,r'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(IDE4_w,IDE4_wp,IDE4_wm), family='serif',color='black',rotation=0,fontsize=12,ha='right')482ax.text(1.9,-0.225-0.225,r'$\varepsilon = %10.5s^{%10.5s}_{%10.5s}$' %(IDE4_e,IDE4_ep,IDE4_em), family='serif',color='black',rotation=0,fontsize=12,ha='right')483ax.set_xlabel(r"$\omega$", fontsize = 18)484ax.set_ylabel(r"$\varepsilon$", fontsize = 18)485# Plot limits486ax.set_xlim(-5.0,2)...

Full Screen

Full Screen

COBAYA_CONTOURS_DES3YR_BIN.py

Source:COBAYA_CONTOURS_DES3YR_BIN.py Github

copy

Full Screen

...35label_Chap, begin_Chap, legend_Chap = get_info(Chap.__name__)36#### PLOTS FOR DIFFERENT MODELS - NOTE PARAMS ARE SAVED AS: MODEL_PARAM - BESIDES FLCDM/LCDM37### FLCDM - Used as a Scatter point on some plots38c.add_chain(FLCDM_COBAYA_CHAIN, parameters=label_FLCDM, linewidth=2.0, name="FLCDM", kde=1.5, color="blue").configure(summary=True, shade_alpha=0.2,statistics="max")39fom = c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][1]40fomp = c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][2]-c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][1]41fomm = c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][1]-c.analysis.get_summary(chains="FLCDM")[r'$\Omega_m$'][0]42c.remove_chain('FLCDM')43### LCDM PLOT & points which is sometimes used as a scatter point on some plots44fig, ax = plt.subplots(1, 1)45c.add_chain(LCDM_COBAYA_CHAIN, parameters=label_LCDM, linewidth=2.0, name="LCDM", kde=1.5, color="red",num_free_params=2).configure(summary=True, shade_alpha=0.2,statistics="max")46om = c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][1]47omp = c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][2]-c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][1]48omm = c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][1]-c.analysis.get_summary(chains="LCDM")[r'$\Omega_m$'][0]49ol = c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][1]50olp =c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][2]-c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][1]51olm =c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][1]-c.analysis.get_summary(chains="LCDM")[r'$\Omega_{\Lambda}$'][0]52c.plotter.plot_contour(ax,r'$\Omega_m$', r'$\Omega_{\Lambda}$')53ax.scatter(fom, 1-fom, marker = 'D', s = 50, c='black', label = r'Flat $\Lambda$')54ax.text(1.2,0.4,'$\Omega_m = %10.5s\pm{%10.5s}$' %(om,omp), family='serif',color='black',rotation=0,fontsize=12,ha='right') 55ax.text(1.2,0.25,'$\Omega_{\Lambda} = %10.5s\pm{%10.5s}$' %(ol,olp), family='serif',color='black',rotation=0,fontsize=12,ha='right')56ax.set_xlabel(r'$\Omega_m$', fontsize = 18)57ax.set_ylabel(r'$\Omega_{\Lambda}$', fontsize = 18) 58#ax.set_xlim(0,1.2)59#ax.set_ylim(0.48,1.06)60plt.minorticks_on()61ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")62ax.legend(loc='upper right',frameon=False,fontsize=12)63plt.close()64#plt.show()65c.remove_chain('LCDM')66### FwCDM PLOT67name = FwCDM.__name__68c.add_chain(FwCDM_COBAYA_CHAIN[200:], parameters=label_FwCDM, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_FwCDM)).configure(summary=True, shade_alpha=0.2,statistics="max")69# Gets best fit and plus/minus error70FwCDM_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]71FwCDM_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]72FwCDM_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]73FwCDM_w = c.analysis.get_summary(chains=name)[r'$\omega$'][1]74FwCDM_wp =c.analysis.get_summary(chains=name)[r'$\omega$'][2]-c.analysis.get_summary(chains=name)[r'$\omega$'][1]75FwCDM_wm =c.analysis.get_summary(chains=name)[r'$\omega$'][1]-c.analysis.get_summary(chains=name)[r'$\omega$'][0]76fig, ax = plt.subplots(1, 1)77# Unique to this plot - plotting FLCDM best fit param78ax.scatter(fom, -1, marker = 'D', s = 50, c='black', label = r'Flat $\Lambda$')79# Selectings which params to plot and on what axis80c.plotter.plot_contour(ax, *label_FwCDM) 81# Unique to FwCDM model82ax.text(0.12,-1.75,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(FwCDM_om,FwCDM_omp,FwCDM_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 83ax.text(0.12,-1.75-0.15,'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(FwCDM_w,FwCDM_wp,FwCDM_wm), family='serif',color='black',rotation=0,fontsize=12,ha='left')84ax.set_xlabel(r'$\Omega_m$', fontsize = 18)85ax.set_ylabel(r'$\omega$', fontsize = 18)86# Plot limits87#ax.set_xlim(0.20,0.5)88#ax.set_ylim(0.48,1.06)89plt.minorticks_on()90ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")91ax.legend(loc='upper right',frameon=False,fontsize=12)92plt.close()93#plt.show()94c.remove_chain('FwCDM')95### wCDM PLOT96name = wCDM.__name__97c.add_chain(wCDM_COBAYA_CHAIN[1000:], parameters=label_wCDM, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_wCDM)).configure(summary=True, shade_alpha=0.2,statistics="max")98# Gets best fit and plus/minus error 99wCDM_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]100wCDM_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]101wCDM_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]102wCDM_ol = c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][1]103wCDM_olp = c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][1]104wCDM_olm = c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_{\Lambda}$'][0]105wCDM_o = c.analysis.get_summary(chains=name)[r'$\omega$'][1]106wCDM_op =c.analysis.get_summary(chains=name)[r'$\omega$'][2]-c.analysis.get_summary(chains=name)[r'$\omega$'][1]107wCDM_omi =c.analysis.get_summary(chains=name)[r'$\omega$'][1]-c.analysis.get_summary(chains=name)[r'$\omega$'][0]108fig, ax = plt.subplots(1, 1)109# Selectings which params to plot and on what axis110c.plotter.plot_contour(ax, r'$\Omega_m$', r"$\omega$")111# Unique to this plot - plotting LCDM best fit param112ax.scatter(om, -1, marker = 'X', s = 60, c='red', label = r'$\Lambda$')113# Unique to model114ax.text(1.15,-1.65,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(wCDM_om,wCDM_omp,wCDM_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 115ax.text(1.15,-1.65-0.13,'$\Omega_{\Lambda} = %10.5s^{%10.5s}_{%10.5s}$' %(wCDM_ol,wCDM_olp,wCDM_olm), family='serif',color='black',rotation=0,fontsize=12,ha='right')116ax.text(1.15,-1.65-0.26,'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(wCDM_o,wCDM_op,wCDM_omi), family='serif',color='black',rotation=0,fontsize=12,ha='right')117ax.set_xlabel(r'$\Omega_m$', fontsize = 18)118ax.set_ylabel(r'$\omega$', fontsize = 18)119# Plot limits120#ax.set_xlim(0.20,0.6)121#ax.set_ylim(-2,-0.5)122#ax.set_xticklabels(['0.2','','0.3','','0.4','','0.5','','0.6'])123#ax.set_yticklabels(['','-1.8','','-1.4','','-1.0','','-0.6'])124plt.minorticks_on()125ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")126ax.legend(loc='upper right',frameon=False,fontsize=12)127#plt.show()128plt.close()129c.remove_chain('wCDM')130### Fwa PLOT131name = Fwa.__name__132# The actualchain this code is about133c.add_chain(Fwa_COBAYA_CHAIN[1000:], parameters=label_Fwa, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_Fwa)).configure(summary=True, shade_alpha=0.2,statistics="max")134# Gets best fit and plus/minus error 135Fwa_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]136Fwa_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]137Fwa_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]138Fwa_o0 = c.analysis.get_summary(chains=name)['$w_0$'][1]139Fwa_o0p = c.analysis.get_summary(chains=name)['$w_0$'][2]-c.analysis.get_summary(chains=name)['$w_0$'][1]140Fwa_o0m = c.analysis.get_summary(chains=name)['$w_0$'][1]-c.analysis.get_summary(chains=name)['$w_0$'][0]141Fwa_oa = c.analysis.get_summary(chains=name)['$w_a$'][1]142Fwa_oap =c.analysis.get_summary(chains=name)['$w_a$'][2]-c.analysis.get_summary(chains=name)['$w_a$'][1]143Fwa_oam =c.analysis.get_summary(chains=name)['$w_a$'][1]-c.analysis.get_summary(chains=name)['$w_a$'][0]144fig, ax = plt.subplots(1, 1)145# Selectings which params to plot and on what axis146c.plotter.plot_contour(ax, '$w_0$', '$w_a$') 147# Unique to model148ax.text(-1.85,-7,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_om,Fwa_omp,Fwa_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 149ax.text(-1.85,-7-1,'$\omega_0 = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_o0,Fwa_o0p,Fwa_o0m), family='serif',color='black',rotation=0,fontsize=12,ha='left')150ax.text(-1.85,-7-2,'$\omega_{a} = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_oa,Fwa_oap,Fwa_oam), family='serif',color='black',rotation=0,fontsize=12,ha='left')151ax.set_xlabel(r'$\omega_0$', fontsize = 18)152ax.set_ylabel(r'$\omega_a$', fontsize = 18)153# Plot limits154#ax.set_xlim(-2,0)155#ax.set_ylim(-3,2)156#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])157plt.minorticks_on()158ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")159ax.legend(loc='upper right',frameon=False,fontsize=12)160#plt.show()161plt.close()162c.remove_chain('Fwa')163### Fwz PLOT164name = Fwz.__name__165# The actual chain this code is about166c.add_chain(Fwz_COBAYA_CHAIN[500:], parameters=label_Fwz, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_Fwz)).configure(summary=True, shade_alpha=0.2,statistics="max")167# Gets best fit and plus/minus error 168Fwz_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]169Fwz_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]170Fwz_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]171Fwz_o0 = c.analysis.get_summary(chains=name)['$w_0$'][1]172Fwz_o0p = c.analysis.get_summary(chains=name)['$w_0$'][2]-c.analysis.get_summary(chains=name)['$w_0$'][1]173Fwz_o0m = c.analysis.get_summary(chains=name)['$w_0$'][1]-c.analysis.get_summary(chains=name)['$w_0$'][0]174Fwz_oz = c.analysis.get_summary(chains=name)['$w_z$'][1]175Fwz_ozp =c.analysis.get_summary(chains=name)['$w_z$'][2]-c.analysis.get_summary(chains=name)['$w_z$'][1]176Fwz_ozm =c.analysis.get_summary(chains=name)['$w_z$'][1]-c.analysis.get_summary(chains=name)['$w_z$'][0]177fig, ax = plt.subplots(1, 1)178# Selectings which params to plot and on what axis179c.plotter.plot_contour(ax,'$w_0$', '$w_z$') 180# Unique to model181ax.text(-1.85,-7,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_om,Fwz_omp,Fwz_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 182ax.text(-1.85,-7-1,'$\omega_0 = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_o0,Fwz_o0p,Fwz_o0m), family='serif',color='black',rotation=0,fontsize=12,ha='left')183ax.text(-1.85,-7-2,'$\omega_{z} = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_oz,Fwz_ozp,Fwz_ozm), family='serif',color='black',rotation=0,fontsize=12,ha='left')184ax.set_xlabel(r'$\omega_0$', fontsize = 18)185ax.set_ylabel(r'$\omega_z$', fontsize = 18)186# Plot limits187#ax.set_xlim(-2,0)188#ax.set_ylim(-3,2)189#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])190plt.minorticks_on()191ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")192ax.legend(loc='upper right',frameon=False,fontsize=12)193#plt.show()194plt.close()195c.remove_chain('Fwz')196### IDE1 PLOT197### FGCHAP PLOT 198c.add_chain(FGChap_COBAYA_CHAIN[200:], parameters=[r'$A$', r'$\alpha$'], linewidth=2.0, name="FGChap", kde=1.5, color="red",num_free_params=2, num_eff_data_points=20).configure(summary=True, shade_alpha=0.2,statistics="max")199FGChap_A = c.analysis.get_summary(chains="FGChap")[r'$A$'][1]200FGChap_Ap = c.analysis.get_summary(chains="FGChap")[r'$A$'][2]-c.analysis.get_summary(chains="FGChap")[r'$A$'][1]201FGChap_Am = c.analysis.get_summary(chains="FGChap")[r'$A$'][1]-c.analysis.get_summary(chains="FGChap")[r'$A$'][0]202FGChap_a = c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][1]203FGChap_ap =c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][2]-c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][1]204FGChap_am =c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][1]-c.analysis.get_summary(chains="FGChap")[r'$\alpha$'][0]205fig, ax = plt.subplots(1, 1)206ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)207ok = 1- (om+ol)208ax.scatter(1-fom, 0, marker = 'D', s = 50, c='black', label = r'Flat $\Lambda$', zorder = 2)209c.plotter.plot_contour(ax,r'$A$', r'$\alpha$')210ax.text(0.89,-0.62,r'$A = %10.5s^{%10.5s}_{%10.5s}$' %(FGChap_A,FGChap_Ap,FGChap_Am), family='serif',color='black',rotation=0,fontsize=12,ha='right') 211ax.text(0.89,-0.62-0.2,r'$\alpha = %10.5s^{%10.5s}_{%10.5s}$' %(FGChap_a,FGChap_ap,FGChap_am), family='serif',color='black',rotation=0,fontsize=12,ha='right')212#ax.text(0.86,-0.5-0.4,r'$X=\Lambda CDM$ Best Fit', family='serif',color='black',rotation=0,fontsize=12,ha='right')213ax.set_xlabel(r'$A$', fontsize = 18)214ax.set_ylabel(r'$\alpha$', fontsize = 18) 215#ax.set_ylim(-1,2)216plt.minorticks_on()217ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")218ax.legend(loc='upper left',frameon=False,fontsize=12)219#plt.show()220plt.close()221c.remove_chain('FGChap')222#c.plotter.plot(figsize="COLUMN", chains=['FGChap'],filename='FGChap_TEST' ) 223#c.plotter.plot(figsize="COLUMN", chains=['LCDM'],filename='LCDM_TEST' ) 224#print(c.comparison.comparison_table(caption="Model comparisons!"))225### CHAP PLOT 226c.add_chain(Chap_COBAYA_CHAIN[500:], parameters=[r'$A$', r'$\Omega_{K}$'], linewidth=2.0, name="Chap", kde=1.5, color="red",num_free_params=2, num_eff_data_points=20).configure(summary=True, shade_alpha=0.2,statistics="max")227Chap_A = c.analysis.get_summary(chains="Chap")[r'$A$'][1]228Chap_Ap = c.analysis.get_summary(chains="Chap")[r'$A$'][2]-c.analysis.get_summary(chains="Chap")[r'$A$'][1]229Chap_Am = c.analysis.get_summary(chains="Chap")[r'$A$'][1]-c.analysis.get_summary(chains="Chap")[r'$A$'][0]230Chap_ok = c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][1]231Chap_okp =c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][2]-c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][1]232Chap_okm =c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][1]-c.analysis.get_summary(chains="Chap")[r'$\Omega_{K}$'][0]233fig, ax = plt.subplots(1, 1)234#ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)235c.plotter.plot_contour(ax, r'$\Omega_{K}$',r'$A$')236ax.text(0.78,0.3,r'$A = %10.5s^{%10.5s}_{%10.5s}$' %(Chap_A,Chap_Ap,Chap_Am), family='serif',color='black',rotation=0,fontsize=12,ha='right') 237ax.text(0.78,0.3-0.08,r'$\Omega_{K} = %10.5s^{%10.5s}_{%10.5s}$' %(Chap_ok,Chap_okp,Chap_okm), family='serif',color='black',rotation=0,fontsize=12,ha='right')238ax.set_ylabel(r'$A$', fontsize = 18)239ax.set_xlabel(r'$\Omega_{K}$', fontsize = 18) 240ax.set_ylim(0.15,1.025)241ax.set_xlim(-0.85,0.85)242plt.minorticks_on()243ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")244ax.legend(loc='upper left',frameon=False,fontsize=12)245#plt.show()246plt.close()247c.remove_chain('Chap')248### GCHAP PLOT 249c.add_chain(GChap_COBAYA_CHAIN[500:], parameters=[r"$A$",r"$\alpha$",r"$\Omega_{K}$"], linewidth=2.0, name="GChap", kde=1.5, color="red",num_free_params=2).configure(summary=True, shade_alpha=0.2,statistics="max")250GChap_A = c.analysis.get_summary(chains="GChap")[r'$A$'][1]251GChap_Ap = c.analysis.get_summary(chains="GChap")[r'$A$'][2]-c.analysis.get_summary(chains="GChap")[r'$A$'][1]252GChap_Am = c.analysis.get_summary(chains="GChap")[r'$A$'][1]-c.analysis.get_summary(chains="GChap")[r'$A$'][0]253GChap_ok = c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][1]254GChap_okp =c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][2]-c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][1]255GChap_okm =c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][1]-c.analysis.get_summary(chains="GChap")[r'$\Omega_{K}$'][0]256GChap_a = c.analysis.get_summary(chains="GChap")[r"$\alpha$"][1]257GChap_ap =c.analysis.get_summary(chains="GChap")[r"$\alpha$"][2]-c.analysis.get_summary(chains="GChap")[r"$\alpha$"][1]258GChap_am =c.analysis.get_summary(chains="GChap")[r"$\alpha$"][1]-c.analysis.get_summary(chains="GChap")[r"$\alpha$"][0]259fig, ax = plt.subplots(1, 1)260ax.scatter(1-(om/(1-ok)), 0, marker = 'X', s = 60, c='red', label = r'$\Lambda$', zorder = 3)261ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)262c.plotter.plot_contour(ax, r'$A$',r"$\alpha$")263ax.text(0.51,1.5 ,r'$A = %10.5s^{%10.5s}_{%10.5s}$' %(GChap_A,GChap_Ap,GChap_Am), family='serif',color='black',rotation=0,fontsize=12,ha='left') 264ax.text(0.51,1.5-0.25,r'$\alpha = %10.5s^{%10.5s}_{%10.5s}$' %(GChap_a,GChap_ap,GChap_am), family='serif',color='black',rotation=0,fontsize=12,ha='left')265ax.text(0.51,1.5-0.5,r'$\Omega_{K} = %10.5s^{%10.5s}_{%10.5s}$' %(GChap_ok,GChap_okp,GChap_okm), family='serif',color='black',rotation=0,fontsize=12,ha='left')266ax.set_xlabel(r'$A$', fontsize = 18)267ax.set_ylabel(r"$\alpha$", fontsize = 18) 268ax.set_ylim(-1,2.0)269ax.set_xlim(0.5,1)270plt.minorticks_on()271ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")272ax.legend(loc='upper left',frameon=False,fontsize=12)273plt.show()274#plt.close()275c.remove_chain('GChap')276exit()277### FCa PLOT 278c.add_chain(FCa_COBAYA_CHAIN[500:], parameters=[r"$\Omega_m$",r"$q$",r"$n$"], linewidth=2.0, name="FCa", kde=1.5, color="red",num_free_params=3).configure(summary=True, shade_alpha=0.2,statistics="max")279FCa_om = c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][1]280FCa_omp = c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][2]-c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][1]281FCa_omm = c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][1]-c.analysis.get_summary(chains="FCa")[r"$\Omega_m$"][0]282FCa_q = c.analysis.get_summary(chains="FCa")[r"$q$"][1]283FCa_qp =c.analysis.get_summary(chains="FCa")[r"$q$"][2]-c.analysis.get_summary(chains="FCa")[r"$q$"][1]284FCa_qm =c.analysis.get_summary(chains="FCa")[r"$q$"][1]-c.analysis.get_summary(chains="FCa")[r"$q$"][0]285FCa_n = c.analysis.get_summary(chains="FCa")[r"$n$"][1]286FCa_np =c.analysis.get_summary(chains="FCa")[r"$n$"][2]-c.analysis.get_summary(chains="FCa")[r"$n$"][1]287FCa_nm =c.analysis.get_summary(chains="FCa")[r"$n$"][1]-c.analysis.get_summary(chains="FCa")[r"$n$"][0]288fig, ax = plt.subplots(1, 1)289ax.scatter(1, 0, marker = 'x', s = 70, c='black', zorder = 3)290ax.axvline(1,color = 'k', ls = ':', linewidth=1, zorder = 1)291c.plotter.plot_contour(ax, r"$q$",r"$n$")292ax.text(2.9,-2.23,r'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(FCa_om,FCa_omp,FCa_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right')293ax.text(2.9,-2.23-0.3,r'$q = %10.5s^{%10.5s}_{%10.5s}$' %(FCa_q,FCa_qp,FCa_qm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 294ax.text(2.9,-2.23-0.6,r'$n = %10.5s^{%10.5s}_{%10.5s}$' %(FCa_n,FCa_np,FCa_nm), family='serif',color='black',rotation=0,fontsize=12,ha='right')295ax.set_xlabel(r'$q$', fontsize = 18)296ax.set_ylabel(r"$n$", fontsize = 18) 297ax.set_ylim(-3,0.5)298ax.set_xlim(0.1,3)299plt.minorticks_on()300ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")301ax.legend(loc='upper left',frameon=False,fontsize=12)302#plt.show()303plt.close()304c.remove_chain('FCa')305### Fwa PLOT306name = Fwa.__name__307# The actualchain this code is about308c.add_chain(Fwa_COBAYA_CHAIN[1000:], parameters=label_Fwa, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_Fwa)).configure(summary=True, shade_alpha=0.2,statistics="max")309# Gets best fit and plus/minus error 310Fwa_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]311Fwa_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]312Fwa_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]313Fwa_o0 = c.analysis.get_summary(chains=name)['$w_0$'][1]314Fwa_o0p = c.analysis.get_summary(chains=name)['$w_0$'][2]-c.analysis.get_summary(chains=name)['$w_0$'][1]315Fwa_o0m = c.analysis.get_summary(chains=name)['$w_0$'][1]-c.analysis.get_summary(chains=name)['$w_0$'][0]316Fwa_oa = c.analysis.get_summary(chains=name)['$w_a$'][1]317Fwa_oap =c.analysis.get_summary(chains=name)['$w_a$'][2]-c.analysis.get_summary(chains=name)['$w_a$'][1]318Fwa_oam =c.analysis.get_summary(chains=name)['$w_a$'][1]-c.analysis.get_summary(chains=name)['$w_a$'][0]319fig, ax = plt.subplots(1, 1)320# Selectings which params to plot and on what axis321c.plotter.plot_contour(ax, '$w_0$', '$w_a$') 322# Unique to model323ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)324ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)325ax.text(-4.4,-6,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_om,Fwa_omp,Fwa_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 326ax.text(-4.4,-6-1.5,'$\omega_0 = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_o0,Fwa_o0p,Fwa_o0m), family='serif',color='black',rotation=0,fontsize=12,ha='left')327ax.text(-4.4,-6-3,'$\omega_{a} = %10.5s^{%10.5s}_{%10.5s}$' %(Fwa_oa,Fwa_oap,Fwa_oam), family='serif',color='black',rotation=0,fontsize=12,ha='left')328ax.set_xlabel(r'$\omega_0$', fontsize = 18)329ax.set_ylabel(r'$\omega_a$', fontsize = 18)330# Plot limits331#ax.set_xlim(-2,0)332#ax.set_ylim(-10,10)333#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])334plt.minorticks_on()335ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")336ax.legend(loc='upper right',frameon=False,fontsize=12)337#plt.show()338plt.close()339c.remove_chain('Fwa')340### Fwz PLOT341name = Fwz.__name__342# The actual chain this code is about343c.add_chain(Fwz_COBAYA_CHAIN[500:], parameters=label_Fwz, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_Fwz)).configure(summary=True, shade_alpha=0.2,statistics="max")344# Gets best fit and plus/minus error 345Fwz_om = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]346Fwz_omp = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][2]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]347Fwz_omm = c.analysis.get_summary(chains=name)[r'$\Omega_m$'][1]-c.analysis.get_summary(chains=name)[r'$\Omega_m$'][0]348Fwz_o0 = c.analysis.get_summary(chains=name)['$w_0$'][1]349Fwz_o0p = c.analysis.get_summary(chains=name)['$w_0$'][2]-c.analysis.get_summary(chains=name)['$w_0$'][1]350Fwz_o0m = c.analysis.get_summary(chains=name)['$w_0$'][1]-c.analysis.get_summary(chains=name)['$w_0$'][0]351Fwz_oz = c.analysis.get_summary(chains=name)['$w_z$'][1]352Fwz_ozp =c.analysis.get_summary(chains=name)['$w_z$'][2]-c.analysis.get_summary(chains=name)['$w_z$'][1]353Fwz_ozm =c.analysis.get_summary(chains=name)['$w_z$'][1]-c.analysis.get_summary(chains=name)['$w_z$'][0]354fig, ax = plt.subplots(1, 1)355# Selectings which params to plot and on what axis356c.plotter.plot_contour(ax,'$w_0$', '$w_z$') 357# Unique to model358ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)359ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)360ax.text(-4.4,-6,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_om,Fwz_omp,Fwz_omm), family='serif',color='black',rotation=0,fontsize=12,ha='left') 361ax.text(-4.4,-6-1.5,'$\omega_0 = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_o0,Fwz_o0p,Fwz_o0m), family='serif',color='black',rotation=0,fontsize=12,ha='left')362ax.text(-4.4,-6-3,'$\omega_{z} = %10.5s^{%10.5s}_{%10.5s}$' %(Fwz_oz,Fwz_ozp,Fwz_ozm), family='serif',color='black',rotation=0,fontsize=12,ha='left')363ax.set_xlabel(r'$\omega_0$', fontsize = 18)364ax.set_ylabel(r'$\omega_z$', fontsize = 18)365# Plot limits366ax.set_xlim(-4.7,0.3)367#ax.set_ylim(-3,2)368#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])369plt.minorticks_on()370ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")371ax.legend(loc='upper right',frameon=False,fontsize=12)372#plt.show()373plt.close()374c.remove_chain('Fwz')375### IDE1 PLOT376name = IDE1.__name__377# The actual chain this code is about378c.add_chain(IDE1_COBAYA_CHAIN[500:], parameters=label_IDE1, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_IDE1)).configure(summary=True, shade_alpha=0.2,statistics="max")379# Gets best fit and plus/minus error 380IDE1_om = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]381IDE1_omp = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]382IDE1_omm = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][0]383IDE1_ol = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]384IDE1_olp = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]385IDE1_olm = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][0]386IDE1_w = c.analysis.get_summary(chains=name)[r"$\omega$"][1]387IDE1_wp =c.analysis.get_summary(chains=name)[r"$\omega$"][2]-c.analysis.get_summary(chains=name)[r"$\omega$"][1]388IDE1_wm =c.analysis.get_summary(chains=name)[r"$\omega$"][1]-c.analysis.get_summary(chains=name)[r"$\omega$"][0]389IDE1_e = c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]390IDE1_ep =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][2]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]391IDE1_em =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][0]392fig, ax = plt.subplots(1, 1)393# Selectings which params to plot and on what axis394c.plotter.plot_contour(ax,r"$\omega$", r"$\varepsilon$") 395# Unique to model396ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)397ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)398ax.text(0,-0.225,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(IDE1_om,IDE1_omp,IDE1_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 399ax.text(0,-0.225-0.075,r'$\Omega_x = %10.5s^{%10.5s}_{%10.5s}$' %(IDE1_ol,IDE1_olp,IDE1_olm), family='serif',color='black',rotation=0,fontsize=12,ha='right')400ax.text(0,-0.225-0.15,r'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(IDE1_w,IDE1_wp,IDE1_wm), family='serif',color='black',rotation=0,fontsize=12,ha='right')401ax.text(0,-0.225-0.225,r'$\varepsilon = %10.5s^{%10.5s}_{%10.5s}$' %(IDE1_e,IDE1_ep,IDE1_em), family='serif',color='black',rotation=0,fontsize=12,ha='right')402ax.set_xlabel(r"$\omega$", fontsize = 18)403ax.set_ylabel(r"$\varepsilon$", fontsize = 18)404# Plot limits405ax.set_xlim(-2.0,0.05)406ax.set_ylim(-0.5,0.5)407#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])408plt.minorticks_on()409ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")410ax.legend(loc='upper right',frameon=False,fontsize=12)411#plt.show()412plt.close()413c.remove_chain('IDE1')414### IDE2 PLOT415name = IDE2.__name__416# The actual chain this code is about417c.add_chain(IDE2_COBAYA_CHAIN[2000:], parameters=label_IDE2, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_IDE1)).configure(summary=True, shade_alpha=0.2,statistics="max")418# Gets best fit and plus/minus error 419IDE2_om = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]420IDE2_omp = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]421IDE2_omm = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][0]422IDE2_ol = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]423IDE2_olp = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]424IDE2_olm = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][0]425IDE2_w = c.analysis.get_summary(chains=name)[r"$\omega$"][1]426IDE2_wp =c.analysis.get_summary(chains=name)[r"$\omega$"][2]-c.analysis.get_summary(chains=name)[r"$\omega$"][1]427IDE2_wm =c.analysis.get_summary(chains=name)[r"$\omega$"][1]-c.analysis.get_summary(chains=name)[r"$\omega$"][0]428IDE2_e = c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]429IDE2_ep =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][2]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]430IDE2_em =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][0]431fig, ax = plt.subplots(1, 1)432# Selectings which params to plot and on what axis433c.plotter.plot_contour(ax,r"$\omega$", r"$\varepsilon$") 434# Unique to model435ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)436ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)437ax.text(1.9,-0.225,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(IDE2_om,IDE2_omp,IDE2_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 438ax.text(1.9,-0.225-0.075,r'$\Omega_x = %10.5s^{%10.5s}_{%10.5s}$' %(IDE2_ol,IDE2_olp,IDE2_olm), family='serif',color='black',rotation=0,fontsize=12,ha='right')439ax.text(1.9,-0.225-0.15,r'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(IDE2_w,IDE2_wp,IDE2_wm), family='serif',color='black',rotation=0,fontsize=12,ha='right')440ax.text(1.9,-0.225-0.225,r'$\varepsilon = %10.5s^{%10.5s}_{%10.5s}$' %(IDE2_e,IDE2_ep,IDE2_em), family='serif',color='black',rotation=0,fontsize=12,ha='right')441ax.set_xlabel(r"$\omega$", fontsize = 18)442ax.set_ylabel(r"$\varepsilon$", fontsize = 18)443# Plot limits444ax.set_xlim(-5.0,2)445ax.set_ylim(-0.5,0.5)446#ax.set_xticklabels(['','',-1.5,'',-1.0,'',-0.5,'',''])447plt.minorticks_on()448ax.tick_params(which = 'both', bottom=True, top=True, left=True, right=True, direction="in")449ax.legend(loc='upper right',frameon=False,fontsize=12)450#plt.show()451plt.close()452c.remove_chain('IDE2')453### IDE4 PLOT454name = IDE4.__name__455# The actual chain this code is about456c.add_chain(IDE4_COBAYA_CHAIN[500:], parameters=label_IDE4, linewidth=2.0, name=name, kde=1.5, color="red",num_free_params=len(begin_IDE1)).configure(summary=True, shade_alpha=0.2,statistics="max")457# Gets best fit and plus/minus error 458IDE4_om = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]459IDE4_omp = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]460IDE4_omm = c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{m}$"][0]461IDE4_ol = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]462IDE4_olp = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][2]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]463IDE4_olm = c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][1]-c.analysis.get_summary(chains=name)[r"$\Omega_{x}$"][0]464IDE4_w = c.analysis.get_summary(chains=name)[r"$\omega$"][1]465IDE4_wp =c.analysis.get_summary(chains=name)[r"$\omega$"][2]-c.analysis.get_summary(chains=name)[r"$\omega$"][1]466IDE4_wm =c.analysis.get_summary(chains=name)[r"$\omega$"][1]-c.analysis.get_summary(chains=name)[r"$\omega$"][0]467IDE4_e = c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]468IDE4_ep =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][2]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]469IDE4_em =c.analysis.get_summary(chains=name)[r"$\varepsilon$"][1]-c.analysis.get_summary(chains=name)[r"$\varepsilon$"][0]470fig, ax = plt.subplots(1, 1)471# Selectings which params to plot and on what axis472c.plotter.plot_contour(ax,r"$\omega$", r"$\varepsilon$") 473# Unique to model474ax.axhline(0,color = 'k', ls = ':', linewidth=1, zorder = 1)475ax.scatter(-1, 0, marker = 'x', s = 70, c='black', zorder = 3)476ax.text(1.9,-0.225,'$\Omega_m = %10.5s^{%10.5s}_{%10.5s}$' %(IDE4_om,IDE4_omp,IDE4_omm), family='serif',color='black',rotation=0,fontsize=12,ha='right') 477ax.text(1.9,-0.225-0.075,r'$\Omega_x = %10.5s^{%10.5s}_{%10.5s}$' %(IDE4_ol,IDE4_olp,IDE4_olm), family='serif',color='black',rotation=0,fontsize=12,ha='right')478ax.text(1.9,-0.225-0.15,r'$\omega = %10.5s^{%10.5s}_{%10.5s}$' %(IDE4_w,IDE4_wp,IDE4_wm), family='serif',color='black',rotation=0,fontsize=12,ha='right')479ax.text(1.9,-0.225-0.225,r'$\varepsilon = %10.5s^{%10.5s}_{%10.5s}$' %(IDE4_e,IDE4_ep,IDE4_em), family='serif',color='black',rotation=0,fontsize=12,ha='right')480ax.set_xlabel(r"$\omega$", fontsize = 18)481ax.set_ylabel(r"$\varepsilon$", fontsize = 18)482# Plot limits483ax.set_xlim(-5.0,2)...

Full Screen

Full Screen

test_space_info.py

Source:test_space_info.py Github

copy

Full Screen

...13 configuration = get_default_test_configuration()14 gateway = get_default_storm_gateway()15 spaceinfo = SpaceInfoBuilder(configuration, gateway).build()16 expected_summary = get_default_space_info_summary()17 self.assertEqual(spaceinfo.get_summary().get_total(), expected_summary.get_total())18 self.assertEqual(spaceinfo.get_summary().get_available(), expected_summary.get_available())19 self.assertEqual(spaceinfo.get_summary().get_used(), expected_summary.get_used())20 self.assertEqual(spaceinfo.get_summary().get_free(), expected_summary.get_free())21 self.assertEqual(spaceinfo.get_summary().get_unavailable(), expected_summary.get_unavailable())22 self.assertEqual(spaceinfo.get_summary().get_reserved(), expected_summary.get_reserved())23 self.assertEqual(spaceinfo.get_summary().get_busy(), expected_summary.get_busy())24 self.assertEqual(spaceinfo.get_summary().get_nearline(), expected_summary.get_nearline())25 def test_space_info_builder_with_default_configuration_but_serving_state_closed(self):26 configuration = get_default_test_configuration()27 configuration.set("STORM_SERVING_STATE", "closed")28 gateway = get_default_storm_gateway()29 spaceinfo = SpaceInfoBuilder(configuration, gateway).build()30 expected_summary = get_default_space_info_summary_from_configuration()31 self.assertEqual(spaceinfo.get_summary().get_total(), expected_summary.get_total())32 self.assertEqual(spaceinfo.get_summary().get_available(), expected_summary.get_available())33 self.assertEqual(spaceinfo.get_summary().get_used(), expected_summary.get_used())34 self.assertEqual(spaceinfo.get_summary().get_free(), expected_summary.get_free())35 self.assertEqual(spaceinfo.get_summary().get_unavailable(), expected_summary.get_unavailable())36 self.assertEqual(spaceinfo.get_summary().get_reserved(), expected_summary.get_reserved())37 self.assertEqual(spaceinfo.get_summary().get_busy(), expected_summary.get_busy())...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run prospector automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful