import numpy as np 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,
from kid_readout.equipment import starcryo_temps acquire.show_settings() logger = acquire.get_script_logger(__file__) # Parameters dummy_MHz = 170 f0_MHz = np.array([78.350, 116.164, 160.815, dummy_MHz]) attenuations = [17, 23, 29, 35, 41] tone_sample_exponent = 21 sweep_length_seconds = 0.1 stream_length_seconds = 30 num_sweep_tones = 128 # Hardware conditioner = analog.Baseband() shield = hardware.Thing(name='magnetic_shield', state={}) hw = hardware.Hardware(conditioner, shield) ri = r2baseband.Roach2Baseband(roachip=ROACH2_IP, adc_valon=ROACH2_VALON) ri.set_modulation_output('high') ri.set_fft_gain(6) # Calculate baseband frequencies num_tone_samples = 2**tone_sample_exponent f_resolution = ri.state.adc_sample_rate / num_tone_samples offset_integers = np.arange(-num_sweep_tones / 2, num_sweep_tones / 2) offset_frequencies_MHz = 1e-6 * f_resolution * offset_integers sweep_frequencies_MHz = offset_frequencies_MHz[:, np.newaxis] + f0_MHz[np.newaxis, :] logger.info("Frequency spacing is {:.3f} kHz".format(1e3 * (offset_frequencies_MHz[1] - offset_frequencies_MHz[0]))) logger.info("Sweep span is {:.3f} MHz".format(offset_frequencies_MHz.ptp()))