TELSHELL USERS GUIDE
Created 01/01/90 TG
Updated 03/31/15 EF
Telshell is an enhanced version of the unix tcsh shell, which runs
in all the xterm windows at FLWO. Telshell behaves as tcsh, with the
addition of built-in instrument and telescope commands. It is used for:
Telshell capabilities include:
- Fully functional aliases, with arguments
- Excellent history mechanism, with command line recall editing
- Scripts
When you start up an instrument system with gokep (1.2m), gofast or
gotres (1.5m), several windows appear. One of these is labeled
Telshell. Many commands can be typed in Telshell, to control the CCD,
telescope, filters and motors or lamps. More documentation is in the
section for the instrument you are using.
Instrument Control Commands
These commands control the state of the detector. Which ones
you wish to use depends on what instrument is mounted. Possible
choices include keplercam, fast and tres. Please consult the
documentation for the appropriate instrument. Of special interest
to this discussion are the commands "total, go, bias, flat, dark,
and comp". These commands all instruct the instrument to expose
for a given time. They are designed to work from the Telshell
window, and to return control of the window back to the observer
after starting the exposure. This is NOT what is needed in a script.
For this reason a special instrument command was created only for
use in script files. This command is "gowait".
The gowait command for the ccds takes the following form:
- ccd gowait [exptime|repcount] [file type[suffix]]
- where:
- exptime is the length of exposure
- repcount is the number of exposures (only for BIAS)
- file type is the type of exposure (BIAS, FLAT, DARK, COMP)
- suffix is single-letter filter suffix on file name (only FLAT)
The complete list of possible commands is
- ccd gowait 30
- expose for 30 seconds, no file type
- ccd gowait 20 FLAT
- take a 20 second flat, named seqnum.FLAT
- ccd gowait 20 FLATV
- take a 20 second flat, named seqnum.FLATV (Keplercam)
- ccd gowait BIAS
- take a 0 second bias, named seqnum.BIAS
- ccd gowait 10 COMP
- take a 10 second comp, named seqnum.COMP (FAST,TRES)
- ccd gowait 10 DARK
- take a 10 second DARK, named seqnum.DARK (FAST,TRES)
- repeat n XX m
- repeat n times CCD command XX,
which may only be one of: total, dark or flat.
Argument m is the desired exposure time for XX.
There is no feedback on the repetitions in the Telshell window, although
Ntcs will show information about each exposure as usual.
BEWARE OF "ccd gowait" with NO exptime! This starts a runaway
infinite exposure, which stops only with a complete restart of the
CCD system!
Telescope Control Commands
The telescope control commands all start with the "tele" prefix. Not
all commands work on both telescopes.
Commands Common to 1.2m and 1.5m
tele coords argument examples:
- tele coords newcat astro100
- load catalog /Realtime/lib/catalogs/astro100.mct
- tele coords {10
- load object coords of line 10 in loaded cat
- tele coords }SN2010Y
- load object SN2010Y coords from loaded cat
tele enable
This command takes no arguments; it slews the telescope to
the next loaded coordinates. The telescope moves only after the enable
is issued.
tele grab
Creates a fits file from the guider window (NOT TRES),
stores it in /Realtime/guider/frames with a time stamp.
1.2m ONLY Commands
- tele offset 120 -30
- offset telescope in arcsec; no "tele enable" command is needed following tele offset commands
- tele filter 3
- move to filter in slot 3
- tele hfocus -0.01
- move secondary to change telescope focus;
units are mm; the sign is required
- tele focus -100
- move secondary to change telescope focus
using ancient units; deprecated, use hfocus
- kfindfwhm
- Run script to measure
seeing FWHM with Keplercam and set telescope focus from that
- tele gfocus -100
- Move guider focus relative to current;
the sign is required
- tele ref
- Set telescope and coordinates to zenith
from sensors
- tele ampcen Namp
- Set view to CCD center if 0 or amp center, Namp=1-4
- tele elaz EL AZ
- Move to EL AZ deg; e.g., 30 180 = flat screen
- tele seg Nseg
- Move pickoff mirror to segment Nseg
(motion takes 45 sec between the extremes, segs 1 and 69)
- tele stow
- Stow telescope and dome
- tele trackon (trackoff)
- Turn telescope tracking on (off)
- tele domeon (domeoff)
- Turn telescope dome tracking on (off)
- tele domeinit
- Set dome position at stow pos and stow dome
- tele incandon (incandoff)
- Turn ON (OFF) the dome flat lamps
NEW 1.2m commands
ONLY Telshell
- openall (shutall)
- Stow telescope,
open (close) dome slit then mirror covers (covers then slit), print status
- opencovers (closecovers)
- Open (close) the mirror covers
- FLIPcovers
- Flip the status of the mirror covers; use when you know the
status is out of synch with the covers
- Ldomes [file]
- Take
biases and dome flats using keyword BIAS and
filters listed in [file], where file is as in this
example; if no argument,
use the standard file in the example. For a set other than the
standard, use the example as a model and edit your own file.
Ldomes checks bias and
flat counts and stops if these are too high (overexposure) or too low
(CCD problem)
- Qdomes [file]
- A simpler Ldomes; it assumes
the telescope is already
pointed at the screen; turns on lamps; when done, the
telescope is left as it was found and lamps are left on.
Qdomes checks bias and
flat counts and stops if these are too high (overexposure) or too low
(CCD problem)
- Rskyflats [filter]
- Take 11 sky flats with filter, if none
given the default is u; open the dome slit if closed, stow tel and
open the covers if closed, turn track and dome on, take test exposure,
adjust exposures to get about 15000 counts, wait until we get that
(see ftime command below), when done do NOT stow the tel, track
remains on
- VIEWguide
- Grab a guider frame and display it with DS9
- FIXpoint
- Take a 15-sec exposure near zenith, calculate astrometry,
apply any offsets, set the telescope position
EITHER Telshell or any xterm
- domeac_on/domeac_off/domeac_status
- dome A/C: turn ON/OFF/report status, respectively.
Normally, the A/C operates automatically, but these commands
may be useful, e.g., in case of a problem with the A/C.
- openslit (closeslit)
- Open (close) the dome slit, aliased to opensesame (closesesame).
- openstatus
- Print open/closed status for covers and dome slit.
- ftime
- Print date & times to start dome and sky flats.
- stime (dtime)
- Print latest time to start sky (dome) flats.
- lightdome
- Turn on a light in the dome to check camera view, automatically shuts off
after 5 minutes.
- darkdome
- Turn the dome light off.
- Rstatus
- Display the status of the RTS2-F robot servers.
- Rstart
- Start all the RTS2-F robot servers.
- Rstop
- Stop all the RTS2-F robot servers.
- KILLweather
- Stop the weather server for the robot (use
with caution) if the Vaisala is malfunctioning: the 1.5m
observer is then your sensor! Rstop also stops the server.
- GOweather
- Start the weather server for the robot.
The Vaisala must be functional. Rstart also starts the server.
- GSCguide hh:mm:ss.ss dd:mm:ss.s [amp]
- Show guide star segment
for a given pointing, including amp center (default: 0).
- find_gstars hh:mm:ss.ss dd:mm:ss.s [amp] [maglim]
-
Look for guide stars brighter than maglim (default: 11.8 mag)
for the given pointing and amp center (default: 0). If
no appropriate guide stars are available, look around the field for one.
Offer offsets that would yield such a star, if found.
1.5m ONLY Commands
- tele stowall
- stow telescope and dome
- tele stow
- stow telescope ONLY (useful e.g., to change gratings)
- tele comp [IN|OUT]
- Move FAST comparison mirror IN/OUT
- tele lamp [HEAR|INCAND] [on|off]
- switch FAST lamps
- tele lamp [THAR|INC] [on|off]
- switch TRES lamps
- tele ffoc value
- Move FAST|TRES spectrograph focus
- tele adc_on
- Turn ADC correction system ON
- tele adc_off
- Turn ADC correction system OFF
TRES ONLY Commands
NEW CALIBRATION SYSTEM:
- tele parm [Pout|Pin|SmaO|Smas|MedO|MedS|LarO|LarS]
- select projector arm position
- tele calb [Inc|Thar|Laser|Emp]
- select calibration lamp source
- tele calb [shuton|shutoff]
- calibration shutter control
OTHER COMMANDS
- setcom inst keyword val
- Set keyword to val for instrument "inst"
Telshell Script Writing Reference
Warning - Scripts are intended for
experienced users who are intimately familiar with the
operations of FLWO telescopes and instruments. Please feel free to
ask Ted about the practicability of specific scripts. Also note the comments
below regarding termination of scripts.
Scripts are sourced in Telshell for the following functions:
- Instrument Control
- Telescope Movements
- Unix Commands
How to run scripts
Scripts MUST only be sourced in a running telshell, not run as shell
scripts! Because Telshell maps in shared memory with the other programs
which comprise the Realtime System, invoking a sub-shell of telshell is an
error. Telshell should only be started with the rest of the system. Other
scripts run by telshell won't know about telescope or other built in commands!
This same problem occurs if you attempt to source a telshell script into an
xterm.
The correct way to run a script, for example a script named my.script,
is "source my.script" Adding arguments to invocation will be discussed
below. If the scripts resides in your home/scripts directory, use
"source ~/scripts/my.script" There is an alias defined to ease this, it is called script. It will automatically fill in the /home/observer directory and source
the script, for example "script my.script" does the same thing as the earlier example.
Writing Scripts
Use your favorite editor (emacs, vi, mg, etc) to create a file.
The observer area has a subdir named scripts, designed to hold
telshell script files. This would be a good place to store your script.
So, if using vi, the command for observer would be "vi ~/scripts/my.script".
Insert your script commands int his file, save the file. In the telshell
window type "source ~/scripts/my.script". This should run the script.
Script Commands
Unix commands can be split into two group when using any shell. These
commands are considered either "built in" or "system". With built in
commands, the commands are part of the shell itself. With system
commands, the shell executes the command in another process.
All instrument control and telescope movement commands are built into
the telshell. Some other commands were already built into tcsh, like
"pwd". This document will only attempt to cover the commands that
were added as built-ins to the tcsh shell.
Please consult man pages for tcsh(1) and csh(1) for more information
about built in commands. Tcsh is a superset of csh, telshell is a
superset of tcsh. All other "system" commands are beyond the scope
of this document as well.
Putting scripts Together
Most people learn best from example, so here are a few:
KILLING A SCRIPT
It is difficult to kill a script! Telshell cannot be interrupted
while a script
is taking an exposure so it will not accept commands like
"kill". Typing CTRL-C during readout will sometimes kill each
individual exposure, and thus may be useful if there are only a few
exposures left. If you would waste more time by allowing a long exposure
or sequence to finish than by restarting the Realtime system,
you should kill the system with command killcom
(click
here for more information) and, after the Telshell and Kep.err
windows are gone, type gokep
to restart. This problem may be
avoided by inserting 5 second delays between each sequenced exposure
in the script used, during which time one can type a CNTRL-C which
will kill the sequence. The standard star and dome flat scripts above
have such a feature. You may wish to include this feature in your
scripts. If the telshell prompt is back and a long exposure is
ongoing, type "sac" (for stop, abort, clear)
in the telshell window. For the newer commands above,
try typing "nabort" in any xterm.