DAQ

Gitlab project: https://gitlab.com/jlogan03/daq

Autodocs

daq package

DAQ Interface Minimum Functionality Spec

class daq.DAQ(device, config_path=None)[source]

Bases: object

Parent class for device interface layer * This only exists as documentation * All methods should be overwritten by inheritors.

assemble_command_table(command_table)[source]

Assemble a human-readable command block into device-friendly commands

Parameters:command_table (pandas.DataFrame) – Time-series table of commands
close()[source]
  1. End stream
  2. Return to default settings
  3. Close connection to device
command(assembled_commands)[source]

Send commands to device low-level interface. * As much processing as possible is done prior to this step. * Mapping from user input to device-level interface is done during initialization.

get_config()[source]

Return current config as json

process_stream_data(stream_data)[source]

Reformat stream output after run

read()[source]

Read values from device. * Channel list is defined during one-time configuration. * No inputs are given to this function.

stream()[source]

Open high-rate read stream

Subpackages

daq.hardware package

Hardware-specific Interface implementations

Submodules
daq.hardware.labjack_u3 module

Abstraction layer and interface utilities for LabJack U3-HV

class daq.hardware.labjack_u3.LabJackU3(device, config_path=None)[source]

Bases: daq.DAQ

Abstraction layer for LabJack U3 (U3-HV or U3-LV) Each interface should take the same constructor arguments and have the same member functions

assemble_command_table(command_table)[source]

Assemble a command block into device-friendly commands

Parameters:command_table (pandas.DataFrame) – Time-series table of commands
close()[source]
  1. End stream
  2. Return to default settings
  3. Close connection to device
command(assembled_commands)[source]

Send commands to device low-level interface

Parameters:assembled_commands (list) – assembled list of device operations
easy_command(command_dict)[source]

!!SLOW!! Intended for manually commanding channels that may not be on the nominal list to reassert

Parameters:command_dict (dict) – Commands indexed by channel
get_config(query=False)[source]

Return current config as json

Parameters:query (bool) – Optional flag to get config directly from device instead of interface class
process_stream_data(stream_data)[source]

Apply device calibrations and reformat stream return

read()[source]

Read values from device

save_config(dst='./')[source]

Save json of pin config, device info, and calibrations

Parameters:dst (str) – destination directory
stream()[source]

Open high-rate read stream

daq.hardware.labjack_u3.replace_char(string, ind, char)[source]

Submodules

daq.operator module

Automation and data acquisition

class daq.operator.Allocator[source]

Bases: object

Asynchronous memory manager

close()[source]

Tell the listener to shut down and return data

listen()[source]

Data listener and memory allocator loop

open(n_channels)[source]

Start asynchronous process watching for incoming data and allocation requests

class daq.operator.Block(name, times, commands)[source]

Bases: object

A block of commands

reset()[source]

Rebuild iterator

class daq.operator.Operator(interface, config_dir, sleep_dt=None)[source]

Bases: object

Controls DAQ hardware

plot_block_graph(**kwargs)[source]

Display a chart of the block graph

run(memory_margin=1.2)[source]

Run automated process

save_block_graph_plot(dst='./')[source]

Save a static image of the block graph

daq.operator.wait(target, sleep_dt)[source]

Sleep until time within (dt) of (target)

daq.visuals module

Automation and data acquisition

daq.visuals.plot(x, ys, xlabel, ylabel, n_markers=10, legend_labels=None, fig_kwargs=None, plot_kwargs=None)[source]

Cleaned-up line chart implementation using sparse markers with random offsets

daq.visuals.show(*figures)[source]

Quickly show a list of figures as a 1xN grid

daq.hardware.labjack_u3hv module