def test_scan1D(self, verbose=0): p = Parameter('p', set_cmd=None) q = Parameter('q', set_cmd=None) r = VoltageDivider(p, 4) _ = MultiParameter(instrumentName('multi_param'), [p, q]) gates = VirtualIVVI( name=qtt.measurements.scans.instrumentName('gates'), model=None) station = qcodes.Station(gates) station.gates = gates if verbose: print('test_scan1D: running scan1D') scanjob = scanjob_t({'sweepdata': dict( {'param': p, 'start': 0, 'end': 10, 'step': 2, 'wait_time': 0.}), 'minstrument': [r]}) _ = scan1D(station, scanjob, liveplotwindow=False, verbose=0) scanjob = scanjob_t({'sweepdata': dict( {'param': p, 'start': 0, 'end': 10, 'step': 2, 'wait_time': 0.}), 'minstrument': [q, r]}) _ = scan1D(station, scanjob, liveplotwindow=False, verbose=0) scanjob = scanjob_t({'sweepdata': dict( {'param': 'dac1', 'start': 0, 'end': 10, 'step': 2}), 'minstrument': [r]}) _ = scan1D(station, scanjob, liveplotwindow=False, verbose=0) scanjob = scanjob_t({'sweepdata': dict( {'param': {'dac1': 1}, 'start': 0, 'range': 10, 'step': 2}), 'minstrument': [r]}) data = scan1D(station, scanjob, liveplotwindow=False, verbose=0, extra_metadata={'hi': 'world'}) self.assertTrue('hi' in data.metadata) gates.close()
def test_scan1D_no_gates(self): p = Parameter('p', set_cmd=None) r = VoltageDivider(p, 4) scanjob = scanjob_t({'sweepdata': {'param': p, 'start': 0, 'end': 10, 'step': 2}, 'minstrument': [r]}) station=qcodes.Station() dataset = scan1D(station, scanjob, liveplotwindow=False, verbose=0) default_record_label = 'scan1D' self.assertTrue(default_record_label in dataset.location)
def test_scanjob_record_label(self): p = Parameter('p', set_cmd=None) r = VoltageDivider(p, 4) record_label='123unittest123' scanjob = scanjob_t({'sweepdata': dict( {'param': p, 'start': 0, 'end': 10, 'step': 2, 'wait_time': 0.}), 'minstrument': [r]}) scanjob['dataset_label']=record_label station=qcodes.Station() dataset = scan1D(station, scanjob, liveplotwindow=False, verbose=0) self.assertTrue(dataset.location.endswith(record_label))
signal_output = 1 oscillator = demodulator update_stimulus(is_enabled=True, signal_output=signal_output, amplitude=0.1, oscillator=oscillator) #%% Sensing a resonance signal_input = signal_output scanjob = scanjob_t(wait_time_startscan=1) scanjob.add_sweep(param=stimulus.set_oscillator_frequency(oscillator), start=140e6, end=180e6, step=0.2e6) scanjob.add_minstrument([scope_reader.acquire_single_sample(demodulator, 'R', partial=True), scope_reader.acquire_single_sample(demodulator, 'x', partial=True), scope_reader.acquire_single_sample(demodulator, 'y', partial=True)]) data_set = scan1D(station, scanjob) plt.clf() plt.plot(data_set.arrays[f'oscillator{demodulator}_freq'], data_set.arrays[f'demod{demodulator}_R']) plt.plot(data_set.arrays[f'oscillator{demodulator}_freq'], data_set.arrays[f'demod{demodulator}_x']) plt.plot(data_set.arrays[f'oscillator{demodulator}_freq'], data_set.arrays[f'demod{demodulator}_y']) plt.show() #%% 1D readout period = 1.0 frequency = 154.8e6 update_scope(period) set_stimulus_oscillator_frequency(frequency)