示例#1
0
 def toggle_data_directory(self):
     index = (self.directory_index + 1) % len(self.data_directories)
     self.directory_index = index
     self.data_directory = self.data_directories[index]
     self.disk_io = qcodes.DiskIO(self.data_directory)
     logging.info('DataViewer: data directory %s' % self.data_directory)
     self.text.setText('Log files at %s' % self.data_directory)
     self.update_logs()
示例#2
0
    def test_load_legacy_dataset(self):
        """ We need to convert old datasets to the current dataset structure."""
        exampledatadir = os.path.join(qtt.__path__[0], 'exampledata')
        qcodes.DataSet.default_io = qcodes.DiskIO(exampledatadir)
        old_dataset = qtt.data.load_dataset(
            os.path.join('2017-09-04', '11-05-17_qtt_scan2Dfastvec'))

        def convert_legacy(old_dataset):
            """ Dummy converter """
            return old_dataset

        new_dataset = convert_legacy(old_dataset)
        self.assertIsInstance(new_dataset, qcodes.DataSet)
示例#3
0
    def default_file_path(cls) -> str:
        """
        The default data output path.
        """
        if cls.storage_folder is "":
            cls.storage_folder = cls.default_storage_folder()

        data_path = os.path.join(cls.storage_folder, "{date}",
                                 "{date}_{counter}.dat")
        loc_provider = qcodes.data.location.FormatLocation(fmt=data_path)
        io = qcodes.DiskIO('.')
        file_path = loc_provider(io)

        dir_name, _ = os.path.split(file_path)
        if not os.path.exists(dir_name):
            os.makedirs(dir_name, exist_ok=True)

        return file_path
示例#4
0
    def __init__(self, datadir=None, window_title='Data browser', default_parameter='amlitude'):
        super(DataViewer, self).__init__()

        self.default_parameter = default_parameter

        if datadir is None:
            datadir = qcodes.DataSet.default_io.base_location
        self.datadir = datadir

        qcodes.DataSet.default_io = qcodes.DiskIO(datadir)
        logging.info('DataViewer: data directory %s' % datadir)

        # setup GUI
        self.text = QtWidgets.QLabel()
        self.text.setText('Log files at %s' %
                          self.datadir)
        self.logtree = QtWidgets.QTreeView()  # QTreeWidget
        self.logtree.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self._treemodel = QtGui.QStandardItemModel()
        self.logtree.setModel(self._treemodel)
        self.__debug = dict()
        self.qplot = QtPlot() # remote=False, interval=0)
        self.plotwindow = self.qplot

        vertLayout = QtWidgets.QVBoxLayout()
        vertLayout.addWidget(self.text)
        vertLayout.addWidget(self.logtree)
        vertLayout.addWidget(self.plotwindow)
        self.setLayout(vertLayout)

        self._treemodel.setHorizontalHeaderLabels(['Log', 'Comments'])
        self.setWindowTitle(window_title)
        self.logtree.header().resizeSection(0, 240)

        # disable edit
        self.logtree.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.logtree.doubleClicked.connect(self.logCallback)

        # get logs from disk
        self.updateLogs()
示例#5
0
import qcodes
from qcodes import MatPlot

import qtt
from qtt.gui.parameterviewer import createParameterWidget
from qtt.algorithms.gatesweep import analyseGateSweep
from qtt.measurements.scans import scanjob_t
from qtt.instrument_drivers.virtual_gates import virtual_gates
from qtt import save_state, load_state
import qtt.measurements.videomode

import qtt.simulation.virtual_dot_array

datadir = tempfile.mkdtemp(prefix='qtt_example')
qcodes.DataSet.default_io = qcodes.DiskIO(datadir)

#%% Create a virtual model for testing
#
# The model resembles the spin-qubit dot setup. The hardware consists of a virtual
# keithley, IVVI racks and a virtual gates object

nr_dots = 3
station = qtt.simulation.virtual_dot_array.initialize(reinit=True,
                                                      nr_dots=nr_dots,
                                                      maxelectrons=2)

keithley1 = station.keithley1
keithley3 = station.keithley3

# virtual gates for the model
示例#6
0
 def set_data_directory(self, data_directory, index=0):
     self.data_directories[index] = data_directory
     self.data_directory = data_directory
     self.disk_io = qcodes.DiskIO(data_directory)
     logging.info('DataViewer: data directory %s' % data_directory)
     self.text.setText('Log files at %s' % self.data_directory)
示例#7
0
 def setDatadir(self, datadir):
     self.datadir = datadir
     self.io = qcodes.DiskIO(datadir)
     logging.info('DataViewer: data directory %s' % datadir)
     self.text.setText('Log files at %s' % self.datadir)