def add_spectra(tmap, emap, bmap, deconv): cmb_dict = {'t': tmap, 'e': emap, 'b': bmap} #polcombs = ['tt', 'te', 'ee', 'bb', 'pp'] #polcombs = ['ee'] polcombs = ['tt'] global lbin if not deconv: for polcomb in polcombs: if polcomb in ['pp']: continue emap1 = cmb_dict[polcomb[0]] emap2 = cmb_dict[polcomb[1]] print('[add_spectra]:', polcomb) l, cl = power.get_raw_power(emap1, emap2=emap2, lmax=lmax, normalize=False) lbin, clbin = binner.binned(l, cl) st.add_to_stats('dl%s_raw' % polcomb, cl2dl(lbin, clbin)) theo_idx = 'cl%s' % polcomb frac_diff = (clbin - theo_bin[theo_idx]) / theo_bin[theo_idx] st.add_to_stats('frac%s_raw' % polcomb, frac_diff) else: fsky = np.sum(taper) / taper.size print(fsky) for polcomb in polcombs: if polcomb in ['ee', 'eb', 'bb', 'pp']: continue emap1 = cmb_dict[polcomb[0]] emap2 = cmb_dict[polcomb[1]] print('[add_spectra]:', polcomb) l, cl = cusps_fc.get_power(emap1, emap2=emap2, polcomb=polcomb.upper()) #cl /= 0.669 lbin, clbin = binner.binned(l, cl) clbin /= fsky st.add_to_stats('dl%s_deconv' % polcomb, cl2dl(lbin, clbin)) theo_idx = 'cl%s' % polcomb frac_diff = (clbin - theo_bin[theo_idx]) / theo_bin[theo_idx] st.add_to_stats('frac%s_deconv' % polcomb, frac_diff) if 'pp' in polcombs: print('[add_spectra]:', 'pp') lbin, clee, cleb, clbb = cusps_fc.get_pureeb_power(emap, bmap) st.add_to_stats('dlee_deconv', cl2dl(lbin, clee)) st.add_to_stats('dleb_deconv', cl2dl(lbin, cleb)) st.add_to_stats('dlbb_deconv', cl2dl(lbin, clbb)) theo_idx = 'clee' frac_diff = (clbin - theo_bin[theo_idx]) / theo_bin[theo_idx] st.add_to_stats('frac%s_deconv' % 'ee', frac_diff) theo_idx = 'clbb' frac_diff = (clbin - theo_bin[theo_idx]) / theo_bin[theo_idx] st.add_to_stats('frac%s_deconv' % 'bb', frac_diff)
(sim_idx, coords_str)), down=3) if plot_only: continue cmb_dict = {'t': tmap, 'e': emap, 'b': bmap} # take take tt and te spectra for polcomb in polcombs: if polcomb in ['ee', 'eb', 'bb', 'pp']: continue if st.has_data('frac%s_deconv' % polcomb, sim_idx): continue emap1 = cmb_dict[polcomb[0]] emap2 = cmb_dict[polcomb[1]] log.info('[add_spectra]: ' + polcomb) l, cl = cusps_fc.get_power(emap1, emap2=emap2, polcomb=polcomb.upper()) lbin, clbin = binner.bin(l, cl) st.add_data('dl%s_deconv' % polcomb, sim_idx, cl2dl(lbin, clbin)) theo_idx = 'cl%s' % polcomb frac_diff = (clbin - theo_bin[theo_idx]) / theo_bin[theo_idx] st.add_data('frac%s_deconv' % polcomb, sim_idx, frac_diff) # take pol spectra if 'pp' in polcombs: if st.has_data('fracbb_deconv', sim_idx): continue log.info('[add_spectra]:' + ' pp') lbin, clee, cleb, clbb = cusps_fc.get_power_pureeb(emap, bmap) st.add_data('dlee_deconv', sim_idx, cl2dl(lbin, clee)) st.add_data('dleb_deconv', sim_idx, cl2dl(lbin, cleb)) st.add_data('dlbb_deconv', sim_idx, cl2dl(lbin, clbb))