def run_load_sort(pwd, data_prefix, delete, disk): ## Load the data into AIPS fitld = AIPSTask('FITLD') fitld.datain = pwd + data_prefix + '_1_1.IDI' fitld.outdisk = disk fitld.digicor = -1 fitld.doconcat = 1 fitld.outname = data_prefix fitld.ncount = 3 fitld.go() #Load the TASAV file which contains the pipelined tables fitld = AIPSTask('FITLD') fitld.datain = pwd + data_prefix + '_1.tasav.FITS' fitld.outdisk = disk fitld.digicor = -1 fitld.outname = 'pipe_TSAV' fitld.ncount = 1 fitld.go() #sort the data into time-baseline order uvdata = WizAIPSUVData(data_prefix, 'UVDATA', disk, 1) tasav = WizAIPSUVData('pipe_TSAV', 'TASAV', disk, 1) uvsrt = AIPSTask('UVSRT') uvsrt.indata = uvdata uvsrt.outdata = uvdata uvsrt.sort = 'TB' uvsrt.go() dqual = AIPSTask('DQUAL') dqual.indata = uvdata dqual.fqcenter = -1 dqual.go() if delete == True: uvdata.zap() uvdata = WizAIPSUVData(data_prefix, 'DQUAL', disk, 1) indxr = AIPSTask('INDXR') uvdata.zap_table('CL', 1) indxr.indata = uvdata indxr.cparm[3] = 0.25 indxr.go() if delete == True: uvdata.rename(data_prefix, 'UVDATA', 1) else: uvdata.rename(data_prefix, 'UVDATA', 2)
uvdata = WizAIPSUVData(data_prefix, 'DQUAL', disk, 1) ## redefined as DQUAL makes another copy ## Index the data to make sure tables are in order indxr = AIPSTask('INDXR') uvdata.zap_table( 'CL', 1 ) ## Zap_table command deletes table. Command is of form .zap_table(<table type>,<table number>) and this one deletes the calibration table (CL) number 1 as we want indxr to make a new one with a different time intervals (indxr.cparm[3] = 0.25) indxr.indata = uvdata indxr.cparm[3] = 0.25 ## Some AIPS variables have multiple inputs so need to be a python list or an AIPS list. BUT AIPS in 1 indexed and python is 0 indexed therefore the first value in a list needs to be None. Aips has special ways of doing this as follows e.g. if i want to set cparm 1 2 and 3 all to 0.25 i can either do: # indxr.cparm[1:] = 0.25,0.25,0.25 # indxr.cparm = AIPSList([0.25,0.25,0.25]) indxr.go() if delete == True: uvdata.rename(data_prefix, 'UVDATA', 1) else: uvdata.rename(data_prefix, 'UVDATA', 2) mystep = 2 ## initialise step 2 if the input command was ParselTongue ParselTongue_example.py 2 uvdata = WizAIPSUVData(data_prefix, 'UVDATA', disk, 1) ## This step is for EVN telescope ONLY!!! Just showing as more examples if (mystep in thesteps): print 'Step ', mystep, step_title[mystep] if snedt_amp == 0: uvdata.zap_table('SN', 1) tacop = AIPSTask('TACOP') tacop.indata = tasav tacop.inext = 'SN' tacop.invers = 1