Beispiel #1
0
                           array,
                           coadd=coadd,
                           mask_patch=mask_patch)
        n2d_sim = noise.get_n2d_data(sims,
                                     ivars2,
                                     emask,
                                     coadd_estimator=coadd,
                                     flattened=False,
                                     plot_fname=pout + "_n2d_sim" if
                                     (args.debug and i == 0) else None,
                                     dtype=dm.dtype)
        #n2d_sim = noise.get_n2d_data(sims,ivars2,emask,coadd_estimator=coadd,flattened=True,plot_fname=pout+"_n2d_sim" if (args.debug and i==0) else None,dtype = dm.dtype)
        del sims
        cents, op1ds_sim = noise.get_p1ds(n2d_sim, modlmap, bin_edges)
        p1ds.append(op1ds_sim.copy().reshape(-1))
    p1dstats = stats.get_stats(np.array(p1ds))

    #del covsqrt

    # For verification
    #splits = dm.get_splits(season=args.season,patch=args.patch,arrays=dm.array_freqs[args.array],srcfree=True)
    #splits = dm.get_splits(args.qid)
    splits = enmap.enmap([dm.get_splits(q) for q in qid])
    #splits = np.expand_dims(splits,axis=0)

    if args.extract_mask is not None:
        splits = enmap.extract(splits, eshape, ewcs)

    n2d_data = noise.get_n2d_data(splits,
                                  ivars2,
                                  emask,
Beispiel #2
0
            comm.Recv(rcvInputPowerMat, source=job, tag=i)
            listAllCrossPower[polComb] = np.vstack((listAllCrossPower[polComb],rcvInputPowerMat))
            print(("Waiting for ", job ," ", polComb," auto"))
            comm.Recv(rcvInputPowerMat, source=job, tag=i+80)
            listAllReconPower[polComb] = np.vstack((listAllReconPower[polComb],rcvInputPowerMat))
        

    statsCross = {}
    statsRecon = {}

    pl = Plotter(scaleY='log')
    pl.add(ellkk,Clkk,color='black',lw=2)
    

    for polComb,col in zip(polCombList,colorList):
        statsCross[polComb] = get_stats(listAllCrossPower[polComb])
        pl.addErr(centers,statsCross[polComb]['mean'],yerr=statsCross[polComb]['errmean'],ls="none",marker="o",markersize=8,label="recon x input "+polComb,color=col,mew=2,elinewidth=2)

        statsRecon[polComb] = get_stats(listAllReconPower[polComb])
        fp = interp1d(centers,statsRecon[polComb]['mean'],fill_value='extrapolate')
        pl.add(ellkk,(fp(ellkk))-Clkk,color=col,lw=2)

        Nlkk2d = qest.N.Nlkk[polComb]
        ncents, npow = stats.bin_in_annuli(Nlkk2d, p2d.modLMap, bin_edges)
        pl.add(ncents,npow,color=col,lw=2,ls="--")

        


    avgInputPower  = totAllInputPower/N
    pl.add(centers,avgInputPower,color='cyan',lw=3) # ,label = "input x input"
Beispiel #3
0
    ymap2, cmap2, dmap2, mask2, ras2, decs2, wt2)
if rank == 0:
    print(i2)
    hplot(ystack2, "fig_all_cmass_ystack_%s_%s" % (cversion, 'boss'))
    hplot(cstack2, "fig_all_cmass_cstack_%s_%s" % (cversion, 'boss'))
    hplot(dstack2, "fig_all_cmass_dstack_%s_%s" % (cversion, 'boss'))

    ystack = (ystack1 + ystack2) / (i1 + i2)
    cstack = (cstack1 + cstack2) / (i1 + i2)
    dstack = (dstack1 + dstack2) / (i1 + i2)

    hplot(ystack, "fig_all_cmass_ystack_%s_%s" % (cversion, 'both'))
    hplot(cstack, "fig_all_cmass_cstack_%s_%s" % (cversion, 'both'))
    hplot(dstack, "fig_all_cmass_dstack_%s_%s" % (cversion, 'both'))

    sy1 = stats.get_stats(y1ds1)
    sc1 = stats.get_stats(c1ds1)
    sd1 = stats.get_stats(d1ds1)

    sy2 = stats.get_stats(y1ds2)
    sc2 = stats.get_stats(c1ds2)
    sd2 = stats.get_stats(d1ds2)

    y1 = sy1['mean']
    ey1 = sy1['errmean']

    c1 = sc1['mean']
    ec1 = sc1['errmean']

    d1 = sd1['mean']
    ed1 = sd1['errmean']
Beispiel #4
0
    uicls = putils.allgatherv(uicls, comm)
    uxcls_nobh_1 = putils.allgatherv(uxcls_nobh_1, comm)
    uxcls_nobh_2 = putils.allgatherv(uxcls_nobh_2, comm)
    uacls_nobh = putils.allgatherv(uacls_nobh, comm)
    if bh:
        uxcls_bh_1 = putils.allgatherv(uxcls_bh_1, comm)
        uxcls_bh_2 = putils.allgatherv(uxcls_bh_2, comm)
        uacls_bh = putils.allgatherv(uacls_bh, comm)

if rank == 0:

    with bench.show("Labels"):
        labs = solenspipe.get_labels()

    with bench.show("Stats"):
        suicls = stats.get_stats(uicls)
        suxcls_nobh_1 = stats.get_stats(uxcls_nobh_1)
        suxcls_nobh_2 = stats.get_stats(uxcls_nobh_2)
        suacls_nobh = stats.get_stats(uacls_nobh)
        if bh:
            suxcls_bh_1 = stats.get_stats(uxcls_bh_1)
            suxcls_bh_2 = stats.get_stats(uxcls_bh_2)
            suacls_bh = stats.get_stats(uacls_bh)

    with bench.show("Save"):
        np.save(f'{solenspipe.opath}mean_uicls_{e1}_{e2}.npy', uicls)
        np.save(f'{solenspipe.opath}mean_uxcls_nobh_1_{e1}_{e2}.npy',
                uxcls_nobh_1)
        np.save(f'{solenspipe.opath}mean_uxcls_nobh_2_{e1}_{e2}.npy',
                uxcls_nobh_2)
        np.save(f'{solenspipe.opath}mean_uacls_nobh_{e1}_{e2}.npy', uacls_nobh)