Planck = {'name': 'Planck',
'do_cib': 1, 'do_tsz': 1, 'do_cibxtsz': 1,
'freq_cib': [100., 143., 217., 353., 545., 857.],
'cc': np.array([1.076, 1.017, 1.119, 1.097, 1.068, 0.995, 0.960]),
'cc_cibmean': np.array([1.076, 1.017, 1.119, 1.097, 1.068, 0.995, 0.960]),
'freq_cibmean': np.array([100., 143., 217., 353., 545., 857.]),
'fc': np.ones(7),
}
from matplotlib.lines import Line2D
cl_cib_cib = class_sz.cl_cib_cib()
freq = ['100', '143', '217', '353', '545', '857']
# freq = ['545']
# nu1, nu2 = 4, 4
# plot_Cell(ell, cl1h_cib, cl2h_cib, nu1, nu2, freq, 'CIB')
# two_halo = cl2h_cib
# one_halo = cl1h_cib
faccib = 1.
# plot_dim = int(1/2*(-1 + np.sqrt(1 + 8*len(freq))))
plot_dim = len(freq)
fig, axes = plt.subplots(figsize=(19, 19),
sharex=True,
#sharey=True,
ncols=plot_dim,
nrows=plot_dim)
plt.subplots_adjust(left=0.1,
bottom=0.1,
right=0.9,
top=0.9,
wspace=0.0,
hspace=0.0)
for i in range(plot_dim):
for j in range(plot_dim):
if i==0 and j==(plot_dim-1):
ax = axes[i, j]
custom_lines = [Line2D([0], [0], color='k', lw=2,ls='-.'),
Line2D([0], [0], color='k', lw=2,ls='--'),
Line2D([0], [0], color='k', lw=2,ls='-')]
ax.legend(custom_lines, ['CLASS_SZ 1h', 'CLASS_SZ 2h','CLASS_SZ 1+2h'],
fontsize=18,frameon=False)
# ax.legend()
ax.axis('off')
elif i<j:
axes[i, j].axis('off')
else:
ax = axes[i, j]
freqs = freq[i]
freqsp = freq[j]
nu1 = i
nu2 = j
faccib = Planck['cc'][i]*Planck['cc'][j]
# ax.set_title(freqs+'x'+freqsp,size=9)
if j==0:
# ax.set_ylabel(r'$\mathrm{C_l}\: [\mathrm{Jy}^2\: \mathrm{sr}^{-1}]$', fontsize=12)
ax.set_ylabel(freqs, fontsize=25)
if i==(plot_dim-1):
# ax.set_xlabel(r'$\;\ell$', fontsize=12)
ax.set_xlabel(freqsp, fontsize=25)
ax.tick_params(axis = 'x',which='both',length=5,direction='in', pad=10)
ax.tick_params(axis = 'y',which='both',length=5,direction='in', pad=5)
ax.xaxis.set_ticks_position('both')
ax.yaxis.set_ticks_position('both')
plt.setp(ax.get_yticklabels(), rotation='horizontal', fontsize=18)
plt.setp(ax.get_xticklabels(), fontsize=18)
ax.grid( visible=True, which="both", alpha=0.2, linestyle='--')
# ax.plot(ell, np.abs(total[nu1, nu2, :]), 'b', label='total')
l = np.asarray(cl_cib_cib[freqs+'x'+freqs]['ell'])
ax.plot(l,cl_cib_cib[freqs+'x'+freqsp]['1h']/l_to_dl(l)*faccib+cl_cib_cib[freqs+'x'+freqsp]['2h']/l_to_dl(l)*faccib*0.,ls='-.',c='k',label='class_sz 1h ')
ax.plot(l,cl_cib_cib[freqs+'x'+freqsp]['1h']/l_to_dl(l)*faccib*0.+cl_cib_cib[freqs+'x'+freqsp]['2h']/l_to_dl(l)*faccib,ls='--',c='k',label='class_sz 2h ')
ax.plot(l,cl_cib_cib[freqs+'x'+freqsp]['1h']/l_to_dl(l)*faccib+cl_cib_cib[freqs+'x'+freqsp]['2h']/l_to_dl(l)*faccib,ls='-',c='k',label='class_sz 1+2h ')
ax.set_xscale("log")
ax.set_yscale("log")
ax.set_xlim(20,50000)
if freqs=='100' and freqsp=='100':
ax.set_ylim(5e-3,5)
if freqs=='143' and freqsp=='100':
ax.set_ylim(1e-2,2e1)
if freqs=='217' and freqsp=='100':
ax.set_ylim(1e-1,5e1)
if freqs=='353' and freqsp=='100':
ax.set_ylim(1e-1,3e2)
if freqs=='545' and freqsp=='100':
ax.set_ylim(1e0,6e2)
if freqs=='857' and freqsp=='100':
ax.set_ylim(1e0,2e3)
if freqs=='143' and freqsp=='143':
ax.set_ylim(1e-1,7e1)
if freqs=='217' and freqsp=='143':
ax.set_ylim(5e-1,2e2)
if freqs=='353' and freqsp=='143':
ax.set_ylim(2e0,6e2)
if freqs=='545' and freqsp=='143':
ax.set_ylim(7e0,2e3)
if freqs=='857' and freqsp=='143':
ax.set_ylim(1e1,5e3)
if freqs=='217' and freqsp=='217':
ax.set_ylim(5e-1,2e3)
if freqs=='353' and freqsp=='217':
ax.set_ylim(2e0,6e3)
if freqs=='545' and freqsp=='217':
ax.set_ylim(7e0,2e4)
if freqs=='857' and freqsp=='217':
ax.set_ylim(1e1,5e4)
if freqs=='353' and freqsp=='353':
ax.set_ylim(2e1,1e4)
if freqs=='545' and freqsp=='353':
ax.set_ylim(7e1,2e5)
if freqs=='857' and freqsp=='353':
ax.set_ylim(1e2,5e5)
if freqs=='545' and freqsp=='545':
ax.set_ylim(7e1,2e5)
if freqs=='857' and freqsp=='545':
ax.set_ylim(1e2,5e5)
if freqs=='857' and freqsp=='857':
ax.set_ylim(1e2,5e5)
fig.suptitle('CIB Power Spectra at the Planck Frequencies',fontsize=20)
fig.tight_layout()
# plt.savefig('maniyar_benchmark.pdf')