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
- To show the current exposure time on the LRIS red
side, type the following command at a
lrisserver prompt:
s ttime
- To change the exposure time on the LRIS red side to 100
seconds, type:
m ttime=100
- To show the current exposure time on the LRIS blue
side, type:
sb ttime
- To return the current exposure time on the LRIS blue
side without any additional characters, type:
show -s lrisblue -terse ttime
- To change the exposure time on the LRIS blue side to 100
seconds, type:
mb ttime=100
- To show all valid keywords for the LRIS blue side, type:
sb keywords
- To return a list of all LRIS keywords controlling lamps, type:
s keywords | fgrep lamp
- To show all valid keywords for the Keck I telescope drive
and control system, type:
show -s dcs keywords
- 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