LRIS Command Language

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:
  • LRIS has a keyword called OBSERVER which contains the name of the current observer.
  • The LRIS GRATING keyword contains the name of the current grating.
  • The telescope keyword RA contains the current Right Ascension of the telescope.
Each system has its own set of keywords, known collectively as a library. Examples of libraries:
  • The Keck I telescope library is known as DCS.
  • The primary mirror control system's library is ACS.
  • LRIS has two keyword libraries, one for shared and red-side-only parameters called LRIS, one for blue-side detector parameters called LRISBLUE.
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:
  • -binary specifies that the command should return a numeric value instead of a string value when possible
  • -debug causes show to return additional diagnostic information, including data type, along with the requested keywords values
  • -terse omits all extraneous characters and causes show to return only the keyword value (very useful for scripts)
  • -timestamp causes show to return a the date and time at which the keywords values were read
  • library is the keyword library to use, such as LRISBLUE or DCS
  • keywords is a list of one or more keywords belonging to the specified library whose values are to be returned, such as GRATING or DEC
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:
  • library is the keyword library to use, such as LRISBLUE or DCS
  • keyword is the name of a keyword belonging to the specified library whose values are to be changed, such as GRATING or OBSERVER
  • value is the new setting the keyword should have, such as 1 for GRATING or Einstein for OBSERVER
  • nowait specifies that the command should return immediately after issuing the request; the default is for the command to wait for the change (e.g., grating move) to complete before returning
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

Last modified: 12/28/2011 20:15
Send questions or comments to:LRIS Support

The information on this page is the property of the W. M. Keck Observatory. The contents of this page or any part thereof shall not be copied or otherwise reproduced or transferred to other documents or used or disclosed to others for any purpose other than observing support at the W. M. Keck Observatory and the subsequent analysis and publication of scientific data obtained from observations conducted at the W. M. Keck Observatory. All rights reserved. © W. M. Keck Observatory.