示例#1
0
 def __init__(self,port='/dev/ttyS0'):
     Pyro.core.ObjBase.__init__(self)
     self.valon = Synthesizer(port)
     self.vs = vegas_status()
     self.dbuf2 = vegas_databuf(2)
     self.dbuf3 = vegas_databuf(3)        
     self.running = True
示例#2
0
 def __init__(self, port='/dev/ttyS0'):
     Pyro.core.ObjBase.__init__(self)
     self.valon = Synthesizer(port)
     self.vs = vegas_status()
     self.dbuf2 = vegas_databuf(2)
     self.dbuf3 = vegas_databuf(3)
     self.running = True
            stdscr.addstr(curline, col, "%8s : " % "NDROP", keycol)
            stdscr.addstr("%s" % ndrop, valcol)

        # Bottom info line
        stdscr.addstr(ymax-2,col,"Last update: " + time.asctime() \
                + "  -  Press 'q' to quit")

        # Redraw screen
        stdscr.refresh()

        # Sleep a bit
        time.sleep(0.25)

        # Look for input
        c = stdscr.getch()
        while (c != curses.ERR):
            if (c == ord('q')):
                run = 0
            c = stdscr.getch()


# Connect to vegas status, data bufs
g = vegas_status()
d = vegas_databuf()

# Wrapper calls the main func
try:
    curses.wrapper(display_status, g, d)
except KeyboardInterrupt:
    print "Exiting..."
        # Look for input
        c = stdscr.getch()
        while (c != curses.ERR):
            if (c==ord('q')):
                run = 0
            c = stdscr.getch()

# Get instance_id
try:
    instance_id = int(argv[1])
except:
    instance_id = 0

# Connect to vegas status, data bufs
try:
    g = vegas_status(instance_id)
except:
    print "Error connecting to status buffer for instance %d" % instance_id
    exit(1)
try:
    d = vegas_databuf()
except:
    print "Error connecting to data buffer for instance %d" % instance_id
    exit(1)

# Wrapper calls the main func
try:
    curses.wrapper(display_status,g,instance_id,d)
except KeyboardInterrupt:
    print "Exiting..."
except:
            stdscr.addstr("%s" % ndrop, valcol)

        # Bottom info line
        stdscr.addstr(ymax-2,col,"Last update: " + time.asctime() \
                + "  -  Press 'q' to quit")

        # Redraw screen
        stdscr.refresh()

        # Sleep a bit
        time.sleep(0.25)

        # Look for input
        c = stdscr.getch()
        while (c != curses.ERR):
            if (c==ord('q')):
                run = 0
            c = stdscr.getch()

# Connect to vegas status, data bufs
g = vegas_status()
d = vegas_databuf()

# Wrapper calls the main func
try:
    curses.wrapper(display_status,g,d)
except KeyboardInterrupt:
    print "Exiting..."


示例#6
0
    #print "Block %2d, poln '%s': Max chan=%d freq=%.3fMHz value=%.3f" %\
    #      (curblock, polns[poln], idx, freqs[idx], main_spec[idx]) 
    fig.canvas.restore_region(background)
    ax.draw_artist(main_line)
    ax.draw_artist(max_line)
    ax.draw_artist(min_line)
    fig.canvas.blit(ax.bbox)
    #time.sleep(delay)
    return True

# Print the usage
usage()

# Get all of the useful values
# get instance_id somehow
g = vegas_status(instance_id)
g.read()
nchan = g["OBSNCHAN"]
npoln = g["NPOL"]
BW = g["OBSBW"]
fctr = g["OBSFREQ"]
bins = n.arange(nchan)
freqs = bins/float(nchan)*BW + (fctr-0.5*BW)

# Sum different amount depending on nchan
nspec_sum = 512 * 2048 / nchan

# Access the data buffer
d = vegas_databuf()
data = d.data(0) # argument is the block in the data buffer
#d.dtype = n.uint8