Exemplo n.º 1
0
class LNAScanner(Mover):
    def __init__(self, address='GPIB0::16'):
        self.device = LockIn(address)
        self.pos = {
            'x': self.device.query('DAC. ' + str(self.device.aidmap['x'])),
            'y': self.device.query('DAC. ' + str(self.device.aidmap['y']))
        }

    devicetype = 's'
    tests = {
        's': [[['xt', 'xf', 'yf', 'yt'], [0, 10],
               'X/Y range(s) out of bounds'],
              [['xv', 'yv'], [0, 1], 'X/Y step size out of bounds']]
    }

    def setDefaults(self, stepx, stepy):
        self.stepdict = {'x': stepx, 'y': stepy}

    def getPos(self, axis=None):
        if axis != None:
            return self.pos[axis]
        else:
            return self.pos

    def moveUp(self, axis):
        self.pos[axis] += self.stepdict[axis]
        self.device.rawmove('DAC. ' + str(self.device.aidmap[axis]) + " %.3f" %
                            (self.pos[axis]))
        return True

    def moveDown(self, axis):
        self.pos[axis] -= self.stepdict[axis]
        self.device.rawmove('DAC. ' + str(self.device.aidmap[axis]) + " %.3f" %
                            (self.pos[axis]))
        return True

    def moveTo(self, axis, position):
        self.device.move(axis, position)
        self.pos[axis] = position
        return True

    def close(self):
        self.device.close()
Exemplo n.º 2
0
class LNAScanner(Mover):
	def __init__(self,address='GPIB0::16'):
		self.device = LockIn(address)
		self.pos = {'x':self.device.query('DAC. '+str(self.device.aidmap['x'])),
					'y':self.device.query('DAC. '+str(self.device.aidmap['y']))}

	devicetype = 's'
	tests = {'s':	[[['xt','xf','yf','yt'],[0,10],'X/Y range(s) out of bounds'],
					  		[['xv','yv'],[0,1],'X/Y step size out of bounds']]}
					  		
	def setDefaults(self,stepx,stepy):
		self.stepdict = {'x':stepx,'y':stepy}

	def getPos(self,axis=None):
		if axis != None:
			return self.pos[axis]
		else:
			return self.pos

	def moveUp(self,axis):
		self.pos[axis] += self.stepdict[axis]
		self.device.rawmove('DAC. '+str(self.device.aidmap[axis])+" %.3f" % (self.pos[axis]))
		return True

	def moveDown(self,axis):
		self.pos[axis] -= self.stepdict[axis]
		self.device.rawmove('DAC. '+str(self.device.aidmap[axis])+" %.3f" % (self.pos[axis]))
		return True

	def moveTo(self,axis,position):
		self.device.move(axis,position)
		self.pos[axis] = position
		return True

	def close(self):
		self.device.close()
Exemplo n.º 3
0
 def __init__(self, address='GPIB0::16'):
     self.device = LockIn(address)
     self.pos = {
         'x': self.device.query('DAC. ' + str(self.device.aidmap['x'])),
         'y': self.device.query('DAC. ' + str(self.device.aidmap['y']))
     }
Exemplo n.º 4
0
	def __init__(self,address='GPIB0::16'):
		self.device = LockIn(address)
		self.pos = {'x':self.device.query('DAC. '+str(self.device.aidmap['x'])),
					'y':self.device.query('DAC. '+str(self.device.aidmap['y']))}