Пример #1
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
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])
Пример #2
0
f_start = 2.4e9
f_stop = 3.1e9
overlap_fraction = 0.5
f_baseband_minimum = 10e6  # Keep the tones away from the LO by at least this frequency
f_baseband_maximum = 200e6  # Keep the tones below this frequency
length_seconds = 0  # Take the minimum amount of data, in this case one block
filterbank_bin_separation = 2  # The minimum number of PFB bins that separate tones
df_lo = 2.5e3  # The minimum
num_tones_maximum = 128  # Imposed by the data streaming rate

# Hardware
conditioner = analog.HeterodyneMarkII()
shield = hardware.Thing(name='magnetic_shield_pocket',
                        state={'orientation': 'horizontal'})
led = hardware.Thing(name='led', state={'bias_current_mA': 10})
hw = hardware.Hardware(conditioner, shield)
ri = hardware_tools.r1h14_with_mk2(initialize=True, use_config=False)
ri.adc_valon.set_ref_select(0)
ri.lo_valon.set_ref_select(1)
ri.set_dac_attenuator(attenuation)
ri.set_fft_gain(fft_gain)

# Calculate sweep parameters, LO and baseband sweep frequencies
ri_state = ri.state
tone_sample_exponent = int(
    np.round(np.log2(ri_state.adc_sample_rate / df_baseband_target)))
df_baseband = ri_state.adc_sample_rate / 2**tone_sample_exponent
logger.info("Baseband resolution is {:.0f} Hz using 2^{:d} samples".format(
    df_baseband, tone_sample_exponent))
num_sweep_tones = np.min([
    int((f_baseband_maximum - f_baseband_minimum) / df_baseband),
f_lo_spacing = 2.5e3  # This is the smallest resolution available
f_baseband_minimum = 100e6  # Keep the tones away from the LO by at least this frequency.
sweep_length_seconds = 0.01
stream_length_seconds = 10

# Hardware
temperature = starcryo_temps.Temperature()
lock = lockin.SR830(serial_device=LOCKIN_SERIAL_PORT)
lock.identification  # This seems to be necessary to wake up the lockin
mmw = mmwave_source.MMWaveSource()
mmw.set_attenuator_ticks(0, 0)
mmw.multiplier_input = 'thermal'
mmw.ttl_modulation_source = "roach_2"
mmw.waveguide_twist_angle = 0
conditioner = analog.HeterodyneMarkII()
hw = hardware.Hardware(temperature, lock, mmw, conditioner)
ri = hardware_tools.r2h11nc_with_mk2(initialize=True, use_config=False)
ri.set_modulation_output('high')
ri.iq_delay = -1
ri.adc_valon.set_ref_select(0)  # internal
assert np.all(ri.adc_valon.get_phase_locks())

# Calculate sweep parameters, LO and baseband sweep frequencies
ri_state = ri.state
tone_sample_exponent = int(
    np.round(np.log2(ri_state.adc_sample_rate / df_baseband_target)))
df_baseband = ri_state.adc_sample_rate / 2**tone_sample_exponent
num_sweep_tones = int(f_sweep_span / df_baseband)
f_baseband = f_baseband_minimum + ri.state.adc_sample_rate / 2**tone_sample_exponent * np.arange(
    num_sweep_tones)
f_lo_center = f_lo_spacing * np.round(
Пример #4
0
# lockin.sensitivity = 17
print lockin.identification
print lockin.identification
# print time.time()-tic
# tic = time.time()
# print lockin.state(measurement_only=True)
# print time.time()-tic
source = mmwave_source.MMWaveSource()
source.set_attenuator_turns(6.0,6.0)
source.multiplier_input = 'thermal'
source.waveguide_twist_angle = 0
source.ttl_modulation_source = 'roach'

hwp_motor = stepper.SimpleStepper(port='/dev/ttyACM2')

setup = hardware.Hardware(hwp_motor, source, lockin)

ifboard = analog.HeterodyneMarkI()

setup = hardware.Hardware(ifboard)

ri = hardware_tools.r2_with_mk1()
ri.iq_delay=-1
ri.set_fft_gain(6)

ri.set_modulation_output(7)


initial_f0s = np.load('/data/readout/resonances/2017-05-JPL-8x8-LF-N1_higher_order_resonances_4.npy')/1e6
initial_lo = 1010.
# Parameters
suffix = 'filterbank_bin_noise'
lo_MHz = 3000
baseband_MHz = 100
lo_round_to_MHz = 2.5e-3
dac_attenuation = 10
tones_per_bin_exponent = 3
half_width_in_bins = 1
stream_length_seconds = 10
fraction_of_maximum = 0.8
wait = 5

# Hardware
conditioner = analog.HeterodyneMarkII()
hw = hardware.Hardware(conditioner)
ri = hardware_tools.r1h11nc_with_mk2(initialize=True, use_config=False)

# Calculate tone bin integers
f_filterbank_MHz = ri.fs / ri.nfft
n_filterbank = int(np.round(baseband_MHz / f_filterbank_MHz))
tone_sample_exponent = int(np.log2(ri.nfft) + tones_per_bin_exponent)
center_integer = 2**tones_per_bin_exponent * n_filterbank
tone_integers = center_integer + np.arange(
    -half_width_in_bins * 2**tones_per_bin_exponent,
    half_width_in_bins * 2**tones_per_bin_exponent + 1)

# Acquire
npd = acquire.new_npy_directory(suffix=suffix)
tic = time.time()
try:
Пример #6
0
# lockin.sensitivity = 17
print lockin.identification
print lockin.identification
# print time.time()-tic
# tic = time.time()
# print lockin.state(measurement_only=True)
# print time.time()-tic
source = mmwave_source.MMWaveSource()
source.set_attenuator_turns(6.0, 6.0)
source.multiplier_input = 'hittite'
source.waveguide_twist_angle = 0
source.ttl_modulation_source = 'roach'

hwp_motor = stepper.SimpleStepper(port='/dev/ttyACM2')

setup = hardware.Hardware(hwp_motor, source, lockin, hittite)

ri = Roach2Baseband()

ri.set_modulation_output(7)
initial_f0s = np.load(
    '/data/readout/resonances/2017-05-JPL-8x8-LF-N1_resonances_optical.npy'
) / 1e6

#initial_f0s = initial_f0s[:96][1::3]

nf = len(initial_f0s)
atonce = 128
if nf % atonce > 0:
    print "extending list of resonators to make a multiple of ", atonce
    initial_f0s = np.concatenate(
Пример #7
0
# Hardware
conditioner = analog.HeterodyneMarkII()
shield = hardware.Thing(name='magnetic_shield_pocket',
                        state={'orientation': 'horizontal'})
generator = hardware.Thing(name='generator',
                           state={
                               'waveform': 'square',
                               'V_pp': 0
                           })
resistor = hardware.Thing(name='resistor',
                          state={
                              'resistance_ohms': 677,
                              'V_pp': 0
                          })
hw = hardware.Hardware(conditioner, shield, generator, resistor)
ri = hardware_tools.r1h11_with_mk2(initialize=True, use_config=False)
ri.adc_valon.set_ref_select(0)  # internal
ri.lo_valon.set_ref_select(1)  # external

# Calculate sweep parameters, LO and baseband sweep frequencies
ri_state = ri.state
tone_sample_exponent = int(
    np.round(np.log2(ri_state.adc_sample_rate / df_baseband_target)))
df_baseband = ri_state.adc_sample_rate / 2**tone_sample_exponent
logger.info("Baseband resolution is {:.0f} Hz using 2^{:d} samples".format(
    df_baseband, tone_sample_exponent))
num_sweep_tones = min(int(df_total / df_baseband),
                      ri.max_num_waveforms(2**tone_sample_exponent))
logger.info("Using {:d} tones".format(num_sweep_tones))
f_baseband = f_baseband_minimum + ri.state.adc_sample_rate / 2**tone_sample_exponent * np.arange(
Пример #8
0
from kid_readout.roach import analog, hardware_tools
from kid_readout.interactive import *
from kid_readout.measurement import acquire
from kid_readout.measurement.legacy import legacy_acquire
from kid_readout.equipment import hardware
from kid_readout.measurement import mmw_source_sweep, core, basic

from equipment.keithley.sourcemeter import SourceMeter

logger.setLevel(logging.DEBUG)
# fg = FunctionGenerator()

sourcemeter = SourceMeter(serial_device='/dev/ttyUSB2')
ifboard = analog.Baseband()

setup = hardware.Hardware(ifboard,sourcemeter)


ri = baseband.RoachBaseband()
ri.initialize()
ri.set_fft_gain(6)

f0s = np.array([104.293,
                110.995,
                141.123,
                145.652,
                170.508,
                193.611,
                195.439,
                201.111])
Пример #9
0
import time

import numpy as np

from kid_readout.interactive import *
from kid_readout.equipment import hardware
from kid_readout.measurement import acquire
from kid_readout.roach import analog

ifboard = analog.HeterodyneMarkI()

setup = hardware.Hardware(ifboard)

ri = hardware_tools.r2_with_mk1()

ri.iq_delay = -1
ri.set_fft_gain(6)

#initial_f0s = np.load('/data/readout/resonances/2016-06-18-jpl-hex-271-32-high-qi-lo-1210-resonances.npy')
#initial_f0s = initial_f0s/1e6
initial_f0s = np.load(
    '/data/readout/resonances/2016-09-13-JPL-8x8-HF-1_thirdcooldown_resonances.npy'
) / 1e6
initial_lo = 1010.

nf = len(initial_f0s)
atonce = 128
if nf % atonce > 0:
    print "extending list of resonators to make a multiple of ", atonce
    initial_f0s = np.concatenate(
        (initial_f0s,
hittite = signal_generator.Hittite(ipaddr='192.168.0.200')
hittite.set_power(0)
hittite.on()
lockin = lockin.Lockin('/dev/ttyUSB2')
tic = time.time()
print lockin.identification
print time.time()-tic
print lockin.state()
print time.time()-tic
source = mmwave_source.MMWaveSource()
source.set_attenuator_turns(3.0,3.0)
source.multiplier_input = 'hittite'
source.waveguide_twist_angle = 45
source.ttl_modulation_source = 'roach'

setup = hardware.Hardware(hittite, source, lockin)
setup.hittite.set_freq(148e9/12.)


ri = heterodyne.RoachHeterodyne(adc_valon='/dev/ttyUSB0')
ri.initialize()
#ri.initialize(use_config=False)
ri.iq_delay = 0


low_group = np.array([ 1119.07673511,  1126.0153982 ,  1133.70131753,  1135.31245427,
        1143.21576741,  1148.0169738 ,  1159.41786884,  1160.26943775, 1162.33,
        1176.56747357,  1177.70848608,  1181.33728799,  1186.05472363,
        1190.29108718,  1193.62180971,  1203.87755917,  1205.8392229 ,
        1207.88046178,  1220.05286255,  1221.41371349,  1235.26613658, 1243.71])
Пример #11
0
fine_sweep_num_linewidths = 5
Q_max_expected = 50e3
df_coarse_sweep = f_center.min(
) / Q_max_expected  # A coarse sweep with a resolution of one linewidth should work
df_total = 4e6  # The total span of the baseband tones
df_lo = 2.5e3  # This is the smallest resolution available
f_baseband_minimum = 10e6  # Keep the tones away from the LO by at least this frequency.
sweep_length_seconds = 0  # Take the minimum amount of data, in this case one block
stream_length_seconds = 10

# Hardware
conditioner = analog.HeterodyneMarkII()
shield = hardware.Thing(name='magnetic_shield_pocket',
                        state={'orientation': 'horizontal'})
hittite = hardware.Thing(name='hittite', state={'output_dBm': 0})
hw = hardware.Hardware(conditioner, shield, hittite)
ri = hardware_tools.r1h11_with_mk2(initialize=True, use_config=False)
ri.adc_valon.set_ref_select(0)  # internal
ri.lo_valon.set_ref_select(1)  # external

# Calculate sweep parameters, LO and baseband sweep frequencies
ri_state = ri.state
tone_sample_exponent = int(
    np.round(np.log2(ri_state.adc_sample_rate / df_baseband_target)))
df_baseband = ri_state.adc_sample_rate / 2**tone_sample_exponent
logger.info("Baseband resolution is {:.0f} Hz using 2^{:d} samples".format(
    df_baseband, tone_sample_exponent))
num_sweep_tones = min(int(df_total / df_baseband),
                      ri.max_num_waveforms(2**tone_sample_exponent))
logger.info("Using {:d} tones".format(num_sweep_tones))
f_baseband = f_baseband_minimum + ri.state.adc_sample_rate / 2**tone_sample_exponent * np.arange(
Пример #12
0
hittite = signal_generator.Hittite(ipaddr='192.168.0.200')
hittite.set_power(0)
hittite.on()
lockin = lockin.Lockin(LOCKIN_SERIAL_PORT)
tic = time.time()
print lockin.identification

source = mmwave_source.MMWaveSource()
source.set_attenuator_turns(3.0, 3.0)
source.multiplier_input = 'hittite'
source.waveguide_twist_angle = 45
source.ttl_modulation_source = 'roach'

ifboard = analog.HeterodyneMarkI()

setup = hardware.Hardware(source, lockin, ifboard, hittite)
setup.hittite.set_freq(148e9 / 12.)

ri = hardware_tools.r2_with_mk1()
ri.set_fft_gain(8)

#initial_f0s = np.load('/data/readout/resonances/2016-06-18-jpl-hex-271-32-high-qi-lo-1210-resonances.npy')
#initial_f0s = initial_f0s/1e6
initial_lo = 1210.
bbtones = np.linspace(5, 220, 256)
initial_f0s = np.hstack((initial_lo - bbtones - 0.2, initial_lo + bbtones))
initial_f0s.sort()

nsamp = 2**15
step = 1
nstep = 24
Пример #13
0
acquire.show_settings()
acquire.show_git_status()
logger = acquire.get_script_logger(__file__)

# Parameters
wait = 4
length_seconds = 0.01
offset_frequency = np.linspace(10, 200, 4)
num_tone_samples = 2**15
dac_attenuation = 62  # The maximum
lo_frequency = 3000

# Hardware
temperature = starcryo_temps.Temperature()
conditioner = analog.HeterodyneMarkII()
hw = hardware.Hardware(temperature, conditioner)
ri = hardware_tools.r2h14_with_mk2(initialize=True, use_config=False)
ri.set_dac_attenuator(dac_attenuation)
ri.set_lo(lomhz=lo_frequency)
ri.set_tone_freqs(freqs=lo_frequency + offset_frequency,
                  nsamp=num_tone_samples)
ri.select_fft_bins(np.arange(offset_frequency.size))
ri.set_modulation_output('high')
ri.iq_delay = -1
ri.adc_valon.set_ref_select(1)  # external
assert np.all(ri.adc_valon.get_phase_locks())
ri.lo_valon.set_ref_select(1)  # external
assert np.all(ri.lo_valon.get_phase_locks())

# Acquire
sweep = basic.SweepArray(core.IOList(), description="T_c measurement")
from kid_readout.equipment import hardware
from equipment.keithley.sourcemeter import SourceMeter
from kid_readout.measurement import acquire
from kid_readout.roach import analog

#fg = agilent_33220.FunctionGenerator()
keithley = SourceMeter('/dev/ttyUSB3')
print keithley.identify()
ifboard = analog.HeterodyneMarkI()
#led = kid_readout.equipment.hardware.Thing('cold_1550nm_led', dict(voltage=3.3,
#                                                                   source_impedance=150,
#                                                                   pulse_width=10e-6,
#                                                                   frequency=244.1,
#                                                                   ))#{'current': 1e-4})

setup = hardware.Hardware(ifboard, keithley)
keithley.set_current_source()

ri = hardware_tools.r2h11_with_mk1()
ri.initialize(use_config=False)
ri.iq_delay = -1
ri.set_fft_gain(6)

#initial_f0s = np.load('/data/readout/resonances/2016-06-18-jpl-hex-271-32-high-qi-lo-1210-resonances.npy')
#initial_f0s = initial_f0s/1e6
initial_f0_groups = [  #[867.636, 926.75, 1009.072],
    [1009.072, 1375.513, 1392.178], [
        1603.5,
        1713.939,
    ]
]
Пример #15
0
#hittite.on()
lockin = lockin.Lockin('/dev/ttyUSB2')
tic = time.time()
print lockin.identification
print time.time()-tic
print lockin.state()
print time.time()-tic
source = mmwave_source.MMWaveSource()
source.set_attenuator_turns(5.0,5.0)
source.multiplier_input = 'thermal'
source.waveguide_twist_angle = 45
source.ttl_modulation_source = 'roach'

ifboard = analog.HeterodyneMarkI()

setup = hardware.Hardware(source, lockin, ifboard)
#setup.hittite.set_freq(148e9/12.)


ri = heterodyne.RoachHeterodyne(adc_valon='/dev/ttyUSB0')
ri.initialize()
#ri.initialize(use_config=False)
ri.iq_delay = 0


low_group = np.array([ 1119.07673511,  1126.0153982 ,  1133.70131753,  1135.31245427,
        1143.21576741,  1148.0169738 ,  1159.41786884,  1160.26943775, 1162.33,
        1176.56747357,  1177.70848608,  1181.33728799,  1186.05472363,
        1190.29108718,  1193.62180971,  1203.87755917,  1205.8392229 ,
        1207.88046178,  1220.05286255,  1221.41371349,  1235.26613658, 1243.71])
Пример #16
0
from kid_readout.interactive import *
from kid_readout.equipment import hardware, agilent_33220
from kid_readout.measurement import acquire
from kid_readout.roach import analog

#fg = agilent_33220.FunctionGenerator()
ifboard = analog.HeterodyneMarkI()
led = kid_readout.equipment.hardware.Thing('cold_1550nm_led',
                                           dict(
                                               voltage=3.3,
                                               source_impedance=150,
                                               pulse_width=10e-6,
                                               frequency=244.1,
                                           ))  #{'current': 1e-4})

setup = hardware.Hardware(ifboard, led)

ri = hardware_tools.r2_with_mk1()
ri.iq_delay = -1
ri.set_fft_gain(6)

#initial_f0s = np.load('/data/readout/resonances/2016-06-18-jpl-hex-271-32-high-qi-lo-1210-resonances.npy')
#initial_f0s = initial_f0s/1e6
initial_f0_groups = [  #[867.636, 926.75, 1009.072],
    [1009.072, 1375.513, 1392.178], [
        1603.5,
        1713.939,
    ]
]
lo_freqs = [  #850.0,
    #1350.0,