Example #1
0
times_fine = n.arange(2456240.3,2456240.4, dt_fine)
dist = 1.                           # size of cells to store in dictionary.
corr_tol = 5000.                    # cutoff of minimum correlation
bmp  = export_beam.beam_real(aa[0], ntop, shape0, 'x')
freq, fbmamp = export_beam.beam_fourier(bmp, d, 400)
print 'Time to initialize:', sys_time.clock(), 'seconds'

d = select_pair.pair_coarse(aa, src,times_coarse,dist,2.)  #coarsely determine crossings
print 'Time after coarse selection:', sys_time.clock(), 'seconds'
# pairs_sorted = select_pair.pair_sort(d,freq,fbmamp)        # sort crossings
# clos_app = select_pair.get_closest(pairs_sorted)           # determine closest approach points
nproc = 4
nkey = len(d)
chunk,remainder = nkey/nproc, nkey%nproc

clos_app = select_pair.alter_clos(d,freq,fbmamp)            # determine closest approach points
print 'Found closest approach points after:', sys_time.clock(), 'seconds'
pairs_final = select_pair.pair_fin(clos_app,dt,aa,src,freq,fbmamp,corr_tol)  # output final sorted pairs
print 'Total time:', sys_time.clock(), 'seconds'

# write result to file and screen
f1 = open('./Pairing.out', 'a')
for j in n.arange(len(pairs_final)):
    # print pairs_final[j]
    f1.write(str(pairs_final[j])+'\n')
f1.close()

# call plotting routines
figname = './corr'+str(int(corr_tol))+'.png'
plot_pair.plot_closapp(clos_app,corr_tol,figname)
pair_xampl = select_pair.test_sample(pairs_final,dt,aa,src,freq,fbmamp,3000.)
Example #2
0
dist = 1.  # size of cells to store in dictionary.
corr_tol = 5000.  # cutoff of minimum correlation
bmp = export_beam.beam_real(aa[0], ntop, shape0, 'x')
freq, fbmamp = export_beam.beam_fourier(bmp, d, 400)
print 'Time to initialize:', sys_time.clock(), 'seconds'

d = select_pair.pair_coarse(aa, src, times_coarse, dist,
                            2.)  #coarsely determine crossings
print 'Time after coarse selection:', sys_time.clock(), 'seconds'
# pairs_sorted = select_pair.pair_sort(d,freq,fbmamp)        # sort crossings
# clos_app = select_pair.get_closest(pairs_sorted)           # determine closest approach points
nproc = 4
nkey = len(d)
chunk, remainder = nkey / nproc, nkey % nproc

clos_app = select_pair.alter_clos(d, freq,
                                  fbmamp)  # determine closest approach points
print 'Found closest approach points after:', sys_time.clock(), 'seconds'
pairs_final = select_pair.pair_fin(clos_app, dt, aa, src, freq, fbmamp,
                                   corr_tol)  # output final sorted pairs
print 'Total time:', sys_time.clock(), 'seconds'

# write result to file and screen
f1 = open('./Pairing.out', 'a')
for j in n.arange(len(pairs_final)):
    # print pairs_final[j]
    f1.write(str(pairs_final[j]) + '\n')
f1.close()

# call plotting routines
figname = './corr' + str(int(corr_tol)) + '.png'
plot_pair.plot_closapp(clos_app, corr_tol, figname)
Example #3
0
nants = len(aa)
bmp_list  = export_beam.beam_real(aa[0], ntop, shape0, 'x')

for ni in range(len(list_freq)):
    bmp = bmp_list[ni]
    freq, fbmamp = export_beam.beam_fourier(bmp, sp, 400)
    bm_intpl = export_beam.beam_interpol(freq,fbmamp,'cubic')
    print 'Time to initialize:', sys_time.clock(), 'seconds'
    print 'fbmampshape, midval', fbmamp.shape, fbmamp[200][200]

    d = select_pair.pair_coarse(aa, src,times_coarse,dist,False, 0.1, True)  #coarsely determine crossings
    print 'Time after coarse selection:', sys_time.clock(), 'seconds'
    #pairs_sorted = select_pair.pair_sort(d,freq,fbmamp)        #sort crossings
    #clos_app = select_pair.get_closest(pairs_sorted)           #determine closest approach points
    clos_app = select_pair.alter_clos(d,bm_intpl)            #determine closest approach points
    print 'Found closest approach points after:', sys_time.clock(), 'seconds'
    pairs_final = select_pair.pair_fin(clos_app,dt_fine,aa,src,freq,fbmamp,multweight=True,noiseweight=True,ovlpweight=True,puv=True)
    print 'Total time:', sys_time.clock(), 'seconds'

    #write result to file and screen
    Oname = './P'+str(n.around(list_freq[ni],decimals=3))+'.out'
    Cname = './P'+str(n.around(list_freq[ni],decimals=3))+'.cue'
    f1 = open(Oname, 'w')
    f1.close()
    f1 = open(Cname, 'w')
    f1.close()
    print "Writting ourput files", Oname, Cname
    f1 = open(Oname, 'a')
    for j in n.arange(len(pairs_final)):
        #print pairs_final[j]