Daq

class undaqTools.Daq

class to represent a NADS DAQ file

Attributes

info Info namedtuple contains information from info block of DAQ
frame Frame recordtype contains information relevent to each frame
elemlist None or list None –> load all elements, list of wildcards
f0 int first frame contained in Daq instance
fend int last frame contained in Daq instance
cursor int starting byte of data in DAQ
dynobjs dict dictionary of dynamic objects
etc dict dictionary for end-user to store analysis relevent info

Methods

load_elemlist_fromfile(filename) load elemlist wildcards from plaintext file
read_daq(filename[, elemlist=None][, loaddata=True][, process_dynobjs=True]) Reads a .daq file into object
read_hd5(filename[, f0=None][, fend=None]) writes Daq object to HDF5 container
write_mat([filename=None][, outpath=None]) writes Daq object to .mat file using scipy.io.savmat
plot_ts(elem_pars[, xindx=None) time series specified by elem_pars
plot_dynobjs(dynobj_wc=’*’) make top-down plot of dynamic object paths
match_keys(wc) list of keys (element names) that match wc
keys_summary(wclist=None) prints table summary of Elements matching wclist
read_daq(filename[, elemlist=None] [, loaddata=True][, process_dynobjs=True])

Reads a .daq file into object

read <==> read_daq

Parameters :

filename : string

path to .daq file

elemlist : None or list_like

None -> load all elements list_like -> load names that match list

loaddata : bool

True -> load data False -> don’t load data

process_dynobjs : bool

True -> process dynobjs and put them in self.dynobjs False -> don’t load dynobjs

write_hd5(filename=None) :

writes Daq object to HDF5 container

read_hd5(filename[, f0=None][, fend=None])

writes Daq object to HDF5 container

f0 and fend specify frame range to read. Will export daq.dynobjs to HDF5 container

Parameters :

filename : string

file to read

f0 : None or int

None -> read from beginning of file int -> read from this frame

fend : None or int

None -> read to end of file int -> read to this frame

write_hd5(filename=None)

writes Daq object to HDF5 container

Parameters :

filename : None or string (optional)

None : file written to daq.filename.replace(‘.daq’, ‘.hdf5’) string : specify output file (will overwrite)

write_mat([filename=None][, outpath=None])

writes Daq object to .mat file using scipy.io.savmat

daq.dynobjs is not exported

This is intended to make convert_daq backwards compatible. pydaqTools users should use write_hdf5. The .mat files cannot be used to instantiate Daq objects.

Parameters :

filename : None or string (optional)

None : file written to daq.filename.replace(‘.daq’, ‘.hdf5’) string : specify output file (will overwrite)

outpath : None or string (optional)

string : directory to path

load_elemlist_fromfile(filename)

load elemlist wildcards from plaintext file.

assumes one wildcard per line

Parameters :

filename : string

path to file containing elemlist wildcards

match_keys(wc)

Returns a list of keys (element names) that match the Unix-style wildcard.

Parameters :

wc : string

wildcard apply to each match

Returns :

matches : list

names (keys to daq)

Notes

keys and wc both case normalized

Patterns are Unix shell style:

*       matches everything
?       matches any single character
[seq]   matches any character in seq
[!seq]  matches any char not in seq
plot_ts(self, elem_pars[, xindx=None])

Returns a time series figure containing elements specified by elem_pars

CSSDC measures yield step plots.

Parameters :

elem_pars : list of tuples

each tuple should contain
name : str

element to plot

yindx : None, int, or slice object

specifies the values of element to plot None -> slice(None, None, None)

xindx : None, slice object, FrameSlice object

specifies the frame range to plot None -> slice(None, None, None)

Returns :

fig : matplotlib.figure.Figure

the plot

plot_dynobjs(self[, dynobj_wc='*'])

make top-down plot of dynamic object paths

Parameters :

dynobj_wc : string

wildcard pattern to apply to dynamic object names using fnmatch (case normalized, shell-style matching)

Returns :

fig : matplotlib.figure.Figure

the plot

Previous topic

Getting Started

Next topic

Element

This Page