The ESI Spectrograph Online Documentation
Generic KTL utilities: KTEST

KTEST (KTL Test) Suite

The KTEST suite consists of each of which is explained in more detail below. All these applications share a common ktest.tlib file. They also require the ktcl.tlib file which is more widely shared among Tcl/KTL applications.

Quick overview: ktauth is a GUI which you can use to write tests for KTL services. ktrun will run such a test non-interactively. ktqual analyzes the results of such tests. ktplot visualizes the results. ktplot contains a "lab notebook" feature which lets the user save and annotate selected plots. ktpub publishes these annotated plots in the form of a "lab notebook" for each test, each lab notebook being a web page with embedded png images. ktred is a "glue" gui which provides a no-brainer interface to ktqual and ktplot.

Typical usage pattern for this suite:

  1. Try out test ideas using ktauth
  2. Finalize and debug test using ktauth
  3. Commit test to cvs using ktauth
  4. Run test interactively on demand using ktauth
  5. Analyze/visualize results using ktred (ktqual+ktplot)
  6. Run test using "at" or "cron" and ktrun
  7. Compare multiple runs using ktred
  8. Publish conclusions using labNotebook feature and ktpub

Coming soon: regression tool for comparing runs of any given test. The KTEST suite is written in Extended Tcl/Tk. It uses the Ktcl and BLT extensions.

NOTE

This suite of tools is not an ESI deliverable. It will be a finished deliverable for DEIMOS. As of Fall 1999, UCO/Lick SPG does not officially support this tool suite for external use. You are welcome to play with it, but please don't file bug reports yet.

The only deliverable chunk of this code is the tlib itself, and ktrun, because the test suite in kroot/kss/esi/ktest uses these. The generic DC stage tests included with the ktest suite are also an implicit deliverable, but you should use the built versions in the esi-specific directory. it).


ktauth

Ktauth is a GUI for authoring KTL Test (hence the name). It consists of a set of text windows gathered into a frame. The test is edited in one window; other windows display data records and log records as the test runs. Online help, via the Help menu, is fairly complete. Tests can be Saved and also CVS Committed from a simple Save menu.

Ktauth is CVS-conscious. When it starts up, one of its earliest actions is to find out whether it's running in a cvs directory, and to attempt a cvs update. Ktauth alerts you, when you Load a test, if the test is not yet CVS-committed. An option in the Load menu inserts into the editing window a standard boilerplate header including proper RCS expandable tags.

The usual method of using ktauth is to start it, Load a test, and push the RUN button. Thereafter, the user usually iterates: edit the test, run it again, edit it again, etc. If the user doesn't like the simple pointy/clicky text editing window, the Alt Editor button will launch an xterm running the editor specified by the EDITOR or VISUAL envars. Ktauth can also launch an xterm running cshow, another KTL tool found in the kroot/kui tree. See the online help for more information.

Output from the Log, Error, and Data statements in ktauth test scripts is directed to files in a known location ./Results/TestName/ The files are named TestName.{log|err|dat}.SysTimeInteger -- where the time integer reflects the start time of the test rather than its end time. The .dat. file, result of Data statements, if well-formed will consist of N records of a consistent number of fields each, a tabular in which each column has a consistent meaning.

Ktauth offers simplified, higher-level commands which are wrappers around the base Ktcl command set. It relies for its keyword knowledge on the .kwd file found in KROOT/data/. If this file is missing or not up to date, ktauth will not work as expected. It will, however, accept a .kwd file in the cwd or the user's home dir as an override. The .kwd file is made by CodeGen, or by a Dashboard in Developer mode.

Ktauth uses Tcl/Tk, TclX, Ktcl. The name stands for KTL Test Authoring tool.


ktrun

Ktrun is very simple. It reads a .tst file created by ktauth, and runs it without the GUI features. The test runs exactly as it would using ktauth.

Ktrun uses Tcl, TclX, Ktcl. The name stands for KTL Test Run tool.


ktqual

Ktqual is a noninteractive data reduction utility. It accepts one or more TestName.dat.SysTimeInteger files, and produces two outputs: a statistical rollup for each input file (goes to stderr, plain text), and a TestName.plt file containing a "reduced" copy of the test's expectations and results. This .plt file can be fed to ktplot for visualization.

Ktqual was written originally as an attempt to "grade" tests based on the degree of deviation between expected and actual results, etc. This "grading" system could do with a lot more work. Visualization and human commentary has so far proven more useful.

Ktqual uses Tcl, TclX. The name stands for KTL Test Quality check.


ktplot

Ktplot ingests a .plt file produced by ktqual from one or more .dat. test result files. It provides a simple GUI for generating a practically infinite variety of plots from the reduced data. Fundamentally ktplot starts with a blank plot whose X axis is determined by the user. It then adds "elements" to that plot whose Y values are determined by vectors found in the reduced data. Data from more than one test run can be displayed on the same plot.

The user can pop up an unrestricted number of plots. Plots can be saved as PostScript files; also, plots can be saved *and* annotated with accompanying text and saved in a special "logbook" directory for each test.

The advanced ktplot user can even "create" and plot new data columns by writing expressions based on existing numeric columns.

The object of ktplot is to make it easy to visualize the behaviour of instrument and control systems across time. Then vs Now (different runs of a test) is as easy to visualize as Expected vs Actual for any particular test.

Ktplot uses Tcl/Tk, TclX, Ktcl, BLT. The name stands for KTL Test results Plot tool.


ktred

Ktred is a simple GUI which spares the user the nuisance of typing long filenames during reduction and visualization of test data. The user chooses a test, then chooses one or more results files from that test. The "Reduce Data" button runs ktqual. The "Plot Data" button runs ktplot on the resulting .plt file.

Ktred uses Tcl/Tk, TclX. The name stands for KTL Test data Reduction tool.


ktpub

Ktpub, given a TestName argument, looks in ./TestName for the "labnotebook" files pertaining to that test. It then converts PS files to png and constructs an HTML doc by concatenating the labnotebook text files. It writes the resulting html file, and copies the png and ps files, into a target directory (which is presently hardwired into the script).

ktpub uses Tcl and TclX. Its name stands for KTL Test results Publishing tool.


De Clarke <de@ucolick.org>
Template Date: 1999/07/16 20:32:05
The Observer documents are hand-written. The Technical Documents are produced from plain text files in the CVS source tree by some Tcl scripts written at UCO/Lick Observatory. The Reference Documents are mostly generated by software from data in a relational database. Individual authors are responsible for the content of the Observer and Technical Documentation. The Lick SPG as a whole is responsible for the content of the Reference doco. Send mail to de@ucolick.org to report inconsistencies or errors in the documentation.