Background

Instruments and other telescope systems at Keck employ keywords to control the state of the system. Keywords can be thought of as ``variables'' that define some aspect of the instrument or system. Example of keywords: Each system has its own set of keywords, known collectively as a library. Examples of libraries: The basic keyword commands show and modify allow you to query and change the state of the instrument using simple commands, issued either at the command line or from a shell script.

Getting keywords values with show

The show command will return the value of one or more keywords from the specified library. The full syntax is:
	show [-binary] [-debug] [-terse] [-timestamp] -service library [keywords]
where: Under LRIS accounts, the s command is shorthand for
	show -s lris
and the sb command expands to
	show -s lrisblue
These may be used as shortcuts to show keyword values on the command line, as shown below.

The show command may also be used to return a list of all known keywords belonging to a particular library, simply by substituting the special word keyword in the show command. For example, to show all of the LRIS keywords, type:

	show -s lris keywords
or, more simply,
	s keywords

Changing keywords values with modify

The modify command will change the value of one or more keywords from the specified library. The full syntax is:
	modify -service library [keyword=value keyword=value ...] [nowait]
where: Under LRIS accounts, the m command is shorthand for
	modify -s lris
and the mb command expands to
	modify -s lrisblue
These may be used as shortcuts to set keyword values on the command line, as shown below.

Examples

  1. To show the current exposure time on the LRIS red side, type the following command at a lrisserver prompt:
    	s ttime
  2. To change the exposure time on the LRIS red side to 100 seconds, type:
    	m ttime=100
  3. To show the current exposure time on the LRIS blue side, type:
    	sb ttime
  4. To return the current exposure time on the LRIS blue side without any additional characters, type:
    	show -s lrisblue -terse ttime
  5. To change the exposure time on the LRIS blue side to 100 seconds, type:
    	mb ttime=100
  6. To show all valid keywords for the LRIS blue side, type:
    	sb keywords
  7. To return a list of all LRIS keywords controlling lamps, type:
    	s keywords | fgrep lamp
  8. To show all valid keywords for the Keck I telescope drive and control system, type:
    	show -s dcs keywords
  9. To have a csh script set the grating to position 1 if it is not already there:
    	set value = `show -s lris -terse grating`
    	if ( "$value" == "1" ) then begin
    		printf "Grating already at position 1; no move required\n"
    	else
    		modify -s lris grating=1
    		if ( $status == 0 ) then
    			printf "Grating changed successfully to position 1\n"
    		else
    			printf "ERROR: grating move to position 1 failed\n"
    		endif
    	endif

See Also