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' # write result to file and screen
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' # write result to file and screen f1 = open('./Pairing.out', 'a') for j in n.arange(len(pairs_final)):
#times_fine = n.arange(T_files[0],T_files[-1]+dt_file, dt_fine) times_coarse = n.arange(T_files[0], T_files[-1], dt) times_fine = n.arange(T_files[0], T_files[-1], dt_fine) 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, northsouth=False) #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,
#times_coarse = n.arange(T_files[0],T_files[-1]+dt_file, dt) #times_fine = n.arange(T_files[0],T_files[-1]+dt_file, dt_fine) times_coarse = n.arange(T_files[0],T_files[-1], dt) times_fine = n.arange(T_files[0],T_files[-1], dt_fine) 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()
#times_coarse = n.arange(T_files[0],T_files[-1]+dt_file, dt) #times_fine = n.arange(T_files[0],T_files[-1]+dt_file, dt_fine) times_coarse = n.arange(T_files[0],T_files[-1], dt) times_fine = n.arange(T_files[0],T_files[-1], dt_fine) 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, northsouth=False) #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=False) 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()