Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initval_horz = gate_horz.get()
initval_vert = gate_vert.get()
if type(measure_names) is list:
data_measured = data[0]
else:
data_measured = data
sweep_horz = gate_horz[initval_horz - sweepranges[0]
/ 2:sweepranges[0] / 2 + initval_horz:sweepranges[0] / len(data_measured[0])]
sweep_vert = gate_vert[initval_vert - sweepranges[1]
/ 2:sweepranges[1] / 2 + initval_vert:sweepranges[1] / len(data_measured)]
else:
# vector scan
p1 = qcodes.Parameter('gate_horz', set_cmd=None)
p2 = qcodes.Parameter('gate_vert', set_cmd=None)
xvals = np.linspace(-sweepranges[0] / 2, sweepranges[0] / 2, data.shape[1])
yvals = np.linspace(-sweepranges[1] / 2, sweepranges[1] / 2, data.shape[0])
sweep_horz = p1[xvals]
sweep_vert = p2[yvals]
assert (data.shape[0] == len(list(sweep_vert)))
assert (data.shape[1] == len(list(sweep_horz)))
dataset = makeDataSet2D(sweep_vert, sweep_horz, measure_names=measure_names,
location=location, loc_record=loc_record, preset_data=data)
if fig is None:
return dataset, None
self._selected_peak = None
self._detune_axis = np.array([1, -1])
self._detune_axis = self._detune_axis / np.linalg.norm(self._detune_axis)
self._debug = {} # store debug data
self.name = '-'.join([s for s in self.gg])
self.goodpeaks = None
self.station = station
self.index = index
self.minstrument = minstrument
if index is not None:
raise Exception('use minstrument argument')
self.virt_gates = virt_gates
self.data = {}
self.plunger = qcodes.Parameter('plunger', get_cmd=self.plungervalue, set_cmd=self._set_plunger)
# values for measurement
if index is not None:
self.valuefunc = station.components[
'keithley%d' % index].amplitude.get
else:
self.valuefunc = None
passed to it as `record`.
Raises:
See _make_data_set for the ValueError and TypeError exceptions that can be raised
Returns:
The resulting dataset.
"""
setpoint_data = np.array(x)
preset_data = np.NaN * np.ones(setpoint_data.size)
if y is not None:
y = np.array(y)
setpoint = DataArray(name=xname, array_id=xname, preset_data=setpoint_data, unit=xunit, is_setpoint=True)
if isinstance(yname, (str, qcodes.Parameter)):
measured_data_list = [y]
measurement_list = [yname]
else:
measured_data_list = y
measurement_list = yname
measurement_unit = yunit
data_set, _ = _make_data_set(measured_data_list, measurement_list, measurement_unit, location, loc_record,
preset_data, [setpoint])
return data_set
def __init__(self, awg):
super().__init__('Keysight_M3201A', channel_numbers=[1, 2, 3, 4], marker_numbers=[1])
if not Keysight_M3201A:
raise AwgCommonError('The Keysight SD drivers can not be found!')
if type(awg).__name__ is not self._awg_name:
raise AwgCommonError('The AWG does not correspond with {}'.format(self._awg_name))
self.__settings = [Parameter(name='enabled_outputs', initial_value=0b0000,
set_cmd=None),
Parameter(name='amplitude', unit='Volt', initial_value=1.0,
vals=Numbers(0.0, 1.5), set_cmd=None),
Parameter(name='offset', unit='seconds', initial_value=0.0,
vals=Numbers(0.0, 2.0), set_cmd=None),
Parameter(name='wave_shape', initial_value=6,
set_cmd=None),
Parameter(name='delay', unit='seconds', initial_value=0,
vals=Numbers(0, 10), set_cmd=None),
Parameter(name='auto_trigger', unit='', initial_value=0,
set_cmd=None),
Parameter(name='cycles', initial_value=0,
set_cmd=None),
Parameter(name='prescaler', initial_value=10,
set_cmd=None)]
self.__awg = awg
from typing import Union
import enum
from qcodes import Parameter
class Role(enum.Enum):
GAIN = 1
DIVISION = 2
class ParameterScaler(Parameter):
""" Deprecated class, use qcodes.ScaledParameter instead
"""
def __init__(self,
output: Parameter,
division: Union[int, float, Parameter] = None,
gain: Union[int, float, Parameter] = None,
name: str = None,
label: str = None,
unit: str = None) -> None:
raise Exception('Use qcodes.ScaledParameter instead')
def _parse_2Dvec(self):
""" Adjust the parameter field in the step- and sweepdata for 2D vector scans.
This adds coefficient zero for parameters in either the sweep-
or the step-parameters that do not exist in the other.
"""
stepdata = self['stepdata']
sweepdata = self['sweepdata']
params = set()
if isinstance(stepdata['param'], qcodes.Parameter):
pass
else:
vec_check = [(stepdata, isinstance(stepdata['param'], lin_comb_type)),
(sweepdata, isinstance(sweepdata['param'], lin_comb_type))]
for scaninfo, boolean in vec_check:
if boolean is False:
scaninfo['param'] = {scaninfo['param']: 1}
params.update(list(stepdata['param'].keys()))
params.update(list(sweepdata['param'].keys()))
for param in params:
if param not in stepdata['param']:
stepdata['param'][param] = 0
if param not in sweepdata['param']:
sweepdata['param'][param] = 0
self['stepdata'] = stepdata
self['sweepdata'] = sweepdata
super().__init__('Keysight_M3201A', channel_numbers=[1, 2, 3, 4], marker_numbers=[1])
if not Keysight_M3201A:
raise AwgCommonError('The Keysight SD drivers can not be found!')
if type(awg).__name__ is not self._awg_name:
raise AwgCommonError('The AWG does not correspond with {}'.format(self._awg_name))
self.__settings = [Parameter(name='enabled_outputs', initial_value=0b0000,
set_cmd=None),
Parameter(name='amplitude', unit='Volt', initial_value=1.0,
vals=Numbers(0.0, 1.5), set_cmd=None),
Parameter(name='offset', unit='seconds', initial_value=0.0,
vals=Numbers(0.0, 2.0), set_cmd=None),
Parameter(name='wave_shape', initial_value=6,
set_cmd=None),
Parameter(name='delay', unit='seconds', initial_value=0,
vals=Numbers(0, 10), set_cmd=None),
Parameter(name='auto_trigger', unit='', initial_value=0,
set_cmd=None),
Parameter(name='cycles', initial_value=0,
set_cmd=None),
Parameter(name='prescaler', initial_value=10,
set_cmd=None)]
self.__awg = awg