for task in subtasks:
    task = int(task)

    na, nb, nc, nd = na_list[task], nb_list[task], nc_list[task], nd_list[task]

    win = {}
    win["Ta"] = so_map.read_map("%s/window_%s.fits" % (window_dir, na))
    win["Tb"] = so_map.read_map("%s/window_%s.fits" % (window_dir, nb))
    win["Tc"] = so_map.read_map("%s/window_%s.fits" % (window_dir, nc))
    win["Td"] = so_map.read_map("%s/window_%s.fits" % (window_dir, nd))
    win["Pa"] = so_map.read_map("%s/window_%s.fits" % (window_dir, na))
    win["Pb"] = so_map.read_map("%s/window_%s.fits" % (window_dir, nb))
    win["Pc"] = so_map.read_map("%s/window_%s.fits" % (window_dir, nc))
    win["Pd"] = so_map.read_map("%s/window_%s.fits" % (window_dir, nd))

    coupling = so_cov.cov_coupling_spin0and2_simple(win, lmax, niter=niter)

    analytic_cov = np.zeros((4 * nbins, 4 * nbins))

    # TaTbTcTd
    M_00 = coupling["TaTcTbTd"] * so_cov.chi(na, nc, nb, nd, ns, ps_all,
                                             nl_all, "TTTT")
    M_00 += coupling["TaTdTbTc"] * so_cov.chi(na, nd, nb, nc, ns, ps_all,
                                              nl_all, "TTTT")
    analytic_cov[0 * nbins:1 * nbins,
                 0 * nbins:1 * nbins] = so_cov.bin_mat(M_00, binning_file,
                                                       lmax)

    # TaEbTcEd
    M_11 = coupling["TaTcPbPd"] * so_cov.chi(na, nc, nb, nd, ns, ps_all,
                                             nl_all, "TTEE")
Ejemplo n.º 2
0
for task in subtasks:
    task = int(task)

    na, nb, nc, nd = na_list[task], nb_list[task], nc_list[task], nd_list[task]
    win = {}
    win["Ta"] = so_map.read_map("%s/window_T_%s-hm1.fits" % (windows_dir, na))
    win["Tb"] = so_map.read_map("%s/window_T_%s-hm2.fits" % (windows_dir, nb))
    win["Tc"] = so_map.read_map("%s/window_T_%s-hm1.fits" % (windows_dir, nc))
    win["Td"] = so_map.read_map("%s/window_T_%s-hm2.fits" % (windows_dir, nd))
    win["Pa"] = so_map.read_map("%s/window_P_%s-hm1.fits" % (windows_dir, na))
    win["Pb"] = so_map.read_map("%s/window_P_%s-hm2.fits" % (windows_dir, nb))
    win["Pc"] = so_map.read_map("%s/window_P_%s-hm1.fits" % (windows_dir, nc))
    win["Pd"] = so_map.read_map("%s/window_P_%s-hm2.fits" % (windows_dir, nd))

    coupling = so_cov.cov_coupling_spin0and2_simple(win,
                                                    lmax,
                                                    niter=niter,
                                                    planck=True)
    analytic_cov = np.zeros((4 * nbins, 4 * nbins))

    # TaTbTcTd
    M_00 = coupling["TaTcTbTd"] * so_cov.chi(na, nc, nb, nd, ns, l, ps_all,
                                             nl_all, "TTTT")
    M_00 += coupling["TaTdTbTc"] * so_cov.chi(na, nd, nb, nc, ns, l, ps_all,
                                              nl_all, "TTTT")
    analytic_cov[0 * nbins:1 * nbins,
                 0 * nbins:1 * nbins] = so_cov.bin_mat(M_00, binning_file,
                                                       lmax)

    # TaEbTcEd
    M_11 = coupling["TaTcPbPd"] * so_cov.chi(na, nc, nb, nd, ns, l, ps_all,
                                             nl_all, "TTEE")
Ejemplo n.º 3
0
    print("cov element (%s x %s, %s x %s)" % (na_r, nb_r, nc_r, nd_r))

    win = {}

    win["Ta"] = so_map.read_map(d["window_T_%s" % na_r])
    win["Tb"] = so_map.read_map(d["window_T_%s" % nb_r])
    win["Tc"] = so_map.read_map(d["window_T_%s" % nc_r])
    win["Td"] = so_map.read_map(d["window_T_%s" % nd_r])
    win["Pa"] = so_map.read_map(d["window_pol_%s" % na_r])
    win["Pb"] = so_map.read_map(d["window_pol_%s" % nb_r])
    win["Pc"] = so_map.read_map(d["window_pol_%s" % nc_r])
    win["Pd"] = so_map.read_map(d["window_pol_%s" % nd_r])

    coupling = so_cov.cov_coupling_spin0and2_simple(win,
                                                    lmax,
                                                    niter=niter,
                                                    l_exact=l_exact,
                                                    l_band=l_band,
                                                    l_toep=l_toep)

    try:
        mbb_inv_ab, Bbl_ab = so_mcm.read_coupling(prefix="%s/%sx%s" %
                                                  (mcms_dir, na_r, nb_r),
                                                  spin_pairs=spin_pairs)
    except:
        mbb_inv_ab, Bbl_ab = so_mcm.read_coupling(prefix="%s/%sx%s" %
                                                  (mcms_dir, nb_r, na_r),
                                                  spin_pairs=spin_pairs)

    try:
        mbb_inv_cd, Bbl_cd = so_mcm.read_coupling(prefix="%s/%sx%s" %
                                                  (mcms_dir, nc_r, nd_r),
Ejemplo n.º 4
0
        for name1, id1 in zip(name_list, id_list):
            for name2, id2 in zip(name_list, id_list):
                spec = id1[0] + id2[0]
                Clth_dict[id1 +
                          id2] = ps_theory[spec] + nl_th[spec] * so_cov.delta2(
                              name1, name2)

        window = so_map.read_map("%s/window_%s_%s.fits" %
                                 (window_dir, scan, run))

        mbb_inv, Bbl = so_mcm.read_coupling(prefix="%s/%s_%s" %
                                            (mcm_dir, scan, run),
                                            spin_pairs=spin_pairs)

        coupling_dict = so_cov.cov_coupling_spin0and2_simple(window,
                                                             lmax,
                                                             niter=niter,
                                                             planck=False)
        analytic_cov = so_cov.cov_spin0and2(Clth_dict, coupling_dict,
                                            binning_file, lmax, mbb_inv,
                                            mbb_inv)

        fsky[scan, run], quick_cov = SO_noise_utils.quick_analytic_cov(
            lth, Clth_dict, window, binning_file, lmax)

        np.save("%s/analytic_cov_%s_%s.npy" % (cov_dir, scan, run),
                analytic_cov)
        np.save("%s/quick_cov_%s_%s.npy" % (cov_dir, scan, run), quick_cov)

for run in runs:
    print("")
    for scan in scan_list: