This page was generated from docs/examples/DataSet/import-data-from-legacy-dat-files.ipynb. Interactive online version: Binder badge.

Importing data from legacy .dat files

This notebook shows you how you can import data from a legacy dataset generated with the old qcodes.data dataset. These are typically generated with qcodes.loops.Loop or qcodes.measure.Measure.

[1]:
%matplotlib inline

from qcodes.dataset import (
    import_dat_file,
    initialise_database,
    load_or_create_experiment,
    plot_by_id,
)
[2]:
# in case it was not there already
initialise_database()
# put the old data in a new experiment
exp = load_or_create_experiment('old_data_loading', sample_name='no_sample')
[3]:
location2d = '../../../qcodes/tests/dataset/fixtures/data_2018_01_17/data_002_2D_test_15_43_14'
location1d = '../../../qcodes/tests/dataset/fixtures/data_2018_01_17/data_001_testsweep_15_42_57'
[4]:
run_ids = import_dat_file(location1d, exp=exp)
axs, cbaxs = plot_by_id(run_ids[0])
Trying to mark a run completed that was already completed.
Starting experimental run with id: 57.
../../_images/examples_DataSet_import-data-from-legacy-dat-files_5_2.png
[5]:
run_ids = import_dat_file(location2d, exp=exp)
axs, cbaxs = plot_by_id(run_ids[0])
Trying to mark a run completed that was already completed.
Starting experimental run with id: 58.
../../_images/examples_DataSet_import-data-from-legacy-dat-files_6_2.png
[ ]: