# Script to plot correlated amplitudes for VGOS data in AIPS # as function of time from AIPS import AIPS from Wizardry.AIPSData import AIPSUVData import numpy as np import sys import matplotlib.pyplot as plt AIPS.userno = 666 uvdata = AIPSUVData('VO0051', 'UVDATA', 1, 1) # Get number of IFs nif=uvdata.header['naxis'][uvdata.header['ctype'].index('IF')] # Get lower-edge frequencies for these IFS freq0=uvdata.header['crval'][uvdata.header['ctype'].index('FREQ')] FQ=uvdata.table('FQ', 1) freqs = (np.array(FQ[0]['if_freq']) + freq0 )/1e6 # Mhz #print freqs # Calculate the channels with pcal signal (need to be removed) pcalch0 = 5- (freqs % 5) - 1 #print pcalch0 pcalch0 = np.round(pcalch0).astype(np.int) #print pcalch0 print "START" ts = [] for row in uvdata:
delay_directory = "./" except KeyError: delay_directory = "./" delays = {} for s in cfg['stations']: filename = delay_directory + '/' + cfg['exper_name'] + '_' + s + '.del' print 'open delay for station ', s, ' : file = ', filename file = open(filename, 'r+') hsize = struct.unpack('i', file.read(4))[0] header = file.read(hsize) delays[s.upper()] = file a = cfg['aips'] AIPS.userno = a['user_nr'] uvdata = AIPSUVData(a['name'].encode('ascii'), a['class'].encode('ascii'), a['disk'], a['seq']) return delays, uvdata def get_cl(uvdata): cl = uvdata.table('CL', 0) nstation = len(uvdata.antennas) #scan = [[[]]*2]*nstation scan = [[[] for j in range(4)] for i in range(nstation)] #pdb.set_trace() cal = [] start_obs = [int(t) for t in uvdata.header.date_obs.split('-')] t0 = datetime.datetime(start_obs[0], start_obs[1], start_obs[2]) time = [cl[0].time] source_old = cl[0].source_id previous_antenna = -1