Package: aaclient
Client for EPICS Archive ApplianceUtilities for interacting with an EPICSArchiver Applianceserver.With the exception ofaaget --how plot ...PV name strings are passed through
verbatim, and may include AA binning operators.
See theProcessing of datasection for a list.For fidelity, data is retrieved in the binary protobuf encoding native to AA.Intended to supplanthttps://github.com/epicsdeb/carchivetoolsBuildingDependencies from the python ecosystem (eg. pip)python >= 3.7aiohttp >= 3.7.0 (and perhaps earlier)numpy >= 1.7Cython >= 0.20setuptools >= 40.9.0h5py (optional)Dependencies from outside the python ecosystem (eg. rpm, deb, etc.)Working C++11 toolchainprotobuf compilerprotobuf-lite library and headers for >= 3.0apt-getinstallprotobuf-compilerlibprotobuf-dev

yuminstallprotobuf-compilerlibprotobuf-devel

dnfinstallprotobuf-compilerlibprotobuf-devel

brewinstallprotobuf(Getting protobuf on windows is difficult...
Seefor an exampleusingvcpkg.)Build and install with pipvirtualenvaa
.aa/bin/activate
pipinstall-Upip
pipinstallCython
./setup.pysdist
pipinstalldist/aaclient-*.tar.gz
aaget-hAlternately, for in-place usage (eg. evaluation or troubleshooting)../setup.pybuild_ext-i
python-maaclient.cmd.get-hIn either case a configuration file isrequired.cpaaclient.conf.exampleaaclient.conf# edit aaclient.conf and fill in at least "host="Command Line InterfaceThis package provides several CLI tools for interacting with
an Archiver Appliance server.See theexample configuration file.aagrepSearching for PVsRunningaagrepwithout arguments will attempt to print a full
list of PV names being archived.
Otherwise query patterns (wildcard or regexp) will be applied.
If multiple patterns are provided, the output will be all
PV names which matched any pattern.$ aagrep RH
CO2:RH-IaagetPrinting dataQuery data from a set of PV names for a certain time range
and print the results.$ aaget --start='-1 h' --end=now CO2:RH-I
01-30 07:50:11.958813 CO2:RH-I 45.10040283203125
01-30 08:13:04.816086 CO2:RH-I 44.56939697265625
01-30 08:40:41.527406 CO2:RH-I 44.06585693359375aah5Extract to HDF5 fileQueries likeaaget, with results written to a HDF5 file
instead of being printed to screen.$ aah5 --start='-1 h' --end=now out.h5 CO2:RH-I
INFO:__main__:'CO2:RH-I' : (3, 1)
$ h5ls -r out.h5 
/                        Group
/CO2:RH-I                Group
/CO2:RH-I/meta           Dataset {3/Inf}
/CO2:RH-I/value          Dataset {3/Inf, 1/Inf}Alternate entry points.aaget->python -m aaclient.cmd.getaagrep->python -m aaclient.cmd.grepaah5->python -m aaclient.cmd.h5APIThe API behind the CLI executables is (primarily) asyncio based.importasynciofromaaclientimportgetArchiveasyncdefdemo():A=awaitgetArchive()V,M=awaitA.raw('CO2:CO2-I',T0='-12 h')print(V.shape,M.shape)asyncio.run(demo())The entry point for API usage isaaclient.getArchive(),
which returns an object inheriting fromaaclient.IArchive.StreamingTheaaclient.IArchive.raw_iter()method allows for incremental
retrieval of arbitrarily large data for long time range.
Async. iteration will yield samples in batches.Blocking APIA blocking (threaded) API is also provided as a convenience
for interactive usage.frommatplotlib.pyplotimport*fromaaclient.threadingimportgetArchiveA=getArchive()# Request ~1000 points of "caplotbinning" data# suitable for quick/efficient visualization of a# long time rangeV,M=A.plot('CO2:CO2-I',T0='-7 d',count=1000)figure()plot_date(M.time_mpl,V[:,0],'-')grid(True)# Request complete (raw) data for a (shorter)# time rangefigure()V,M=A.raw('CO2:CO2-I',T0='-12 h')plot_date(M.time_mpl,V[:,0],'-')grid(True)show()