cpsc2_host_demux
Usage
usage: cpsc2_host_demux.py [-h] [--nchan NCHAN] [--nblks NBLKS] [--save SAVE] [--src SRC] [--cycle CYCLE] [--pchan PCHAN] [--egu EGU] [--xdt XDT]
[--data_type DATA_TYPE] [--double_up DOUBLE_UP] [--plot_mpl PLOT_MPL] [--drive_letter DRIVE_LETTER] [--show_columns SHOW_COLUMNS]
Named Arguments
- --nchan
Default: 80
- --nblks
Default: -1
- --save
save channelized data to dir
- --src
data source root
Default: “/data”
- --cycle
cycle from rtm-t-stream-disk
- --pchan
channels to plot
Default: “:”
- --egu
plot egu (V vs s) .. –egu UUT
Default: 0
- --xdt
0: use interval from UUT, else specify interval
Default: 0
- --data_type
Use int16 or int32 for data demux.
Default: 16
- --double_up
Use for ACQ480 two lines per channel mode
Default: 0
- --plot_mpl
Use MatPlotLib to plot subrate data args: start:stop[:step]
Default: “1:1000:1”
- --drive_letter
Which drive letter to use when on windows.
Default: “D”
- --show_columns
Default: 0
Outline:
host_demux.py Demux Data on HOST Computer
data is stored locally, either from mgtdram/ftp or fiber-optic AFHBA404
channelize the data
optionally store file-per-channel
optionally plot in pykst
@@todo store to MDSplus as segments.
example usage:
./host_demux.py --save=DATA --nchan=32 --nblks=-1 --pchan=none acq2106_067
# load all blocks, save per channel to subdirectory DATA/data_CC.dat
./host_demux.py --nchan=32 --nblks=4 --pchan=1:8 acq2106_067
# plot channels 1:8, 4 blocks
./host_demux.py --nchan=32 --nblks=-1 --pchan=1,2 acq2106_067
# plot channels 1,2, ALL blocks
# works for 8GB data, best to LIMIT the number of channels ..
./host_demux.py --nchan=96 --src=/data/ACQ400DATA/1 --egu=1 --xdt=2e-6 --cycle=1:4 --pchan=1:2 acq2106_061
# plot AFHBA404 data from PORT1
# plot egu (V vs s), specify interval, plot 4 cycles, plot 2 channels
# uut
use of --src
--src=/data # valid for FTP upload data
--src=/data/ACQ400DATA/1 # valid for SFP data, port 1
--src=afhba.0.log # one big raw file, eg from LLC
./host_demux.py --nchan 128 --pchan 1,33,65,97 --src=/path-to/afhba.0.log acq2106_110
# plot data from LLC, 128 channels, show one "channel" from each site.
# 97 was actually the LSB of TLATCH.
- host_demux.py [-h] [–nchan NCHAN] [–nblks NBLKS] [–save SAVE]
[–src SRC] [–pchan PCHAN] uut
host demux, host side data handling
positional arguments: uut uut
optional arguments: -h, –help show this help message and exit –nchan NCHAN –nblks NBLKS –save SAVE save channelized data to dir –src SRC data source root –pchan PCHAN channels to plot –egu EGU plot egu (V vs s) –xdt XDT 0: use interval from UUT, else specify interval –double_up Use for ACQ480 two lines per channel mode
- if –src is a file, use it directly
dir/nnnn
- if –src is a directory, first check if it has cycles:
dir/NNNNN/nnnnn*
- else iterate files in dir
dir/nnnnn*
- TO DEMUX ON WINDOWS TO STORE CHANNELISED DATA:
python .host_demux.py –save=1 –src=”[dir]” –pchan=none acq2106_114
Make sure that the muxed data is in D:[dir][UUT name]
Where [dir] is the location of the data.
Demuxed data will be written to D:demuxed[UUT name]
- To plot subsampled data on windows:
python .host_demux.py –src=Projects –nchan=8 –pchan 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 –plot_mpl=1:1000:1 acq2106_120
- class PacketID_ColumnHandler[source]
Bases:
ColumnHandler
- class Payload_ColumnHandler[source]
Bases:
ColumnHandler