Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/asap/tutorials/tutorial2.html
Дата изменения: Unknown Дата индексирования: Wed Dec 26 03:12:19 2007 Кодировка: Поисковые слова: http www.stsci.edu science goods |
x = range(5) # creates a vector of length 5, x = [0,1,2,3,4] len(x) # gives the length of the vector x[0] # gets the first element of the vector x[-1] # gets the last element of the vector
for i in range(5): print i
x = [] # empty for i in range(5): x.append(i*5)
for i in x: print i
Let's say we have three files (a.rpf, b.rpf, c.rpf) which contain
on/off pairs and we want to get the quotients
fnames = ["a.rpf","b.rpf","c.rpf"] # First we set up a vector of filenames vec = [] # a vector to hold the scantables for f in fnames: vec.append(scantable(f)) # fill the vector with scantables
quotients = [] # to hold the quotient scantables for scan in vec: # loop over input scantables quotients.append(scan.auto_quotient()) # add this quotient to the vector
for q in quotients: print q q.auto_poly_baseline(order=1,insitu=True)
av = average_time(quotients)