Previous: The mimic
Up: Using the DAS
Next: Writing the disk files to tape
Previous Page: The mimic
Next Page: Writing the disk files to tape

ICL procedures and the DAS

DAS commands have four features to be borne in mind when writing ICL procedures: command synchronization; use of the ICL terminal; ICL exceptions; quantity of messages sent to the terminal.

Almost all DAS commands complete asynchronously, with queuing enforced only between and within DAS commands on one channel. To synchronize DAS commands on different channels, or to synchronize DAS commands with non-DAS commands, you must use the rat_wait command.

Rat_wait takes as parameters the name of a channel and the elapsed time, in seconds after which rat_wait will time-out and abort. It forces ICL to block until the current command on the named channel completes, but uses the time-out to avoid hanging up ICL if something goes wrong.

For example, consider the following procedure to take and exposure and an arc on both arms of Isis.

PROC both_arms
      rat_run  red  1200 "3C273 - nucleus"   { Parallel                 }
      rat_run  blue  600 "3C273 - nucleus"   { exposures.               }
      rat_run  blue  600 "3C273 - nucleus"   { Queued exposure.         }
      rat_wait red  1230                     { Wait for red to finish.  }
      rat_wait blue 1230                     { Wait for blue to finish. }
      complamps cune                         { Arc lamp on.             }
      rat_arc red  10                        { Parallel                 }
      rat_arc blue 10                        { exposures.               }
   END PROC
Exposures are started in parallel on the red and blue arms. The blue observation is two exposures each hald the length of the single red exposure as there is a danger of saturating the blue-arm CCD. The two blue exposures are naturally sequential because of the queuing. We then wait for both exposures to finish, specifying a time-out for each channel of the exposure time plus a 30-second margin of error. Rat_wait blue does not start until rat_wait red has finished so we expect it to complete very quickly; however, we give it the full time allowance in case the red-arm exposure fails and completes early. With all science frames taken we can then turn on the arc lamp and do the arcs in parallel.

When planning a procedure, remember that it will retain control of the command terminal until it completes, preventing you from issuing other commands. The procedure above locks the terminal for more than 20 minutes: think carefully about whether you can work this way.

In the example procedure, rat_run is used in place of run. Most of the DAS commands have procedure-oriented versions with the prefix rat_. The only difference between the two versions of a command is that if the command fails (perhaps the parameters were wrongly chosen) the rat_ version generates an exception that aborts the procedure; the normal interactive commands send error messages but the procedure continues. You can use this feature or not as best suits your procedure.

The various messages sent by the DAS to your terminal can be filtered according to your needs. The command

ICL> rat_talk <channel> <filter-level>
where filter-level is one of quiet, help, debug, lets you choose the level of reporting. The default is help, and this is appropriate for most interactive use. Debug is only helpful when tracing faults but quiet may be useful in procedures. When the filter level is quiet, only messages that need some user response are sent.



Previous: The mimic
Up: Using the DAS
Next: Writing the disk files to tape
Previous Page: The mimic
Next Page: Writing the disk files to tape


Mon Oct 3 21:59:29 WET 1994