9 """@module   visaodevices 
   11    The visaodevices python module provides interfaces to all of the scriptable VisAO processes. 
   13    Each process has a class dervied from VisAOFifoDev 
   17 from visaofifos 
import *
 
   22       Class to control the Focus stage. 
   32          Get the current position of the stage. 
   37       return float(ans.rstrip(
'\n\x00'))
 
   41          Abort a move in progress. 
   48    def pos(self, newpos):
 
   50          Move to a new position, specified in microns. 
   53          print 'Must take control of ' + self.
base_name + 
' first.' 
   56       argstr = 
'pos ' + str(newpos)
 
   66          Move to a preset focus position based on the filter selection. 
   69          print 'Must take control of ' + self.
base_name + 
' first.' 
   82          Wait for a move to complete. 
   98       Class to control the ccd47. 
  108          Get the current state of the ccd47 controller. 
  133          n = -1 save continuously 
  138          print 'Must take control of ' + self.
base_name + 
' first.' 
  144       argstr = 
'save ' + str(n)
 
  153          n = -1 save continuously 
  158       return self.
save(n, 0)
 
  163          n = -1 save continuously 
  168          print 'Must take control of ' + self.
base_name + 
' first.' 
  174       argstr = 
'savedark ' + str(n)
 
  182          Wait for a save sequence to complete. 
  198          Change to a new sub-directory for saving. 
  201          print 'Must take control of ' + self.
base_name + 
' first.' 
  203       com = 
"subdir %s" % sd
 
  213          print 'Must take control of ' + self.
base_name + 
' first.' 
  215       com = 
"imtype %s" % it
 
  222          Set ccd 47 accumulator reps 
  224       argstr = 
'reps ' + str(rp)
 
  231          Set ccd 47 exposure time 
  233       argstr = 
'exptime ' + str(et)
 
  240          Get current framerate 
  249          Get current repititions 
  258          Get current subdirectory 
  267          Set the CCD47 program. 
  269          pixrate = integer, the pixel rate.  Must be one of 2500, 250, or 80. 
  270          window = integer, the window size, depending on pixel rate can be 1024, 512, 256, 64,32 
  271          gain = string the gain.  Choices are 'H', 'MH', 'ML', or 'L' 
  272          etime = exposure time, in seconds.  0 is the minimum exposure time for the other settings 
  311       if pset == -1 
or pno == -1 
or pgain == -1:
 
  312          raise "CCD47Ctrl: unknown or unsupported program" 
  315       pstr = 
'set %d %d %d 0' % (pset, pno, pgain)
 
  322          raise "CCD47Ctrl: you do no have SCRIPT control of CCD47" 
  329       print 'CCD47Ctrl: reprogramming little joe' 
  335       print 'CCD47Ctrl: little joe reprogrammed' 
  345       Class to control the a filter wheel.  You should use the FilterWheel2 or FilterWheel3 for a specific device. 
  349          Get the current filter. 
  359          Set filter to filt, moves the wheel. 
  361          filt should exactly match the names of filter used in its conf file (e.g. "SDSS z'") 
  366          print 'Must take control of ' + self.base_name + 
' first.' 
  369       com = 
"filter %s" % filt
 
  382          print 'Must take control of ' + self.base_name + 
' first.' 
  391          Wait for a filter wheel move to complete. 
  408          Wait for a filter wheel home to complete. 
  436       Class to control the FilterWheel2. 
  446       Class to control the FilterWheel2. 
  456       Class to control the Shutter. 
  466          Get the current state of the shutter. 
  470       shutstate = self.
write_fifoch(
'state?').rstrip(
'\n\x00')
 
  471       return int(shutstate[2]+shutstate[3]) 
 
  509    def move_xabs(self, newx):
 
  513       argstr = 
'xabs ' + str(newx)
 
  516       if resp == 
'N' or resp == 
'L' or resp == 
'A':
 
  517         print 'Do not have SCRIPT control of ' + self.
base_name 
  522          print 'Response: ' + resp
 
  527    def move_yabs(self, newy):
 
  531       argstr = 
'yabs ' + str(newy)
 
  534       if resp == 
'N' or resp == 
'L' or resp == 
'A':
 
  535         print 'Do not have SCRIPT control of ' + self.
base_name 
  540          print 'Response: ' + resp
 
  545    def move_xrel(self, dx):
 
  549       argstr = 
'xrel ' + str(dx)
 
  552       if resp == 
'N' or resp == 
'L' or resp == 
'A':
 
  553         print 'Do not have SCRIPT control of ' + self.
base_name 
  558          print 'Response: ' + resp
 
  563    def move_yrel(self, dy):
 
  567       argstr = 
'yrel ' + str(dy)
 
  570       if resp == 
'N' or resp == 
'L' or resp == 
'A':
 
  571         print 'Do not have SCRIPT control of ' + self.
base_name 
  576          print 'Response: ' + resp
 
  587       if resp == 
'N' or resp == 
'L' or resp == 
'A':
 
  588         print 'Do not have SCRIPT control of ' + self.
base_name 
  604       if resp == 
'N' or resp == 
'L' or resp == 
'A':
 
  605         print 'Do not have SCRIPT control of ' + self.
base_name 
  617          Wait for a gimbal move to complete. 
  627       while statx > 0  
or staty > 0:
 
  645          n = -1 save continuously 
  650          print 'Must take control of ' + self.
base_name + 
' first.' 
  653       argstr = 
'save ' + str(n)
 
  661          Wait for a save sequence to complete. 
  677          Change to a new sub-directory for saving. 
  680          print 'Must take control of ' + self.
base_name + 
' first.' 
  682       com = 
"subdir %s" % sd
 
  697          Change to a new sub-directory for saving. 
  700          print 'Must take control of ' + self.
base_name + 
' first.' 
  702       com = 
"subdir %s" % sd
 
def set_program(self, pixrate, window, gain, etime)
 
def set_filter(self, filt)
 
def setup_fifo_names(self)
 
def write_fifoch(self, com)