[Kst] Re: reading ASCII files / KST command line options

Peter Kümmel syntheticpp at gmx.net
Sun Jan 30 15:45:00 CET 2011


On 30.01.2011 08:34, Reimund rebel wrote:
> I want to use KST as a general Plot and View Tool in a test lab
> environment. For several reasons we decided to store the measured data
> in simple CSV files. The data sets contain a header (embedded in Comment
> lines) with some information about the measurement itself. Then a line
> with the column headers followed by the dataset.  I attached a sample.
> One of the usage is to interactively view, post process and plot the
> measured data. This works great since you can set the parameters for
> reading the data file manually. The problem is the other usage to show
> streamed data in real time during the measurement. Here the idea is to
> start KST by calling it from the test program (Python) and control the
> graphs either by command line options or by a previously generated
> setup.kst file.   The command line option would be preffered, since the
> calling program would have total control what to plot. For example:
> 
> kst  -x 1 -y 3 -y 4 -n 500 -m 1  -g  test.csv     or
> kst  -x Time  -y Temp  -y V1 -n 500 -F test.csv   setup1.kst    
> 
> So far I had no luck with both of them. On a linux box,  I have the
> feeling it does understand the command line but it seems to have trouble
> reading the data in ending in blank graphs. On windows it behaves even
> worse. It always shows just a blank screen and it looks like it does not
> even read the setup.kst file


On Windows I've moved the filename to the first position.
Then it loads the vectors from the files and adds a graph with these vectors,
but the graph is empty, therefore I think it is a Kst bug.

> 
> Attached a sample file and the setup.kst
> 
> When using the data wizard it can read the file and seems ok with the
> format. It just does not follow the same rules for the data file
> (komments, delimiter, skipped lines ...) when using the the command line
> together with the -F option and the setup.kst file.
> 
> By the way is it possible to read data also from stdin or a pipe, this
> would be an elegant way to plot directly from the test program.
> 
> Long term I also would be interested to write a plugin for a different
> (binary) file format for exchange with a free circuit simulation tool
> (Switcher CAD ).
> 
> I would appreciate if someone could help me with the ASCII file format
> to get it to work from command line. I have no idea what I'm doing wrong
> or if I just discovered a bug.
> On the binary It would be great if someone could point me to the right
> place how to get started with a plugin.

Have a look at the existing code in src/datasources/ascii or netcdf.

To add it to the build system add a line in
cmake/src/datasources/CMakeLists.txt, for instance

    kst_add_plugin(. my_plugin)


Peter


More information about the Kst mailing list