Exemplo n.º 1
0
 def filt(x):
     return ccg.filters(x, edd_method='sch')
Exemplo n.º 2
0
        ptch = mapp + gmu * srgp  #+nsp
        t0 = time()
        ptch = blocker(ptch, 512, 512)
        btime.append(time() - t0)
        npp = len(ptch)

        for i in range(npp):
            mp = ptch[i]
            for rs in range(4, 8):
                keyn = 'ip{}_ipp{}_c{}_'.format(i_patch, i, rs)
                t0 = time()
                mc = ccg.curvelet(mp, r_scale=rs)
                ctime.append(time() - t0)

                t0 = time()
                m1 = ccg.filters(mc, edd_method='sob')
                m2 = ccg.filters(mc, edd_method='sch')
                ftime.append(time() - t0)
                res[keyn + 'sob'] = np.std(m1)
                res[keyn + 'sch'] = np.std(m2)

    ccg.save(fname, res)

dtt = time() - t00
print(np.mean(btime), np.mean(ctime), np.mean(ftime))
print(100. * np.sum(btime) / dtt, 100. * np.sum(ctime) / dtt,
      100. * np.sum(ftime) / dtt)
exit()
# IN CASE YOU WANT TO RUN IT parallel
#igmu = int(sys.argv[1])
#gmulist = gmulist[igmu:igmu+1]
Exemplo n.º 3
0
tadd = '../data/test_set/healpix_p/'
sim_name = tadd.split('/')[3]
res_add = '../classic/'+sim_name+'/'
ccg.ch_mkdir(res_add)

print('Buiding classical method results:')
for j,gmu in enumerate(gmulist):
    dir_name = '{:3.2e}'.format(gmu)
    add = tadd+dir_name+'/'
    stds = []
    for i in range(480):
        ccg.pop_percent(j*480+i,480*ngmu)
        m = np.load(add+str(i)+'.npy')
        m = ccg.curvelet(m,r_scale = 7)
        m = ccg.filters(m, edd_method = 'sch')
        std = np.std(m)
        stds.append(std)
    np.save(res_add+dir_name,stds)

lst1 = []
for gmu in gmulist:
    file_name = '{:3.2e}'.format(gmu)
    var_file = res_add+file_name+'.npy'
    lst1.append(np.load(var_file))
lst1 = np.array(lst1)    

result = p_value(lst1)
np.save(res_add[:-1],np.array([gmulist,result]))