Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.naic.edu/~phil/hardware/byuPhasedAr/rfischercode/plotposn.py
Дата изменения: Wed Jan 27 16:46:07 2010
Дата индексирования: Sat Jun 26 01:40:23 2010
Кодировка:
import numarray as np
from pgclass import *
pg = PgPlot()
import string as st

def plot_vs_time ( file_name, coord='Azimuth' ) :
fd = file(file_name, 'rb')
lines = fd.readlines()
t = np.zeros(len(lines), type=np.Float64)
posn = np.zeros(len(lines), type=np.Float64)
ii = 0
for i in range(len(lines)) :
line = st.split(lines[i])
azt = st.atof(line[2])
if lines[i][0] != '#' : # and azt > 338.0 :
t[ii] = st.atof(line[1])
ix = 2
if coord != 'Azimuth' :
ix = 3
posn[ii] = st.atof(line[ix])
ii += 1
print 't[0]:', t[0]
t -= t[0]
t *= 86400.0
pg.plot(t[:ii], posn[:ii])
#pl.xlabel('Time in Seconds')
#pl.ylabel(coord + ' in Degrees')

plot_vs_time('log2008_07_29_23:02:01', 'Azimuth')
plot_vs_time('log2008_07_29_23:02:01', 'Elevation')

def plot_azel ( file_name ) :
fd = file(file_name, 'rb')
lines = fd.readlines()
az = np.zeros(len(lines), type=np.Float32)
el = np.zeros(len(lines), type=np.Float32)
ix = 0
for i in range(len(lines)) :
line = st.split(lines[i])
azt = st.atof(line[2])
if lines[i][0] != '#' : # and azt > 338.0 :
az[ix] = st.atof(line[2])
el[ix] = st.atof(line[3])
ix += 1
pg.plot(az[:ix], el[:ix])
#pl.xlabel('Azimuth in Degrees')
#pl.ylabel('Elevation in Degrees')

plot_azel('log2008_07_29_23:02:01')
# 'dec': [27.124075257464423], 'ra': [5.9580942184963135],
#54676.9610796 +++++++++