示例#1
0
    def probe(self, timestep):
        params = self.parameters.widget.get()
        # triangle = Arbseq_Class('triangle', timestep)
        # triangle.heights = self.makeTriangle(timestep)
        # triangle.totaltime = 1/params['triangle frequency'].magnitude
        # triangle.widths = [timestep] * len(triangle.heights)
        # triangle.delays=[0]*len(triangle.heights)
        # triangle.repeatstring = 'once'
        # triangle.markerstring = 'lowAtStart'
        # triangle.markerloc = 0
        # triangle.nrepeats = 0
        # triangle.create_sequence()

        chn1dc = Arbseq_Class('chn1dc', timestep)
        chn1dc.delays = [0] * len(triangle.heights)
        chn1dc.heights = [1] * len(triangle.heights)
        chn1dc.widths = [timestep] * len(triangle.heights)
        chn1dc.totaltime = params['pump width'].magnitude
        chn1dc.repeatstring = 'once'
        chn1dc.markerstring = 'lowAtStart'
        chn1dc.markerloc = 0
        chn1dc.nrepeats = 0
        chn1dc.create_sequence()

        self.fungen.send_arb(chn1dc, 1)
        # self.fungen.send_arb(triangle, 2)

        seq = [chn1dc]
        # seq2=[triangle]

        self.fungen.create_arbseq('probe', seq, 1)
        # self.fungen.create_arbseq('triangle', seq2, 2)
        self.fungen.wait()
        self.fungen.voltage[1] = params['probe height'] * 2
示例#2
0
    def pump(self, timestep):
        for i in range(70):
            params = self.parameters.widget.get()
            per = 1

            chn2pulse2 = Arbseq_Class('chn2pulse2', timestep)
            tri_time = 1000e-6
            offset = 0
            height = 0.73 - offset
            heights = list()
            heights.append(height)
            while height > 0.44 - offset:
                height -= 0.28 * (4 * timestep) / tri_time
                if height < 0.44 - offset:
                    height = 0.44 - offset
                heights.append(height)
            # while height < 0:
            # 	height += (4*timestep)/tri_time
            # 	if height>0:
            # 		height=0
            # 	heights.append(height)
            while height < 1 - offset:
                height += 0.28 * (4 * timestep) / tri_time
                if height > 1 - offset:
                    height = 1 - offset
                heights.append(height)
            while height > 0.73 - offset:
                height -= 0.28 * (4 * timestep) / tri_time
                if height < 0.73 - offset:
                    height = 0.73 - offset
                heights.append(height)
            print(heights)
            chn2pulse2.heights = heights
            chn2pulse2.delays = [0] * len(heights)
            chn2pulse2.totaltime = tri_time
            chn2pulse2.widths = [timestep] * len(heights)
            chn2pulse2width = [timestep] * len(heights)
            print('chn2 len(heights) is:' + str(len(heights)))
            chn2pulse2.totaltime = len(heights) * timestep
            print('chn2_shb totaltime is:' + str(chn2pulse2.totaltime))
            chn2pulse2.nrepeats = 1
            print('chn2_shb nrepeats is:' + str(chn2pulse2.nrepeats))
            chn2pulse2.repeatstring = 'repeat'
            chn2pulse2.markerstring = 'lowAtStart'
            chn2pulse2.markerloc = 0
            chn2pulse2.create_sequence()

            # chn2trioff = Arbseq_Class('chn2trioff', timestep)
            # chn2trioff.heights = heights
            # chn2trioff.delays = [0] * len(heights)
            # chn2trioff.totaltime = tri_time
            # chn2trioff.widths = [timestep] * len(heights)
            # chn2trioffwidth=[timestep] * len(heights)
            # print('chn2 len(heights) is:' + str(len(heights)))
            # chn2trioff.totaltime = len(heights) * timestep
            # chn2trioff.nrepeats = int(0.1e-3/tri_time)
            # chn2trioff.repeatstring = 'repeat'
            # chn2trioff.markerstring = 'lowAtStart'
            # chn2trioff.markerloc = 0
            # chn2trioff.create_sequence()

            chn1off1 = Arbseq_Class('chn1off1', timestep)
            chn1off1.delays = [0]
            chn1off1.heights = [0]
            chn1off1.widths = [params['ramp time'].magnitude]
            chn1off1.totaltime = params['ramp time'].magnitude
            chn1off1.nrepeats = 0
            chn1off1.repeatstring = 'once'
            chn1off1.markerstring = 'lowAtStart'
            chn1off1.markerloc = 0
            chn1off1.create_sequence()

            chn1pulse = Arbseq_Class('chn1pulse', timestep)
            chn1pulse.delays = [0]
            chn1pulse.heights = [1]
            chn1pulse.widths = [params['pump width'].magnitude]
            chn1pulse.totaltime = params['pump width'].magnitude
            chn1pulse.nrepeats = 100
            chn1pulse.repeatstring = 'repeat'
            chn1pulse.markerstring = 'lowAtStart'
            chn1pulse.markerloc = 0
            chn1pulse.create_sequence()

            chn1off2 = Arbseq_Class('chn1off2', timestep)
            chn1off2.delays = [0]
            chn1off2.heights = [0]
            chn1off2.widths = [params['ramp time'].magnitude]
            chn1off2.totaltime = params['ramp time'].magnitude
            chn1off2.nrepeats = 0
            chn1off2.repeatstring = 'once'
            chn1off2.markerstring = 'highAtStartGoLow'
            chn1off2.markerloc = 0
            chn1off2.create_sequence()

            # chn1trioff = Arbseq_Class('chn1trioff', timestep)
            # chn1trioff.delays = [0]*len(heights)
            # chn1trioff.heights = [1]*len(heights)
            # chn1trioff.widths = [timestep] * len(heights)
            # chn1trioff.totaltime = tri_time
            # chn1trioff.nrepeats = int(0.1e-3/tri_time)
            # chn1trioff.repeatstring = 'repeat'
            # chn1trioff.markerstring = 'lowAtStart'
            # chn1trioff.markerloc = 0
            # chn1trioff.create_sequence()

            chn1dc = Arbseq_Class('dc1', timestep)
            chn1dc.delays = [0]
            chn1dc.heights = [0]
            chn1dc.widths = [params['wait time unit'].magnitude]
            chn1dc.totaltime = params['wait time unit'].magnitude
            chn1dc.nrepeats = 500
            chn1dc.repeatstring = 'repeat'
            chn1dc.markerstring = 'lowAtStart'
            chn1dc.markerloc = 0
            chn1dc.create_sequence()

            chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
            chn1pulse2.delays = [0] * len(heights)
            chn1pulse2.heights = [1] * 10 + [1] * (len(heights) - 10)
            chn1pulse2.widths = [timestep] * len(heights)
            chn1pulse2.totaltime = tri_time
            chn1pulse2.nrepeats = 1
            chn1pulse2.repeatstring = 'repeat'
            chn1pulse2.markerstring = 'lowAtStart'
            chn1pulse2.markerloc = 0
            chn1pulse2.create_sequence()

            chn1dc2 = Arbseq_Class('chn1dc2', timestep)
            chn1dc2.delays = [0]
            chn1dc2.heights = [0]
            chn1dc2.widths = [params['pump width'].magnitude]
            chn1dc2.totaltime = params['pump width'].magnitude
            chn1dc2.repeatstring = 'repeat'
            chn1dc2.markerstring = 'lowAtStart'
            chn1dc2.markerloc = 0
            chn1dc2.nrepeats = int(
                (per - tri_time - (500) * params['wait time unit'].magnitude -
                 10 * params['pump width'].magnitude) /
                params['pump width'].magnitude)
            chn1dc2.create_sequence()

            chn2off1 = Arbseq_Class('chn2off1', timestep)
            chn2off1.delays = [0]
            chn2off1.heights = [0]
            chn2off1.widths = [params['ramp time'].magnitude]
            chn2off1.totaltime = params['ramp time'].magnitude
            chn2off1.nrepeats = 0
            chn2off1.repeatstring = 'once'
            chn2off1.markerstring = 'lowAtStart'
            chn2off1.markerloc = 0
            chn2off1.create_sequence()

            chn2pulse = Arbseq_Class('chn2pulse', timestep)
            chn2pulse.delays = [0]
            chn2pulse.heights = [0.9]
            chn2pulse.widths = [params['pump width'].magnitude]
            chn2pulse.totaltime = params['pump width'].magnitude
            chn2pulse.nrepeats = 100
            chn2pulse.repeatstring = 'repeat'
            chn2pulse.markerstring = 'lowAtStart'
            chn2pulse.markerloc = 0
            chn2pulse.create_sequence()

            chn2off2 = Arbseq_Class('chn2off2', timestep)
            chn2off2.delays = [0]
            chn2off2.heights = [0]
            chn2off2.widths = [params['ramp time'].magnitude]
            chn2off2.totaltime = params['ramp time'].magnitude
            chn2off2.nrepeats = 0
            chn2off2.repeatstring = 'once'
            chn2off2.markerstring = 'highAtStartGoLow'
            chn2off2.markerloc = 0
            chn2off2.create_sequence()

            chn2dc = Arbseq_Class('chn2dc', timestep)
            chn2dc.delays = [0]
            chn2dc.heights = [0]
            chn2dc.widths = [params['wait time unit'].magnitude]
            chn2dc.totaltime = params['wait time unit'].magnitude
            chn2dc.nrepeats = 500
            chn2dc.repeatstring = 'repeat'
            chn2dc.markerstring = 'lowAtStart'
            chn2dc.markerloc = 0
            chn2dc.create_sequence()

            chn2dc2 = Arbseq_Class('chn2dc2', timestep)
            chn2dc2.delays = [0]
            chn2dc2.heights = [0]
            chn2dc2.widths = [params['pump width'].magnitude]
            chn2dc2.totaltime = params['pump width'].magnitude
            chn2dc2.repeatstring = 'repeat'
            chn2dc2.markerstring = 'lowAtStart'
            chn2dc2.markerloc = 0
            chn2dc2.nrepeats = int(
                (per - tri_time - (500) * params['wait time unit'].magnitude -
                 10 * params['pump width'].magnitude) /
                params['pump width'].magnitude)
            chn2dc2.create_sequence()

            self.fungen.send_arb(chn1off1, 1)
            self.fungen.send_arb(chn1pulse, 1)
            self.fungen.send_arb(chn1off2, 1)
            self.fungen.send_arb(chn1dc, 1)
            # self.fungen.send_arb(chn1trioff, 1)
            self.fungen.send_arb(chn1pulse2, 1)
            self.fungen.send_arb(chn1dc2, 1)
            self.fungen.send_arb(chn2off1, 2)
            self.fungen.send_arb(chn2pulse, 2)
            self.fungen.send_arb(chn2off2, 2)
            self.fungen.send_arb(chn2dc, 2)
            self.fungen.send_arb(chn2pulse2, 2)
            self.fungen.send_arb(chn2dc2, 2)
            # self.fungen.send_arb(chn2trioff, 2)

            seq = [chn1off1, chn1pulse, chn1off2, chn1dc, chn1pulse2, chn1dc2]
            seq2 = [chn2off1, chn2pulse, chn2off2, chn2dc, chn2pulse2, chn2dc2]
            self.fungen.create_arbseq('pumpPulse', seq, 1)
            self.fungen.create_arbseq('freq', seq2, 2)
            self.fungen.sync()
            self.fungen.wait()
            self.fungen.voltage[1] = 0.5 + 0.00000001 * i
            self.fungen.voltage[2] = 3.6 + 0.00000001 * i
            self.fungen.wait()
            self.fungen.output[2] = 'ON'
            time.sleep(1)
            self.fungen.output[1] = 'ON'
            #			self.osc.triggersource = 'CH4'
            #self.osc.set_time((i+1)*params['wait time unit'].magnitude + 0.0208)
            time.sleep(10000)

            time.sleep(10)
            x, y = self.osc.curv()
            x = np.array(x)
            x = x - x.min()
            y = np.array(y)
            np.savez(
                os.path.join("D:\\Data\\6.12.2019\\HoleBurning0T", str(i)), x,
                y)

            self.fungen.clear_mem(1)
            self.fungen.clear_mem(2)
            self.fungen.wait()
            self.fungen.output[2] = 'OFF'
            self.fungen.output[1] = 'OFF'
示例#3
0
    def startpulse(self, timestep=1e-9):
        params = self.pulse_parameters.widget.get()
        tau = params['start tau'].magnitude
        #self.osc.set_time(2*tau+0.4e-6)
        period = params['period'].magnitude
        repeat_unit = params['repeat unit'].magnitude
        pulse_width = params['pulse width'].magnitude
        echo = params['echo'].magnitude
        varwidth = pulse_width * 2
        step_tau = params['step tau'].magnitude
        self.osc.datasource(1)
        self.osc.scale(1, 1)
        for i in range(300):
            self.dataset.clear()
            self.fungen.output[1] = 'OFF'
            self.fungen.output[2] = 'OFF'
            self.fungen.clear_mem(1)
            self.fungen.clear_mem(2)
            self.fungen.wait()

            ## build pulse sequence for AWG channel 1
            chn1pulse = Arbseq_Class('chn1pulse', timestep)
            chn1pulse.delays = [0]
            chn1pulse.heights = [1]
            chn1pulse.widths = [pulse_width]
            chn1pulse.totaltime = pulse_width
            chn1pulse.nrepeats = 0
            chn1pulse.repeatstring = 'once'
            chn1pulse.markerstring = 'highAtStartGoLow'
            chn1pulse.markerloc = 0
            chn1pulsewidth = pulse_width
            chn1pulse.create_sequence()

            chn1dc = Arbseq_Class('chn1dc', timestep)
            chn1dc.delays = [0]
            chn1dc.heights = [0]
            chn1dc.widths = [repeat_unit]
            chn1dc.totaltime = repeat_unit
            chn1dc.repeatstring = 'repeat'
            chn1dc.markerstring = 'lowAtStart'
            chn1dc.markerloc = 0
            chn1dcrepeats = int(
                (tau - 0.5 * pulse_width - pulse_width) / repeat_unit)
            chn1dc.nrepeats = chn1dcrepeats
            chn1dcwidth = repeat_unit * chn1dcrepeats
            print(tau, pulse_width, chn1dcrepeats)
            chn1dc.create_sequence()

            chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
            chn1pulse2.delays = [0]
            chn1pulse2.heights = [1]
            chn1pulse2.widths = [pulse_width * 2]
            chn1pulse2.totaltime = pulse_width * 2
            chn1pulse2width = pulse_width * 2
            chn1pulse2.nrepeats = 0
            chn1pulse2.repeatstring = 'once'
            chn1pulse2.markerstring = 'lowAtStart'
            chn1pulse2.markerloc = 0
            chn1pulse2.create_sequence()

            chn1pulse3 = Arbseq_Class('chn1pulse3', timestep)
            chn1pulse3.delays = [0]
            chn1pulse3.heights = [0]
            chn1pulse3.widths = [repeat_unit]
            chn1pulse3.totaltime = repeat_unit
            chn1pulse3width = echo
            chn1pulse3.nrepeats = echo / repeat_unit
            chn1pulse3.repeatstring = 'repeat'
            chn1pulse3.markerstring = 'lowAtStart'
            chn1pulse3.markerloc = 0
            chn1pulse3.create_sequence()

            chn1dc2 = Arbseq_Class('chn1dc2', timestep)
            chn1dc2.delays = [0]
            chn1dc2.heights = [0]
            chn1dc2.widths = [1e-5]
            chn1dc2.totaltime = 1e-5
            chn1dc2.repeatstring = 'repeat'
            chn1dc2.markerstring = 'lowAtStart'
            print(
                float(
                    (period - chn1pulsewidth - chn1dcwidth - chn1pulse2width) /
                    1e-6))
            chn1dc2repeats = 1e4  #int((period-chn1pulsewidth-chn1dcwidth-chn1pulse2width)/1e-6)
            chn1dc2.nrepeats = chn1dc2repeats
            chn1dc2.markerloc = 0
            chn1dc2.create_sequence()

            self.fungen.send_arb(chn1pulse, 1)
            self.fungen.send_arb(chn1dc, 1)
            self.fungen.send_arb(chn1pulse2, 1)
            # self.fungen.send_arb(chn1pulse3, 1)
            self.fungen.send_arb(chn1dc2, 1)
            seq = [chn1pulse, chn1dc, chn1pulse2, chn1dc2]

            self.fungen.create_arbseq('twoPulse', seq, 1)

            self.fungen.wait()
            self.fungen.voltage[
                1] = params['pulse height'].magnitude + 0.000000000001 * i

            print(self.fungen.voltage[1])
            self.fungen.output[1] = 'ON'
            # self.osc.set_time(tau*2+pulse_width*3-tau/20)
            #time.sleep(100000)
            # if tau>6.0e-6:
            # 	if tau>60e-6:
            # 		self.osc.scale(1,0.01)
            # 	elif tau>30.0e-6:
            # 		self.osc.scale(1,0.02)
            # 	else:
            # 		self.osc.scale(1,0.02)
            # 	if tau>100e-6:
            # 		self.osc.scale(1,0.01)
            # else:
            # 	self.osc.scale(1,0.02)
            # maxy=self.osc.measure_max(1)
            # print(maxy)

            # if maxIndex<75000:
            # 	self.osc.set_time(curTime-700e-9)

            curTime = float(self.osc.query_time())
            # self.osc.set_time(curTime-step_tau)
            #print(maxy,float(self.osc.scale_query(1)))
            print("maxy", self.maxy)
            print("scale", float(self.osc.scale_query(1)))
            if i != 0:
                if self.maxy < 1 * float(self.osc.scale_query(1)):
                    self.osc.scale(
                        1, self.stepDown(1, float(self.osc.scale_query(1))))
            self.setwv(1535.120)
            time.sleep(5)
            self.maxy = 0
            for j in range(100):
                self.setwv(1535.137)
                time.sleep(0.3 + 0.004 * j)
                x, y = self.osc.curv()
                x = np.array(x)
                x = x - x.min()
                y = np.array(y)
                if max(y) > self.maxy:
                    self.maxy = max(y)
                self.saveData(x, y, tau, j)
                time.sleep(0.5)
                self.setwv(1535.120)
                time.sleep(5)

            #time.sleep(100000)

            tau = tau + step_tau
            curTime = float(self.osc.query_time())
            self.osc.set_time(curTime + 2 * step_tau - 20e-9 * step_tau * 1e6)
示例#4
0
    def startpulse(self, timestep=1e-9):
        self.fungen.output[1] = 'OFF'
        self.fungen.output[2] = 'OFF'
        self.fungen.clear_mem(1)
        self.fungen.clear_mem(2)
        params = self.pulse_parameters.widget.get()
        pulse = Arbseq_Class('pulse', timestep)
        pulse.delays = [0]
        pulse.heights = [1]
        pulse.widths = [params['pulse width'].magnitude]
        pulse.totaltime = params['pulse width'].magnitude
        pulse.nrepeats = 0
        pulse.repeatstring = 'once'
        pulse.markerstring = 'highAtStartGoLow'
        pulse.markerloc = 0
        pulse.create_sequence()

        dc = Arbseq_Class('dc', timestep)
        dc.delays = [0]
        dc.heights = [0]
        dc.widths = [params['pulse width'].magnitude]
        dc.totaltime = params['pulse width'].magnitude
        dc.repeatstring = 'repeat'
        dc.markerstring = 'lowAtStart'
        dc.markerloc = 0
        period = params['period'].magnitude
        width = params['pulse width'].magnitude
        repeats = period / width - 1
        dc.nrepeats = repeats
        dc.create_sequence()

        dc2 = Arbseq_Class('dc', timestep)
        dc2.delays = [0]
        dc2.heights = [1]
        dc2.widths = [params['pulse width'].magnitude]
        dc2.totaltime = params['pulse width'].magnitude
        dc2.repeatstring = 'repeat'
        dc2.markerstring = 'lowAtStart'
        dc2.markerloc = 0
        period = params['period'].magnitude
        print(period)
        width = params['pulse width'].magnitude
        repeats = period / width
        dc2.nrepeats = repeats
        dc2.create_sequence()

        self.fungen.send_arb(pulse, 1)
        self.fungen.send_arb(dc, 1)
        self.fungen.send_arb(dc2, 2)

        seq1 = [pulse, dc]

        self.fungen.create_arbseq('pulsetest', seq1, 1)
        self.fungen.wait()
        self.fungen.voltage[1] = params['pulse height']
        self.fungen.output[1] = 'ON'

        dcparams = self.DC_parameters.widget.get()

        self.fungen.create_arbseq('dc2', [dc2], 2)
        self.fungen.wait()
        self.fungen.voltage[2] = dcparams['DC height']
        self.fungen.output[2] = 'ON'

        self.configureQutag()

        qutagparams = self.qutag_params.widget.get()
        lost = self.qutag.getLastTimestamps(True)  # clear Timestamp buffer
        stoptimestamp = 0
        synctimestamp = 0
        bincount = qutagparams['Bin Count']
        timebase = self.qutag.getTimebase()
        start = qutagparams['Start Channel']
        stop = qutagparams['Stop Channel']

        expparams = self.exp_parameters.widget.get()
        for i in range(expparams['# of points']):
            ##Wavemeter measurements
            stoparray = []
            startTime = time.time()
            wls = []
            lost = self.qutag.getLastTimestamps(True)
            while time.time(
            ) - startTime < expparams['Measurement Time'].magnitude:
                lost = self.qutag.getLastTimestamps(True)
                time.sleep(30 * period)
                timestamps = self.qutag.getLastTimestamps(True)

                tstamp = timestamps[0]  # array of timestamps
                tchannel = timestamps[1]  # array of channels
                values = timestamps[2]  # number of recorded timestamps
                for k in range(values):
                    # output all stop events together with the latest start event
                    if tchannel[k] == start:
                        synctimestamp = tstamp[k]
                    else:
                        stoptimestamp = tstamp[k]
                        stoparray.append(stoptimestamp)
                wls.append(str(self.wm.measure_wavelength()))
            self.createHistogram(stoparray, timebase, bincount, period, i, wls)
            print(i)
            self.fungen.voltage[2] = self.fungen.voltage[
                2].magnitude + 2 * dcparams['DC step size'].magnitude
            time.sleep(100000)

        self.fungen.output[1] = 'OFF'
	def startpulse(self, timestep=1e-9):
		self.fungen.output[1] = 'OFF'
		self.fungen.output[2] = 'OFF'
		repeat_unit = 50e-9
		buffer_time = 100e-6
		pulse_width = 500e-9
		period = 200e-3
		self.fungen.clear_mem(1)
		self.fungen.clear_mem(2)
		params = self.pulse_parameters.widget.get()

		chn1buffer = Arbseq_Class('chn1buffer', timestep)
		chn1buffer.delays = [0]
		chn1buffer.heights = [0]
		chn1buffer.widths = [repeat_unit]
		chn1buffer.totaltime = repeat_unit
		chn1buffer.nrepeats = buffer_time/repeat_unit
		chn1buffer.repeatstring = 'repeat'
		chn1buffer.markerstring = 'lowAtStart'
		chn1buffer.markerloc = 0
		chn1bufferwidth = repeat_unit*chn1buffer.nrepeats
		chn1buffer.create_sequence()

		pulse = Arbseq_Class('pulse', timestep)
		pulse.delays = [0]
		pulse.heights = [0]
		pulse.widths = [repeat_unit]
		pulse.totaltime = repeat_unit
		pulserepeat = 400000
		pulse.nrepeats = pulserepeat
		chn1pulsewidth=pulserepeat*repeat_unit
		pulse.repeatstring = 'repeat'
		pulse.markerstring = 'lowAtStart'
		pulse.markerloc = 0
		pulse.create_sequence()

		chn1dc = Arbseq_Class('chn1dc', timestep)
		chn1dc.delays = [0]
		chn1dc.heights = [0]
		chn1dc.widths = [repeat_unit]
		chn1dc.totaltime = repeat_unit
		chn1dc.repeatstring = 'repeat'
		chn1dc.markerstring = 'lowAtStart'
		chn1dc.markerloc = 0
		chn1dcrepeats = 200000
		chn1dc.nrepeats = chn1dcrepeats
		chn1dcwidth = repeat_unit*chn1dcrepeats
		chn1dc.create_sequence()
		
		chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
		chn1pulse2.delays = [0]
		chn1pulse2.heights = [1]
		chn1pulse2.widths = [pulse_width]
		chn1pulse2.totaltime = pulse_width
		chn1pulse2width = pulse_width
		chn1pulse2.nrepeats = 0
		chn1pulse2.repeatstring = 'once'
		chn1pulse2.markerstring = 'highAtStartGoLow'
		chn1pulse2.markerloc = 0
		chn1pulse2.create_sequence()

		# chn1pulse3 = Arbseq_Class('chn1pulse3', timestep)
		# chn1pulse3.delays = [0]
		# chn1pulse3.heights = [0]
		# chn1pulse3.widths = [repeat_unit]
		# chn1pulse3.totaltime = repeat_unit 
		# chn1pulse3width = shutter_offset
		# chn1pulse3.nrepeats = shutter_offset/repeat_unit
		# chn1pulse3.repeatstring = 'repeat'
		# chn1pulse3.markerstring = 'lowAtStart'
		# chn1pulse3.markerloc = 0
		# chn1pulse3.create_sequence()

		chn1dc2 = Arbseq_Class('chn1dc2', timestep)
		chn1dc2.delays = [0]
		chn1dc2.heights = [0]
		chn1dc2.widths = [pulse_width]
		chn1dc2.totaltime = pulse_width
		chn1dc2.repeatstring = 'repeat'
		chn1dc2.markerstring = 'lowAtStart'
		chn1dc2repeats = 2e5
		ch1dc2width=chn1dc2repeats*pulse_width
		chn1dc2.nrepeats = chn1dc2repeats
		chn1dc2.markerloc = 0
		#print((chn1dc2repeats*params['repeat unit'].magnitude) + tau.magnitude + params['pulse width'].magnitude)
		chn1dc2.create_sequence()

		totalTime=chn1bufferwidth+chn1pulsewidth+chn1dcwidth+chn1pulse2width+ch1dc2width

		chn2buffer = Arbseq_Class('chn2buffer', timestep)
		chn2buffer.delays = [0]
		chn2buffer.heights = [1]
		chn2buffer.widths = [repeat_unit]
		chn2buffer.totaltime = repeat_unit
		chn2buffer.nrepeats = buffer_time/repeat_unit
		chn2buffer.repeatstring = 'repeat'
		chn2buffer.markerstring = 'lowAtStart'
		chn2buffer.markerloc = 0
		chn2bufferwidth = repeat_unit*chn2buffer.nrepeats
		chn2buffer.create_sequence()

		chn2pulse1 = Arbseq_Class('chn2pulse1', timestep)
		chn2pulse1.delays = [0]
		chn2pulse1.heights = [1]
		chn2pulse1.widths = [repeat_unit]
		chn2pulse1.totaltime = repeat_unit
		chn2pulse1.nrepeats = pulserepeat
		chn2pulse1width = pulse_width
		chn2pulse1.repeatstring = 'repeat'
		chn2pulse1.markerstring = 'lowAtStart'
		chn2pulse1.markerloc = 0
		chn2pulse1.create_sequence()

		chn2dc1 = Arbseq_Class('chn2dc1', timestep)
		chn2dc1.delays = [0]
		chn2dc1.heights = [1]
		chn2dc1.widths = [repeat_unit]
		chn2dc1.totaltime = repeat_unit
		chn2dc1.repeatstring = 'repeat'
		chn2dc1.markerstring = 'lowAtStart'
		chn2dc1.markerloc = 0
		chn2dc1repeats = chn1dcrepeats
		chn2dc1.nrepeats = chn1dcrepeats
		chn2dc1width = repeat_unit*chn2dc1repeats
		chn2dc1.create_sequence()
	
		chn2pulse2 = Arbseq_Class('chn2pulse2', timestep)
		chn2pulse2.delays = [0]
		chn2pulse2.heights = [-1]
		chn2pulse2.widths = [pulse_width]
		chn2pulse2.totaltime = pulse_width
		chn2pulse2width = pulse_width
		chn2pulse2.nrepeats = 0
		chn2pulse2.repeatstring = 'once'
		chn2pulse2.markerstring = 'highAtStartGoLow'
		chn2pulse2.markerloc = 0
		chn2pulse2.create_sequence()

		chn2dc2 = Arbseq_Class('chn2dc2', timestep)
		chn2dc2.delays = [0]
		chn2dc2.heights = [-1]
		chn2dc2.widths = [pulse_width]
		chn2dc2.totaltime = pulse_width
		chn2dc2.repeatstring = 'repeat'
		chn2dc2.markerstring = 'lowAtStart'
		chn2dc2repeats = chn1dc2repeats
		chn2dc2.nrepeats = chn2dc2repeats
		chn2dc2.markerloc = 0
		chn2dc2.create_sequence()


		self.fungen.send_arb(chn1buffer, 1)
		self.fungen.send_arb(pulse, 1)
		self.fungen.send_arb(chn1dc, 1)
		self.fungen.send_arb(chn1pulse2, 1)
		self.fungen.send_arb(chn1dc2, 1)
		self.fungen.send_arb(chn2buffer, 2)
		self.fungen.send_arb(chn2pulse1, 2)
		self.fungen.send_arb(chn2dc1, 2)
		self.fungen.send_arb(chn2pulse2, 2)
		self.fungen.send_arb(chn2dc2, 2)

		seq = [chn1buffer, pulse, chn1dc, chn1pulse2, chn1dc2]
		seq2=[chn2buffer,chn2pulse1,chn2dc1,chn2pulse2,chn2dc2]

		self.fungen.create_arbseq('pulsetest', seq2, 2)
		self.fungen.wait()
		self.fungen.voltage[2] = 7.1
		self.fungen.output[2] = 'ON'
		#self.fungen.sync()

		self.fungen.create_arbseq('pulsetest', seq, 1)
		self.fungen.wait()
		self.fungen.voltage[1] = params['pulse height']
		self.fungen.sync()
		self.fungen.output[1] = 'ON'

		#time.sleep(100000)

		self.configureQutag()

		qutagparams = self.qutag_params.widget.get()
		lost = self.qutag.getLastTimestamps(True) # clear Timestamp buffer
		stoptimestamp = 0
		synctimestamp = 0
		bincount = qutagparams['Bin Count']
		timebase = self.qutag.getTimebase()
		start = qutagparams['Start Channel']
		stop = qutagparams['Stop Channel']

		expparams = self.exp_parameters.widget.get()
		for i in range(expparams['# of points']):
			##Wavemeter measurements
			stoparray = []
			startTime = time.time()
			wls=[]
			lost = self.qutag.getLastTimestamps(True)
			while time.time()-startTime < expparams['Measurement Time'].magnitude:
				lost = self.qutag.getLastTimestamps(True)
				time.sleep(30*totalTime)
				timestamps = self.qutag.getLastTimestamps(True)

				tstamp = timestamps[0] # array of timestamps
				tchannel = timestamps[1] # array of channels
				values = timestamps[2] # number of recorded timestamps
				for k in range(values):
					# output all stop events together with the latest start event
					if tchannel[k] == start:
						synctimestamp = tstamp[k]
					else:
						stoptimestamp = tstamp[k]
						stoparray.append(stoptimestamp)
			self.createHistogram(stoparray, timebase, bincount, totalTime,i, wls)
			print(i)
			#self.fungen.voltage[2] = self.fungen.voltage[2].magnitude + 2*dcparams['DC step size'].magnitude

		self.fungen.output[1] = 'OFF'
示例#6
0
    def startpulse(self, timestep=1e-9):
        params = self.pulse_parameters.widget.get()
        tau = params['start tau']
        period = params['period'].magnitude
        repeat_unit = params['repeat unit'].magnitude
        pulse_width = params['pulse width'].magnitude
        buffer_time = params['buffer time'].magnitude
        shutter_offset = params['shutter offset'].magnitude
        wholeRange = params['measuring range'].magnitude

        self.configureQutag()
        for i in range(
                int((params['stop tau'] - params['start tau']) /
                    params['step tau']) + 1):
            xs = np.array([])
            ys = np.array([])
            hist = []
            self.dataset.clear()
            self.fungen.output[1] = 'OFF'
            self.fungen.output[2] = 'OFF'
            self.fungen.clear_mem(1)
            self.fungen.clear_mem(2)
            self.fungen.wait()
            # self.srs.module_reset[5]
            # self.srs.SIM928_voltage[5]=params['srs bias'].magnitude+0.000000001*i
            # self.srs.SIM928_on[5]

            ## build pulse sequence for AWG channel 1
            chn1buffer = Arbseq_Class('chn1buffer', timestep)
            chn1buffer.delays = [0]
            chn1buffer.heights = [0]
            chn1buffer.widths = [repeat_unit]
            chn1buffer.totaltime = repeat_unit
            chn1buffer.nrepeats = buffer_time / repeat_unit
            chn1buffer.repeatstring = 'repeat'
            chn1buffer.markerstring = 'lowAtStart'
            chn1buffer.markerloc = 0
            chn1bufferwidth = repeat_unit * chn1buffer.nrepeats
            chn1buffer.create_sequence()

            chn1pulse = Arbseq_Class('chn1pulse', timestep)
            chn1pulse.delays = [0]
            chn1pulse.heights = [1]
            chn1pulse.widths = [pulse_width]
            chn1pulse.totaltime = pulse_width
            chn1pulse.nrepeats = 0
            chn1pulse.repeatstring = 'once'
            chn1pulse.markerstring = 'highAtStartGoLow'
            chn1pulse.markerloc = 0
            chn1pulsewidth = pulse_width
            chn1pulse.create_sequence()

            chn1dc = Arbseq_Class('chn1dc', timestep)
            chn1dc.delays = [0]
            chn1dc.heights = [0]
            chn1dc.widths = [repeat_unit]
            chn1dc.totaltime = repeat_unit
            chn1dc.repeatstring = 'repeat'
            chn1dc.markerstring = 'lowAtStart'
            chn1dc.markerloc = 0
            chn1dcrepeats = int(
                (tau.magnitude - 1.5 * pulse_width) / repeat_unit)
            chn1dc.nrepeats = chn1dcrepeats
            chn1dcwidth = repeat_unit * chn1dcrepeats
            print(tau.magnitude, pulse_width, chn1dcrepeats)
            chn1dc.create_sequence()

            chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
            chn1pulse2.delays = [0]
            chn1pulse2.heights = [1]
            chn1pulse2.widths = [pulse_width * 2]
            chn1pulse2.totaltime = pulse_width * 2
            chn1pulse2width = pulse_width * 2
            chn1pulse2.nrepeats = 0
            chn1pulse2.repeatstring = 'once'
            chn1pulse2.markerstring = 'lowAtStart'
            chn1pulse2.markerloc = 0
            chn1pulse2.create_sequence()

            chn1pulse3 = Arbseq_Class('chn1pulse3', timestep)
            chn1pulse3.delays = [0]
            chn1pulse3.heights = [0]
            chn1pulse3.widths = [repeat_unit]
            chn1pulse3.totaltime = repeat_unit
            chn1pulse3width = shutter_offset
            chn1pulse3.nrepeats = shutter_offset / repeat_unit
            chn1pulse3.repeatstring = 'repeat'
            chn1pulse3.markerstring = 'lowAtStart'
            chn1pulse3.markerloc = 0
            chn1pulse3.create_sequence()

            chn1dc2 = Arbseq_Class('chn1dc2', timestep)
            chn1dc2.delays = [0]
            chn1dc2.heights = [0]
            chn1dc2.widths = [repeat_unit]
            chn1dc2.totaltime = repeat_unit
            chn1dc2.repeatstring = 'repeat'
            chn1dc2.markerstring = 'lowAtStart'
            chn1dc2repeats = int(
                (period - chn1bufferwidth - chn1pulsewidth - chn1dcwidth -
                 chn1pulse2width - chn1pulse3width) / repeat_unit)
            chn1dc2.nrepeats = chn1dc2repeats
            chn1dc2.markerloc = 0
            #print((chn1dc2repeats*params['repeat unit'].magnitude) + tau.magnitude + params['pulse width'].magnitude)
            print(params['repeat unit'].magnitude * chn1dc2.nrepeats)
            chn1dc2.create_sequence()

            ## build pulse sequence for AWG channel 2
            chn2buffer = Arbseq_Class('chn2buffer', timestep)
            chn2buffer.delays = [0]
            chn2buffer.heights = [1]
            chn2buffer.widths = [repeat_unit]
            chn2buffer.totaltime = repeat_unit
            chn2buffer.nrepeats = buffer_time / repeat_unit
            chn2buffer.repeatstring = 'repeat'
            chn2buffer.markerstring = 'lowAtStart'
            chn2buffer.markerloc = 0
            chn2bufferwidth = repeat_unit * chn2buffer.nrepeats
            chn2buffer.create_sequence()

            chn2pulse1 = Arbseq_Class('chn2pulse1', timestep)
            chn2pulse1.delays = [0]
            chn2pulse1.heights = [1]
            chn2pulse1.widths = [pulse_width]
            chn2pulse1.totaltime = pulse_width
            chn2pulse1width = pulse_width
            chn2pulse1.nrepeats = 0
            chn2pulse1.repeatstring = 'once'
            chn2pulse1.markerstring = 'highAtStartGoLow'
            chn2pulse1.markerloc = 0
            chn2pulse1.create_sequence()

            chn2dc1 = Arbseq_Class('chn2dc1', timestep)
            chn2dc1.delays = [0]
            chn2dc1.heights = [1]
            chn2dc1.widths = [repeat_unit]
            chn2dc1.totaltime = repeat_unit
            chn2dc1.repeatstring = 'repeat'
            chn2dc1.markerstring = 'lowAtStart'
            chn2dc1.markerloc = 0
            chn2dc1repeats = int(
                (tau.magnitude - 1.5 * pulse_width) / repeat_unit)
            chn2dc1.nrepeats = chn2dc1repeats
            chn2dc1width = repeat_unit * chn2dc1repeats
            chn2dc1.create_sequence()

            chn2pulse2 = Arbseq_Class('chn2pulse2', timestep)
            chn2pulse2.delays = [0]
            chn2pulse2.heights = [1]
            chn2pulse2.widths = [pulse_width * 2]
            chn2pulse2.totaltime = pulse_width * 2
            chn2pulse2width = pulse_width * 2
            chn2pulse2.nrepeats = 0
            chn2pulse2.repeatstring = 'once'
            chn2pulse2.markerstring = 'lowAtStart'
            chn2pulse2.markerloc = 0
            chn2pulse2.create_sequence()

            chn2pulse3 = Arbseq_Class('chn2pulse3', timestep)
            chn2pulse3.delays = [0]
            chn2pulse3.heights = [1]
            chn2pulse3.widths = [repeat_unit]
            chn2pulse3.totaltime = repeat_unit
            chn2pulse3width = shutter_offset
            chn2pulse3.nrepeats = shutter_offset / repeat_unit
            chn2pulse3.repeatstring = 'repeat'
            chn2pulse3.markerstring = 'lowAtStart'
            chn2pulse3.markerloc = 0
            chn2pulse3.create_sequence()

            chn2dc2 = Arbseq_Class('chn2dc2', timestep)
            chn2dc2.delays = [0]
            chn2dc2.heights = [-1]
            chn2dc2.widths = [repeat_unit]
            chn2dc2.totaltime = repeat_unit
            chn2dc2.repeatstring = 'repeat'
            chn2dc2.markerstring = 'lowAtStart'
            chn2dc2repeats = int(
                (period - chn2bufferwidth - chn2pulse1width - chn2dc1width -
                 chn2pulse2width - chn2pulse3width) / repeat_unit)
            chn2dc2.nrepeats = chn2dc2repeats
            chn2dc2.markerloc = 0
            print(repeat_unit * chn2dc2.nrepeats)
            chn2dc2.create_sequence()

            self.fungen.send_arb(chn1buffer, 1)
            self.fungen.send_arb(chn1pulse, 1)
            self.fungen.send_arb(chn1dc, 1)
            self.fungen.send_arb(chn1pulse2, 1)
            self.fungen.send_arb(chn1pulse3, 1)
            self.fungen.send_arb(chn1dc2, 1)
            self.fungen.send_arb(chn2buffer, 2)
            self.fungen.send_arb(chn2pulse1, 2)
            self.fungen.send_arb(chn2dc1, 2)
            self.fungen.send_arb(chn2pulse2, 2)
            self.fungen.send_arb(chn2pulse3, 2)
            self.fungen.send_arb(chn2dc2, 2)

            seq = [
                chn1buffer, chn1pulse, chn1dc, chn1pulse2, chn1pulse3, chn1dc2
            ]
            seq2 = [
                chn2buffer, chn2pulse1, chn2dc1, chn2pulse2, chn2pulse3,
                chn2dc2
            ]

            self.fungen.create_arbseq('twoPulse', seq, 1)
            self.fungen.create_arbseq('shutter', seq2, 2)
            self.fungen.wait()
            self.fungen.voltage[
                1] = params['pulse height'].magnitude + 0.000000000001 * i
            self.fungen.voltage[2] = 7.1 + 0.0000000000001 * i

            print(self.fungen.voltage[1], self.fungen.voltage[2])
            self.fungen.output[2] = 'ON'
            self.fungen.trigger_delay(1, shutter_offset)
            self.fungen.sync()
            time.sleep(1)
            self.fungen.output[1] = 'ON'
            #self.fungen.output[2] = 'OFF'

            ##Qutag Part
            self.configureQutag()
            qutagparams = self.qutag_params.widget.get()
            lost = self.qutag.getLastTimestamps(True)  # clear Timestamp buffer
            stoptimestamp = 0
            synctimestamp = 0
            bincount = qutagparams['Bin Count']
            timebase = self.qutag.getTimebase()
            start = qutagparams['Start Channel']
            stop = qutagparams['Stop Channel']
            stoparray = []
            tempStopArray = []
            histCounter = 0
            quenchCounter = 0
            self.initHist(bincount)
            for j in range(int(
                    self.exp_parameters.widget.get()['# of Passes'])):
                lost = self.qutag.getLastTimestamps(True)
                time.sleep(period)
                timestamps = self.qutag.getLastTimestamps(True)

                tstamp = timestamps[0]  # array of timestamps
                tchannel = timestamps[1]  # array of channels
                values = timestamps[2]  # number of recorded timestamps
                # print(values)
                for k in range(values):
                    # output all stop events together with the latest start event
                    # if tchannel[k] == start:
                    # 	synctimestamp = tstamp[k]
                    if tchannel[k] == stop:
                        #stoptimestamp = tstamp[k]
                        # if tstamp[k]*1e-6>2*tau.magnitude-1 and tstamp[k]*1e-6<2*tau.magnitude+2:
                        stoparray.append(tstamp[k])
                        #tempStopArray.append(stoptimestamp)
                # histCounter+=1
                # if histCounter%20==0:
                # 	self.createPlottingHist(tempStopArray, timebase, bincount,qutagparams['Total Hist Width Multiplier']*tau.magnitude)
                # 	self.xs = np.asarray(range(len(self.hist)))
                # 	self.ys=np.asarray(self.hist)
                # 	values = {
                # 	't': np.asarray(range(len(self.hist))),
                # 	'y': np.asarray(self.hist),
                # 	}
                # 	self.startpulse.acquire(values)
                # 	tempStopArray = []
                # TODO: quench protection
                # if self.srs.SIM928_voltage[???] >= qunech threshold and quenchCounter<=10:
                # 	self.srs.SIM928_off[6]
                # 	time.sleep(period*10)
                # 	self.srs.SIM928_on[6]
                # 	quenchCounter+=1
                # elif quenchCounter>10:
                # 	print('quenched more than 10 times')
                # 	break
                # else:
                # 	continue

            self.createHistogram(stoparray, timebase, bincount, wholeRange,
                                 tau.magnitude)

            tau += params['step tau']
示例#7
0
    def makePulse(self, pulse_width, i):
        timestep = 1e-9
        self.fungen.output[1] = 'OFF'
        self.fungen.output[2] = 'OFF'
        self.fungen.clear_mem(1)
        self.fungen.clear_mem(2)
        params = self.pulse_parameters.widget.get()
        period = params['period'].magnitude
        repeat_unit = 50e-9

        buffer1 = Arbseq_Class('buffer1', timestep)
        buffer1.delays = [0]
        buffer1.heights = [0]
        buffer1.widths = [pulse_width]
        buffer1.totaltime = pulse_width
        buffer1.nrepeats = 0
        buffer1.repeatstring = 'once'
        buffer1.markerstring = 'highAtStartGoLow'
        buffer1.markerloc = 0
        buffer1.create_sequence()

        pulse = Arbseq_Class('pulse', timestep)
        pulse.delays = [0]
        pulse.heights = [1]
        pulse.widths = [pulse_width]
        pulse.totaltime = pulse_width
        pulse.nrepeats = 0
        pulse.repeatstring = 'once'
        pulse.markerstring = 'lowAtStart'
        pulse.markerloc = 0
        pulse.create_sequence()

        offset1 = Arbseq_Class('offset1', timestep)
        offset1.delays = [0]
        offset1.heights = [0]
        offset1.widths = [pulse_width]
        offset1.totaltime = pulse_width
        offset1.nrepeats = 0
        offset1.repeatstring = 'once'
        offset1.markerstring = 'lowAtStart'
        offset1.markerloc = 0
        offset1.create_sequence()

        dc = Arbseq_Class('dc', timestep)
        dc.delays = [0]
        dc.heights = [0]
        dc.widths = [params['pulse width'].magnitude]
        dc.totaltime = params['pulse width'].magnitude
        dc.repeatstring = 'repeat'
        dc.markerstring = 'lowAtStart'
        dc.markerloc = 0
        width = params['pulse width'].magnitude
        repeats = period / width - 3
        dc.nrepeats = repeats
        dc.create_sequence()

        buffer2 = Arbseq_Class('buffer2', timestep)
        buffer2.delays = [0]
        buffer2.heights = [1]
        buffer2.widths = [pulse_width]
        buffer2.totaltime = pulse_width
        buffer2.nrepeats = 0
        buffer2.repeatstring = 'once'
        buffer2.markerstring = 'lowAtStart'
        buffer2.markerloc = 0
        buffer2.create_sequence()

        pulse2 = Arbseq_Class('pulse2', timestep)
        pulse2.delays = [0]
        pulse2.heights = [1]
        pulse2.widths = [pulse_width]
        pulse2.totaltime = pulse_width
        pulse2.nrepeats = 0
        pulse2.repeatstring = 'once'
        pulse2.markerstring = 'lowAtStart'
        pulse2.markerloc = 0
        pulse2.create_sequence()

        offset2 = Arbseq_Class('offset2', timestep)
        offset2.delays = [0]
        offset2.heights = [1]
        offset2.widths = [pulse_width]
        offset2.totaltime = pulse_width
        offset2.nrepeats = 0
        offset2.repeatstring = 'once'
        offset2.markerstring = 'lowAtStart'
        offset2.markerloc = 0
        offset2.create_sequence()

        dc2 = Arbseq_Class('dc2', timestep)
        dc2.delays = [0]
        dc2.heights = [-1]
        dc2.widths = [params['pulse width'].magnitude]
        dc2.totaltime = params['pulse width'].magnitude
        dc2.repeatstring = 'repeat'
        dc2.markerstring = 'lowAtStart'
        dc2.markerloc = 0
        period2 = params['period'].magnitude
        width2 = params['pulse width'].magnitude
        repeats = period2 / width2 - 3
        dc2.nrepeats = repeats
        dc2.create_sequence()

        self.fungen.send_arb(buffer1, 1)
        self.fungen.send_arb(pulse, 1)
        self.fungen.send_arb(offset1, 1)
        self.fungen.send_arb(dc, 1)
        self.fungen.send_arb(buffer2, 2)
        self.fungen.send_arb(pulse2, 2)
        self.fungen.send_arb(offset2, 2)
        self.fungen.send_arb(dc2, 2)

        seq = [buffer1, pulse, offset1, dc]
        seq2 = [buffer2, pulse2, offset2, dc2]

        self.fungen.create_arbseq('twoPulse', seq, 1)
        self.fungen.create_arbseq('shutter', seq2, 2)
        self.fungen.wait()
        self.fungen.voltage[
            1] = params['pulse height'].magnitude + 0.000000000001 * i
        self.fungen.voltage[2] = 7.1 + 0.000000000001 * i
        self.fungen.sync()

        print(self.fungen.voltage[1])
        self.fungen.output[2] = 'ON'
        self.fungen.output[1] = 'ON'
示例#8
0
    def create_pulses(self, tau):
        params = self.pulse_parameters.widget.get()
        totaltime = params['period'].magnitude
        shb_time = params['shb time'].magnitude
        tri_time = params['tri time'].magnitude
        ramp_time = params['ramp time'].magnitude
        heterodyne_time = params['heterodyne time'].magnitude
        timestep = params['time step'].magnitude
        step = params['voltage step'].magnitude
        pulse_width = params['pulse widths'].magnitude
        voltage1 = params['ch1 voltage'].magnitude
        voltage2 = params['ch2 voltage'].magnitude
        echo_voltage = params['echo voltage'].magnitude
        step_voltage = params['voltage step'].magnitude
        #        tau = params['tau start'].magnitude
        T_wait = params['wait start'].magnitude
        '''
        chn2_dc = Arbseq_Class('chn2dc', timestep)
        chn2_dc.totaltime = tri_time
        chn2_dc.widths = [chn2_dc.totaltime]
        chn2_dc.delays = [0]
        chn2_dc.heights = [voltage2]
        chn2_dc.create_sequence()
        chn2_dc.nrepeats = int(totaltime/chn2_dc.totaltime)
        chn2_dc.repeatstring = 'repeat'
        chn2_dc.markerstring = 'maintain'
        chn2_dc.markerloc = 0
        '''
        '''
        chn2_shb = Arbseq_Class('chn2shb', timestep)
        chn2_shb.totaltime = tri_time
        chn2_shb.widths = [chn2_shb.totaltime]
        chn2_shb.delays = [0]
        chn2_shb.heights = [voltage2]
        chn2_shb.create_sequence()
        chn2_shb.nrepeats = int(shb_time/chn2_shb.totaltime)
        chn2_shb.repeatstring = 'repeat'
        chn2_shb.markerstring = 'maintain'
        chn2_shb.markerloc = 0
       

        
        chn2_shb = Arbseq_Class('chn2shb', 2e-7)
        period = tri_time
        height = voltage2
        heights = list()
        while height <= voltage2 + step_voltage/8:
            heights.append(height)
            height += (4*(step_voltage/8)*timestep)/period
        while height >= voltage2 - step_voltage/8:
            height -= (4*(step_voltage/8)*timestep)/period
            heights.append(height)
        while height <= voltage2:
            height += (4*(step_voltage/8)*timestep)/period
            heights.append(height)
        chn2_shb.heights = heights
        chn2_shb.widths = [timestep] * len(heights)
        chn2_shb.delays = [0] * len(heights)
        chn2_shb.totaltime = period
        chn2_shb.create_sequence()
        chn2_shb.widths = [timestep] * len(heights)
        print('chn2 len(heights) is:' + str(len(heights)))
        chn2_shb.delays = [0] * len(heights)
        chn2_shb.totaltime = len(heights) * timestep
        print('chn2_shb totaltime is:' + str(chn2_shb.totaltime))
        chn2_shb.create_sequence()
        chn2_shb.nrepeats = int(shb_time/tri_time)
        print('chn2_shb nrepeats is:' + str(chn2_shb.nrepeats))
        chn2_shb.repeatstring = 'repeat'
        chn2_shb.markerstring = 'maintain'
        chn2_shb.markerloc = 0
        
              
        freq_rampdown2 = Arbseq_Class('frampdown2', timestep)
        slope = (step_voltage)/(ramp_time)
        height = voltage2
        heights = list()
        while height >= voltage2 - step_voltage:
            height -= (slope * timestep)
            heights.append(height)
        freq_rampdown2.heights = heights
        freq_rampdown2.widths = len(heights) * [timestep]
        freq_rampdown2.delays = [0] * len(heights)
        freq_rampdown2.totaltime = len(heights) * timestep
        freq_rampdown2.create_sequence()
        freq_rampdown2.nrepeats = 0
        freq_rampdown2.repeatstring = 'once'
        freq_rampdown2.markerstring = 'maintain'
        freq_rampdown2.markerloc = 0
        
        
        chn2 = Arbseq_Class('ch2', timestep)
        chn2.totaltime = tau + pulse_width + 2e-6
        chn2.widths = (tau + 2e-6, pulse_width)
        chn2.delays = (0, 0)
        chn2.heights = (voltage2 - step_voltage, voltage2 - step_voltage)
        chn2.create_sequence()
        chn2.nrepeats = 0
        chn2.repeatstring = 'once'
        chn2.markerstring = 'maintain'
        chn2.markerloc = 0

        
        freq_rampup2 = Arbseq_Class('freqrampup2', timestep)
        slope = (step_voltage)/(ramp_time)
        height = voltage2 - step_voltage
        heights = list()
        while height <= voltage2:
            heights.append(height)
            height += (slope * timestep)
        freq_rampup2.heights = heights
        print('voltage length is:' + str(freq_rampup2.heights))
        freq_rampup2.widths = len(heights) * [timestep]
        print('shb widths is:' + str(chn2_shb.totaltime))
        freq_rampup2.delays = [0] * len(heights)
        freq_rampup2.totaltime = len(heights) * timestep
        print('rampup2 totaltime is:' + str(freq_rampup2.totaltime))
        freq_rampup2.create_sequence()
        freq_rampup2.nrepeats = 0
        freq_rampup2.repeatstring = 'once'
        freq_rampup2.markerstring = 'maintain'
        freq_rampup2.markerloc = 0
        


        heterodyne2 = Arbseq_Class('heterodyne2', timestep)
    #    pulses.totaltime = max(4*tau, 10*pulse_width)
        heterodyne2.totaltime = heterodyne_time + 4e-6
        heterodyne2.widths = [4e-6, heterodyne2.totaltime]
        heterodyne2.delays = [0, 0]
        heterodyne2.heights = [voltage2, voltage2]
        heterodyne2.create_sequence()
        heterodyne2.nrepeats = 0
        heterodyne2.repeatstring = 'once'
        heterodyne2.markerstring = 'maintain'
        heterodyne2.markerloc = 0

        chn2_repeat = Arbseq_Class('chn2r', timestep)
        chn2_repeat.totaltime = tri_time
        chn2_repeat.widths = [chn2_repeat.totaltime]
        chn2_repeat.delays = [0]
        chn2_repeat.heights = [voltage2]
        chn2_repeat.create_sequence()
        chn2_repeat.nrepeats = int((totaltime - chn2_shb.totaltime*chn2_shb.nrepeats - freq_rampdown2.totaltime -  chn2.totaltime - freq_rampup2.totaltime - heterodyne2.totaltime)/tri_time) - 1
        chn2_repeat.repeatstring = 'repeat'
        chn2_repeat.markerstring = 'maintain'
        chn2_repeat.markerloc = 0

        end2 = Arbseq_Class('end2', timestep)
        end2.totaltime = totaltime - chn2_shb.totaltime*chn2_shb.nrepeats - freq_rampdown2.totaltime - chn2.totaltime - freq_rampup2.totaltime - heterodyne2.totaltime - chn2_repeat.totaltime*chn2_repeat.nrepeats
        print('end2.totaltime:' + str(end2.totaltime))
        end2.widths = [end2.totaltime]
        end2.delays = [0]
        end2.heights = [voltage2]
        end2.create_sequence()
        end2.nrepeats = 0
        end2.repeatstring = 'once'
        end2.markerstring = 'maintain'
        end2.markerloc = 0
        '''
        '''
        chn1_shb = Arbseq_Class('chn1shb', timestep)
        chn1_shb.totaltime = tri_time
        chn1_shb.widths = [chn1_shb.totaltime]
        chn1_shb.delays = [0]
        chn1_shb.heights = [0]
        chn1_shb.create_sequence()
        chn1_shb.nrepeats = int(shb_time/chn1_shb.totaltime)
        chn1_shb.repeatstring = 'repeat'
        chn1_shb.markerstring = 'maintain'
        chn1_shb.markerloc = 0
        '''
        '''
        freq_rampdown1 = Arbseq_Class('frampdown1', timestep)
        freq_rampdown1.totaltime = freq_rampdown2.totaltime
        freq_rampdown1.widths = [freq_rampdown1.totaltime]
        freq_rampdown1.delays = [0]
        #pulses.heights = (1, 1, basevoltage/voltage1)
        freq_rampdown1.heights = [0]
        freq_rampdown1.create_sequence()
        freq_rampdown1.nrepeats = 0
        freq_rampdown1.repeatstring = 'once'
        freq_rampdown1.markerstring = 'maintain'
        freq_rampdown1.markerloc = 0
        '''

        pulses12 = Arbseq_Class('pulses12', timestep)
        #    pulses.totaltime = max(4*tau, 10*pulse_width)
        pulses12.totaltime = tau + pulse_width + 2e-6
        pulses12.widths = (pulse_width, pulse_width)
        #    pulses.delays = (2e-6,tau,tau)
        #    pulses.widths = (pulse_width*2, pulse_width*5, pulse_width*5)
        #    pulses.delays = (2e-6,tau - pulse_width*1.5,0)
        pulses12.delays = (2e-6, tau - pulse_width)
        #pulses.heights = (1, 1, basevoltage/voltage1)
        pulses12.heights = (voltage1 * 0.65, voltage1 * 0.65)
        pulses12.create_sequence()
        pulses12.nrepeats = 0
        pulses12.repeatstring = 'once'
        pulses12.markerstring = 'maintain'
        pulses12.markerloc = 0
        '''
        freq_rampup1 = Arbseq_Class('freqrampup1', timestep)
        freq_rampup1.totaltime = freq_rampup2.totaltime
        freq_rampup1.widths = [freq_rampup1.totaltime]
        freq_rampup1.delays = [0]
        #pulses.heights = (1, 1, basevoltage/voltage1)
        freq_rampup1.heights = [0]
        freq_rampup1.create_sequence()
        freq_rampup1.nrepeats = 0
        freq_rampup1.repeatstring = 'once'
        freq_rampup1.markerstring = 'maintain'
        freq_rampup1.markerloc = 0
        '''
        wait1 = Arbseq_Class('wait1', timestep)
        wait1.totaltime = tri_time
        wait1.widths = [wait1.totaltime]
        wait1.delays = [0]
        wait1.heights = [0]
        wait1.create_sequence()
        wait1.nrepeats = int(T_wait / tri_time)
        wait1.repeatstring = 'repeat'
        wait1.markerstring = 'maintain'
        wait1.markerloc = 0

        pulses3 = Arbseq_Class('pulses3', timestep)
        #    pulses.totaltime = max(4*tau, 10*pulse_width)
        pulses3.totaltime = pulse_width + 2e-6
        pulses3.widths = (pulse_width, 2e-6)
        #    pulses.delays = (2e-6,tau,tau)
        #    pulses.widths = (pulse_width*2, pulse_width*5, pulse_width*5)
        #    pulses.delays = (2e-6,tau - pulse_width*1.5,0)
        pulses3.delays = (0, 0)
        #pulses.heights = (1, 1, basevoltage/voltage1)
        pulses3.heights = (voltage1 * 0.65, 0)
        pulses3.create_sequence()
        pulses3.nrepeats = 0
        pulses3.repeatstring = 'once'
        pulses3.markerstring = 'maintain'
        pulses3.markerloc = 0
        '''
        heterodyne1 = Arbseq_Class('heterodyne1', timestep)
        heterodyne1.totaltime = T_wait + 4e-6
        heterodyne1.widths = [T_wait, pulse_width]
        heterodyne1.delays = [0, 0]
        heterodyne1.heights = [0, voltage1*0.58]
        heterodyne1.create_sequence()
        heterodyne1.nrepeats = 0
        heterodyne1.repeatstring = 'once'
        heterodyne1.markerstring = 'maintain'
        heterodyne1.markerloc = 0
        '''

        DC = Arbseq_Class('DC1', timestep)
        DC.totaltime = tri_time
        DC.heights = [0]
        DC.delays = [0]
        DC.widths = [DC.totaltime]
        DC.create_sequence()
        DC.nrepeats = int(
            (totaltime - pulses12.totaltime - wait1.totaltime * wait1.nrepeats
             - pulses3.totaltime) / tri_time) - 1
        DC.repeatstring = 'repeat'
        DC.markerstring = 'maintain'
        DC.markerloc = 0

        end1 = Arbseq_Class('end1', timestep)
        end1.totaltime = totaltime - pulses12.totaltime - wait1.totaltime * wait1.nrepeats - DC.totaltime * DC.nrepeats - -pulses3.totaltime
        print('end1.totaltime:' + str(end1.totaltime))
        end1.heights = [0]
        end1.delays = [0]
        end1.widths = [end1.totaltime]
        end1.create_sequence()
        end1.nrepeats = 0
        end1.repeatstring = 'once'
        end1.markerstring = 'maintain'
        end1.markerloc = 0

        return pulses12, wait1, pulses3, DC, end1
示例#9
0
	def startpulse(self, timestep=1e-9):
		self.fungen.output[1] = 'OFF'
		self.fungen.output[2] = 'OFF'
		self.fungen.clear_mem(1)
		self.fungen.clear_mem(2)
		params = self.pulse_parameters.widget.get()

		pre1 = Arbseq_Class('pre1', timestep)
		pre1.delays = [0]
		pre1.heights = [0]
		pre1.widths = [params['pulse width'].magnitude]
		pre1.totaltime = params['pulse width'].magnitude
		pre1.nrepeats = 1000
		pre1.repeatstring = 'repeat'
		pre1.markerstring = 'lowAtStart'
		pre1.markerloc = 0
		pre1.create_sequence()

		pulse = Arbseq_Class('pulse', timestep)
		pulse.delays = [0]
		pulse.heights = [1]
		pulse.widths = [params['pulse width'].magnitude]
		pulse.totaltime = params['pulse width'].magnitude
		pulse.nrepeats = 0
		pulse.repeatstring = 'once'
		pulse.markerstring = 'highAtStartGoLow'
		pulse.markerloc = 0
		pulse.create_sequence()

		post1 = Arbseq_Class('post1', timestep)
		post1.delays = [0]
		post1.heights = [0]
		post1.widths = [params['pulse width'].magnitude]
		post1.totaltime = params['pulse width'].magnitude
		post1.nrepeats = 1000
		post1.repeatstring = 'repeat'
		post1.markerstring = 'lowAtStart'
		post1.markerloc = 0
		post1.create_sequence()

		dc = Arbseq_Class('dc', timestep)
		dc.delays = [0]
		dc.heights = [0]
		dc.widths = [params['pulse width'].magnitude]
		dc.totaltime = params['pulse width'].magnitude
		dc.repeatstring = 'repeat'
		dc.markerstring = 'lowAtStart'
		dc.markerloc = 0
		period = params['period'].magnitude
		width = params['pulse width'].magnitude
		repeats = period/width - 1
		dc.nrepeats = repeats
		dc.create_sequence()

		pre2 = Arbseq_Class('pre2', timestep)
		pre2.delays = [0]
		pre2.heights = [1]
		pre2.widths = [params['pulse width'].magnitude]
		pre2.totaltime = params['pulse width'].magnitude
		pre2.nrepeats = 1000
		pre2.repeatstring = 'repeat'
		pre2.markerstring = 'lowAtStart'
		pre2.markerloc = 0
		pre2.create_sequence()

		pulse2 = Arbseq_Class('pulse2', timestep)
		pulse2.delays = [0]
		pulse2.heights = [1]
		pulse2.widths = [params['pulse width'].magnitude]
		pulse2.totaltime = params['pulse width'].magnitude
		pulse2.nrepeats = 0
		pulse2.repeatstring = 'once'
		pulse2.markerstring = 'highAtStartGoLow'
		pulse2.markerloc = 0
		pulse2.create_sequence()

		post2 = Arbseq_Class('post2', timestep)
		post2.delays = [0]
		post2.heights = [1]
		post2.widths = [params['pulse width'].magnitude]
		post2.totaltime = params['pulse width'].magnitude
		post2.nrepeats = 1000
		post2.repeatstring = 'repeat'
		post2.markerstring = 'lowAtStart'
		post2.markerloc = 0
		post2.create_sequence()

		dc2 = Arbseq_Class('dc2', timestep)
		dc2.delays = [0]
		dc2.heights = [-1]
		dc2.widths = [params['pulse width'].magnitude]
		dc2.totaltime = params['pulse width'].magnitude
		dc2.repeatstring = 'repeat'
		dc2.markerstring = 'lowAtStart'
		dc2.markerloc = 0
		period = params['period'].magnitude
		width = params['pulse width'].magnitude
		repeats = period/width - 1
		dc2.nrepeats = repeats
		dc2.create_sequence()

		self.fungen.send_arb(pulse, 1)
		self.fungen.send_arb(dc, 1)
		self.fungen.send_arb(pulse2, 2)
		self.fungen.send_arb(dc2, 2)
		self.fungen.send_arb(pre1, 1)
		self.fungen.send_arb(pre2, 2)
		self.fungen.send_arb(post1, 1)
		self.fungen.send_arb(post2, 2)

		seq1 = [pre1,pulse,post1,dc]
		seq2 = [pre2,pulse2,post2,dc2]

		self.fungen.create_arbseq('pulsetest', seq1, 1)
		self.fungen.wait()
		self.fungen.voltage[1] = params['pulse height']

		self.fungen.create_arbseq('shutter', seq2, 2)
		self.fungen.wait()
		self.fungen.voltage[2] = 7.1
		self.fungen.sync()

		self.configureQutag()

		expparams = self.exp_parameters.widget.get()
		wlparams = self.wl_parameters.widget.get()
		self.homelaser(wlparams['start'])
		print('Laser Homed!')
		self.fungen.output[2] = 'ON'
		self.fungen.output[1] = 'ON'
		qutagparams = self.qutag_params.widget.get()
		lost = self.qutag.getLastTimestamps(True) # clear Timestamp buffer
		stoptimestamp = 0
		synctimestamp = 0
		bincount = qutagparams['Bin Count']
		timebase = self.qutag.getTimebase()
		start = qutagparams['Start Channel']
		stop = qutagparams['Stop Channel']
		for i in range(expparams['# of points']):
			##Wavemeter measurements
			stoparray = []
			startTime = time.time()
			wls=[]
			lost = self.qutag.getLastTimestamps(True)
			while time.time()-startTime < expparams['Measurement Time'].magnitude:
				lost = self.qutag.getLastTimestamps(True)
				time.sleep(30*period)
				timestamps = self.qutag.getLastTimestamps(True)

				tstamp = timestamps[0] # array of timestamps
				tchannel = timestamps[1] # array of channels
				values = timestamps[2] # number of recorded timestamps
				for k in range(values):
					# output all stop events together with the latest start event
					if tchannel[k] == start:
						synctimestamp = tstamp[k]
					else:
						stoptimestamp = tstamp[k]
						stoparray.append(stoptimestamp)
				wls.append(str(self.wm.measure_wavelength()))
			self.createHistogram(stoparray, timebase, bincount, period,i, wls)
			print(i)
			with Client(self.laser) as client:
				setting=client.get('laser1:ctl:wavelength-set', float)
				client.set('laser1:ctl:wavelength-set', setting-0.002)
				time.sleep(1)

		self.fungen.output[1] = 'OFF'
		self.fungen.output[2] = 'OFF'
示例#10
0
    def makePulse(self, pulseWidth2, i):
        timestep = 1e-9
        self.fungen.output[1] = 'OFF'
        self.fungen.output[2] = 'OFF'
        self.fungen.clear_mem(1)
        self.fungen.clear_mem(2)
        params = self.pulse_parameters.widget.get()
        tau = Q_(5e-6, 's')
        period = params['period'].magnitude
        repeat_unit = 50e-9
        echo = 100e-6
        buffer_time = 100e-6
        shutter_offset = 500e-9
        pulse_width = params['pulse width'].magnitude
        chn1buffer = Arbseq_Class('chn1buffer', timestep)
        chn1buffer.delays = [0]
        chn1buffer.heights = [0]
        chn1buffer.widths = [repeat_unit]
        chn1buffer.totaltime = repeat_unit
        chn1buffer.nrepeats = buffer_time / repeat_unit
        chn1buffer.repeatstring = 'repeat'
        chn1buffer.markerstring = 'lowAtStart'
        chn1buffer.markerloc = 0
        chn1bufferwidth = repeat_unit * chn1buffer.nrepeats
        chn1buffer.create_sequence()

        chn1pulse = Arbseq_Class('chn1pulse', timestep)
        chn1pulse.delays = [0]
        chn1pulse.heights = [1]
        chn1pulse.widths = [pulse_width]
        chn1pulse.totaltime = pulse_width
        chn1pulse.nrepeats = 0
        chn1pulse.repeatstring = 'once'
        chn1pulse.markerstring = 'highAtStartGoLow'
        chn1pulse.markerloc = 0
        chn1pulsewidth = pulse_width
        chn1pulse.create_sequence()

        chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
        chn1pulse2.delays = [0]
        chn1pulse2.heights = [1]
        chn1pulse2.widths = [pulseWidth2]
        chn1pulse2.totaltime = pulseWidth2
        chn1pulse2width = pulseWidth2
        chn1pulse2.nrepeats = 0
        chn1pulse2.repeatstring = 'once'
        chn1pulse2.markerstring = 'lowAtStart'
        chn1pulse2.markerloc = 0
        chn1pulse2.create_sequence()

        chn1dc = Arbseq_Class('chn1dc', timestep)
        chn1dc.delays = [0]
        chn1dc.heights = [0]
        chn1dc.widths = [repeat_unit]
        chn1dc.totaltime = repeat_unit
        chn1dc.repeatstring = 'repeat'
        chn1dc.markerstring = 'lowAtStart'
        chn1dc.markerloc = 0
        chn1dcrepeats = int(
            (tau.magnitude - 0.5 * pulse_width - 0.5 * pulseWidth2) /
            repeat_unit)
        chn1dc.nrepeats = chn1dcrepeats
        chn1dcwidth = repeat_unit * chn1dcrepeats
        print(tau.magnitude, pulse_width, chn1dcrepeats)
        chn1dc.create_sequence()

        chn1pulse3 = Arbseq_Class('chn1pulse3', timestep)
        chn1pulse3.delays = [0]
        chn1pulse3.heights = [0]
        chn1pulse3.widths = [repeat_unit]
        chn1pulse3.totaltime = repeat_unit
        chn1pulse3width = shutter_offset
        chn1pulse3.nrepeats = shutter_offset / repeat_unit
        chn1pulse3.repeatstring = 'repeat'
        chn1pulse3.markerstring = 'lowAtStart'
        chn1pulse3.markerloc = 0
        chn1pulse3.create_sequence()

        chn1dc2 = Arbseq_Class('chn1dc2', timestep)
        chn1dc2.delays = [0]
        chn1dc2.heights = [0]
        chn1dc2.widths = [repeat_unit]
        chn1dc2.totaltime = repeat_unit
        chn1dc2.repeatstring = 'repeat'
        chn1dc2.markerstring = 'lowAtStart'
        chn1dc2repeats = int(
            (period - chn1bufferwidth - chn1pulsewidth - chn1dcwidth -
             chn1pulse2width - chn1pulse3width) / repeat_unit)
        chn1dc2.nrepeats = chn1dc2repeats
        chn1dc2.markerloc = 0
        #print((chn1dc2repeats*params['repeat unit'].magnitude) + tau.magnitude + params['pulse width'].magnitude)
        chn1dc2.create_sequence()

        chn2buffer = Arbseq_Class('chn2buffer', timestep)
        chn2buffer.delays = [0]
        chn2buffer.heights = [1]
        chn2buffer.widths = [repeat_unit]
        chn2buffer.totaltime = repeat_unit
        chn2buffer.nrepeats = buffer_time / repeat_unit
        chn2buffer.repeatstring = 'repeat'
        chn2buffer.markerstring = 'lowAtStart'
        chn2buffer.markerloc = 0
        chn2bufferwidth = repeat_unit * chn2buffer.nrepeats
        chn2buffer.create_sequence()

        chn2pulse1 = Arbseq_Class('chn2pulse1', timestep)
        chn2pulse1.delays = [0]
        chn2pulse1.heights = [1]
        chn2pulse1.widths = [pulse_width]
        chn2pulse1.totaltime = pulse_width
        chn2pulse1width = pulse_width
        chn2pulse1.nrepeats = 0
        chn2pulse1.repeatstring = 'once'
        chn2pulse1.markerstring = 'highAtStartGoLow'
        chn2pulse1.markerloc = 0
        chn2pulse1.create_sequence()

        chn2dc1 = Arbseq_Class('chn2dc1', timestep)
        chn2dc1.delays = [0]
        chn2dc1.heights = [1]
        chn2dc1.widths = [repeat_unit]
        chn2dc1.totaltime = repeat_unit
        chn2dc1.repeatstring = 'repeat'
        chn2dc1.markerstring = 'lowAtStart'
        chn2dc1.markerloc = 0
        chn2dc1repeats = int(
            (tau.magnitude - 0.5 * pulse_width - 0.5 * pulseWidth2) /
            repeat_unit)
        chn2dc1.nrepeats = chn2dc1repeats
        chn2dc1width = repeat_unit * chn2dc1repeats
        chn2dc1.create_sequence()

        chn2pulse2 = Arbseq_Class('chn2pulse2', timestep)
        chn2pulse2.delays = [0]
        chn2pulse2.heights = [1]
        chn2pulse2.widths = [pulseWidth2]
        chn2pulse2.totaltime = pulseWidth2
        chn2pulse2width = pulseWidth2
        chn2pulse2.nrepeats = 0
        chn2pulse2.repeatstring = 'once'
        chn2pulse2.markerstring = 'lowAtStart'
        chn2pulse2.markerloc = 0
        chn2pulse2.create_sequence()

        chn2pulse3 = Arbseq_Class('chn2pulse3', timestep)
        chn2pulse3.delays = [0]
        chn2pulse3.heights = [1]
        chn2pulse3.widths = [repeat_unit]
        chn2pulse3.totaltime = repeat_unit
        chn2pulse3width = shutter_offset
        chn2pulse3.nrepeats = shutter_offset / repeat_unit
        chn2pulse3.repeatstring = 'repeat'
        chn2pulse3.markerstring = 'lowAtStart'
        chn2pulse3.markerloc = 0
        chn2pulse3.create_sequence()

        chn2dc2 = Arbseq_Class('chn2dc2', timestep)
        chn2dc2.delays = [0]
        chn2dc2.heights = [-1]
        chn2dc2.widths = [repeat_unit]
        chn2dc2.totaltime = repeat_unit
        chn2dc2.repeatstring = 'repeat'
        chn2dc2.markerstring = 'lowAtStart'
        chn2dc2repeats = int(
            (period - chn2bufferwidth - chn2pulse1width - chn2dc1width -
             chn2pulse2width - chn2pulse3width) / repeat_unit)
        chn2dc2.nrepeats = chn2dc2repeats
        chn2dc2.markerloc = 0
        chn2dc2.create_sequence()

        self.fungen.send_arb(chn1buffer, 1)
        self.fungen.send_arb(chn1pulse, 1)
        self.fungen.send_arb(chn1dc, 1)
        self.fungen.send_arb(chn1pulse2, 1)
        self.fungen.send_arb(chn1pulse3, 1)
        self.fungen.send_arb(chn1dc2, 1)
        self.fungen.send_arb(chn2buffer, 2)
        self.fungen.send_arb(chn2pulse1, 2)
        self.fungen.send_arb(chn2dc1, 2)
        self.fungen.send_arb(chn2pulse2, 2)
        self.fungen.send_arb(chn2pulse3, 2)
        self.fungen.send_arb(chn2dc2, 2)

        seq = [chn1buffer, chn1pulse, chn1dc, chn1pulse2, chn1pulse3, chn1dc2]
        seq2 = [
            chn2buffer, chn2pulse1, chn2dc1, chn2pulse2, chn2pulse3, chn2dc2
        ]

        self.fungen.create_arbseq('twoPulse', seq, 1)
        self.fungen.create_arbseq('shutter', seq2, 2)
        self.fungen.wait()
        self.fungen.voltage[
            1] = params['pulse height'].magnitude + 0.000000000001 * i
        self.fungen.voltage[2] = 7.1 + 0.0000000000001 * i

        print(self.fungen.voltage[1], self.fungen.voltage[2])
        self.fungen.output[2] = 'ON'
        self.fungen.trigger_delay(1, shutter_offset)
        self.fungen.sync()
        time.sleep(1)
        self.fungen.output[1] = 'ON'
    def startpulse(self, timestep=1e-9):
        self.fungen.output[1] = 'OFF'
        self.fungen.output[2] = 'OFF'
        self.fungen.clear_mem(1)
        self.fungen.clear_mem(2)
        self.fungen.wait()
        params = self.pulse_parameters.widget.get()
        tau = params['start tau']
        period = params['period'].magnitude

        chn1pulse = Arbseq_Class('chn1pulse', timestep)
        chn1pulse.delays = [0]
        chn1pulse.heights = [1]
        chn1pulse.widths = [params['pulse width'].magnitude]
        chn1pulse.totaltime = params['pulse width'].magnitude
        chn1pulse.nrepeats = 0
        chn1pulse.repeatstring = 'once'
        chn1pulse.markerstring = 'highAtStartGoLow'
        chn1pulse.markerloc = 0
        chn1pulsewidth = params['pulse width'].magnitude
        chn1pulse.create_sequence()

        chn1dc = Arbseq_Class('chn1dc', timestep)
        chn1dc.delays = [0]
        chn1dc.heights = [0]
        chn1dc.widths = [params['repeat unit'].magnitude]
        chn1dc.totaltime = params['repeat unit'].magnitude
        chn1dc.repeatstring = 'repeat'
        chn1dc.markerstring = 'lowAtStart'
        chn1dc.markerloc = 0
        chn1dcrepeats = int((tau.magnitude - params['pulse width'].magnitude) /
                            (params['repeat unit'].magnitude))
        chn1dc.nrepeats = chn1dcrepeats
        chn1dcwidth = (params['repeat unit'].magnitude) * chn1dcrepeats
        print(tau.magnitude, params['pulse width'].magnitude, chn1dcrepeats)
        chn1dc.create_sequence()

        chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
        chn1pulse2.delays = [0]
        chn1pulse2.heights = [1]
        chn1pulse2.widths = [params['pulse width'].magnitude]
        chn1pulse2.totaltime = params['pulse width'].magnitude
        chn1pulse2width = params['pulse width'].magnitude
        chn1pulse2.nrepeats = 0
        chn1pulse2.repeatstring = 'once'
        chn1pulse2.markerstring = 'lowAtStart'
        chn1pulse2.markerloc = 0
        chn1pulse2.create_sequence()

        chn1pulse3 = Arbseq_Class('chn1pulse3', timestep)
        chn1pulse3.delays = [0]
        chn1pulse3.heights = [0]
        chn1pulse3.widths = [params['repeat unit'].magnitude]
        chn1pulse3.totaltime = params['repeat unit'].magnitude
        chn1pulse3width = 400e-9
        chn1pulse3.nrepeats = 400e-9 / params['repeat unit'].magnitude
        chn1pulse3.repeatstring = 'repeat'
        chn1pulse3.markerstring = 'lowAtStart'
        chn1pulse3.markerloc = 0
        chn1pulse3.create_sequence()

        chn1dc2 = Arbseq_Class('chn1dc2', timestep)
        chn1dc2.delays = [0]
        chn1dc2.heights = [0]
        chn1dc2.widths = [params['repeat unit'].magnitude]
        chn1dc2.totaltime = params['repeat unit'].magnitude
        chn1dc2.repeatstring = 'repeat'
        chn1dc2.markerstring = 'lowAtStart'
        chn1dc2repeats = int(
            (params['period'].magnitude - tau.magnitude -
             params['pulse width'].magnitude - chn1pulse3width) /
            (params['repeat unit'].magnitude))
        chn1dc2.nrepeats = chn1dc2repeats
        chn1dc2.markerloc = 0
        print((chn1dc2repeats * params['repeat unit'].magnitude) +
              tau.magnitude + params['pulse width'].magnitude)
        chn1dc2.create_sequence()

        chn2pulse1 = Arbseq_Class('chn2pulse1', timestep)
        chn2pulse1.delays = [0]
        chn2pulse1.heights = [1]
        # chn2pulse1width = pulsewidth+pulse2width+dcwidth
        chn2pulse1.widths = [params['pulse width'].magnitude]
        chn2pulse1.totaltime = params['pulse width'].magnitude
        chn2pulse1.nrepeats = 0
        chn2pulse1.repeatstring = 'once'
        chn2pulse1.markerstring = 'highAtStartGoLow'
        chn2pulse1.markerloc = 0
        chn2pulse1.create_sequence()
        chn2dc1 = Arbseq_Class('chn2dc1', timestep)
        chn2dc1.delays = [0]
        chn2dc1.heights = [1]
        chn2dc1.widths = [params['repeat unit'].magnitude]
        chn2dc1.totaltime = params['repeat unit'].magnitude
        chn2dc1.repeatstring = 'repeat'
        chn2dc1.markerstring = 'lowAtStart'
        chn2dc1.markerloc = 0
        chn2dc1repeats = int(
            (tau.magnitude - params['pulse width'].magnitude) /
            (params['repeat unit'].magnitude))
        chn2dc1.nrepeats = chn2dc1repeats
        chn2dc1width = (params['repeat unit'].magnitude) * chn2dc1repeats
        chn2dc1.create_sequence()

        chn2pulse2 = Arbseq_Class('chn2pulse2', timestep)
        chn2pulse2.delays = [0]
        chn2pulse2.heights = [1]
        chn2pulse2.widths = [params['pulse width'].magnitude]
        chn2pulse2.totaltime = params['pulse width'].magnitude
        chn2pulse2width = params['pulse width'].magnitude
        chn2pulse2.nrepeats = 0
        chn2pulse2.repeatstring = 'once'
        chn2pulse2.markerstring = 'lowAtStart'
        chn2pulse2.markerloc = 0
        chn2pulse2.create_sequence()

        chn2pulse3 = Arbseq_Class('chn2pulse3', timestep)
        chn2pulse3.delays = [0]
        chn2pulse3.heights = [1]
        chn2pulse3.widths = [params['repeat unit'].magnitude]
        chn2pulse3.totaltime = params['repeat unit'].magnitude
        chn2pulse3width = 400e-9
        chn2pulse3.nrepeats = 400e-9 / params['repeat unit'].magnitude
        chn2pulse3.repeatstring = 'repeat'
        chn2pulse3.markerstring = 'lowAtStart'
        chn2pulse3.markerloc = 0
        chn2pulse3.create_sequence()

        chn2dc2 = Arbseq_Class('chn2dc2', timestep)
        chn2dc2.delays = [0]
        chn2dc2.heights = [-1]
        chn2dc2.widths = [params['repeat unit'].magnitude]
        chn2dc2.totaltime = params['repeat unit'].magnitude
        chn2dc2.repeatstring = 'repeat'
        chn2dc2.markerstring = 'lowAtStart'
        chn2dc2repeats = int(
            (params['period'].magnitude - tau.magnitude -
             params['pulse width'].magnitude - chn2pulse3width) /
            (params['repeat unit'].magnitude))
        chn2dc2.nrepeats = chn2dc2repeats
        chn2dc2.markerloc = 0
        print((chn2dc2repeats * params['repeat unit'].magnitude) +
              tau.magnitude + params['pulse width'].magnitude)
        chn2dc2.create_sequence()

        self.fungen.send_arb(chn1pulse, 1)
        self.fungen.send_arb(chn1dc, 1)
        self.fungen.send_arb(chn1pulse2, 1)
        self.fungen.send_arb(chn1pulse3, 1)
        self.fungen.send_arb(chn1dc2, 1)
        self.fungen.send_arb(chn2pulse1, 2)
        self.fungen.send_arb(chn2dc1, 2)
        self.fungen.send_arb(chn2pulse2, 2)
        self.fungen.send_arb(chn2pulse3, 2)
        self.fungen.send_arb(chn2dc2, 2)

        seq = [chn1pulse, chn1dc, chn1pulse2, chn1pulse3, chn1dc2]
        seq2 = [chn2pulse1, chn2dc1, chn2pulse2, chn2pulse3, chn2dc2]

        self.fungen.create_arbseq('twoPulse', seq, 1)
        self.fungen.create_arbseq('shutter', seq2, 2)
        self.fungen.wait()
        self.fungen.voltage[
            1] = params['pulse height'].magnitude + 0.000000000001
        self.fungen.voltage[2] = 7.0 + 0.0000000000001

        print(self.fungen.voltage[1], self.fungen.voltage[2])
        self.fungen.output[1] = 'ON'
        self.fungen.output[2] = 'ON'
        #self.fungen.output[2] = 'OFF'
        self.fungen.trigger_delay(1, 400e-9)
        self.fungen.sync()

        self.srs.module_reset[5]
        self.srs.SIM928_voltage[5] = params['srs bias'].magnitude
        self.srs.SIM928_on[5]

        self.configureQutag()

        qutagparams = self.qutag_params.widget.get()
        lost = self.qutag.getLastTimestamps(True)  # clear Timestamp buffer
        stoptimestamp = 0
        synctimestamp = 0
        bincount = qutagparams['Bin Count']
        timebase = self.qutag.getTimebase()
        start = qutagparams['Start Channel']
        stop = qutagparams['Stop Channel']

        expparams = self.exp_parameters.widget.get()
        for i in range(expparams['# of points']):
            ##Wavemeter measurements
            stoparray = []
            startTime = time.time()
            wls = []
            lost = self.qutag.getLastTimestamps(True)
            while time.time(
            ) - startTime < expparams['Measurement Time'].magnitude:
                lost = self.qutag.getLastTimestamps(True)
                time.sleep(30 * period)
                timestamps = self.qutag.getLastTimestamps(True)

                tstamp = timestamps[0]  # array of timestamps
                tchannel = timestamps[1]  # array of channels
                values = timestamps[2]  # number of recorded timestamps
                for k in range(values):
                    # output all stop events together with the latest start event
                    if tchannel[k] == start:
                        synctimestamp = tstamp[k]
                    else:
                        stoptimestamp = tstamp[k]
                        stoparray.append(stoptimestamp)
                wls.append(str(self.wm.measure_wavelength()))
            self.createHistogram(stoparray, timebase, bincount, period, i, wls)
            print('Approx. ' + str(
                int((expparams['# of points'] - i) /
                    expparams['Measurement Time'].magnitude)) + ' min left')
            #self.fungen.voltage[2] = self.fungen.voltage[2].magnitude + 2*dcparams['DC step size'].magnitude

        self.fungen.output[1] = 'OFF'
        self.fungen.output[2] = 'OFF'
        startTime = time.time()
        startWl = self.wm.measure_wavelength()
        stoparray = []
        lastwls = []
        while time.time(
        ) - startTime < expparams['Measurement Time'].magnitude:
            time.sleep(period)
            timestamps = self.qutag.getLastTimestamps(True)

            tstamp = timestamps[0]  # array of timestamps
            tchannel = timestamps[1]  # array of channels
            values = timestamps[2]  # number of recorded timestamps
            for k in range(values):
                # output all stop events together with the latest start event
                if tchannel[k] == start:
                    synctimestamp = tstamp[k]
                else:
                    stoptimestamp = tstamp[k]
                    stoparray.append(stoptimestamp)
            lastwls.append(str(self.wm.measure_wavelength()))
        self.createHistogram(stoparray, timebase, bincount, period, 'bg',
                             lastwls)
示例#12
0
    def startpulse(self, timestep=1e-9):
        params = self.pulse_parameters.widget.get()
        tau = params['start tau']
        for i in range(
                int((params['stop tau'] - params['start tau']) /
                    params['step tau']) + 1):
            self.dataset.clear()
            self.fungen.output[1] = 'OFF'
            self.fungen.output[2] = 'OFF'
            self.fungen.clear_mem(1)
            self.fungen.clear_mem(2)
            self.fungen.wait()

            chn1pulse = Arbseq_Class('chn1pulse', timestep)
            chn1pulse.delays = [0]
            chn1pulse.heights = [1]
            chn1pulse.widths = [params['pulse width'].magnitude]
            chn1pulse.totaltime = params['pulse width'].magnitude
            chn1pulse.nrepeats = 0
            chn1pulse.repeatstring = 'once'
            chn1pulse.markerstring = 'highAtStartGoLow'
            chn1pulse.markerloc = 0
            chn1pulsewidth = params['pulse width'].magnitude
            chn1pulse.create_sequence()

            chn1dc = Arbseq_Class('chn1dc', timestep)
            chn1dc.delays = [0]
            chn1dc.heights = [0]
            chn1dc.widths = [params['repeat unit'].magnitude]
            chn1dc.totaltime = params['repeat unit'].magnitude
            chn1dc.repeatstring = 'repeat'
            chn1dc.markerstring = 'lowAtStart'
            chn1dc.markerloc = 0
            chn1dcrepeats = int(
                (tau.magnitude - params['pulse width'].magnitude) /
                (params['repeat unit'].magnitude))
            chn1dc.nrepeats = chn1dcrepeats
            chn1dcwidth = (params['repeat unit'].magnitude) * chn1dcrepeats
            print(tau.magnitude, params['pulse width'].magnitude,
                  chn1dcrepeats)
            chn1dc.create_sequence()

            chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
            chn1pulse2.delays = [0]
            chn1pulse2.heights = [1]
            chn1pulse2.widths = [params['pulse width'].magnitude * 2]
            chn1pulse2.totaltime = params['pulse width'].magnitude * 2
            chn1pulse2width = params['pulse width'].magnitude * 2
            chn1pulse2.nrepeats = 0
            chn1pulse2.repeatstring = 'once'
            chn1pulse2.markerstring = 'lowAtStart'
            chn1pulse2.markerloc = 0
            chn1pulse2.create_sequence()

            chn1pulse3 = Arbseq_Class('chn1pulse3', timestep)
            chn1pulse3.delays = [0]
            chn1pulse3.heights = [0]
            chn1pulse3.widths = [params['repeat unit'].magnitude]
            chn1pulse3.totaltime = params['repeat unit'].magnitude
            chn1pulse3width = 400e-9
            chn1pulse3.nrepeats = 400e-9 / params['repeat unit'].magnitude
            chn1pulse3.repeatstring = 'repeat'
            chn1pulse3.markerstring = 'lowAtStart'
            chn1pulse3.markerloc = 0
            chn1pulse3.create_sequence()

            chn1dc2 = Arbseq_Class('chn1dc2', timestep)
            chn1dc2.delays = [0]
            chn1dc2.heights = [0]
            chn1dc2.widths = [params['repeat unit'].magnitude]
            chn1dc2.totaltime = params['repeat unit'].magnitude
            chn1dc2.repeatstring = 'repeat'
            chn1dc2.markerstring = 'lowAtStart'
            chn1dc2repeats = int(
                (params['period'].magnitude - tau.magnitude -
                 params['pulse width'].magnitude - chn1pulse3width) /
                (params['repeat unit'].magnitude))
            chn1dc2.nrepeats = chn1dc2repeats
            chn1dc2.markerloc = 0
            print((chn1dc2repeats * params['repeat unit'].magnitude) +
                  tau.magnitude + params['pulse width'].magnitude)
            chn1dc2.create_sequence()

            chn2pulse1 = Arbseq_Class('chn2pulse1', timestep)
            chn2pulse1.delays = [0]
            chn2pulse1.heights = [0]
            # chn2pulse1width = pulsewidth+pulse2width+dcwidth
            chn2pulse1.widths = [params['pulse width'].magnitude]
            chn2pulse1.totaltime = params['pulse width'].magnitude
            chn2pulse1.nrepeats = 0
            chn2pulse1.repeatstring = 'once'
            chn2pulse1.markerstring = 'highAtStartGoLow'
            chn2pulse1.markerloc = 0
            chn2pulse1.create_sequence()

            chn2dc1 = Arbseq_Class('chn2dc1', timestep)
            chn2dc1.delays = [0]
            chn2dc1.heights = [1]
            chn2dc1.widths = [params['repeat unit'].magnitude]
            chn2dc1.totaltime = params['repeat unit'].magnitude
            chn2dc1.repeatstring = 'repeat'
            chn2dc1.markerstring = 'lowAtStart'
            chn2dc1.markerloc = 0
            chn2dc1repeats = int(
                (tau.magnitude - params['pulse width'].magnitude) /
                (params['repeat unit'].magnitude))
            chn2dc1.nrepeats = chn2dc1repeats
            chn2dc1width = (params['repeat unit'].magnitude) * chn2dc1repeats
            chn2dc1.create_sequence()

            chn2pulse2 = Arbseq_Class('chn2pulse2', timestep)
            chn2pulse2.delays = [0]
            chn2pulse2.heights = [1]
            chn2pulse2.widths = [params['pulse width'].magnitude]
            chn2pulse2.totaltime = params['pulse width'].magnitude
            chn2pulse2width = params['pulse width'].magnitude
            chn2pulse2.nrepeats = 0
            chn2pulse2.repeatstring = 'once'
            chn2pulse2.markerstring = 'lowAtStart'
            chn2pulse2.markerloc = 0
            chn2pulse2.create_sequence()

            chn2pulse3 = Arbseq_Class('chn2pulse3', timestep)
            chn2pulse3.delays = [0]
            chn2pulse3.heights = [0]
            chn2pulse3.widths = [params['repeat unit'].magnitude]
            chn2pulse3.totaltime = params['repeat unit'].magnitude
            chn2pulse3width = 400e-9
            chn2pulse3.nrepeats = 400e-9 / params['repeat unit'].magnitude
            chn2pulse3.repeatstring = 'repeat'
            chn2pulse3.markerstring = 'lowAtStart'
            chn2pulse3.markerloc = 0
            chn2pulse3.create_sequence()

            chn2dc2 = Arbseq_Class('chn2dc2', timestep)
            chn2dc2.delays = [0]
            chn2dc2.heights = [0]
            chn2dc2.widths = [params['repeat unit'].magnitude]
            chn2dc2.totaltime = params['repeat unit'].magnitude
            chn2dc2.repeatstring = 'repeat'
            chn2dc2.markerstring = 'lowAtStart'
            chn2dc2repeats = int(
                (params['period'].magnitude - tau.magnitude -
                 params['pulse width'].magnitude - chn2pulse3width) /
                (params['repeat unit'].magnitude))
            chn2dc2.nrepeats = chn2dc2repeats
            chn2dc2.markerloc = 0
            print((chn2dc2repeats * params['repeat unit'].magnitude) +
                  tau.magnitude + params['pulse width'].magnitude)
            chn2dc2.create_sequence()

            self.fungen.send_arb(chn1pulse, 1)
            self.fungen.send_arb(chn1dc, 1)
            self.fungen.send_arb(chn1pulse2, 1)
            self.fungen.send_arb(chn1pulse3, 1)
            self.fungen.send_arb(chn1dc2, 1)
            self.fungen.send_arb(chn2pulse1, 2)
            self.fungen.send_arb(chn2dc1, 2)
            self.fungen.send_arb(chn2pulse2, 2)
            self.fungen.send_arb(chn2pulse3, 2)
            self.fungen.send_arb(chn2dc2, 2)

            seq = [chn1pulse, chn1dc, chn1pulse2, chn1pulse3, chn1dc2]
            seq2 = [chn2pulse1, chn2dc1, chn2pulse2, chn2pulse3, chn2dc2]

            self.fungen.create_arbseq('twoPulse', seq, 1)
            self.fungen.create_arbseq('shutter', seq2, 2)
            self.fungen.wait()
            self.fungen.voltage[1] = 3.3 + 0.000000000001 * i
            self.fungen.voltage[2] = 0.6
            self.fungen.offset[2] = 3.0

            print(self.fungen.voltage[1], self.fungen.voltage[2])
            self.fungen.output[1] = 'ON'
            self.fungen.output[2] = 'ON'
            self.fungen.trigger_delay(1, 400e-9)
            self.fungen.sync()

            time.sleep(10000)
    def startpulse(self, timestep=1e-9):
        params = self.pulse_parameters.widget.get()
        tau = params['start tau'].magnitude
        period = params['period'].magnitude
        repeat_unit = params['repeat unit'].magnitude
        pulse_width = params['pulse width'].magnitude
        echo = params['echo'].magnitude
        step_tau = params['step tau'].magnitude
        waitTime = 0.02e-3
        for i in range(100):
            self.dataset.clear()
            self.fungen.output[1] = 'OFF'
            self.fungen.output[2] = 'OFF'
            self.fungen.clear_mem(1)
            self.fungen.clear_mem(2)
            self.fungen.wait()

            chn1pulse = Arbseq_Class('chn1pulse', timestep)
            chn1pulse.delays = [0]
            chn1pulse.heights = [1]
            chn1pulse.widths = [pulse_width]
            chn1pulse.totaltime = pulse_width
            chn1pulse.nrepeats = 0
            chn1pulse.repeatstring = 'once'
            chn1pulse.markerstring = 'lowAtStart'
            chn1pulse.markerloc = 0
            chn1pulsewidth = pulse_width
            chn1pulse.create_sequence()

            chn1dc = Arbseq_Class('chn1dc', timestep)
            chn1dc.delays = [0]
            chn1dc.heights = [0]
            chn1dc.widths = [repeat_unit]
            chn1dc.totaltime = repeat_unit
            chn1dc.repeatstring = 'repeat'
            chn1dc.markerstring = 'lowAtStart'
            chn1dc.markerloc = 0
            chn1dcrepeats = int((tau - pulse_width) / repeat_unit)
            chn1dc.nrepeats = chn1dcrepeats
            chn1dcwidth = repeat_unit * chn1dcrepeats
            chn1dc.create_sequence()

            chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
            chn1pulse2.delays = [0]
            chn1pulse2.heights = [1]
            chn1pulse2.widths = [pulse_width]
            chn1pulse2.totaltime = pulse_width
            chn1pulse2width = pulse_width
            chn1pulse2.nrepeats = 0
            chn1pulse2.repeatstring = 'once'
            chn1pulse2.markerstring = 'lowAtStart'
            chn1pulse2.markerloc = 0
            chn1pulse2.create_sequence()

            chn1dc2 = Arbseq_Class('chn1dc2', timestep)
            chn1dc2.delays = [0]
            chn1dc2.heights = [0]
            chn1dc2.widths = [repeat_unit]
            chn1dc2.totaltime = repeat_unit
            chn1dc2width = repeat_unit
            chn1dc2repeats = int((waitTime - pulse_width) / repeat_unit)
            chn1dc2.nrepeats = chn1dc2repeats
            chn1dc2width = repeat_unit * chn1dc2repeats
            chn1dc2.repeatstring = 'repeat'
            chn1dc2.markerstring = 'lowAtStart'
            chn1dc2.markerloc = 0
            chn1dc2.create_sequence()

            chn1pulse3 = Arbseq_Class('chn1pulse3', timestep)
            chn1pulse3.delays = [0]
            chn1pulse3.heights = [1]
            chn1pulse3.widths = [pulse_width]
            chn1pulse3.totaltime = pulse_width
            chn1pulse3width = pulse_width
            chn1pulse3.nrepeats = 0
            chn1pulse3.repeatstring = 'once'
            chn1pulse3.markerstring = 'highAtStartGoLow'
            chn1pulse3.markerloc = 0
            chn1pulse3.create_sequence()

            chn1dc3 = Arbseq_Class('chn1dc3', timestep)
            chn1dc3.delays = [0]
            chn1dc3.heights = [0]
            chn1dc3.widths = [repeat_unit]
            chn1dc3.totaltime = repeat_unit
            chn1dc3.repeatstring = 'repeat'
            chn1dc3.markerstring = 'lowAtStart'
            chn1dc3repeats = int(
                (period - 3 * chn1pulsewidth - chn1dcwidth - chn1dc2width) /
                repeat_unit)
            chn1dc3.nrepeats = chn1dc3repeats
            chn1dc3.markerloc = 0
            chn1dc3.create_sequence()

            self.fungen.send_arb(chn1pulse, 1)
            self.fungen.send_arb(chn1dc, 1)
            self.fungen.send_arb(chn1pulse2, 1)
            self.fungen.send_arb(chn1pulse3, 1)
            self.fungen.send_arb(chn1dc2, 1)
            self.fungen.send_arb(chn1dc3, 1)
            seq = [chn1pulse, chn1dc, chn1pulse2, chn1dc2, chn1pulse3, chn1dc3]

            self.fungen.create_arbseq('twoPulse', seq, 1)

            self.fungen.wait()
            self.fungen.voltage[
                1] = params['pulse height'].magnitude + 0.000000000001 * i

            print(self.fungen.voltage[1])
            self.fungen.sync()
            self.fungen.output[1] = 'ON'
            # self.osc.set_time(tau*2+pulse_width*3-tau/20)
            #time.sleep(100000)
            # if tau>6.0e-6:
            # 	if tau>60e-6:
            # 		self.osc.scale(1,0.01)
            # 	elif tau>30.0e-6:
            # 		self.osc.scale(1,0.02)
            # 	else:
            # 		self.osc.scale(1,0.02)
            # 	if tau>100e-6:
            # 		self.osc.scale(1,0.01)
            # else:
            # 	self.osc.scale(1,0.02)
            x, y = self.osc.curv()
            y = np.array(y)
            curTime = float(self.osc.query_time())
            maxIndex = np.argmax(y)
            if maxIndex < 800:
                self.osc.set_time(curTime - 500e-9)
            if np.max(y) < 1.1 * float(self.osc.scale_query(1)):
                self.osc.scale(
                    1, self.stepDown(1, float(self.osc.scale_query(1))))

            for j in range(5):
                x, y = self.osc.curv()
                x = np.array(x)
                x = x - x.min()
                y = np.array(y)
                self.saveData(x, y, tau, j)
                time.sleep(0.1)
            #time.sleep(1)

            tau = tau + step_tau
            curTime = float(self.osc.query_time())
            self.osc.set_time(curTime + 1.98 * step_tau)
示例#14
0
	def pump(self, timestep):
		params = self.parameters.widget.get()
		per=100e-3
		


		chn1pulse = Arbseq_Class('chn1pulse', timestep)
		chn1pulse.delays = [0]
		chn1pulse.heights = [1]
		chn1pulse.widths = [params['pump width'].magnitude]
		chn1pulse.totaltime = params['pump width'].magnitude
		chn1pulse.nrepeats = 0
		chn1pulse.repeatstring = 'once'
		chn1pulse.markerstring = 'highAtStartGoLow'
		chn1pulse.markerloc = 0
		chn1pulse.create_sequence()

		chn1dc = Arbseq_Class('dc1', timestep)
		chn1dc.delays = [0]
		chn1dc.heights = [0]
		chn1dc.widths = [params['wait time'].magnitude]
		chn1dc.totaltime = params['wait time'].magnitude
		chn1dc.nrepeats = 0
		chn1dc.repeatstring = 'once'
		chn1dc.markerstring = 'lowAtStart'
		chn1dc.markerloc = 0
		chn1dc.create_sequence()

		chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
		chn1pulse2.delays = [0]
		chn1pulse2.heights = [0]
		chn1pulse2.widths = [params['probe time'].magnitude]
		chn1pulse2.totaltime = params['probe time'].magnitude
		chn1pulse2.nrepeats = 0
		chn1pulse2.repeatstring = 'once'
		chn1pulse2.markerstring = 'highAtStartGoLow'
		chn1pulse2.markerloc = 0
		chn1pulse2.create_sequence()

		chn1dc2 = Arbseq_Class('dc2', timestep)
		chn1dc2.delays = [0]
		chn1dc2.heights = [0]
		chn1dc2.widths = [params['pump width'].magnitude]
		chn1dc2.totaltime = params['pump width'].magnitude
		chn1dc2.nrepeats = (per-params['pump width'].magnitude-params['wait time'].magnitude-params['probe time'].magnitude)/params['pump width'].magnitude
		chn1dc2.repeatstring = 'repeat'
		chn1dc2.markerstring = 'lowAtStart'
		chn1dc2.markerloc = 0
		chn1dc2.create_sequence()

		chn2pulse = Arbseq_Class('chn2pulse', timestep)
		chn2pulse.delays = [0]
		chn2pulse.heights = [0]
		chn2pulse.widths = [params['pump width'].magnitude]
		chn2pulse.totaltime = params['pump width'].magnitude
		chn2pulse.nrepeats = 0
		chn2pulse.repeatstring = 'once'
		chn2pulse.markerstring = 'highAtStartGoLow'
		chn2pulse.markerloc = 0
		chn2pulse.create_sequence()

		chn2dc = Arbseq_Class('chn2dc', timestep)
		chn2dc.delays = [0]
		chn2dc.heights = [0]
		chn2dc.widths = [params['wait time'].magnitude]
		chn2dc.totaltime = params['wait time'].magnitude
		chn2dc.nrepeats = 0
		chn2dc.repeatstring = 'once'
		chn2dc.markerstring = 'lowAtStart'
		chn2dc.markerloc = 0
		chn2dc.create_sequence()

		chn2pulse2 = Arbseq_Class('chn2pulse2', timestep)
		chn2pulse2.delays = [0]
		chn2pulse2.heights = [1]
		chn2pulse2.widths = [params['probe time'].magnitude]
		chn2pulse2.totaltime = params['probe time'].magnitude
		chn2pulse2.nrepeats = 0
		chn2pulse2.repeatstring = 'once'
		chn2pulse2.markerstring = 'highAtStartGoLow'
		chn2pulse2.markerloc = 0
		chn2pulse2.create_sequence()

		chn2dc2 = Arbseq_Class('chn2dc2', timestep)
		chn2dc2.delays = [0]
		chn2dc2.heights = [0]
		chn2dc2.widths = [params['pump width'].magnitude]
		chn2dc2.totaltime = params['pump width'].magnitude
		chn2dc2.nrepeats = (per-params['pump width'].magnitude-params['wait time'].magnitude-params['probe time'].magnitude)/params['pump width'].magnitude
		chn2dc2.repeatstring = 'repeat'
		chn2dc2.markerstring = 'lowAtStart'
		chn2dc2.markerloc = 0
		chn2dc2.create_sequence()

		self.fungen.send_arb(chn1pulse, 1)
		self.fungen.send_arb(chn1dc, 1)
		self.fungen.send_arb(chn1pulse2, 1)
		self.fungen.send_arb(chn1dc2, 1)

		self.fungen.send_arb(chn2pulse, 2)
		self.fungen.send_arb(chn2dc, 2)
		self.fungen.send_arb(chn2pulse2, 2)
		self.fungen.send_arb(chn2dc2, 2)

		seq = [chn1pulse, chn1dc, chn1pulse2, chn1dc2]
		seq2 = [chn2pulse, chn2dc, chn2pulse2, chn2dc2]
		self.fungen.create_arbseq('pumpPulse', seq, 1)
		self.fungen.create_arbseq('freq', seq2, 2)
		self.fungen.sync()
		self.fungen.wait()
		self.fungen.voltage[1] = 3.0
		self.fungen.voltage[2] = 0.8
		self.fungen.wait()
		self.fungen.output[2] = 'ON'
		time.sleep(1)
		self.fungen.output[1] = 'ON'
		time.sleep(100000)
		return
示例#15
0
    def pump(self, timestep):
        params = self.parameters.widget.get()
        per = 100e-3
        chn2pulse2 = Arbseq_Class('chn2pulse2', timestep)
        tri_time = 100e-6
        height = 0
        heights = list()
        heights.append(height)
        while height > -1:
            height -= (4 * timestep) / tri_time
            if height < -1:
                height = -1
            heights.append(height)
        # while height < 0:
        # 	height += (4*timestep)/tri_time
        # 	if height>0:
        # 		height=0
        # 	heights.append(height)
        while height < 1:
            height += (4 * timestep) / tri_time
            if height > 1:
                height = 1
            heights.append(height)
        while height > 0:
            height -= (4 * timestep) / tri_time
            if height < 0:
                height = 0
            heights.append(height)
        print(heights)
        chn2pulse2.heights = heights
        chn2pulse2.delays = [0] * len(heights)
        chn2pulse2.totaltime = tri_time
        chn2pulse2.widths = [timestep] * len(heights)
        chn2pulse2width = [timestep] * len(heights)
        print('chn2 len(heights) is:' + str(len(heights)))
        chn2pulse2.totaltime = len(heights) * timestep
        print('chn2_shb totaltime is:' + str(chn2pulse2.totaltime))
        chn2pulse2.nrepeats = int(0.5e-3 / tri_time)
        print('chn2_shb nrepeats is:' + str(chn2pulse2.nrepeats))
        chn2pulse2.repeatstring = 'repeat'
        chn2pulse2.markerstring = 'lowAtStart'
        chn2pulse2.markerloc = 0
        chn2pulse2.create_sequence()

        chn2trioff = Arbseq_Class('chn2trioff', timestep)
        chn2trioff.heights = heights
        chn2trioff.delays = [0] * len(heights)
        chn2trioff.totaltime = tri_time
        chn2trioff.widths = [timestep] * len(heights)
        chn2trioffwidth = [timestep] * len(heights)
        print('chn2 len(heights) is:' + str(len(heights)))
        chn2trioff.totaltime = len(heights) * timestep
        chn2trioff.nrepeats = int(0.2e-3 / tri_time)
        chn2trioff.repeatstring = 'repeat'
        chn2trioff.markerstring = 'lowAtStart'
        chn2trioff.markerloc = 0
        chn2trioff.create_sequence()

        chn1off1 = Arbseq_Class('chn1off1', timestep)
        chn1off1.delays = [0]
        chn1off1.heights = [0]
        chn1off1.widths = [params['ramp time'].magnitude]
        chn1off1.totaltime = params['ramp time'].magnitude
        chn1off1.nrepeats = 0
        chn1off1.repeatstring = 'once'
        chn1off1.markerstring = 'highAtStartGoLow'
        chn1off1.markerloc = 0
        chn1off1.create_sequence()

        chn1pulse = Arbseq_Class('chn1pulse', timestep)
        chn1pulse.delays = [0]
        chn1pulse.heights = [1]
        chn1pulse.widths = [params['pump width'].magnitude]
        chn1pulse.totaltime = params['pump width'].magnitude
        chn1pulse.nrepeats = 0
        chn1pulse.repeatstring = 'once'
        chn1pulse.markerstring = 'lowAtStart'
        chn1pulse.markerloc = 0
        chn1pulse.create_sequence()

        chn1off2 = Arbseq_Class('chn1off2', timestep)
        chn1off2.delays = [0]
        chn1off2.heights = [0]
        chn1off2.widths = [params['ramp time'].magnitude]
        chn1off2.totaltime = params['ramp time'].magnitude
        chn1off2.nrepeats = 0
        chn1off2.repeatstring = 'once'
        chn1off2.markerstring = 'lowAtStart'
        chn1off2.markerloc = 0
        chn1off2.create_sequence()

        chn1trioff = Arbseq_Class('chn1trioff', timestep)
        chn1trioff.delays = [0] * len(heights)
        chn1trioff.heights = [0] * len(heights)
        chn1trioff.widths = [timestep] * len(heights)
        chn1trioff.totaltime = tri_time
        chn1trioff.nrepeats = int(0.2e-3 / tri_time)
        chn1trioff.repeatstring = 'repeat'
        chn1trioff.markerstring = 'lowAtStart'
        chn1trioff.markerloc = 0
        chn1trioff.create_sequence()

        chn1dc = Arbseq_Class('dc1', timestep)
        chn1dc.delays = [0]
        chn1dc.heights = [0]
        chn1dc.widths = [params['wait time'].magnitude]
        chn1dc.totaltime = params['wait time'].magnitude
        chn1dc.nrepeats = 0
        chn1dc.repeatstring = 'once'
        chn1dc.markerstring = 'lowAtStart'
        chn1dc.markerloc = 0
        chn1dc.create_sequence()

        chn1pulse2 = Arbseq_Class('chn1pulse2', timestep)
        chn1pulse2.delays = [0] * len(heights)
        chn1pulse2.heights = [0.35] * len(heights)
        chn1pulse2.widths = [timestep] * len(heights)
        chn1pulse2.totaltime = tri_time
        chn1pulse2.nrepeats = int(0.5e-3 / tri_time)
        chn1pulse2.repeatstring = 'repeat'
        chn1pulse2.markerstring = 'lowAtStart'
        chn1pulse2.markerloc = 0
        chn1pulse2.create_sequence()

        chn1dc2 = Arbseq_Class('chn1dc2', timestep)
        chn1dc2.delays = [0]
        chn1dc2.heights = [0]
        chn1dc2.widths = [params['pump width'].magnitude]
        chn1dc2.totaltime = params['pump width'].magnitude
        chn1dc2.repeatstring = 'repeat'
        chn1dc2.markerstring = 'lowAtStart'
        chn1dc2.markerloc = 0
        chn1dc2.nrepeats = int(
            (per - tri_time - params['wait time'].magnitude -
             params['pump width'].magnitude) / params['pump width'].magnitude)
        chn1dc2.create_sequence()

        chn2off1 = Arbseq_Class('chn2off1', timestep)
        chn2off1.delays = [0]
        chn2off1.heights = [0]
        chn2off1.widths = [params['ramp time'].magnitude]
        chn2off1.totaltime = params['ramp time'].magnitude
        chn2off1.nrepeats = 0
        chn2off1.repeatstring = 'once'
        chn2off1.markerstring = 'lowAtStart'
        chn2off1.markerloc = 0
        chn2off1.create_sequence()

        chn2pulse = Arbseq_Class('chn2pulse', timestep)
        chn2pulse.delays = [0]
        chn2pulse.heights = [0]
        chn2pulse.widths = [params['pump width'].magnitude]
        chn2pulse.totaltime = params['pump width'].magnitude
        chn2pulse.nrepeats = 0
        chn2pulse.repeatstring = 'once'
        chn2pulse.markerstring = 'highAtStartGoLow'
        chn2pulse.markerloc = 0
        chn2pulse.create_sequence()

        chn2off2 = Arbseq_Class('chn2off2', timestep)
        chn2off2.delays = [0]
        chn2off2.heights = [0]
        chn2off2.widths = [params['ramp time'].magnitude]
        chn2off2.totaltime = params['ramp time'].magnitude
        chn2off2.nrepeats = 0
        chn2off2.repeatstring = 'once'
        chn2off2.markerstring = 'lowAtStart'
        chn2off2.markerloc = 0
        chn2off2.create_sequence()

        chn2dc = Arbseq_Class('chn2dc', timestep)
        chn2dc.delays = [0]
        chn2dc.heights = [0]
        chn2dc.widths = [params['wait time'].magnitude]
        chn2dc.totaltime = params['wait time'].magnitude
        chn2dc.nrepeats = 0
        chn2dc.repeatstring = 'once'
        chn2dc.markerstring = 'lowAtStart'
        chn2dc.markerloc = 0
        chn2dc.create_sequence()

        chn2dc2 = Arbseq_Class('chn2dc2', timestep)
        chn2dc2.delays = [0]
        chn2dc2.heights = [0]
        chn2dc2.widths = [params['pump width'].magnitude]
        chn2dc2.totaltime = params['pump width'].magnitude
        chn2dc2.repeatstring = 'repeat'
        chn2dc2.markerstring = 'lowAtStart'
        chn2dc2.markerloc = 0
        chn2dc2.nrepeats = int(
            (per - tri_time - params['wait time'].magnitude -
             params['pump width'].magnitude) / params['pump width'].magnitude)
        chn2dc2.create_sequence()

        self.fungen.send_arb(chn1off1, 1)
        self.fungen.send_arb(chn1pulse, 1)
        self.fungen.send_arb(chn1off2, 1)
        self.fungen.send_arb(chn1dc, 1)
        self.fungen.send_arb(chn1trioff, 1)
        self.fungen.send_arb(chn1pulse2, 1)
        self.fungen.send_arb(chn1dc2, 1)
        self.fungen.send_arb(chn2off1, 2)
        self.fungen.send_arb(chn2pulse, 2)
        self.fungen.send_arb(chn2off2, 2)
        self.fungen.send_arb(chn2dc, 2)
        self.fungen.send_arb(chn2pulse2, 2)
        self.fungen.send_arb(chn2dc2, 2)
        self.fungen.send_arb(chn2trioff, 2)

        seq = [
            chn1off1, chn1pulse, chn1off2, chn1dc, chn1trioff, chn1pulse2,
            chn1dc2
        ]
        seq2 = [
            chn2off1, chn2pulse, chn2off2, chn2dc, chn2trioff, chn2pulse2,
            chn2dc2
        ]
        self.fungen.create_arbseq('pumpPulse', seq, 1)
        self.fungen.create_arbseq('freq', seq2, 2)
        self.fungen.sync()
        self.fungen.wait()
        self.fungen.voltage[1] = 1
        self.fungen.voltage[2] = 1.4
        self.fungen.offset[2] = 3.6
        self.fungen.wait()
        self.fungen.output[2] = 'ON'
        time.sleep(1)
        self.fungen.output[1] = 'ON'
        time.sleep(100000)