示例#1
0
    mapi,mapq,mapu=hp.synfast(spectra[1:],nside,fwhm=0,pixwin=True,new=True)
    noisei1=np.random.randn(12*nside**2)*sigI
    noiseq1=np.random.randn(12*nside**2)*sigQU
    noiseu1=np.random.randn(12*nside**2)*sigQU
    noisei2=np.random.randn(12*nside**2)*sigI
    noiseq2=np.random.randn(12*nside**2)*sigQU
    noiseu2=np.random.randn(12*nside**2)*sigQU
    allmapsi1[i,:]=mapi[~mask]+noisei1[~mask]
    allmapsq1[i,:]=mapq[~mask]+noiseq1[~mask]
    allmapsu1[i,:]=mapu[~mask]+noiseu1[~mask]
    allmapsi2[i,:]=mapi[~mask]+noisei2[~mask]
    allmapsq2[i,:]=mapq[~mask]+noiseq2[~mask]
    allmapsu2[i,:]=mapu[~mask]+noiseu2[~mask]

############ Auto
covii=qml.cov_from_maps(allmapsi1,allmapsi1)
coviq=qml.cov_from_maps(allmapsi1,allmapsq1)
coviu=qml.cov_from_maps(allmapsi1,allmapsu1)
covqi=qml.cov_from_maps(allmapsq1,allmapsi1)
covqq=qml.cov_from_maps(allmapsq1,allmapsq1)
covqu=qml.cov_from_maps(allmapsq1,allmapsu1)
covui=qml.cov_from_maps(allmapsu1,allmapsi1)
covuq=qml.cov_from_maps(allmapsu1,allmapsq1)
covuu=qml.cov_from_maps(allmapsu1,allmapsu1)
bigmatmc=np.array([[covii,coviq,coviu],[covqi,covqq,covqu],[covui,covuq,covuu]])
newmatmc=qml.allmat2bigmat(bigmatmc)
clf()
imshow(np.log10(np.abs(newmatmc)),interpolation='nearest')
colorbar()

############ Cross
示例#2
0
mask=(np.arange(12*nside**2) >= nbpixok)

#### maps simulation
nbmc=1000
npix=np.size(where(mask==False))
allmapsi=np.zeros((nbmc,npix))
allmapsq=np.zeros((nbmc,npix))
allmapsu=np.zeros((nbmc,npix))
for i in np.arange(nbmc):
    pyquad.progress_bar(i,nbmc)
    mapi,mapq,mapu=hp.synfast(spectra[1:],nside,fwhm=0,pixwin=True,new=True)
    allmapsi[i,:]=mapi[~mask]
    allmapsq[i,:]=mapq[~mask]
    allmapsu[i,:]=mapu[~mask]

covii=qml.cov_from_maps(allmapsi,allmapsi)
coviq=qml.cov_from_maps(allmapsi,allmapsq)
coviu=qml.cov_from_maps(allmapsi,allmapsu)

covqi=qml.cov_from_maps(allmapsq,allmapsi)
covqq=qml.cov_from_maps(allmapsq,allmapsq)
covqu=qml.cov_from_maps(allmapsq,allmapsu)

covui=qml.cov_from_maps(allmapsu,allmapsi)
covuq=qml.cov_from_maps(allmapsu,allmapsq)
covuu=qml.cov_from_maps(allmapsu,allmapsu)

clf()
subplot(3,3,1)
imshow(covii,interpolation='nearest')
title('II')