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)
Esempio n. 2
0
    assert ([3, 'AIPS CL'] in uvdata.tables)
    assert ([1, 'AIPS CL'] not in uvdata.tables)

    tacop = AIPSTask('tacop')
    tacop.indata = uvdata
    tacop.outdata = uvdata
    tacop.inext = 'CL'
    tacop.invers = 3
    tacop.outvers = 5
    tacop()

    uvdata2 = WAIPSUVData(uvdata.name, uvdata.klass, uvdata.disk, uvdata.seq)

    assert ([5, 'AIPS CL'] in uvdata2.tables)

    uvdata2.zap_table('CL', 0)

    assert ([5, 'AIPS CL'] not in uvdata2.tables)
    assert ([3, 'AIPS CL'] in uvdata2.tables)
    assert ([1, 'AIPS CL'] not in uvdata2.tables)

    count = 0
    for cl in uvdata2.table('CL', 3):
        count += 1
        continue
    assert (count > 0)

finally:
    uvdata.zap()
Esempio n. 3
0
    ## dont worry about this
    dqual = AIPSTask('DQUAL')
    dqual.indata = uvdata
    dqual.fqcenter = -1
    dqual.go()
    if delete == True:
        uvdata.zap(
        )  ### zap command deletes files in AIPS so be careful! e.g. this one will delete WizAIPSUVData(data_prefix,'UVDATA',disk,1)
    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)
Esempio n. 4
0
    assert([3, 'AIPS CL'] in uvdata.tables)
    assert([1, 'AIPS CL'] not in uvdata.tables)

    tacop = AIPSTask('tacop')
    tacop.indata = uvdata
    tacop.outdata = uvdata
    tacop.inext = 'CL'
    tacop.invers = 3
    tacop.outvers = 5
    tacop()

    uvdata2 = WAIPSUVData(uvdata.name, uvdata.klass, uvdata.disk, uvdata.seq)

    assert([5, 'AIPS CL'] in uvdata2.tables)

    uvdata2.zap_table('CL', 0)

    assert([5, 'AIPS CL'] not in uvdata2.tables)
    assert([3, 'AIPS CL'] in uvdata2.tables)
    assert([1, 'AIPS CL'] not in uvdata2.tables)

    count = 0
    for cl in uvdata2.table('CL', 3):
        count += 1
        continue
    assert(count > 0)

finally:
    uvdata.zap()