Exemple #1
0
    def run(self, cxn, context):
        endPosition = int(self.parameters["shuttle.position"])
        stepSize = int(self.parameters["shuttle.step_size"])
        print "start, end", self.startPosition, endPosition
        if endPosition == self.startPosition:
            return
        elif endPosition > self.startPosition:
            endPosition -= (endPosition - self.startPosition) % stepSize
            ordering = range(self.startPosition + stepSize, endPosition + stepSize, stepSize)
        else:
            endPosition += (endPosition - self.startPosition) % stepSize
            ordering = range(endPosition, self.startPosition, stepSize)[::-1]
            # if len(ordering) > 126: raise Exception("Too many voltage sets!")
        for i, p in enumerate(ordering):
            print "pos: ", p
            should_stop = self.pause_or_stop()
            if should_stop:
                break
            self.dacserver.set_next_voltages(p)
            av = self.dacserver.get_analog_voltages()
            for e, v in av:
                try:
                    self.volts[e].append(v)
                except:
                    self.volts[e] = [v]
        self.parameters["advanceDACs.steps"] = len(ordering)
        self.seq = advance_DACs_shuttle(self.parameters)
        # self.doSequence()

        self.dacserver.set_first_voltages()
        self.seq = reset_DACs(self.parameters)
Exemple #2
0
    def run(self, cxn, context):
        endPosition = int(self.parameters['shuttle.position'])
        stepSize = int(self.parameters['shuttle.step_size'])
        print 'start, end', self.startPosition, endPosition
        if endPosition == self.startPosition: return
        elif endPosition > self.startPosition:
            endPosition -= (endPosition - self.startPosition) % stepSize
            ordering = range(self.startPosition + stepSize,
                             endPosition + stepSize, stepSize)
        else:
            endPosition += (endPosition - self.startPosition) % stepSize
            ordering = range(endPosition, self.startPosition, stepSize)[::-1]
        # if len(ordering) > 126: raise Exception("Too many voltage sets!")
        for i, p in enumerate(ordering):
            print 'pos: ', p
            should_stop = self.pause_or_stop()
            if should_stop: break
            self.dacserver.set_next_voltages(p)
            av = self.dacserver.get_analog_voltages()
            for e, v in av:
                try:
                    self.volts[e].append(v)
                except:
                    self.volts[e] = [v]
        self.parameters['advanceDACs.steps'] = len(ordering)
        self.seq = advance_DACs_shuttle(self.parameters)
        # self.doSequence()

        self.dacserver.set_first_voltages()
        self.seq = reset_DACs(self.parameters)
Exemple #3
0
	def run(self, cxn, context):
		print 'run'
		print self.parameters['shuttle.position']
		print self.parameters['shuttle.step_size']
		position = int(self.parameters['shuttle.position'])
		step_size = int(self.parameters['shuttle.step_size'])
		duration = float(self.parameters['shuttle.duration'])
		loop = bool(self.parameters['shuttle.loop'])
		loop_delay = float(self.parameters['shuttle.loop_delay'])
		overshoot = bool(self.parameters['shuttle.overshoot'])
		# shuttle_times = self.dac_server.shuttle(endPosition, step_size, duration, loop, overshoot)
		# shuttle_times = self.dac_server.get_shuttle_times()
		self.parameters['advanceDACs.times'] = self.dac_server.shuttle((position, step_size, duration, loop, loop_delay, overshoot))
		self.seq = advance_DACs_shuttle(self.parameters)
		self.doSequence()
		
		self.dac_server.set_first_voltages()
		self.seq = reset_DACs(self.parameters)
		self.doSequence()			
Exemple #4
0
    def run(self, cxn, context):
        print 'run'
        print self.parameters['shuttle.position']
        print self.parameters['shuttle.step_size']
        position = int(self.parameters['shuttle.position'])
        step_size = int(self.parameters['shuttle.step_size'])
        duration = float(self.parameters['shuttle.duration'])
        loop = bool(self.parameters['shuttle.loop'])
        loop_delay = float(self.parameters['shuttle.loop_delay'])
        overshoot = bool(self.parameters['shuttle.overshoot'])
        # shuttle_times = self.dac_server.shuttle(endPosition, step_size, duration, loop, overshoot)
        # shuttle_times = self.dac_server.get_shuttle_times()
        self.parameters['advanceDACs.times'] = self.dac_server.shuttle(
            (position, step_size, duration, loop, loop_delay, overshoot))
        self.seq = advance_DACs_shuttle(self.parameters)
        self.doSequence()

        self.dac_server.set_first_voltages()
        self.seq = reset_DACs(self.parameters)
        self.doSequence()
Exemple #5
0
	def run(self, cxn, context):
		duration = float(self.parameters['Ramp.duration'])
		total_steps = int(self.parameters['Ramp.total_steps'])
		initial_field = float(self.parameters['Ramp.initial_field'])
		final_field = float(self.parameters['Ramp.final_field'])
		multipole = str(self.parameters['Ramp.multipole'])
		# shuttle_times = self.dac_server.shuttle(endPosition, step_size, duration, loop, overshoot)
		# shuttle_times = self.dac_server.get_shuttle_times()
		self.dac_server.ramp_multipole(multipole, initial_field, final_field, total_steps)

		time_interval = duration/float(total_steps) #in us
		time_interval = time_interval * 10**-6
		self.parameters['advanceDACs.times'] = [i*time_interval for i in range(0,total_steps+1)]
		
		self.seq = advance_DACs_shuttle(self.parameters)
		self.doSequence()
		
		self.dac_server.set_first_voltages()
		self.seq = reset_DACs(self.parameters)
		self.doSequence()