I've written a program for controlling the TASS Mark IV camera from a computer running Linux. It's not in any finished state:
In addition, the communications occur on a very low level. One cannot request a set of many identical operations, for example. I'm not sure that this control program is the place to insert a scripting capability -- it might be better to write a high-level facility which allows a user to define a night's worth of observations, and produces as output a file containing low-level commands for this program to execute.
The goal of the program is to allow one to operate a Mark IV in two-and-a-half modes:
Almost all the time, the program would simply read commands from a file and execute them one at a time. However, I wanted to permit a user to interrupt the regular schedule of operations in the middle of the night, in case something very interesting happened (a gamma-ray burst or nova). In addition, I wanted the user to be able to interrupt operations remotely, without having to travel to the telescope. Hence, the program is designed to run under Linux (so that a user can log in remotely and modify the command file), and the program reads the command file in a manner which allows one to modify the program on the fly.
The program reads simple ASCII text, one line at a time. Each line looks something like this:
command arg1 ....where there is one command, and may be 0, 1, 2 or more arguments. Below is a list of the current commands and any arguments they take.
OK ra atlimit yesOtherwise, it prints a line like
OK ra atlimit noThe on argument causes the RA motor to run at sidereal rate. The off argument causes the RA motor to stop. The ff argument causes the RA motor to move the telescope West at about 30 times sidereal rate. The rev argument causes the RA motor to move the telescope East at about 30 times sidereal rate. The tolimit or home argument causes the telescope to move to its home position.
The images are read out into the memory card, and then saved to disk via Robert Creager's downfits program, which is invoked from within the program via a system call. The FITS images are currently saved in the current working directory. File names are generated following Arne Henden's E-mail, msg 134 in June, 2001, with names like this:
jjjjxxxc.fit where jjjj is the integer portion of Julian Date - 2,450,000 xxx is an image sequence number within the current run (typically one run per night) c is a code indicating the camera 'E' for the V-band camera 'F' for the I-band camera
tait [infile=foo] [fake]where the optional arguments are
infile= read commands from the given file; if not present, use stdin fake don't really talk to the Mark IV, just run through the commands and parse each one for proper grammar. Sometime in the future, this might do more to simulate real operations.
The program prints diagnostics to stdout (usually the screen), and also to a log file called tait.log
Here's an example: given this simple input file, tait.in:
# Test of "tait" Mark IV control program # (these comments should be printed out) # nop echo start of run nop echo end of run quit
if we invoke
tait infile=tait.in fake
we get output like this (both to the screen, and to the log file tait.log):
08/27/2001 22:31:10 08/27/2001 22:31:10 starting tait control program open_port: Unable to open serial port : Permission denied 08/27/2001 22:31:10 ERROR init_memcard: ioperm returns with error 08/27/2001 22:31:10 # Test of "tait" Mark IV control program 08/27/2001 22:31:10 OK echo 08/27/2001 22:31:10 # (these comments should be printed out) 08/27/2001 22:31:10 OK echo 08/27/2001 22:31:10 # 08/27/2001 22:31:10 OK echo 08/27/2001 22:31:10 nop 08/27/2001 22:31:10 OK nop 08/27/2001 22:31:10 echo start of run 08/27/2001 22:31:10 OK echo 08/27/2001 22:31:10 nop 08/27/2001 22:31:10 OK nop 08/27/2001 22:31:10 08/27/2001 22:31:10 echo end of run 08/27/2001 22:31:10 OK echo 08/27/2001 22:31:10 08/27/2001 22:31:10 quit 08/27/2001 22:31:10 tait: parse_and_execute says to quit 08/27/2001 22:31:10 ending tait control program 08/27/2001 22:31:10
The ERROR near the beginning occured because I ran the program as an ordinary user; in order to read the memory card, the program must be run as "root", the Unix super-user.
In real use, of course, the timestamps would show the time taken to carry out each of the commands.
Last modified Aug 27, 2001 by MWR.