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

Peter Kümmel syntheticpp at gmx.net
Thu Feb 10 14:52:25 CET 2011

On 31.01.2011 10:10, rrebel at rfecllc.com wrote:
> Dear Nicolas,
> thank you for your fast response. Meanwhile I got the command line
> version to work. The problem is more or less the available documentation.
> I checked out the repository to have a look at the source and voila,
> there I found under design specs a document describing the command line
> options for the 2.02 Version as well as all the documentation required
> for the reader plug in. By searching the documents I found that the
> order the options are given, matters. This is a little unusual so. First
> the datafile and then the options in the right order. (-n in front tof
> the plot definitions).
> But on top of this you have to set the default settings for the reader
> in a way that it can read the file without error. This means you have to
> set the  delimiter, the data start line, the comment symbol's and the
> line where the headers are as the default settings. Otherwise the reader
> fails and no data are available. Unfortunately there are no command line
> options to specify all that.
> In my opinion the ASCII reader is to intollerant on the format.
> The ".kst" file seems to be a real bug.

This is fixed now in 2.0.3 beta2.

> Anyway for more complex automation it would be nice that onealso could
> specify a script on the command line to run. This would be the most
> powerful and flexible way for automation since the program generating
> the data could also generate the script for post processing and
> displaying the data.
> I also took a look on the reader plug in. I'm not an experienced C++
> programmer but I think I can manage it. It is just a matter of priority
> and time. Since the ASCII works now I have a solution for my problem and
> it just sunk a little in importance.
> Best Regards
> Reimund Rebel
> On 1/30/2011 14:19, Nicolas Brisset wrote:
>> 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
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst

More information about the Kst mailing list