load_labone_demod_csv#

load_labone_demod_csv(fname: Union[str, Path], column_names: List[str] = ('chunk', 'timestamp', 'x', 'y', 'freq', 'phase', 'dio', 'trigger', 'auxin0', 'auxin1')) ndarray[source]#

Load a CSV file containing demodulator samples.

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

Parameters:
  • fname (Union[str, Path]) – The file or filename of the CSV file to load.

  • column_names (list or tuple of str, optional) – A list (or tuple) of column

  • columns. (names to load from the CSV file. Default is to load all) –

Returns:

A numpy structured array of shape (num_points,) whose field names correspond to the column names in the first line of the CSV file. num_points is the number of lines in the CSV file - 1.

Return type:

sample

Example

>>> import zhinst.utils
>>> sample = zhinst.utils.load_labone_demod_csv(
>>>   'dev2004_demods_0_sample_00000.csv',
>>>   ('timestamp', 'x', 'y'))
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> plt.plot(sample['timestamp'], np.abs(sample['x'] + 1j*sample['y']))