Beispiel #1
0
def rd_tsys_multi(trange):
    ''' Given a timerange (2-element Time() array), dump and
        return the tsys data for all IDB files in that timerange.
    '''
    # Just call dump_tsys to create the xt*.txt and yt*.txt files
    dtsys.dump_tsys(trange)
    time.sleep(3)
    # Now call the offline routine
    return offline.rd_tsys_multi(trange)
Beispiel #2
0
def rd_tsys_multi(trange):
 
    ''' Given a timerange (2-element Time() array), dump and
        return the tsys data for all IDB files in that timerange.
    '''
    # Just call dump_tsys to create the xt*.txt and yt*.txt files
    dtsys.dump_tsys(trange)
    time.sleep(3)
    # Now call the offline routine
    return offline.rd_tsys_multi(trange)
Beispiel #3
0
def dmp_tsys(t):
    ''' Given a start time as a Time() object t, find and dump the
        corresponding tsys values using Miriad (note that this only works
        on dpp or pipeline).  Returns the filenames of the files created.
    '''
    import socket, time
    import dump_tsys as dtsys

    hostname = socket.gethostname()
    if hostname != 'dpp' and hostname != 'pipeline':
        print 'Error: Cannot run dump_tsys() on host:',hostname
        return
    tnow = util.Time.now()
    t1 = t.lv - 10.   # 10 s before given time
    t2 = t.lv + 300.  # 300 s after given time
    trange = util.Time([t1,t2],format='lv')
    dtsys.dump_tsys(trange)
    # Check that the dump worked (wait 2 s for data)
    time.sleep(2)
    filestem ='t'+t.iso.replace('-','').replace(':','').replace(' ','')[:12]+'*.txt'
    xfiles = dtsys.glob.glob('/common/tmp/txt/x'+filestem)
    yfiles = dtsys.glob.glob('/common/tmp/txt/y'+filestem)
    return xfiles,yfiles