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

Nicolas Brisset nicolas.brisset at free.fr
Sun Jan 30 22:19:56 CET 2011


Dear Reimund,

> 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.
This should work without any problem. In the coming version (2.0.3) you will even be able to display the metadata contained in the header in your plots.

> 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
> 
> Attached a sample file and the setup.kst
I have just a done a quick test, and I can read the data with the data wizard. 
However, I confirm that loading your .kst does not work.
I don't know about the -F flag: Barth, is it still available with 2.0.x and if yes, has it been tested thoroughly?
I think you've uncovered a bug, we'll try to fix it ASAP. We'd like to release 2.0.3 in the coming days, it would be nice to have solved it until then. By the way, I did the previous tests with today's svn, not 2.0.2...

> 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.
I think it is possible, but I am not a stdin user so I'll let someone else give you a more detailed answer.

> 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 ).
Peter already gave you some hints. Basically, you need to be able to:
- detect the file type and announce that you can read it
- list the variables it contains 
- provide the number of samples for each variable
- provide the values for a given range of samples
- if the file grows and you want to plot "live" curves, you'll need to implement the corresponding update() mechanism
The best way is probably trying to do it, and reporting here the issues you run into and the questions you have. Be aware that the ASCII datasource is a pretty capable and heavily optimized piece of code. I don't know how good a coder you are, but if you're just a hobbyist as I am, you might get scared. NetCDF is much easier to understand, even though it has quite some stuff for metadata and primitive types (vectors, matrices, strings and scalars are so-called "primitives") which you may not need to support.

And if I can recommend something: use QtCreator to develop that, it'll help you a lot!
 
Best regards,

Nicolas


More information about the Kst mailing list