load_zicontrol_csv#

load_zicontrol_csv(filename: str, column_names: List[str] = ('t', 'x', 'y', 'freq', 'dio', 'auxin0', 'auxin1')) ndarray[source]#

Load a CSV file containing demodulator samples.

Load a CSV file containing demodulator samples as saved by the ziControl User Interface into a numpy structured array.

Parameters:
  • filename (str) – The file or filename of the CSV file to load.

  • column_names (List[str]) – A list (or tuple) of column names (demodulator sample field names) to load from the CSV file. Default is to load all columns.

Returns:

A numpy structured array of shape (num_points,) whose field names correspond to the field names of a ziControl demodulator sample. num_points is the number of lines in the CSV file - 1.

Return type:

sample

Example

>>> import zhinst.utils
>>> import matplotlib.plt as plt
>>> import numpy as np
>>> sample = zhinst.utils.load_labone_csv('Freq1.csv', ('t', 'x', 'y'))
>>> plt.plot(sample['t'], np.abs(sample['x'] + 1j*sample['y']))