def track_source(source, site, p, aznow, elnow, azcount, elcount, tracktime=2 / 60.0):
    site = set_site(p)
    object = sources.set_object(source)
    timeout = time.time() + 60 * tracktime
    while 1:
        [az, el] = source_azel(object, site)
        [aznow, elnow, azcount, elcount, p.azatstow, p.elatstow] = cmd_azel(az, el, azcount, elcount, aznow, elnow)
        time.sleep(2)
        if time.time() > timeout:
            break
    return [aznow, elnow, azcount, elcount, p.azatstow, p.elatstow]
def track_source(source,
                 site,
                 p,
                 aznow,
                 elnow,
                 azcount,
                 elcount,
                 tracktime=2 / 60.):
    site = set_site(p)
    object = sources.set_object(source)
    timeout = time.time() + 60 * tracktime
    while (1):
        [az, el] = source_azel(object, site)
        [aznow, elnow, azcount, elcount, p.azatstow,
         p.elatstow] = cmd_azel(az, el, azcount, elcount, aznow, elnow)
        time.sleep(2)
        if (time.time() > timeout):
            break
    return [aznow, elnow, azcount, elcount, p.azatstow, p.elatstow]
Beispiel #3
0
        print 'Please specify a folder to store data.\n'
        print 'Run with the -h flag to see all options.\n'
        print 'Exiting.'
        sys.exit()
    else:
        folder = args[0]
        
    # Check if specified folder exists
    if not os.path.exists(folder):
        os.makedirs(folder)

    ant = srt.SRT(opts.ant)
        
    # Set source to observe
    #source = srt1.sources.set_object(opts.source)
    source = sources.set_object(opts.source)
    
    # Initialize the Signal Hound
    sh = SHManager.SHManager()
    sh.set_bw(opts.bw)
    
    # First scan in azimuth
    sh.set_file_name('{0}/sun_AZ.txt'.format(folder))
    offsets_l = [(i,0) for i in range(-12, -5)]
    offsets_c = [(0.2*i,0) for i in range(-25, 25)]
    offsets_r = [(i,0) for i in range(5, 12)]
    offsets = offsets_l + offsets_c + offsets_r
    source_scan(ant, source, offsets, det=sh, itime=opts.inttime)
    
    # Then scan in elevation
    sh.set_file_name('{0}/sun_EL.txt'.format(folder))