Exemplo n.º 1
0
    def setup_roach(self, N=16, nsamp=2**20, NFFT=2**8, lendata=2**6, Fs=512.e6, atten=None, lof=1000, use_r2=True, use_mk2=True):
        self.N = N
        self.nsamp = nsamp
        self.NFFT = NFFT
        self.lendata = lendata
        self.Fs = Fs
        self.use_r2 = use_r2

        if use_r2:
            self.r = hardware_tools.r2_with_mk2()
        else:
            if use_mk2:
                self.r = hardware_tools.r1_with_mk2()
            else:   
                self.r = hardware_tools.r1_with_mk1()
            self.lendata = 1

        if atten != None: 
            self.r.set_dac_attenuator(atten)

        self.r.set_lo(lof, modulator_lo_power=5, demodulator_lo_power=5)
        self.lo = lof
        self.r.iq_delay = 0
        freqs = self.r.set_tone_baseband_freqs(np.linspace(10, 150, N), nsamp=nsamp)
        self.r.select_fft_bins(range(N))
        self.r._sync()
        return
Exemplo n.º 2
0
minimum_MHz = 10
round_to_MHz = 2
lo_MHz = round_to_MHz * np.round(
    (f0_MHz - span_MHz / 2 - minimum_MHz) / round_to_MHz)
offsets_MHz = np.linspace(minimum_MHz, minimum_MHz + span_MHz, num_offsets)
num_tone_samples = 2**19
length_seconds = 0.1

# Hardware
conditioner = analog.HeterodyneMarkII()
magnet = hardware.Thing('canceling_magnet', {
    'orientation': 'up',
    'distance_from_base_mm': 25
})
hw = hardware.Hardware(conditioner, magnet)
ri = hardware_tools.r2_with_mk2()
ri.set_dac_atten(40)
ri.set_fft_gain(4)
ri.set_modulation_output('high')

# Run
ncf = acquire.new_nc_file(suffix='sweep')
tic = time.time()
try:
    for lo in progress(lo_MHz):
        state = hw.state()
        state['temperature'] = {
            'package': temps.get_temperature_at(time.time())
        }
        tone_banks = np.array([np.array([f]) for f in lo + offsets_MHz])
        ri.set_lo(lomhz=lo, chan_spacing=round_to_MHz)
Exemplo n.º 3
0
span_MHz = 20
minimum_MHz = 10
round_to_MHz = 2
lo_MHz = round_to_MHz * np.round((f0_MHz - span_MHz / 2 - minimum_MHz) / round_to_MHz)
offsets_MHz = np.linspace(minimum_MHz, minimum_MHz + span_MHz, num_offsets)
num_tone_samples = 2**19
sweep_length_seconds = 0.1
stream_length_seconds = 30

# Hardware
conditioner = analog.HeterodyneMarkII()
magnet = hardware.Thing('canceling_magnet',
                        {'orientation': 'up',
                         'distance_from_base_mm': 25})
hw = hardware.Hardware(conditioner, magnet)
ri = hardware_tools.r2_with_mk2()
ri.set_dac_atten(40)
ri.set_fft_gain(4)
ri.set_modulation_output('high')

# Run
ncf = acquire.new_nc_file(suffix='sweep_stream')
tic = time.time()
try:
    for lo in progress(lo_MHz):
        state = hw.state()
        state['temperature'] = {'package': temps.get_temperature_at(time.time())}
        tone_banks = (lo + offsets_MHz)[:, np.newaxis]  # Transform to shape (num_offsets, 1)
        ri.set_lo(lomhz=lo, chan_spacing=round_to_MHz)
        sweep_array = acquire.run_sweep(ri, tone_banks=tone_banks, num_tone_samples=num_tone_samples,
                                        length_seconds=sweep_length_seconds)