flat_map = np.ones(Defaults.NPIXEL) / float(Defaults.NPIXEL) pdf_2000 = flat_map*nevts_2000 pdf_10000 = flat_map*nevts_10000 cls_pdf_2000 = hp.sphtfunc.anafast(pdf_2000) cls_pdf_10000 = hp.sphtfunc.anafast(pdf_10000) cls_gg = hp.sphtfunc.anafast(gg_density) cls_pdf_2000[1::2] = cls_pdf_2000[0::2] cls_pdf_2000[1] = cls_pdf_2000[2] cls_pdf_10000[1::2] = cls_pdf_10000[0::2] cls_pdf_10000[1] = cls_pdf_10000[2] syn_maps_2000 = hp_utils.vector_generate_counts_from_pdf(flat_map, nevts_2000, 100) syn_maps_10000 = hp_utils.vector_generate_counts_from_pdf(flat_map, nevts_10000, 100) sigma_maps_2000 = syn_maps_2000.std(0) sigma_maps_10000 = syn_maps_10000.std(0) cls_sigma_maps_2000 = hp.sphtfunc.anafast(sigma_maps_2000) cls_sigma_maps_10000 = hp.sphtfunc.anafast(sigma_maps_10000) w_cross_2000 = hp_utils.vector_cross_correlate_maps(gg_density, syn_maps_2000, Defaults.NCL) w_cross_10000 = hp_utils.vector_cross_correlate_maps(gg_density, syn_maps_10000, Defaults.NCL) w_cross_2000_norm = w_cross_2000 / np.sqrt(cls_sigma_maps_2000 * cls_gg) w_cross_10000_norm = w_cross_10000 / np.sqrt(cls_sigma_maps_10000 * cls_gg) #w_cross_2000_norm = hp_utils.vector_cross_correlate_maps_normed(gg_density, syn_maps_2000, Defaults.NCL)
cl_density = hp.sphtfunc.anafast(gg_density) n_events = np.logspace(1, 7, 13) n_trial = 20 max_map = gg_density * n_events[-1] syn_cls_means = [] syn_cls_stds = [] labels = [] lvals = np.arange(384) for n_evt in n_events: syn_maps = hp_utils.vector_generate_counts_from_pdf( gg_density, n_evt, n_trial) pdf_map = gg_density * n_evt syn_cls = hp_utils.vector_cross_correlate_maps_normed( max_map, syn_maps, Defaults.NCL) syn_cls_means.append(syn_cls.mean(0)) syn_cls_stds.append(syn_cls.std(0)) #pdf_cls = hp.sphtfunc.anafast(pdf_map) #syn_cls_means.append(pdf_cls) #syn_cls_stds.append(pdf_cls*0.1) labels.append("Syn %i" % n_evt) #labels.append("Pdf %i" % n_evt) o_dict = figs.plot_cl("cl", lvals, syn_cls_means, ymax=10.,
gg_density /= gg_density.sum() pdf_2000 = gg_density * rej_map pdf_2000 *= nevts_2000 / pdf_2000.sum() pdf_10000 = gg_density * rej_map pdf_10000 *= nevts_2000 / pdf_10000.sum() cls_pdf_2000 = hp.sphtfunc.anafast(pdf_2000) cls_pdf_10000 = hp.sphtfunc.anafast(pdf_10000) cls_gg = hp.sphtfunc.anafast(gg_density) alm_gg = hp.sphtfunc.map2alm(gg_density) n_trial = 500 syn_maps_2000 = hp_utils.vector_generate_counts_from_pdf( gg_density, nevts_2000, n_trial) syn_maps_10000 = hp_utils.vector_generate_counts_from_pdf( gg_density, nevts_10000, n_trial) alm_2000 = hp_utils.vector_alm_from_overdensity(syn_maps_2000, Defaults.NALM) alm_10000 = hp_utils.vector_alm_from_overdensity(syn_maps_10000, Defaults.NALM) syn_alm_2000 = hp_utils.vector_generate_alm_from_cl(cls_pdf_2000, Defaults.NALM, n_trial) syn_alm_10000 = hp_utils.vector_generate_alm_from_cl(cls_pdf_10000, Defaults.NALM, n_trial) w_cross_2000 = hp_utils.vector_cross_correlate_alms(alm_2000, alm_gg, Defaults.NCL) w_cross_10000 = hp_utils.vector_cross_correlate_alms(alm_10000, alm_gg, Defaults.NCL)