####### Calcul de la covariance par bins nside=128 nbpixok=50 mask=(np.arange(12*nside**2) >= nbpixok) ip=np.arange(12*nside**2) ipok=ip[~mask] lmax=3*nside ell=spectra[0] maskl=ell<(lmax+1) bl=np.ones(maskl.size) reload(qml) allcovth=qml.covth(nside,ipok,lmax,bl,spectra,polar=False,temp=True) ellbins=[0,30,60,90,120,384] allcovth_bins=qml.covth_bins(ellbins,nside,ipok,bl,spectra,polar=False,temp=True) newcovth=np.zeros_like(allcovth) for i in np.arange(len(ellbins)-1): newcovth += allcovth_bins[i,:,:] nstokes=allcovth.shape[0]/nbpixok nn=1 clf() for i in np.arange(nstokes): for j in np.arange(nstokes): subplot(nstokes,nstokes,nn) imshow(allcovth[i*nbpixok:(i+1)*nbpixok,j*nbpixok:(j+1)*nbpixok]-newcovth[i*nbpixok:(i+1)*nbpixok,j*nbpixok:(j+1)*nbpixok],interpolation='nearest') colorbar() nn+=1
plot(ell,np.sqrt(spectra[2]*(ell*(ell+1))/(2*np.pi)),label='$C_\ell^{EE}$') plot(ell,np.sqrt(spectra[3]*(ell*(ell+1))/(2*np.pi)),label='$C_\ell^{BB} (r=0.1)$') yscale('log') xlim(0,600) ylim(0.01,100) xlabel('$\ell$') ylabel('$\sqrt{\ell(\ell+1)C_\ell/(2\pi)}$'+' '+'$[\mu K]$ ') legend(loc='lower right',frameon=False) #### Verification avec un seul bin en ell nside=128 nbpixok=50 mask=(np.arange(12*nside**2) >= nbpixok) ip=np.arange(12*nside**2) ipok=ip[~mask] lmax=3*nside ell=spectra[0] maskl=ell<(lmax+1) bl=np.ones(maskl.size) ellbins=[0,24] ##################### cas polar=True, temp=True, EBTB=False reload(qml) spec_dTE=[ell,ctt*0,cee*0,cbb*0,cte*0+1] cov_dTE=qml.covth_bins(ellbins,nside,ipok,bl,spec_dTE,polar=True,temp=True) np.sum(cov_dTE)
ipok=ip[~mask] lmax=3*nside ell=spectra[0] maskl=ell<(lmax+1) bl=np.ones(maskl.size) ellbins=[0,24] rpix=np.array(hp.pix2vec(nside,ipok)) allcosang=np.dot(np.transpose(rpix),rpix) ##################### cas polar=True, temp=True, EBTB=False reload(qml) dsdcb=qml.compute_ds_dcb(ellbins,nside,ipok,bl,polar=True,temp=True) spec_dTT=[ell,ctt*0+1,cee*0,cbb*0,cte*0] cov_dTT=qml.covth_bins(ellbins,nside,ipok,allcosang,bl,spec_dTT,polar=True,temp=True) spec_dEE=[ell,ctt*0,cee*0+1,cbb*0,cte*0] cov_dEE=qml.covth_bins(ellbins,nside,ipok,allcosang,bl,spec_dEE,polar=True,temp=True) spec_dBB=[ell,ctt*0,cee*0,cbb*0+1,cte*0] cov_dBB=qml.covth_bins(ellbins,nside,ipok,allcosang,bl,spec_dBB,polar=True,temp=True) spec_dTE=[ell,ctt*0,cee*0,cbb*0,cte*0+1] cov_dTE=qml.covth_bins(ellbins,nside,ipok,allcosang,bl,spec_dTE,polar=True,temp=True) clf() subplot(2,2,1) imshow(dsdcb[0,0,:,:]-cov_dTT[0,:,:],interpolation='nearest') subplot(2,2,2) imshow(dsdcb[1,0,:,:]-cov_dEE[0,:,:],interpolation='nearest') subplot(2,2,3) imshow(dsdcb[2,0,:,:]-cov_dBB[0,:,:],interpolation='nearest') subplot(2,2,4)