Measurement class basics

Objects of the measurement class are used to save all the information for one single measurement (in contrast to an object of the sample class that is used for multiple measurements).
A measurement object is currently created for spectroscopy and transport measurements, with time domain measurement support coming in the near future. Besides all used instrument settings it records

  • UUID, run, and user
  • measurement type (i.e. spectroscopy), used function (i.e. measure_2D()), and measurement axis
  • used sample object (in its then form)
  • git commit id of qkit

The measurement object is saved in the hdf5 file, viewable with qviewkit and saved in a separate .measurement file in the same folder as the hdf5 file. A saved measurement object can be loaded similar to a data file.


In [ ]:
## start qkit and import the necessary classes; here we assume a already configured qkit environment 
import qkit
qkit.start()

from qkit.measure.measurement_class import Measurement

In qkit's file information database there is a dictionary, mapping the UUID of the data file to the absolute path of the saved .measurement file. This can be loaded by creating a measurement object and parsing the abspath.


In [ ]:
m = Measurement(qkit.fid.measure_db['XXXXXX'])

The information in the file is JSON encoded (basically a large dict) and upon init gets converted into object attributes.


In [ ]:
user = m.user
run_id = m.run_id
smpl = m.sample

Besides this readout of parameters is also possible to set an instrument back to its settings during this measurement to recreate the mesurement environment. For this to work the specific instruments need to be initialized first.


In [ ]:
m.update_instrument('vna')

## also possible for all measurements
## m.update_all_instruments()

The entries can be added or changed (be careful not to lose information) and saved again.


In [ ]:
m.analyzed = True
m.rating = 5
m.save(qkit.fid.measure_db['XXXXXX'])