The ESI Spectrograph Online Documentation

ktlwatch

ktlwatch is a daemon written in Tcl. Its purpose is to monitor a KTL service according to a template stored in the Memes database, and to store the collected data in tables in another database (usually called "telemetry").

Significant setup is required for ktlwatch to operate. The target tables must exist and be correct for the current shape of the service keyword library. The ktlwatch script must be started in an environment with correct KROOT, SYBASE, and related envars.

First, the service must be fully described in the Memes schema. For Lick-built instruments from PFCAM onwards, this will already be the case. For non Lick KTL instruments and instruments which predate PFCAM, keyword collection and data entry will have to be done, and a service bundle constructed, before high-level tools like ktlwatch can be used.

After the service is modelled in the database, the 'assignlog' utility attempts to infer the correct logging type for every keyword in the service. But a human must make the final decision on the difference between continuously variable and boolean (State) keywords and textual (Event) keywords. In general (quote from the comment block of assignlog):

 
# 	    if you are an Alpha keyword 
#              	you are by definition an Event, not a State 
#           if you are an Alpha keyword with a lookup map 
#               to a list of discrete integer values then you 
#               are both (appear in Event as alpha, in State 
#               as numeric) 
#           if you are a numeric keyword you are State 
# 

Once this assignment has been done, the mklogtbl utility is used to create DDL (SQL) scripts which, if executed, will create the log tables. An Event table should be made by the author manually editing a copy of the sample sql script Event.sql and naming this copy _Event.sql. This and the other .sql scripts finally used to create the tables should be cvs committed.

Once the tables are created and protected appropriately so that ktlwatch (which runs as special Sybase user ktlw) can write on them, the ktlwatch daemon is started. The best way to start it is with a config file Mumble.ktw -- for example, esi.ktw.

This config file can be made by editing the Example.ktw file or one of the existing instrument ktw files. Once it works, it should be cvs'd. The config file establishes the timing of the snapshot of state keywords, defines the "canary" keywords which are used to determine whether the backend has died, etc.

NOTE ktlwatch will be installed with the ESI software but is not a deliverable (will not be fully documented) for that instrument. It will be fully documented and better packaged for DEIMOS. ktlwatch data will be used by Lick personnel during the months between ESI and DEIMOS commissionings.

The best tool for viewing and analyzing the masses of data collected by ktlwatch is DataMynah, which was invented for that purpose. However, any interface (even wisql) which allows you to get records from the log tables and plot the resulting data sets (perhaps by exporting the data into your favourite spreadsheet?) will work.

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.