acl = hp.alm2cl(recon_alms,recon_alms) # reconstruction raw autopower xcl = hp.alm2cl(recon_alms,kalms) # cross-power of input and reconstruction icl = hp.alm2cl(kalms,kalms) # autopower of input # Apply mask corrections and add to stats collecter s.add_to_stats('acl',acl/w4) s.add_to_stats('xcl',xcl/w3) s.add_to_stats('icl',icl/w2) # Stack meanfield alms if args.write_meanfield: s.add_to_stack('rmf',recon_alms.real) s.add_to_stack('imf',recon_alms.imag) with io.nostdout(): s.get_stats() s.get_stacks() if rank==0: # Collect statistics and plot with io.nostdout(): acl = s.stats['acl']['mean'] xcl = s.stats['xcl']['mean'] icl = s.stats['icl']['mean'] if args.write_meanfield: mf_alm = s.stacks['rmf'] + 1j*s.stacks['imf'] hp.write_alm(f'{solenspipe.opath}/mf_{args.label}_{args.polcomb}_{isostr}_alm.fits',mf_alm,overwrite=True)
def _init_qests(self): mlist = ['e', 's', 'r'] self.qest = {} tellminY = 500 tellmaxY = 3000 pellminY = 500 pellmaxY = 3000 tellminX = 500 tellmaxX = 3000 pellminX = 500 pellmaxX = 3000 kellmin = 80 kellmax = 3000 self.kellmin = kellmin self.kellmax = kellmax for m in mlist: modlmap_dat = enmap.modlmap(self.shape[m], self.wcs[m]) nT = modlmap_dat.copy() * 0. nP = modlmap_dat.copy() * 0. lbeam = modlmap_dat.copy() * 0. + 1. fMaskCMB_TX = fmaps.mask_kspace(self.shape[m], self.wcs[m], lmin=tellminX, lmax=tellmaxX) fMaskCMB_TY = fmaps.mask_kspace(self.shape[m], self.wcs[m], lmin=tellminY, lmax=tellmaxY) fMaskCMB_PX = fmaps.mask_kspace(self.shape[m], self.wcs[m], lmin=pellminX, lmax=pellmaxX) fMaskCMB_PY = fmaps.mask_kspace(self.shape[m], self.wcs[m], lmin=pellminY, lmax=pellmaxY) fMask = fmaps.mask_kspace(self.shape[m], self.wcs[m], lmin=kellmin, lmax=kellmax) with io.nostdout(): self.qest[m] = Estimator( self.shape[m], self.wcs[m], self.theory, theorySpectraForNorm=None, noiseX2dTEB=[nT, nP, nP], noiseY2dTEB=[nT, nP, nP], fmaskX2dTEB=[fMaskCMB_TX, fMaskCMB_PX, fMaskCMB_PX], fmaskY2dTEB=[fMaskCMB_TY, fMaskCMB_PY, fMaskCMB_PY], fmaskKappa=fMask, kBeamX=lbeam, kBeamY=lbeam, doCurl=False, TOnly=True, halo=True, uEqualsL=True, gradCut=None, verbose=False, bigell=self.lmax)