Package: clat
clatCommand Line Analysis Tools: A collection of tools for doing data analysis.This project started out as a small collection of example scripts to learn about using Python for simple
data analysis at the command line and grew into a collection of utilities I have found useful.InstallationInstall this tool usingpip:$ pip install clatUsageclatconsists of several different commands, all named with theclat-prefix. For example,clat-avgcomputes the average of a set of numbers. It behaves like a standard UNIX filter program.set10|clat-avg5.5There are scripts for computing the sum, standard deviation, generating histograms, plotting, and more. To see a list of available tools, just typeclat-and then press<TAB>a couple of times. All commands
accept the--helpoption.Filtersclatincludes commands for computing the sum, average, standard deviation, root mean square, and uncertainty (standard error of the mean) for a stream of data. These commands read data from standard input and behave
like a normal UNIX filter (grep,cut,sort,etc). For example:echo-e'1\n2\n3'|clat-sumecho-e'1\n2\n3'|clat-avgecho-e'1\n2\n3'|clat-stddevecho-e'1\n2\n3'|clat-rmsecho-e'1\n2\n3'|clat-unc6.02.01.02.1602468994692870.5773502691896258GeneratorsSometimes it is useful to be able to generate some data at the command line. For example, creating a test function to use with some other analysis tool or check that your plotting program is working.
In the past I have usedseqwithgawkto do this, but it gets clumsy. Theclat-funccommand was created to make this easier. For example, to generate a Gaussian function from -1 to 1, you could do thisclat-func--x-min-1--x-max1--n20--y"exp( -({x}/0.2)**2 ) "-1.01.3887943864964021e-11
-0.89473684210526322.032802578425745e-09
-0.78947368421052631.7098030687941603e-07
-0.68421052631578958.26400593449372e-06
-0.57894736842105270.00022952436120824522
-0.47368421052631580.003663199685231906
-0.3684210526315790.033595881277480345
-0.263157894736842150.17705374665950163
-0.15789473684210530.5361889303292543
-0.0526315789473684740.93309143901457570.052631578947368360.93309143901457590.15789473684210530.53618893032925430.263157894736842040.177053746659501850.368421052631578760.0335958812774804840.47368421052631570.0036631996852319160.57894736842105270.000229524361208245220.68421052631578948.264005934493735e-060.78947368421052611.7098030687941723e-070.8947368421052632.0328025784257597e-091.01.3887943864964021e-11CAREFUL!! This script uses Pythonseval(...)function to evaluate the arguments passed to the various options so that you can use expressions. For example:clat-func--x-min0--x-max2*pi--n10--y"sin({x})"0.00.00.69813170079773180.64278760968653931.39626340159546360.9848077530122082.09439510239319530.86602540378443872.7925268031909270.342020143325668933.490658503988659-0.34202014332566874.1887902047863905-0.86602540378443834.886921905584122-0.98480775301220815.585053606381854-0.64278760968653956.283185307179586-2.4492935982947064e-16That means you should only run this with TRUSTED input. You have been warned...PlottingTheclat-plotcommand can be used to quickly plot some data at the command line. It reads from standard input and uses Gnuplot to generate the graph.clat-func--x-min0--x-max2*pi--n100--y"sin({x})"|clat-plot-iThis will open a plot window with this graph