[Kst] [EXTERNAL] Problem using KST from Command Line

Barth Netterfield barth.netterfield at utoronto.ca
Wed Apr 22 20:16:04 UTC 2015


Hi,

-The kst handbook is grossly out of date, with no-one in sight who seems 
excited to fix that sad fact :-(

---------------------
Data sources:

-kst2 does have several default data sources, including the ascii one.  

-Some of them (including ascii) can be re-configured from the GUI to 
handle slightly different file formats.  For example, ascii can be 
reconfigured from the GUI to read field names and units from the file, to 
change to various column delineation options (eg, csv vs whitespace vs 
fixed width) or time interpretation.

-datasource re-configuration is automatically saved on a per-file basis, and 
can also be saved as a global default.  Again, only from the GUI.

-By default, the ascii source interprets files as white-space delineated files, 
with '1', '2', etc as the field names - in which case
    kst2 data.dat -x 1 -y 2 
would plot col 2 vs col 1.  If the configuration is changed in the GUI to look 
for the filed names in the first row, then this will no longer work.  Instead 
you would need to know what the field names are, and use those.

-there is currently no way to access the data-source configuration options 
from the command line.

-if you have a kst file which only accesses one file, you can override which 
file is read using the -F option:
    kst2 -F file2.dat session.kst
This presumes that the data source configuration has been set up so that 
file2.dat is properly recognized and interpreted.

--------------------
PyKst:

-Longer term, a more flexible way to create more elaborate custom 
sessions might be to use pykst to control kst, rather than the command 
line.  Once could either create the session with a pykst script, or use a 
pykst script to change the files being read for each of the datavectors.

-PyKst largely works in linux - ie, almost everything you can do in the gui 
(except for data source configuration!) you can do from pykst.  So you 
could just write a python script that uses pykst to create whatever session 
you wanted, with whatever inputs you want.  

-PyKst has issues under windows which a windows python guru could 
probably fix around 7 or 8 seconds.

-PyKst isn't actually released yet - you would have to use the pre-release 
packages - eg - the kst ppa for kubuntu.  We still have to figure out how to 
distribute and install it.  Any minute now.  Really!  

--------------------
My own feature requests to me/us:

-There needs to be a way to control datasource configurations outside the 
GUI.  For sure pykst.  Maybe command line.

-We might want to re-think the data-source configuration system so that 
there could be a set of configurations (eg, csv, whitespace, etc) which the 
datasource could recognize and use.  

-There might be room for improvement in the file search path system.  For 
example, looking in the local directory if the other searches fail would be 
helpful.


Barth

On April 22, 2015 02:23:30 PM Roger Wehage wrote:

> Hi David,
> 
> On the contrary, this discussion has been quite beneficial. I’ve been 
aware
> of kst less than two weeks and am facing a learning curve. My goal is to
> find out if kst can do what I need, and so far it appears to be the best
> option I’ve found. The main difficulty is that the kst2 GUI and its
> conventions are considerably different than the kst1 GUI and its
> conventions, which are described in the kst1 Handbook. So there is 
some
> extrapolation and faith involved in bridging the gap between the kst1
> Handbook and the kst2 application.
> 
> I understand from 3.4 Datasources in the Kst1 Handbook that there are 
a
> number of default datasources, including an ASCII datasource. But I can
> find no information related to datasources for kst2. The manual says to
> enter kinfocenter at the command line, but that option is not on my
> computer. It is apparently part of KDE, which I've been unable to install
> and likely shouldn’t need to install. I assume that the xml files set up in
> kst GUI sessions contain the ASCII datasource information, but I don’t 
see
> any way to use this information other than to reference the appropriate
> .kst file from the command line. The part I haven’t figured out is how to
> merge command-line options with those that are set in the .kst file. If
> I’ve set up a .kst file to plot channels from a data file and try to issue
> commands overriding the plot commands in the .kst file, I get the 
original
> plots from the .kst file plus additional frames sans plots, which is
> clearly not what I want.
> > That hack seems to be the quickest way to do it but it is less than 
ideal.
> > Another option would be for your application to generate a tailored 
.kst
> > file for the user's selections and load that from the command line but
> > that seems like a lot of work.
> That was my first thought, but the .kst file is sacred and must not be
> touched. So I figured, “If the hill will not come to Mahomet, Mahomet will
> go to the hill.”
> http://www.literaturepage.com/read/francis-bacon-essays-24.html
> <http://www.literaturepage.com/read/francis-bacon-essays-24.html> 
Thus on
> to Plan B where I was thinking of permuting header information so as to
> fool the rigid .kst file into picking the set of channels that the user
> wants. But before attempting that I must study this
> https://mail.kde.org/pipermail/kst/2011-March/019494.html
> <https://mail.kde.org/pipermail/kst/2011-March/019494.html> to insure 
that
> I’m not “Reinventing the square wheel.”
> http://en.wikipedia.org/wiki/Reinventing_the_wheel#Related_phrases
> <http://en.wikipedia.org/wiki/Reinventing_the_wheel#Related_phrases> It
> would be ideal to have kst2 read auxiliary channel selection information
> from a separate file or pipe and not modify the original data file at all.
> Thus users may choose to use the kst2 GUI as usual to directly access
> channels as they see fit, or they may use my GUI to direct kst2 to access
> channels without the need to learn kst2.
> 
> Once I understand the problem and potential solution(s) sufficiently, I will
> attempt to submit a feature request.
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kst/attachments/20150422/ffa9c843/attachment-0001.html>


More information about the Kst mailing list