acq400_hapi package

Submodules

acq400_hapi.acq400 module

acq400.py interface to one acq400 appliance instance

  • enumerates all site services, available as uut.sX.knob
  • simple property interface allows natural "script-like" usage
  • eg:

    uut1.s0.set_arm = 1
    
  • equivalent to running this on a logged in shell session on the UUT:

    set.site1 set_arm=1
    
  • monitors transient status on uut, provides blocking events

  • read_channels() - reads all data from channel data service.

Created on Sun Jan 8 12:36:38 2017

@author: pgm

class acq400_hapi.acq400.Acq2106(_uut, monitor=True, has_mgtdram=False)[source]

Bases: acq400_hapi.acq400.Acq400

Acq2106 specialization of Acq400

Defines features specific to ACQ2106

run_mgt(_filter=<acq400_hapi.acq400.NullFilter instance>)[source]
set_master_trg(trg, edge='rising', enabled=True)[source]
set_mb_clk(hz=4000000, src='zclk', fin=1000000)[source]
set_sync_routing_slave()[source]
class acq400_hapi.acq400.Acq400(_uut, monitor=True)[source]

host-side proxy for Acq400 uut.

discovers and maintains all site servers maintains a monitor thread on the monitor port handles multiple channel post shot upload

Args:

_uut (str) : ip-address or dns name

monitor=True (bool) : set false to stub monitor,
useful for tracing on a second connection to an active system.
exception AwgBusyError(value)[source]

Bases: exceptions.Exception

chan2volts(chan, raw)[source]

chan2volts(self, chan, raw) returns calibrated volts for channel

Args:

chan: 1..nchan

raw: raw bits to convert.

clear_counters()[source]
classmethod create_uuts(uut_names)[source]

create_uuts(): factory .. create them in parallel

* Experimental Do Not Use *

demux_status()[source]
elapsed_samples()[source]
fetch_all_calibration()[source]
get_aggregator_sites()[source]
init_site_client(site)[source]
load_awg(data, autorearm=False)[source]
load_dpg(stl, trace=False)[source]
load_gpg(stl, trace=False)[source]
load_segments(segs)[source]
load_stl(stl, port, trace=False)[source]
mod_count
nchan()[source]
post_samples()[source]
pre_samples()[source]
read_chan(chan, nsam=0)[source]
read_channels(channels=())[source]

read all channels post shot data.

Returns:
chx (list) of np arrays.
run_livetop()[source]
run_oneshot()[source]
run_service(port, eof='EOF', prompt='>')[source]
samples()[source]
scale_raw(raw, volts=False)[source]
set_mb_clk(hz=4000000, src='zclk', fin=1000000)[source]
set_sync_routing(role)[source]
set_sync_routing_master(clk_dx='d1', trg_dx='d0')[source]
set_sync_routing_slave()[source]
show_segments()[source]
state()[source]
class acq400_hapi.acq400.AcqPorts[source]

server port constants

AWG_AUTOREARM = 54202
AWG_ONCE = 54201
BOLO8_CAL = 45072
DATA0 = 53000
DPGSTL = 4521
GPGDUMP = 4543
GPGSTL = 4541
LIVETOP = 53998
MGTDRAM = 53990
ONESHOT = 53999
SEGSR = 4251
SEGSW = 4250
SITE0 = 4220
STREAM = 4210
TSTAT = 2235
class acq400_hapi.acq400.Channelclient(addr, ch)[source]

Bases: acq400_hapi.netclient.Netclient

handles post shot data for one channel.

Args:

addr (str) : ip address or dns name

ch (int) : channel number 1..N

read(ndata, data_size=2, maxbuf=4194304)[source]

read ndata from channel data server, return as np array. Args:

ndata (int): number of elements

data_size : 2|4 short or int

maxbuf=4096 : max bytes to read per packet

Returns:
np: data array
  • TODO buffer +=

this is probably horribly inefficient probably better:

retbuf = np.array(dtype, ndata)
retbuf[cursor].
exception acq400_hapi.acq400.ExitCommand[source]

Bases: exceptions.Exception

class acq400_hapi.acq400.NullFilter[source]
class acq400_hapi.acq400.ProcessMonitor(_uut, _filter)[source]
st_monitor()[source]
st_re = <_sre.SRE_Pattern object>
class acq400_hapi.acq400.SF[source]

state constants

DEMUX = 5
ELAPSED = 3
POST = 2
PRE = 1
STATE = 0
class acq400_hapi.acq400.STATE[source]

transient states

ARM = 1
CLEANUP = 5
IDLE = 0
POPROCESS = 4
RUNPOST = 3
RUNPRE = 2
static str()[source]
class acq400_hapi.acq400.Signals[source]
EXT_TRG_DX = 'd0'
INT_TRG_DX = 'd1'
MB_CLK_DX = 'd1'
class acq400_hapi.acq400.Statusmonitor(_uut, _status)[source]

monitors the status channel

Efficient event-driven monitoring in a separate thread

get_state()[source]
st_monitor()[source]
st_re = <_sre.SRE_Pattern object>
trace = 0
wait_armed()[source]

blocks until uut is ARMED

wait_event(ev, descr)[source]
wait_stopped()[source]

blocks until uut is STOPPED

class acq400_hapi.acq400.StreamClient(addr)[source]

Bases: acq400_hapi.netclient.Netclient

handles live streaming data

acq400_hapi.acq400.run_unit_test()[source]
acq400_hapi.acq400.signal_handler(signal, frame)[source]

acq400_hapi.acq400_ui module

class acq400_hapi.acq400_ui.Acq400UI[source]

Common UI features for consistent args handling across all apps

static add_args(post=True, pre=True)[source]

generate standard args list

Args:
post: set False to disable createing the arg, becomes client app resposibility
static exec_args(args)[source]

and execute all the args

acq400_hapi.awg_data module

class acq400_hapi.awg_data.AllFullScale(uut, nchan, nsam, run_forever=False)[source]

Bases: acq400_hapi.awg_data.SinGen

load(autorearm=False)[source]
class acq400_hapi.awg_data.AwgDefaults(uut_name)[source]
read_defaults()[source]
store_defaults(current)[source]
class acq400_hapi.awg_data.Pulse(uut, nchan, nsam, args=(1000, 10))[source]
generate()[source]
load(autorearm=False)[source]
class acq400_hapi.awg_data.RainbowGen(uut, nchan, nsam, run_forever=False, ao0=0)[source]
NCYCLES = 5
load(autorearm=False)[source]
offset(ch)[source]
rainbow(ch)[source]
sin()[source]
sinc(ch)[source]
class acq400_hapi.awg_data.RunsFiles(uut, files, run_forever=False)[source]
load(autorearm=False)[source]
class acq400_hapi.awg_data.SinGen[source]
NCYCLES = 5
sin()[source]

acq400_hapi.cleanup module

exception acq400_hapi.cleanup.ExitCommand[source]

Bases: exceptions.Exception

acq400_hapi.cleanup.init()[source]
acq400_hapi.cleanup.signal_handler(signal, frame)[source]
acq400_hapi.cleanup.sleep(secs)[source]

acq400_hapi.intSIAction module

class acq400_hapi.intSIAction.intSIAction(option_strings, decimal=True, *args, **kwargs)[source]

Bases: argparse.Action

acq400_hapi.intSIAction.intSI_cvt(value, decimal=True)[source]

acq400_hapi.netclient module

netclient.py interface to client tcp socket with - sr() send/receive a command Created on Sun Jan 8 12:36:38 2017

@author: pgm

class acq400_hapi.netclient.Logclient(addr, port)[source]

Bases: acq400_hapi.netclient.Netclient

Netclient optimised for logging, line by line

poll()[source]
class acq400_hapi.netclient.Netclient(addr, port)[source]

connects and holds open a socket to defined port.

Args:
addr (str) : ip-address or dns name on network port (int) : server port number.
addr()[source]
port()[source]
receive_message(termex, maxlen=4096)[source]

Read the information from the socket line at a time.

Args:
termex (str): regex defines line terminator maxlen (int): max read size
Returns:
string representing message
trace = 0
class acq400_hapi.netclient.Siteclient(addr, port)[source]

Bases: acq400_hapi.netclient.Netclient

Netclient optimised for site service, may be multi-line response.

Autodetects all knobs and holds them as properties for simple script-like set/get syntax.

build_knobs(knobstr)[source]
get_knob(name)[source]
help(regex='.*')[source]

list available knobs, optionally filtered by regex.

eg

  • help() : list all
  • help("SIG) : list all knobs with SIG
  • help("SIG*FREQ") list all knobs SIG*FREQ
knobs = {}
pat = <_sre.SRE_Pattern object>
prevent_autocreate = False
set_knob(name, value)[source]
sr(message)[source]

send a command and receive a reply

Args:
message (str) : command (query) to send
Returns:
rx (str): response string
trace = 0
acq400_hapi.netclient.run_unit_test()[source]

acq400_hapi.rad_dds module

raddds.py specializes Acq400 for RADCELF triple DDS device

  • enumerates all site services, available as uut.sX.knob
  • simply property interface allows natural "script-like" usage
  • eg
  • uut1.s0.set_arm = 1
  • compared to
  • set.site1 set_arm=1
  • monitors transient status on uut, provides blocking events
  • read_channels() - reads all data from channel data service.

Created on Sun Jan 8 12:36:38 2017

@author: pgm

class acq400_hapi.rad_dds.RAD3DDS(_uut, monitor=True)[source]

Bases: acq400_hapi.acq400.Acq400

acq400_hapi.shotcontrol module

class acq400_hapi.shotcontrol.ActionScript(script_and_args)[source]
class acq400_hapi.shotcontrol.ShotController(_uuts)[source]

ShotController handles shot synchronization for a set of uuts

abort_shot()[source]
arm_shot()[source]
map_channels(channels)[source]
on_shot_complete()[source]

runs on completion, expect subclass override.

prep_shot()[source]
read_channels(channels=())[source]
run_shot(soft_trigger=False, acq1014_ext_trigger=0, remote_trigger=None)[source]

run_shot() control an entire shot from client.

for more control, use the individual methods above.

Args:
soft_trigger=False (bool) : trigger when armed
wait_armed()[source]
wait_complete()[source]
acq400_hapi.shotcontrol.intSI(x)[source]

Module contents