Example #1
0
X, Y, Z = img.get_top(center=(200, 200))
shape0 = X.shape
X, Y, Z = X.flatten(), Y.flatten(), Z.flatten()
ntop = n.array([X, Y, Z])
aa = a.cal.get_aa('psa6622_v001', n.array([.15]))
src = a.fit.RadioFixedBody(0, aa.lat, janskies=0., mfreq=.15, name='test')
# src=a.fit.RadioSpecial("Sun")
nants = 128
dt = 0.001
dt_fine = 43. / 3600 / 24
times_coarse = n.arange(2456240.3, 2456240.4, dt)
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,
Example #2
0
X,Y,Z = img.get_top(center=(200,200))
shape0 = X.shape
X,Y,Z = X.flatten(),Y.flatten(),Z.flatten()
ntop = n.array([X,Y,Z])
aa = a.cal.get_aa('psa6622_v001',n.array([.15]))
src = a.fit.RadioFixedBody(0, aa.lat, janskies=0., mfreq=.15, name='test')
# src=a.fit.RadioSpecial("Sun")
nants = 128
dt = 0.001
dt_fine = 43./3600/24
times_coarse = n.arange(2456240.3,2456240.4, dt)
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'