qetpy.io package

Submodules

qetpy.io.io module

qetpy.io.io.loadstanfordfile(f, convtoamps=1024, lgcfullrtn=False)

Function that opens a Stanford .mat file and extracts the useful parameters. There is an option to return a dictionary that includes all of the data.

Parameters:
f : list, str

A list of filenames that should be opened (or just one filename). These files should be Stanford DAQ .mat files.

convtoamps : float, optional

Correction factor to convert the data to Amps. The traces are divided by this factor, as is the TTL channel (if it exists). Default is 1024.

lgcfullrtn : bool, optional

Boolean flag that also returns a dict of all extracted data from the file(s). Set to False by default.

Returns:
traces : ndarray

An array of shape (# of traces, # of channels, # of bins) that contains the traces extracted from the .mat file.

times : ndarray

An array of shape (# of traces,) that contains the starting time (in s) for each trace in the traces array. The zero point of the times is arbitrary.

fs : float

The digitization rate (in Hz) of the data.

ttl : ndarray, None

The TTL channel data, if it exists in the inputted data. This is set to None if there is no TTL data.

data : dict, optional

The dictionary of all of the data in the data file(s). Only returned if lgcfullrtn is set to True.

qetpy.io.io.getchannels_singlefile(filename)

Function for opening a .mat file from the Stanford DAQ and returns a dictionary that contains the data.

Parameters:
filename : str

The filename that will be opened. Should be a Stanford DAQ .mat file.

Returns:
res : dict

A dictionary that has all of the needed data taken from a Stanford DAQ .mat file.

qetpy.io.io.getchannels(filelist)

Function for opening multiple .mat files from the Stanford DAQ and returns a dictionary that contains the data.

Parameters:
filelist : list, str

The list of files that will be opened. Should be Stanford DAQ .mat files.

Returns:
combined : dict

A dictionary that has all of the needed data taken from all of the inputted Stanford DAQ .mat files.

Module contents