Example #1
0
    def init(self):
        self.cfg['ex_mw'] = self.rm.open_resource(ex_mw)
        self.cfg['me_mw'] = self.rm.open_resource(me_mw)
        self.cfg['lo_mw'] = self.rm.open_resource(lo_mw)
        self.cfg['awg'] = AWG(self.rm.open_resource(awg))

        self.cfg['WAVEFORM_SIZE'], _ = self.cfg['awg'].current_waveforms()
        points1 = "0" * READ_OUT + "1" * ME_LEN + "0" * (
            self.cfg['WAVEFORM_SIZE'] - ME_LEN - READ_OUT)
        points2 = "0" * (READ_OUT + TRIGGER_DELAY) + "1" * ME_LEN + "0" * (
            self.cfg['WAVEFORM_SIZE'] - ME_LEN - READ_OUT - TRIGGER_DELAY)
        self.cfg['awg'].marker_data("trigger", points1, points2)

        self.cfg['ats'] = ATS()
        self.cfg['ats'].init()

        self.cfg['ex_mw'].write(":FREQ:CW %.13e" % (ex_freq * 1e9))
        self.cfg['ex_mw'].write(":POWER %.8e" % ex_power)
        self.cfg['ex_mw'].write(":OUTPUT ON")

        self.cfg['me_mw'].write(":POWER %.8e" % me_power)
        #self.cfg['me_mw'].write(":FREQ:CW %.13e" % (me_freq*1e9))
        self.cfg['me_mw'].write(":OUTPUT ON")

        #self.cfg['lo_mw'].write(":FREQ:CW %.13e" % (me_freq*1e9-heterodyne_freq))
        self.cfg['lo_mw'].write(":POWER %.8e" % 18)
        self.cfg['lo_mw'].write(":OUTPUT ON")
Example #2
0
    def init(self):
        self.cfg['ex21'] = self.rm.open_resource(ex21_mw)
        self.cfg['ex_mw'] = self.rm.open_resource(ex_mw)
        self.cfg['me_mw'] = self.rm.open_resource(me_mw)
        self.cfg['lo_mw'] = self.rm.open_resource(lo_mw)
        self.cfg['awg']   = AWG(self.rm.open_resource(awg))
        
        self.cfg['WAVEFORM_SIZE'], _ = self.cfg['awg'].current_waveforms()
        points1 = "0"*READ_OUT + "1"*ME_LEN + "0"*(self.cfg['WAVEFORM_SIZE']-ME_LEN-READ_OUT)
        points2 = "0"*(READ_OUT+TRIGGER_DELAY) + "1"*ME_LEN + "0"*(self.cfg['WAVEFORM_SIZE']-ME_LEN-READ_OUT-TRIGGER_DELAY)
        self.cfg['awg'].marker_data("trigger", points1, points2)

        self.cfg['ats'] = ATS()
        self.cfg['ats'].init(max_input = 0.2)
        
        self.cfg['ex21'].write(":FREQ:CW %.13e" % (ex21_freq*1e9))
        self.cfg['ex21'].write(":POWER %.8e" % (ex21_power+ex21_att))
        self.cfg['ex21'].write(":OUTPUT ON")
        
        self.cfg['ex_mw'].write(":FREQ:CW %.13e" % (ex_freq*1e9))
        self.cfg['ex_mw'].write(":POWER %.8e" % ex_power)
        self.cfg['ex_mw'].write(":OUTPUT ON")
        
        self.cfg['me_mw'].write(":POWER %.8e" % me_power)
        #self.cfg['me_mw'].write(":FREQ:CW %.13e" % (me_freq*1e9))
        self.cfg['me_mw'].write(":OUTPUT ON")
        
        points = np.array([1]*int(READ_OUT) + [0]*int(self.cfg['WAVEFORM_SIZE']-READ_OUT))
        mk = "1"*READ_OUT + "0"*(self.cfg['WAVEFORM_SIZE']-READ_OUT)
        self.cfg['awg'].write_data(points, "MW", mk, mk)
        self.cfg['awg'].write_data(points, "stock", mk, mk)
        
        #self.cfg['lo_mw'].write(":FREQ:CW %.13e" % (me_freq*1e9-heterodyne_freq))
        self.cfg['lo_mw'].write(":POWER %.8e" % 18)
        self.cfg['lo_mw'].write(":OUTPUT ON")
Example #3
0
    def init(self):
        self.cfg['ex_mw'] = self.rm.open_resource(ex_mw)
        self.cfg['me_mw'] = self.rm.open_resource(me_mw)
        self.cfg['lo_mw'] = self.rm.open_resource(lo_mw)
        self.cfg['awg'] = self.rm.open_resource(awg)

        WAVEFORM_SIZE = self.cfg['awg'].query_ascii_values(
            'WLIST:WAVEFORM:LENGTH? "MW"', 'd')[0]
        points1 = "0" * READ_OUT + "1" * ME_LEN + "0" * (WAVEFORM_SIZE -
                                                         ME_LEN - READ_OUT)
        points2 = "0" * (READ_OUT + TRIGGER_DELAY) + "1" * ME_LEN + "0" * (
            WAVEFORM_SIZE - ME_LEN - READ_OUT - TRIGGER_DELAY)
        marker_data(self.cfg['awg'], "trigger", points1, points2)

        self.cfg['ats'] = ATS()
        self.cfg['ats'].init()

        self.cfg['ex_mw'].write(":FREQ:CW %.13e" % (ex_freq * 1e9))
        self.cfg['ex_mw'].write(":POWER %.8e" % ex_power)
        self.cfg['ex_mw'].write(":OUTPUT ON")
        points = "0" * (READ_OUT - PI_LEN) + "1" * PI_LEN + "0" * (
            WAVEFORM_SIZE - READ_OUT)
        marker_data(self.cfg['awg'], "MW", points, points)

        self.cfg['me_mw'].write(":POWER %.8e" % me_power)
        self.cfg['me_mw'].write(":OUTPUT ON")
        self.cfg['lo_mw'].write(":POWER %.8e" % 18)
        self.cfg['lo_mw'].write(":OUTPUT ON")
Example #4
0
    def init(self):
        self.cfg['ex21'] = self.rm.open_resource("TCPIP::10.122.7.104::INSTR")
        self.cfg['ex_mw'] = self.rm.open_resource(ex_mw)
        self.cfg['me_mw'] = self.rm.open_resource(me_mw)
        self.cfg['lo_mw'] = self.rm.open_resource(lo_mw)
        self.cfg['awg'] = AWG(self.rm.open_resource(awg))

        WAVEFORM_SIZE, _ = self.cfg['awg'].current_waveforms()
        points1 = "0" * READ_OUT + "1" * ME_LEN + "0" * (WAVEFORM_SIZE -
                                                         ME_LEN - READ_OUT)
        points2 = "0" * (READ_OUT + TRIGGER_DELAY) + "1" * ME_LEN + "0" * (
            WAVEFORM_SIZE - ME_LEN - READ_OUT - TRIGGER_DELAY)
        points3 = "1" * READ_OUT + "0" * (WAVEFORM_SIZE - READ_OUT)
        self.cfg['awg'].marker_data("trigger", points1, points2)
        self.cfg['awg'].marker_data("MW", points3, points3)

        self.cfg['ats'] = ATS()
        self.cfg['ats'].init(max_input=0.2)

        self.cfg['ex21'].write(":OUTPUT OFF")

        self.cfg['ex_mw'].write(":POWER %.8e" % ex_power)
        self.cfg['ex_mw'].write(":OUTPUT ON")

        self.cfg['me_mw'].write(":POWER %.8e" % me_power)
        self.cfg['me_mw'].write(":FREQ:CW %.13e" % (me_freq * 1e9))
        self.cfg['me_mw'].write(":OUTPUT ON")

        self.cfg['lo_mw'].write(":FREQ:CW %.13e" %
                                (me_freq * 1e9 - heterodyne_freq))
        self.cfg['lo_mw'].write(":POWER %.8e" % 18)
        self.cfg['lo_mw'].write(":OUTPUT ON")
Example #5
0
    def set_parameters(self):
        class Parameters(DataSet):
            ex_mw = StringItem("Excitting Microwave",
                               default="TCPIP::10.122.7.103::INSTR")
            lo_mw = StringItem("LO Microwave",
                               default="TCPIP::10.122.7.102::INSTR")
            me_mw = StringItem("Measurement Microwave",
                               default="TCPIP::10.122.7.101::INSTR")
            awg = StringItem("AWG", default="TCPIP::10.122.7.100::INSTR")
            #me_power = FloatItem("Measuerment Power (dBm)",
            #                 default=10, min=-135, max=25, step=0.01, slider=True)

            f_range_s = FloatItem("Frequency start (GHz)",
                                  default=9.0,
                                  min=1,
                                  max=20,
                                  step=0.01)
            f_range_e = FloatItem("Frequency stop (GHz)",
                                  default=9.04,
                                  min=1,
                                  max=20,
                                  step=0.01).set_pos(col=1)
            f_range_n = IntItem("Frequency Num", default=41, min=1,
                                max=100000).set_pos(col=2)

            p_range_s = FloatItem("Power start (dBm)",
                                  default=-30,
                                  min=-130,
                                  max=25,
                                  step=0.01)
            p_range_e = FloatItem("Power stop (dBm)",
                                  default=10.0,
                                  min=-130,
                                  max=25,
                                  step=0.01).set_pos(col=1)
            p_range_n = IntItem("Power Num", default=41, min=1,
                                max=100000).set_pos(col=2)

            npoints = IntItem("Number of points",
                              default=1000,
                              min=100,
                              max=100000)

        e = Parameters()

        if e.edit():
            self.cfg['f_range'] = np.linspace(e.f_range_s, e.f_range_e,
                                              e.f_range_n)
            self.cfg['p_range'] = np.linspace(e.p_range_s, e.p_range_e,
                                              e.p_range_n)
            self.cfg['ex_mw'] = self.rm.open_resource(e.ex_mw)
            self.cfg['me_mw'] = self.rm.open_resource(e.me_mw)
            self.cfg['lo_mw'] = self.rm.open_resource(e.lo_mw)
            self.cfg['awg'] = AWG(self.rm.open_resource(e.awg))
            self.cfg['npoints'] = e.npoints

        self.cfg['ats'] = ATS()
Example #6
0
    def init(self):
        self.cfg['ex_mw'] = self.rm.open_resource(ex_mw)
        self.cfg['me_mw'] = self.rm.open_resource(me_mw)
        self.cfg['lo_mw'] = self.rm.open_resource(lo_mw)
        self.cfg['awg'] = AWG(self.rm.open_resource(awg))

        WAVEFORM_SIZE, _ = self.cfg['awg'].current_waveforms()
        points1 = "0" * READ_OUT + "1" * ME_LEN + "0" * (WAVEFORM_SIZE -
                                                         ME_LEN - READ_OUT)
        points2 = "0" * (READ_OUT + TRIGGER_DELAY) + "1" * 1000 + "0" * (
            WAVEFORM_SIZE - 1000 - READ_OUT - TRIGGER_DELAY)
        self.cfg['awg'].marker_data("trigger", points1, points2)

        self.cfg['ats'] = ATS()
        self.cfg['ats'].init()

        self.cfg['ex_mw'].write(":OUTPUT OFF")
        self.cfg['me_mw'].write(":POWER %.8e" % me_power)
        self.cfg['me_mw'].write(":OUTPUT ON")
        self.cfg['lo_mw'].write(":POWER %.8e" % 18)
        self.cfg['lo_mw'].write(":OUTPUT ON")
Example #7
0
"""
Created on Fri Mar 25 12:43:16 2016

@author: Administrator
"""
import numpy as np
import visa
from qulab.drivers import ATS, AWG

heterodyne_freq = 50e6
ME_LEN = 20000
npoints = 1000

rm = visa.ResourceManager()

ats = ATS()
awg = AWG(rm.open_resource("TCPIP::10.122.7.100::INSTR"))

ats.init(0.2)

dt = 1
t = np.linspace(0, ME_LEN - 1, ME_LEN) * dt
f = -heterodyne_freq * 1e-9
#N = ME_LEN
Exp = np.exp(-2j * np.pi * (f * t + 0.885))
hat = 2 * np.abs(f) / np.sqrt(2 * np.pi) * np.exp(-0.5 * (f *
                                                          (t - t.mean()))**2)


def fft_convolve(a, b, n, N):
    A = np.fft.fft(a, N)