\documentstyle{report}
\parskip 10pt
\parindent 0pt
%
%============= Definition of {asyoulikeit} page style ======================*
%
% Jonathan Burch        This is the terse form  -  expanded, formatted,
%  20-Jan-1989          commented version in TEX$LATEX:ASYOULIKEIT.FULL
%
\catcode`\@=11\def\ps@asyoulikeit{\def\@oddhead{\hbox{}\lp@innerhead
\lp@headfill\lp@middlehead\lp@headfill\lp@outerhead}\def\@evenhead
{\hbox{}\lp@outerhead\lp@headfill\lp@middlehead\lp@headfill\lp@innerhead}
\def\@oddfoot{\hbox{}\lp@innerfoot\lp@footfill\lp@middlefoot\lp@footfill
\lp@outerfoot}\def\@evenfoot{\hbox{}\lp@outerfoot\lp@footfill\lp@middlefoot
\lp@footfill\lp@innerfoot}\def\sectionmark##1{}\def\subsectionmark##1{}}
\def\lp@innerhead{}\def\lp@middlehead{}\def\lp@outerhead{}\def\lp@innerfoot{}
\def\lp@middlefoot{ {\thepage} }\def\lp@outerfoot{}\def\lp@headfill{\hfil}
\def\lp@footfill{\hfil}\newcommand{\lp@linefill}{\leaders\hrule height 0.55ex
depth -0.5ex\hfill}\newcommand{\innerhead}[1]{\def\lp@innerhead{#1}}
\newcommand{\middlehead}[1]{\def\lp@middlehead{#1}}\newcommand{\outerhead}[1]
{\def\lp@outerhead{#1}}\newcommand{\innerfoot}[1]{\def\lp@innerfoot{#1}}
\newcommand{\middlefoot}[1]{\def\lp@middlefoot{#1}}\newcommand{\outerfoot}[1]
{\def\lp@outerfoot{#1}}\newcommand{\lineheadfill}{\def\lp@headfill
{\lp@linefill}}\newcommand{\linefootfill}{\def\lp@footfill{\lp@linefill}}
\newcommand{\blankheadfill}{\def\lp@headfill{\hfill}}\newcommand
{\blankfootfill}{\def\lp@footfill{\hfill}}\newcommand{\documentnumber}[1]
{\def\lp@docno{#1}\outerhead{\lp@docno}}\def\lp@docno{}\def\@maketitle
{\newpage\null\vskip -14ex\hbox{}\hfill\lp@docno\vskip 13ex\begin{center}
{\LARGE\@title\par}\vskip 1.5em{\large\lineskip .5em\begin{tabular}[t]{c}
\@author\end{tabular}\par}\vskip 1em{\large\@date}\end{center}\par\vskip 3em}
\def\abstract{\if@twocolumn\section*{Abstract}\else\small\begin{center}
{\bf Abstract\vspace{-.5em}\vspace{0pt}}\end{center}\quotation\fi}\def
\endabstract{\if@twocolumn\else\endquotation\fi}\ps@asyoulikeit\catcode`\@=12
%
%=========== End of {asyoulikeit} page style definition ====================*

%============= Definition of \WHTlogo control sequence =====================*
%
%   Roger Wood          This is the terse form  -  expanded, formatted,
%  20-Apr-1989          commented version in ???
%
\newcommand{\WHTlogo}[1]{         \setlength{\unitlength}{#1mm}
\begin{picture}(8,10)(-4,0.7)     \put(-0.4,10.4){\line(1,0){0.8}}
\put(-0.4,10.1){\line(0,1){0.3}}  \put(+0.4,10.1){\line(0,1){0.3}}
\put(-0.4,9.2){\line(0,1){0.6}}   \put(+0.4,9.2){\line(0,1){0.6}}
\put(-0.3,8.9){\line(1,0){0.6}}   \put(-1.6,10.1){\line(1,0){3.2}}
\put(-1.6,9.8){\line(1,0){3.2}}   \put(-1.4,6.2){\line(1,3){1.2}}
\put(+1.4,6.2){\line(-1,3){1.2}}  \put(-1.2,6.2){\line(1,3){1.2}}
\put(+1.2,6.2){\line(-1,3){1.2}}  \put(-1.4,6.2){\line(0,1){3.6}}
\put(+1.4,6.2){\line(0,1){3.6}}   \put(-1.6,4.6){\line(0,1){5.5}}
\put(+1.6,4.6){\line(0,1){5.5}}   \put(-1.5,4.4){\line(-1,3){0.1}}
\put(+2.5,4.4){\line(1,3){0.1}}   \put(-0.25,7.0){\line(1,0){0.5}}
\put(-0.25,6.2){\line(0,1){0.8}}  \put(+0.25,6.2){\line(0,1){0.8}}
\put(-1.6,6.2 ){\line(1,0){3.2}}  \put(0.0,5.77){\circle{0.6}}
\put(-0.75,5.35){\line(1,0){1.5}} \put(-0.95,5.35){\line(-1,0){0.65}}
\put(+0.95,5.35){\line(1,0){0.65}}\put(-0.0,4.6){\line(-1,1){1.6}}
\put(+0.0,4.6){\line(1,1){1.6}}   \put(-0.1,4.5){\line(-1,1){1.5}}
\put(+0.1,4.5){\line(1,1){1.5}}   \put(-0.1,4.5){\line(1,0){0.2}}
\put(-0.4,4.8){\line(-1,0){1.0}}  \put(+0.4,4.8){\line(1,0){1.0}}
\put(-0.2,4.8){\line(1,0){0.4}}   \put(-1.4,4.6){\line(0,1){0.2}}
\put(+1.4,4.6){\line(0,1){0.2}}   \put(-0.2,4.6){\line(-1,0){1.4}}
\put(+0.2,4.6){\line(1,0){1.4}}   \put(-1.5,4.2){\line(0,1){1.15}}
\put(+1.5,4.2){\line(0,1){1.15}}  \put(-1.5,4.2){\line(1,0){3.0}}
\put(-1.0,3.9){\line(0,1){0.3}}   \put(+1.0,3.9){\line(0,1){0.3}}
\put(-1.0,3.9){\line(1,0){2.0}}   \put(-1.6,6.1){\line(-1,0){0.5}}
\put(+1.6,6.1){\line(1,0){0.5}}   \put(-1.6,5.4){\line(-1,0){0.5}}
\put(+1.6,5.4){\line(1,0){0.5}}   \put(-2.1,5.2){\line(0,1){0.9}}
\put(+2.1,5.2){\line(0,1){0.9}}   \put(-2.2,5.7){\line(-1,0){1.5}}
\put(+2.2,5.7){\line(1,0){1.5}}   \put(-2.2,5.5){\line(-1,0){1.5}}
\put(+2.2,5.5){\line(1,0){1.5}}   \put(-3.5,5.2){\line(0,1){0.5}}
\put(+3.5,5.2){\line(0,1){0.5}}   \put(-2.4,5.2){\line(0,1){0.5}}
\put(+2.4,5.2){\line(0,1){0.5}}   \put(-1.8,5.2){\line(-1,0){1.9}}
\put(+1.8,5.2){\line(1,0){1.9}}   \put(-3.7,4.9){\line(0,1){0.3}}
\put(+3.7,4.9){\line(0,1){0.3}}   \put(-1.8,4.0){\line(0,1){1.4}}
\put(+1.8,4.0){\line(0,1){1.4}}   \put(-2.5,3.9){\line(-6,5){1.2}}
\put(+2.5,3.9){\line(6,5){1.2}}   \put(-0.9,2.2){\line(-1,2){0.9}}
\put(+0.9,2.2){\line(1,2){0.9}}   \put(-2.2,2.2){\line(1,0){4.4}}
\put(-2.2,2.1){\line(0,1){0.1}}   \put(+2.2,2.1){\line(0,1){0.1}}
\put(-2.2,2.1){\line(1,0){4.4}}   \put(-1.7,1.5){\line(-1,3){0.8}}
\put(+1.7,1.5){\line(1,3){0.8}}   \put(-1.7,1.5){\line(1,0){3.4}}
\put(-1.7,1.0){\line(0,1){0.5}}   \put(+1.7,1.0){\line(0,1){0.5}}
\put(-1.7,1.0){\line(1,0){3.4}}
\end{picture} }
%
%=========== End of \WHTlogo control sequence definition ===================*


% Page layout definitions to suit A4 paper

\setcounter{secnumdepth}{3}        \setcounter{tocdepth}{3}
\setlength{\topmargin}{0mm}
\setlength{\textwidth}{160mm}      \setlength{\textheight}{220mm}
\setlength{\oddsidemargin}{0mm}    \setlength{\evensidemargin}{0mm}
%
% Local definitions
% -----------------
\newcommand{\eg}{{\it e.g.\hspace{0.5ex}}}    
\newcommand{\etc}{{\it etc.\hspace{0.5ex}}}
\newcommand{\ie}{{\it i.e.\hspace{0.5ex}}}
\newcommand{\qv}{{\it q.v.\hspace{0.5ex}}}
\newcommand{\viz}{{\it viz.\hspace{0.5ex}}}
\newcommand{\via}{{\it via\hspace{0.5ex}}}
\newcommand{\degs}[1]{$#1^\circ$}                       % Degrees symbol
\newcommand{\mins}[1]{$#1^{\scriptsize\prime}$}         % Minutes symbol
\newcommand{\secs}[1]{$#1^{\scriptsize\prime\prime}$}   % Seconds symbol
\newcommand{\key}[1]{\fbox{\sc#1}}                      % Box for keys
\newcommand{\?}{\_\hspace{0.115em}}                     % Proper spacing for 
                                                        %   underscore
%----- Display example text (#1) in typewriter font

\newcommand{\example}[1]{\\ \smallskip\hspace{1in}{\tt #1}\hfil\\
                            \smallskip\noindent}

%----- Enclose text (#2) in ruled box of given thickness (#1)

\def\boxit#1#2{\vbox{\hrule height #1pt\hbox{\vrule width #1pt\hskip 5pt
                   \vbox{\vskip 5pt #2 \vskip 5pt}\hskip 5pt
                   \vrule width #1pt}\hrule height #1pt}}

%----- Display boxed warning text (#1)

\def\warning#1{\bigskip
               \setbox1=\vbox{\tolerance=5000\parfillskip=0pt
               \hsize=3in\noindent#1}
               \centerline{\boxit{1.0}{\box1}}
               \bigskip}

%----- Definitions to aid display of help text 
%         (modelled on \item and \itemitem)

\def\helpindent#1{\setbox2=\hbox to\parindent{{\it #1}\hfil}
                  \indent\llap{\box2}\ignorespaces}
\def\helpitem{\parindent=70pt\par\hang\helpindent}
\def\helpitemitem{\parindent=70pt\par\indent \hangindent2\parindent \helpindent}

%----- Tables and footnotes to tables
%
\newcommand{\spacerA}{\rule{0mm}{4mm}}
\newcommand{\spacerB}{\rule[-2mm]{0mm}{5mm}}
%\footnotesep=5mm
%\renewcommand{\footnoterule}{{\small Notes:}}
%
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%
\begin{document}
% 
% Title page
% ----------
%
\middlefoot{ }                               % No page number on title page
\begin{center}

{\large Roque de los Muchachos Observatory }

\vspace{1.0in}

{\LARGE \bf William Herschel Telescope}

{\Huge \bf Data-acquisition system}

\vspace{0.5in}

{\large Issue 2.0, 6th April 1993}

\vspace{0.5in}

{\Large Guy Rixon \& Steve Unger}

\vspace{0.7in}

\WHTlogo{4}

\vfill

\parbox{3.2in}{\parindent=0pt \parfillskip=0pt \scriptsize
    The Isaac Newton Group of telescopes on La~Palma is owned by the UK
    Science and Engineering Research Council and operated by the Royal
    Greenwich Observatory for the SERC in partnership with the Organisatie
    voor Zuiver Wetenschappelijk Onderzoek (ZWO) of the Netherlands, the
    Irish National Board for Science and Technology and the Dublin
    Institute for Advanced Studies.} 
%
\end{center}
%
\newpage


\innerhead{{\Large\bf  WHT control  }} % Running inner head for whole manual

% Contents
% --------

\outerhead{{\large\bf CONTENTS}}             % Outer head for contents
\pagenumbering{roman}                        % Lower case roman page numbers
\middlefoot{\thepage}                        % Contents page numbers centred

\tableofcontents    


% Main text
% ---------

\middlefoot{ } \outerfoot{{\bf\thepage}}     % Body of manual has bolded page
                                             % numbers at outer edges


%----------------------------------------------------------------------------

%=============================================================================%
\chapter{\bf Introduction}                                                    %
\label{chap:intro}                                                            %
\outerhead{{\large\bf Introduction}}                                          %
\pagenumbering{arabic}                                                        %
%=============================================================================%



%-----------------------------------------------------------------------------%
\section{Context}                                                             %
%-----------------------------------------------------------------------------%

The {\it data-acquisition system} (DAS) at the WHT is the set of hardware and
software used by the observers to obtain and store images from the detectors.
As a secondary function, the DAS also collects and stores a description of each
observation and maintains a log of observations throughout the night.

The DAS is a part of a general control system that old hands know as the
`ICL system'.
That is, you drive the WHT's data-taking functions from the same terminal
(running ICL) that controls the instruments.



%-----------------------------------------------------------------------------%
\section{Scope of this manual}                                                %
%-----------------------------------------------------------------------------%

This manual describes the facilities available from the DAS and the commands
used to invoke them. 
Chapter~\ref{chap:overview} is a tour of the hardware and software facilities.
Observers new to the WHT may find it useful to read this information.
Chapter~\ref{chap:usage} describes, in `cook-book' style, how to use the system.
Chapter~\ref{chap:commands} is a reference guide to the full command set.
The appendicies are papers describing the available detectors.

The current issue of this manual describes the DAS commands as offered by the
observing-system version S0-7/V5-0. 
Earlier versions of the system have significant differences in the command set.

This manual has been prepared using \LaTeX. 
The source-code for the current issue is available on-line on the LPO
VAXcluster and the Starlink node CAVAD; look in the directory tree [MANUALS] or
ask your support astronomer.





%-----------------------------------------------------------------------------%
\section{Notation}                                                            %
%-----------------------------------------------------------------------------%

The following conventions have been used more-or-less consistently throughout
this manual: 
%
\begin{list}{$\bullet$}{\setlength{\itemsep}{-0.5mm}\setlength{\topsep}{0mm}}
 \item  Examples of commands entered at the terminal are in typewriter font:
        {\tt USLITWIDTH 50}, as are messages from the computer;
 \item  Angle brackets denote parameter values or character strings:
        {\tt $<$angle$>$};
 \item  Square brackets denote optional input \eg\ {\tt [x,y]}; all other 
        parameters are obligatory;
\end{list}
\clearpage
%=============================================================================%





%=============================================================================%
\chapter{\bf Overview of the data acquisition system}                         %
\label{chap:overview}                                                         %
\outerhead{\large\bf Overview}                                                %
%=============================================================================%

In this chapter, the general arrangement of the DAS is discussed, with some
emphasis on the hardware involved.
Users familiar with the WHT's equipment need not read this chapter.



%-----------------------------------------------------------------------------% 
\section{General description}                                                 %
%-----------------------------------------------------------------------------% 

The data-acquisition system can (somewhat arbitrarily) be divided into 
the following components:

\begin{itemize}
   \item The detectors themselves. Two types of detectors are available; 
         various CCDs, and the IPCS-2 photon counting system. Each detector has an 
         associated local controller.
   \item The Detector Memory System (DMS). Immediately after an exposure,
         the data from all detectors appears in memory in the DMS. Images 
         obtained with CCD detectors are read out into the DMS at the end 
         of an exposure.  Photon counts from the IPCS--2 are continually 
         transferred to the DMS during an exposure, where they are built 
         up into an image ({\em c.f.} the External Memory for IPCS-1). 

         The DMS provides some basic data-analysis facilities; however, 
         these facilities will not be fully supported once the
         SPARCstation data-evaluation system comes online (see below).
   \item The SPARCstation analysis-system. Raw data resident
         in the DMS can be rapidly transferred to this SPARCstation,
         where it can be inspected using standard reduction packages
         (principally IRAF).
   \item The system computer. On completion of an exposure, the data is 
         transferred to a data disk on the system computer, where it is merged
         with header information, and then archived. The data can also be
         copied from the system computer to one of several data-reduction 
         computers.
\end{itemize}

These components of the system are described more fully in the subsequent
sections. The flow of data between the different parts of the system
is illustrated in Figure~\ref{Dataflow}.


\begin{figure}[p]
\label{Dataflow}
\caption{Data flow in the Data-acquisition system}
\begin{verbatim}

          --------      --------      --------      --------
          | CCD1 |      | CCD2 |      | CCD3 |      | IPCS |
          --------      --------      --------      --------
             |             |              |             |
             |             |              |             |
             V             V              V             V        
             |             |              |             |
             |             |              |             |
            ----------------------------------------------
            |            Detector Memory System          |
            ----------------------------------------------
                     |                       |            
                     |                       |            
                     V                       V
                     |                       |            
                     |                       |            
               -------------          ----------------
               |   System  |          | Sparcstation |
               |  computer |          ----------------
               -------------
                     |                                  
                     |                                  
                     V                      
                     |                                  
                     |                                  
              -------------
              |  Archive  |
              |   tape    |
              -------------


\end{verbatim}
\end{figure}


It should be noted that we have attempted to describe the data acquisition
system as it currently is, not in its final planned form. It is expected
that in the long term, the SPARCstation will take on much of the functionality
of the system computer, and in particular, that data will be archived
through the SPARCstation rather than through the system computer.




%-----------------------------------------------------------------------------%
\section{CCDs and their controllers}                                          %
%-----------------------------------------------------------------------------% 

Most observations on the WHT will be carried out using a CCD detector.
Several different detectors are available, with different formats, sensitivity
and readout noise.  The properties of these detectors are described
in detail in La Palma Technical Notes 55 and 79.

Each CCD is mounted in a cryostat (often referred to as the CCD camera-head); 
this is filled with liquid nitrogen in order to cool the CCD  to its operating
temperature (typically 150 kelvin). 

The electronics required to operate the CCD comprises a CCD controller, 
(mounted on the telescope), and a preamplifier (mounted on the cryostat).
Briefly, the CCD controller carries out the following functions:
\begin{itemize}
   \item Operation of the CCD shutter
   \item Monitoring of CCD telemetry (operating temperature, voltages)
   \item Generation of the clock voltages required to read out the CCD
   \item Amplification and analogue to digital conversion of the 
         signal from the CCD preamplifier
\end{itemize}

The CCD controller used on the WHT is a new design, developed 
specifically for this telescope,
and is described in some detail in {\it Bregman \& Doorduin 1986 
(proc SPIE vol 627, p616), Bregman \& Waltham 1986 (ESO/OHP workshop
proc vol 25, p127), Jorden 1990 (proc SPIE vol 1235, p790)}. These papers
are reproduced as Appendix~\ref{PubCCD} to this manual. 

Each controller was originally intended to be capable of operating up to 16
CCD devices in two separate camera heads simultaneously. 
However, due to various practical constraints, the WHT normally operates with 
one controller per detector.

As for all the instrument controllers, the CCD controller receives 
commands from the system computer over the utility network.
The data produced by the CCD controller is transmitted over a dedicated
fibre-optic datalink to the detector memory system.
%-----------------------------------------------------------------------------% 





%-----------------------------------------------------------------------------% 
\section{The IPCS-2}                                                          %
%-----------------------------------------------------------------------------% 

The IPCS-2 is an imaging detector, which counts individual photon events 
with zero readout noise.  In very general terms, the way in which it
does this is similar to the way in which original IPCS (as used on the
AAT and INT) operates. However, the camera and electronics for the
IPCS-2 have been completely redesigned, and so the detailed operation
of the detector is completely different.

The principles of operation of the original IPCS are described by
{\it Boksenberg 1982 (Philosophical Transactions of the Royal Society
of London A, vol 307, p531)}. The design of the IPCS-2 is described
by {\it Fordham, Bone \& Jorden 1986 (SPIE proceedings vol 627, Instrumentation
in astronomy VI, p 206)}. This article is somewhat out-of-date, in that
the RCA CCD camera has been replaced by a GEC CCD camera; this affects the
pixel size and detector format. Both of these articles are reproduced 
as Appendix~\ref{PubIPCS} to this manual. For an up-to-date and detailed
description of the IPCS-2, see the IPCS-2 Users Manual.

Since the operation of the IPCS-2 is described in detail elsewhere,
we only give a brief description of the general principles here:
individual photon events are detected by means of an image intensifier,
on the front of which is mounted a photocathode. Photons incident on
the photocathode result in the emission of an electron. Each of these 
electrons triggers a cascade of electrons through the image intensifier,
producing a signal of about 10$^{7}$ electrons at the output. This splash of
electrons is detected by a CCD camera, and passed to an image processing
unit which calculates the centroid of each splash, and hence the position
on the photocathode of each photon event. The (x,y) coordinates of each 
photon event are then passed to the Detector Memory System, which counts
the number of photons detected in each pixel by incrementing an appropriate
memory location. During the course on an integration, a 2-dimensional
image or spectrum is built up in the Detector Memory System.
%-----------------------------------------------------------------------------% 





%-----------------------------------------------------------------------------% 
\section{The Detector Memory System}                                          %
%-----------------------------------------------------------------------------% 

The Detector Memory System allows detector data to be collected,
displayed and transferred to the system computer. A detailed
description of the system is given by {\it Johnson 1986 (Electronics
Report 413, the Detector Memory System)} and this will not be repeated 
here. 

Essentially, the DMS is a purpose-built computer, with a large area of memory
for storage of detector data.
The system is based on the industry-standard VME architecture.
There is a high speed data interface (DICI; Dual IPCS CCD Interface) between
the detectors and the VME memory. The system also has an image display
facility, based on an Opal Graphics Controller. 

After each exposure, the data from all  detectors appears in memory in the
Detector Memory System (DMS).
Images  obtained with CCD detectors are read out into the DMS at the end  of an
exposure; for a full-frame readout this can take several minutes.
Photon counts from the IPCS--2 are continually  transferred to the DMS during
an exposure, where they are built up into an image.
All data are displayed on a dedicated monitor as they arrive.

The DMS is capable of handling multiple detectors simultaneously, reading the
data from different detectors into different areas of memory (normally referred
to as buffers).
This feature is particularly important for the operation of ISIS.

Once the data is in the DMS, it can be transferred to the Sparcstation
for quick evaluation, or it can be transferred to the system computer
for archival to tape. It is also possible to display images on the
DMS, and carry out some basis data-analysis functions; however, with
the introduction of the SPARCstation it is expected that these DMS
functions will be used less frequently. 
%-----------------------------------------------------------------------------% 





%-----------------------------------------------------------------------------% 
\section{The SPARCstation data-evaluation system}                             %
%-----------------------------------------------------------------------------% 

A workstation (currently a SPARCstation 2) is provided for very-rapid on-line
evaluation of data, using standard reduction software.
This machine has a direct connection to the DMS, and can save data to disk (in
IRAF's file format) in addition to or in place of the normal archiving on the 
system computer.
Dedicated software is provided to work this link, but the observer must
explicitly request the saving of each file of interest; unlike the normal
archiving on the system computer (\qv), the SPARCstation cannot be set to save
observations automatically.
Observations saved on the SPARCstation have no headers.

Once data has been transferred to the SPARCstation it can be inspected
using standard astronomical reduction software. 
At present the only reduction facilities available on the SPARCstation are
SAOIMAGE and IRAF. It is expected that this will cater for most requirements. 
However, other  packages (\eg FIGARO) might be made available in the future,
given availability and sufficient demand.

It is also possible to copy observations to VAXes for inspection and reduction.
%-----------------------------------------------------------------------------% 





%-----------------------------------------------------------------------------% 
\section{The system computer}                                                 %
%-----------------------------------------------------------------------------% 

The system computer has three principal roles as part of the data-acquisition
system:

\begin{itemize}
   \item The system computer, running the ADAM control system, is responsible
         for coordinating the entire data acquisition process.
   \item The data acquisition system writes the data to files on the system 
         computer data-disk, ready to be archived.
   \item The system-computer hosts the tape drives and runs the software that
         allows the data to be archived.
\end{itemize}

On completion of an exposure, the data is normally transferred  from the DMS to
the system computer.
The header information associated with that data will have been collected by
the system computer, either during the exposure, or on completion of the
exposure.
Data and headers are then merged into a datafile on the system computer disk. 
Finally, two copies of the data are written to tape; a FITS format tape for the
La Palma archive, and either a FITS tape or a VAX backup tape for the observer.
The system computer is networked to various VAXes, VAXstations and
SPARCstations.
If desired, data can be copied across to these machines for immediate reduction
and analysis.

The structure and operation of the programs invoked by ICL commands should be
completely transparent to observers: you do not need to read the rest of this
section to use the system.
However, if you are curious, or if you are trying to cure a problem in the
system, the following information may be useful.

ICL is a program running on the system computer, which displays its output on
the user-interface VAXstation by means of the  X-windows system.
The mimic runs in a similar fashion.

Commands given to ICL cause messages to be passed to a set of programs which
also run on the system computer.
These programs are `ADAM tasks' (a.k.a. `D-tasks', `C-tasks' {\em etc.}) and it
is the protocol by which the messages are exchanged that defines this part of
the WHT software as an `ADAM system'.

The ADAM tasks extract data from the incoming ADAM messages and send out
commands to the computers controlling the CCDs and instruments.
The latter computers are mounted on the telescope and the ADAM tasks talk to
them over a local-area network, the Utility Network.

The control computers send status messages back over the utility network to the
ADAM tasks.
The tasks process this information into a human-readable form and transmit it
to the mimic display.
Finally, at the end of a particular operation or `action', the ADAM tasks send
a summary status back to ICL, which reports the outcome of the action to the
command terminal.

Tasks particularly concerned with data-acquisition (as opposed to instrument
control or telescope control) are the NDF-writing Task (NWT), the
Header-Collection Task (HCT) and the Run-Administration Tasks (RATs).
Of these, the NWT is concerned with writing data to disk on the system
computer, the HCT collects header information from other ADAM tasks and the 
RATs coordinate the rest of the software in order to perform the observations.
There is one RAT per active detector channel and progress messages prefixed by
the name of the channel are coming from the RAT.
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------% 
\section{Names of detector channels}                                          %
%-----------------------------------------------------------------------------% 

The DAS associates most commands with a single detector.
The hardware and software supporting this detector is known collectively as a
{\it detector channel}, and the name of the channel is a required parameter for
most commands.
Rather than name channels after individual detectors (\eg EEV3, IPCS) which
tend to move around from focus to focus, fixed names derived from the foci and
instruments are used.
Thus, data from the red arm of Isis is acquired on channel RED, while data from
the Cassegrain auxilliary port go to channel AUX.
The full set of channel names is shown in Table~\ref{CCDnames}.

\begin{table}[h]
\begin{center}
\caption{CCD naming conventions}
\label{CCDnames}
\begin{tabular}{ll}
\hline
Name    &   Location of detector \\
\hline
RED     & ISIS red arm           \\
BLUE    & ISIS blue arm          \\
FOS     & Faint Object Spectrograph \\
AUX     & Cass A\&G unit auxiliary port \\
TAURUS  & TAURUS \\
LDSS    & LDSS \\
UES     & Utrecht Echelle Spectrograph \\
GHRILL  & GHRILL Nasmyth focus \\
\hline
\end{tabular}
\end{center}
\end{table}
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------%
\section{The disk files}                                                      %
%-----------------------------------------------------------------------------%

The observations are stored on disk in NDF structures, which can be read by
Figaro and by Starlink's ADAM-based software.

The NDF structure is a specific organization of objects in the disk format HDS
and is described in the Starlink document SGP/38. NDFs are stored in HDS files
with an extension `.SDF' to the file name.

Naming conventions are used to identify observations: RUN\_FILES:R80200.SDF is
an NDF containing run 80200; SCRATCH\_FILES:S3.SDF is an NDF containing scratch
exposure number 3.

The NDFs produced at the WHT contain images with an 16-bit unsigned-integer 
datum for each pixel. This is HDS type `\_UWORD' which corresponds to Figaro's 
type `USHORT'.
The headers are stored in a standard NDF-extension `FITS' (component name
$<$file$>$.MORE.FITS) which is an array of 80-byte character strings, each
string containing one FITS record.
%-----------------------------------------------------------------------------%








%=============================================================================%
\clearpage                                                                    %
\chapter{Using the DAS}                                                       %
\label{chap:usage}                                                            %
\outerhead{\large\bf Using the DAS}                                           %
%=============================================================================%

This chapter contains practical advice on how to drive the DAS.
General information on the functions of the system is in
Chapter~\ref{chap:overview}.
Detailed information on the command set is in Chapter~\ref{chap:commands}.





%-----------------------------------------------------------------------------%
\section{Access to the data acquisition system}                               %
\label{sec:control}                                                           %
%-----------------------------------------------------------------------------%

As an observer, you can control most of the data-acquisition system from a 
single console; this is a VAXstation mounted in the middle of the observing 
desk
From the VAXstation, you enter commands in a terminal window and receive
feedback information both as messages send to the terminal window and 
{\em via\/} a graphical display --- the observer's mimic --- running on the
VAXstation screen.

The terminal window with which you control the data-acquisition system is also
used to control the instruments and, optionally,
the telescope.
This terminal window runs the command language ICL, for which relevant commands
are given in the following sections.

The data-assessment SPARCstation is controlled from its own console.
To get data from the DMS to the SPARCstation you must wait for the system
computer to finish an observation and then run a program on the SPARCstation
to copy over the image.





%-----------------------------------------------------------------------------%
\section{Starting up the system}                                              %
\label{sec:start}                                                             %
%-----------------------------------------------------------------------------%

The DAS is started automatically in the general start-up of the observing
system, invoked as follows.

Log on to the account on the system computer 
\footnote{Ask your support astronomer for the account name and password.}
from which you intend to observe.
Give the command {\tt ICL} to start the command language ICL.
You will now be asked to choose a configuration (\ie a set of hardware) from a
series of menus.
When you have made your choice, the system will run some initialization
programs, output some progress messages and then ask you whether you are ready
to load the system.
If you answer `NO', you will be given control of ICL and the instrument-control
and data-acquisition systems will not be loaded.
If you answer `YES', the system will proceed to load and initialize the system.
It is normal to answer `YES' at this point; if you answer `NO', you can load
the system at a later time by issuing the ICL command {\tt STARTSYS}.
The loading has finished when the \verb#ICL># prompt returns and when messages
of the form 
\begin{verbatim}
   RED_RAT: Ready to set up this channel.
\end{verbatim}
have appeared on the screen.
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------%
\section{Setting up the detector channels}                                    %
%-----------------------------------------------------------------------------%

The format of the images obtained by the DAS is highly flexible.
The default image size --- {\em full-frame readout} --- is normally set to be
the full area of the CCD chip plus some extra pixels --- {\em overscan} ---
which indicate the bias level.
However, the default size can be set to be a sub-set of the CCD chip or to be
very much larger than the size of the chip.
You must set this default size when you first use a detector channel.

The SETUP command sets the default image size.
Whenever you start or restart ICL, you should must SETUP to format each 
channel whith which you will observe.
It is also good practice to issue SETUP whenever the CCD controller or the DMS
has been reset in hardware.

The usual image size for the various CCD chips are stored in a database and
will be retrieved by the DAS and presented as defaults when prompting for the
image dimensions.
Usually, it is best to accept these defaults.
If you choose to override the defaults, this fact should be noted in the log.

The end of the set-up operation on each channel is marked by a message of the
form
\begin{verbatim}
   RED_RAT: SETUP has completed. Next operation?
\end{verbatim}
When all channels have been set up, you may take exposures.

Normally, each channel need only be set-up once at the beginning of the night,
or if you are changing to a new detector.
However, provided you're not in the middle of an exposure, you can use the
SETUP command at any time.

To reduce the amount of raw data that must be handled, and hence to reduce the
time taken to read out and store an image, you may use windowing, binning, or
both at once.

Binning factors, set with the BIN command, must be between one and 10 and can
be different for the $x$ and $y$ axes of the image.
To bin up CCD data, use commands such as
\begin{verbatim}
   ICL>  BIN RED 2 2 
   ICL>  BIN AUX 2 1 
\end{verbatim}
where the parameters give the binning factors in $x$ and $y$.
Binning factors are set to 1,1 whenever you issue the SETUP command.

To set a window on a CCD, use the WINDOW command. For example, when using ISIS
with an 1280 $\times$ 1180 CCD and the spectrum running in the $x$ direction
you might use
\begin{verbatim}
   ICL> WINDOW RED 1 1280 200 0 350
\end{verbatim}
to capture a 200-pixel strip about the spectrum that runs the full length of
the chip.
The parameters are, in order, channel name, window number, window $x$-size,
window $y$-size, window $x$-offset and window $y$-offset.
The sizes and offsets are in unbinned CCD pixels.
The offsets are the number of pixels by which the window is displaced from the
origin of the CCD; \ie a window with offset (0,0) includes part of the first
row and column of the CCD.
The window number can be from 1 to 10 and you can reuse a window number ---
this eliminates the previous window of that number from the system.

Multiple windows can be set on the same CCD.
The readout supplies data for all windows set, but the DMS does not treat
supply each window as a separate image.
Instead, if two or more windows are set, the DMS constructs an image with the
full frame size of the CCD, and with the pixels between the windows set to
zero.

Windows can be removed by setting the $x$-size to zero.
You can temporarily disable windowing, return to reading 
out the whole CCD, and then re-enable the windows:
\begin{verbatim}
   ICL> DISABLE_WINDOWS RED
   ICL> RUN RED 10
   ICL> ENABLE_WINDOWS RED
\end{verbatim}
Note that enabling and disabling the windows does not change the binning.
Windows are disabled by SETUP.

The windowing and binning must be compatible.
That is, the window sizes must be exact multiples of the binning factors.
The commands BIN, WINDOW and ENABLE\_WINDOWS check this compatibility and will
not let you set unsuitable values.

When setting the windowing and binning, you may also want to change the
readout speed of the CCD, trading faster readout for higher readout noise.
The READOUT\_SPEED command allows this:
\begin{verbatim}
   ICL> READOUT_SPEED RED  STANDARD
   ICL> READOUT_SPEED BLUE FAST
\end{verbatim}
Fast readout is intended mainly for exposures taken while setting up the
instrument.
It is very rare for observations to be made with fast readout.
%-----------------------------------------------------------------------------%




%-----------------------------------------------------------------------------%
\section{Making exposures}                                                    %
%-----------------------------------------------------------------------------%

Suppose that you have just started the system, or have finished, read out and
saved the previous exposure.
You now configure instrument for the next observation (see the separate manuals
for the WHT instruments for the appropriate commands) and are ready to start
an exposure.

To make an observation you only need to give one command.
In response to the command, the system will
\begin{itemize}
   \item prepare the detector;
   \item expose the detector for the requested time;
   \item collect the image data in the DMS;
   \item collect header information describing the observation;
   \item write the image and headers to a disk file on the system computer;
   \item record the observation in the observing log.
\end{itemize}
There is no need to use separate `Expose' and `Save-data' commands.

For example
\begin{verbatim}
   ICL> RUN RED 100 "NGC 1068"
\end{verbatim}
requests a run of length 100 seconds on the RED channel (\ie on the
red arm of ISIS).
Specifying a value for the third parameter causes the given string to be
written to the FITS header OBJECT; this parameter is optional.

The system will have allocated a run number to the run and will have sent you
a message stating the number.
The datafile will have been created in the directory pointed to by the logical
name RUN\_FILES.
Use the command
\begin{verbatim}
   ICL> DIR
\end{verbatim}
whenever you want to check the contents of this directory.
A naming convention exists: run 4151 would be written to a file named
R4151.SDF.
All the datafiles from a given night's observing appear in the same directory on
disk.

The system returns control of ICL to you before as soone as the observation is
underway.
From this time the the detector channel is `busy' --- \ie unavailable for other
operations.
The system indicates when the channel is free again with a message of the form
\begin{verbatim}
   RED_RAT: Run 80200 has completed. Next operation?
\end{verbatim}

To take data simultaneously on the red and blue arms of ISIS,
just type
\begin{verbatim}
   ICL>  RUN RED  <exposure time> ["<title>"]
   ICL>  RUN BLUE <exposure time> ["<title>"]
\end{verbatim}
and the exposure will proceed in parallel.
This also applies to any other set of channels that can receive light
simultaneously.

The RUN command (and its synonym, the TARGET command) are intended for
observations of astronomical targets. 
The commands FLAT, SKY, ARC, MAP, DARK, BIAS and FLASH are intended to be used
for calibration  exposures. 
The first four of these commands (FLAT, SKY, ARC, MAP)
differ only from RUN in that a different observation type is written
to the header, in order that data-reduction software can recognise
calibration exposures and process them accordingly. 
The DARK command carried out an exposure of the specified length, but without
opening the CCD shutter, whilst the BIAS and PREFLASH commands carry out zero
length exposures.
Examples of use of these commands are as follows.

Take a 60 second arc exposure on ISIS red arm:
\begin{verbatim}
   ICL> ARC RED 60 "CuAr arc"
\end{verbatim}

Take a 100 second flat field exposure:
\begin{verbatim}
   ICL> FLAT RED 100
\end{verbatim}

Take a bias exposure:
\begin{verbatim}
   ICL> BIAS RED
\end{verbatim}

Take a 9999 second dark exposure:
\begin{verbatim}
   ICL> DARK RED 9999
\end{verbatim}

It is important to remember that none of these commands affect the {\em
instrument}; using the ARC command, for example, won't turn on arc lamps or set
up the A\&G box for calibration exposures.
%-----------------------------------------------------------------------------%




%-----------------------------------------------------------------------------%
\section{Multiple sequential exposures}                                       %
%-----------------------------------------------------------------------------%
For each single-exposure command, there is a multiple-exposure equivalent that
takes a series of similar frames.

For example:
\begin{verbatim}
   ICL> MULTRUN RED 5 30 "<title>"
\end{verbatim}
Starts a series of 5 30-second observations.
Each observation is logged with the same title, if any title is given.

Note that there is no way to pause {\em between} exposures in a series
(as distinct from pausing {\em during} an exposure) in order to adjust the
instrument settings.
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------%
\section{Quick-look and instrument set-up}                                    %
%-----------------------------------------------------------------------------%

If you want to take a quick look at data, displaying it on the DMS or
SPARCstation, but not collecting header information or copying the data
to disk on the system computer, do a glance exposure:
\begin{verbatim}
   ICL> GLANCE RED 5
\end{verbatim}
In this example, a 5-second exposure is made on the Red channel and the data
appears in the DMS.
The data can then be inspected using on the DMS display before proceeding
further.

If you decide you want to keep this data on the system computer after all,
type
\begin{verbatim}
   ICL> KEEP RED <observation type> ["<title>"]
\end{verbatim}
This command will assign a run number, collect headers and write the data to
a disk file in RUN\_FILES a for a normal run.
The parameter {\it observation type} can take values from the set TARGET, SKY,
ARC, FLAT, BIAS, FLASH and MAP; the value of the parameter is written to the
header OBSTYPE.
Note that if you have changed the instrumental setup between taking the glance
exposure and saving it the headers will be incorrect.
KEEP can save data from any type of observation (not just from GLANCE), so is
useful for rescuing data if a routine run does not complete correctly.

To make an observation that you do not intend to archive, but which you want to
save to disk on the system computer, use the SCRATCH command.
\begin{verbatim}
   ICL> SCRATCH RED 1 <observation type> <exposure time> ["<title>"]
\end{verbatim}
causes the data (image plus headers) to be written to a `scratch file' S1.SDF\\
in the directory SCRATCH\_FILES.
Scratch files have headers but aren't allocated run numbers; they are temporary
files that should not be exported from LPO.

Any number of such scratch files may be created (subject to disk-space
constraints) by substituting another file number for the 1 in the command.
If you make a scratch exposure into an existing scratch file, the new data
over-writes the old.

SCRATCH\_FILES is initially the same directory as RUN\_FILES but this can be 
changed by redefining the logical name {\em at job level}.
\footnote{If you don't understand this fully, don't try it.}

If you later find that you want to keep a scratch file, you can convert it
to a proper run using the PROMOTE command.
\begin{verbatim}
   ICL> PROMOTE 1
\end{verbatim}
causes scratch file 1 to be allocated a run number and moved to RUN\_FILES.
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------%
\section{Pausing and stopping exposures}                                      %
%-----------------------------------------------------------------------------%
If you need to pause and then restart a CCD exposure, do so using the
following commands:
\begin{verbatim}
   ICL> PAUSE BLUE
   ICL> CONTINUE BLUE
\end{verbatim}

If you need either to abort a CCD  exposure or stop it before the
pre-set exposure time has elapsed, do so using the following commands:
\begin{verbatim}
   ICL> ABORT BLUE 
   ICL> FINISH BLUE
\end{verbatim}
FINISH saves the data, but ABORT throws the data away!

FINISH and ABORT will not stop a multiple exposure.
To stop this, use the KILLMULT command, which cancels the pending exposures,
followed by ABORT or FINISH to stop the exposure in progress:
\begin{verbatim}
   ICL> KILLMULT BLUE 
   ICL> FINISH BLUE
\end{verbatim}
You can, of course, give the KILLMULT command and let the current exposure
complete normally.
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------%
\section{The observing log}                                                   %
%-----------------------------------------------------------------------------%
Each time a normal observation is made (with the commands RUN, BIAS \etc), an
entry is made in the observing log.
This entry is distilled from a sub-set of the FITS headers, and should avoid
the need to keep a log manually.

During observing, the log is displayed in a dedicated terminal-window on the
same screen as the ICL terminal.
At start-up, this window appears as an icon labelled `Log'
The display updates itself whenever the log is extended.
Normally, the last 15 lines of the log are displayed.
If you want to review older observations, use the scrollbar on the side of the
log's terminal window.

The data recorded for each observation are those most likely to change from
exposure to exposure.
More stable information can be added using the command LOG\_CHANGE (no
parameters).
This command starts a text editor (EVE, with EDT's keypad) in the ICL window.
You can enter any text \via the editor; press Cntrl-z to exit from the editor
and append the text to the log.
It is best not to use LOG\_CHANGE during an observation.

Comments on an observation can be entered during the exposure.
\begin{verbatim}
   ICL> COMMENT AUX "Better seeing: 0.7 arcsec"
\end{verbatim}
will enter the given text (up to 70 characters) as a line in the log following
the observation it applies to and will also include the comment in the FITS
headers.
Note that the comment will not appear in the log display until the end of the
exposure.
Using the COMMENT command without comment text starts an editor similar to that
invoked by LOG\_CHANGE.
This allows you to enter comments longer than one line of text.
You may enter as many comments per observation as you have time to type,
but any comments still in the editor after the CCD reads out will be lost.
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------%
\section{Writing the disk files to tape}
%-----------------------------------------------------------------------------%
The commands that make exposures do not write the observations to tape
\footnote{This is planned as a future upgrade.}
and it is the responsibility of the observers to control the tape writing.
A separate manual discusses RGO's policy for the use of tapes and explains how
to drive the tape-writing programs; ask your support astronomer for document
WHT-FITS-2.
%=============================================================================%






%=============================================================================%
\clearpage                                                                    %
\chapter{\bf Command reference section}                                       %
\label{chap:commands}                                                         %
\outerhead{\large\bf Command reference}                                       %
%=============================================================================%

\section{Introduction}

This chapter is a reference section, describing all commands concerned with
data acquisition.
Commands are first listed alphabetically, then listed by function, then 
defined in detail (in alphabetical order).

Commands for operating the telescope are listed in the telescope users manual,
and commands for operating different instruments are summarised in the
instrument manuals.

Where reference is made to a channel name, see Table~\ref{CCDnames} for
the allowed set of names.

\parindent=70pt
\parskip 0pt

\vspace{7mm}
\noindent{\bf Notation: }  
%
\begin{list}{$\bullet$}{\setlength{\itemsep}{-0.5mm}\setlength{\topsep}{0mm}}
 \item  Examples of commands entered at the terminal are in typewriter font:
        {\tt USLITWIDTH 50};
 \item  Angle brackets denote parameter values or character strings:
        {\tt $<$angle$>$};
 \item  Square brackets denote optional input: {\tt [x,y]}; all other 
        parameters are obligatory;
\end{list}

\parindent=70pt
\clearpage
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------%
\section{Commands listed alphabetically}                                      %
%-----------------------------------------------------------------------------%
\begin{description}
   \item [ABORT] --- terminate an exposure immediately; discard the data.
   \item [ARC] --- take one exposure (of an arc lamp) and save it.
   \item [BIAS] --- take one bias frame and save it.
   \item [BIN] --- select binned readout of a CCD.
   \item [COMMENT] --- log a comment about an observation.
   \item [CONTINUE] --- restart an exposure suspended by PAUSE ({\it q.v.}).
   \item [DARK] --- take one dark frame and save it.
   \item [DIR] --- list observations made tonight.
   \item [DISABLE\_WINDOWS] --- suspend the effect of windowing on a CCD.
   \item [DISKSPACE] --- list remaining diskspace for storing observations.
   \item [ENABLE\_WINDOWS] --- resume windowing after DISABLE\_WINDOWS ({\it q.v.}).
   \item [FINISH] --- terminate an exposure immediately; save the data.
   \item [FLASH] --- take one exposure (to measure preflash levels) and save it.
   \item [FLAT] --- take one flat-field exposure and save it.
   \item [GLANCE] --- take one exposure but do not save it to disk.
   \item [KEEP] --- save the last exposure to disk.
   \item [KILLMULT] --- stop a multiple exposure.
   \item [LOG\_CHANGE] --- log a major change in observing configuration.
   \item [MAP] --- take one exposure (to map the dekker position) and save it.
   \item [MULTRUN {\it etc.}] --- make multiple exposures.
   \item [NEWTIME] --- change the length of an exposure.
   \item [PAUSE] --- suspend an exposure.
   \item [PROMOTE] --- promote a scratch file to a normal run.
   \item [RAT\_WAIT] --- wait (in an ICL procedure) for an exposure to finish.
   \item [READOUT\_SPEED] --- change the readout speed of a CCD.
   \item [RUN] --- take one exposure (of an astronomical target) and save it.
   \item [SCRATCH] --- take one exposure and save it in a scratch file.
   \item [SETUP] --- prepare a channel for taking data.
   \item [SKY] --- take one exposure (of the night/twilight sky) and save it.
   \item [STOP\_CHANNEL] --- free a `hung' data-acquisition channel.
   \item [TARGET] --- synonym for RUN.
   \item [WINDOW] --- define a readout window on a CCD.
   \item [WINK] --- as SCRATCH ({\it qv.}) but with no header collection.
\end{description}
%-----------------------------------------------------------------------------%





%-----------------------------------------------------------------------------%
\section{Commands listed by function}                                         %
%-----------------------------------------------------------------------------%

\subsection{Normal exposures}
\begin{description}
   \item [RUN] --- take one exposure (of an astronomical target) and save it.
   \item [TARGET] --- synonym for RUN.
   \item [BIAS] --- take one bias frame and save it.
   \item [ARC] --- take one exposure (of an arc lamp) and save it.
   \item [FLAT] --- take one flat-field exposure and save it.
   \item [SKY] --- take one exposure (of the night/twilight sky) and save it.
   \item [DARK] --- take one dark frame and save it.
   \item [FLASH] --- take one exposure (to measure preflash levels) and save it.
   \item [MAP] --- take one exposure (to map the dekker position) and save it.
\end{description}


\subsection{Multiple-exposure sequences}
There are comments MULTRUN, MULTBIAS {\it etc.} for each of the normal-exposure
commands.


\subsection{Test exposures}
\begin{description}
   \item [GLANCE] --- take one exposure but do not save it to disk.
   \item [KEEP] --- save the last exposure to disk.
   \item [SCRATCH] --- take one exposure and save it in a scratch file.
   \item [WINK] --- as SCRATCH but with no header collection.
   \item [PROMOTE] --- promote a scratch file to a normal run.
\end{description}


\subsection{Changing the image size}
\begin{description}
   \item [SETUP] --- prepare a channel for taking data.
   \item [WINDOW] --- define a readout window on a CCD.
   \item [BIN] --- select binned readout of a CCD.
   \item [DISABLE\_WINDOWS] --- suspend the effect of windowing on a CCD.
   \item [ENABLE\_WINDOWS] --- resume windowing after DISABLE\_WINDOWS.
\end{description}


\subsection{Interrupting an exposure}
\begin{description}
   \item [NEWTIME] --- change the length of an exposure.
   \item [PAUSE] --- suspend an exposure.
   \item [CONTINUE] --- restart an exposure suspended by PAUSE.
   \item [FINISH] --- terminate an exposure immediately; save the data.
   \item [ABORT] --- terminate an exposure immediately; discard the data.
   \item [KILLMULT] --- stop a multiple exposure.
\end{description}


\subsection{Logging and commentary}
\begin{description}
   \item [COMMENT] --- log a comment about an observation.
   \item [LOG\_CHANGE] --- log a major change in observaing configuration.
\end{description}


\subsection{Housekeeping}
\begin{description}
   \item [DIR] --- list observations made tonight.
   \item [DISKSPACE] --- list remaining diskspace for storing observations.
   \item [RAT\_WAIT] --- wait (in an ICL procedure) for an exposure to finish.
   \item [READOUT\_SPEED] --- change the readout speed of a CCD.
   \item [STOP\_CHANNEL] --- free a `hung' data-acquisition channel.
\end{description}
%-----------------------------------------------------------------------------%




%-----------------------------------------------------------------------------%
\section{Commmand descriptions}                                               %
%-----------------------------------------------------------------------------%

\subsection {ABORT}
Terminate an exposure early, abandoning the data.

\helpitem{Format:  } {\tt ABORT <channel> }
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Examples:} {\tt ABORT RED }
\helpitem{Comments:} This command terminates the current CCD exposure, 
                     throwing away the data.


\subsection {ARC}
This is equivalent to the RUN command, but intended for exposures
of arc lamps rather than observations of astronomical targets. 

\helpitem{Format:  } {\tt ARC <channel> <time> ["<string>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Time:    } The exposure time in seconds.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt ARC RED 1.5 "CuAr arc 5500 Angstrom"}
\helpitem{Comments:} As for the RUN command, except that the observation
                     type is set in the headers as ARC.
                     This command does not control arc lamps.
 

\subsection {BIAS}

Takes a single bias frame (a zero-second dark-exposure), and transfers the
data plus headers to an HDS file on the system computer.

\helpitem{Format:  } {\tt BIAS <channel> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt BIAS RED "Bias frame 5"}
\helpitem{Comments:} As for the DARK command, except that exposure time will be 
                     zero, and the observation type is set in the headers 
                     as BIAS.

\subsection {BIN}
Bins the readout of a CCD detector

\helpitem{Format:  } {\tt BIN <channel> <xbin> <ybin>}
\helpitem{Channel: } The name of the data-acquisition channel to be binned.
\helpitem{Xbin:    } The binning factor in X. This must be an integer
                     in the range 1 -- 10.
\helpitem{Ybin:    } The binning factor in Y. This must be an integer
                     in the range 1 -- 10.
\helpitem{Examples:} {\tt BIN UES 2 2}
\helpitem{Comments:} This command sets the binning factors on the named
                     channel in both X and Y.
                     Binning factors that do not divide exactly into the
                     current window sizes will be rejected.

\subsection {COMMENT}
Log a comment on an observation. The text of the comment is written to the
observing log and to the FITS headers.

\helpitem{Format:  } {\tt COMMENT <channel> [<comment>]}
\helpitem{Channel: } The name of data-acquisition channel on which to
                     log the comment.
\helpitem{Comment: } The text of the comment (up to 70 characters).
\helpitem{Examples:} {\tt COMMENT UES "Superb S/N!"}
\helpitem{Comments:} If no comment text is given on the command line, an
                     editor is started to take in the comment.


\subsection {CONTINUE}
Continue a paused CCD exposure.

\helpitem{Format:  } {\tt CONTINUE <channel> }
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Examples:} {\tt CONTINUE RED }
\helpitem{Comments:} This command resumes a paused CCD exposure, opening the 
                     CCD shutter. The shutter will not be opened if it was 
                     closed when the exposure was paused (as in the case of a 
                     dark exposure). The command will be aborted if no 
                     exposure is in progress.


\subsection {DARK}
Takes an exposure without opening the CCD shutter, and transfers the
data plus headers to an HDS file on the system computer.

\helpitem{Format:  } {\tt DARK <channel> <time> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Time:    } The exposure time in seconds.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt DARK RED 9999 "Measuring dark counts"}
\helpitem{Comments:} As for the RUN command, except that the CCD shutter
                     is not opened, and the observation type is set in 
                     the headers as DARK.


\subsection {DIR}
Lists run and scratch files taken during the current night.

\helpitem{Format:  } {\tt DIR}
\helpitem{Comments:} Lists observations in RUN\_FILES and SCRATCH\_FILES.
                     If the storage area for scratch files has been changed
                     during the night (\ie the logical name
                     SCRATCH\_FILES has been redefined), previous 
                     scratch-areas will not be searched.
                     Normal DCL qualifiers to the DIRECTORY command
                     (\eg /DATE, /SIZE) are accepted.


\subsection {DISABLE\_WINDOWS}
Disables windows and binning factors previously set up on a CCD detector

\helpitem{Format:  } {\tt DISABLE\_WINDOWS <channel>}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Examples:} {\tt DISABLE\_WINDOWS FOS}
\helpitem{Comments:} This command disables windowing of the CCD. 
                     The command does not delete the system's memory of window 
                     parameters; it only stops the system applying it. The 
                     windows can be re-enabled with the command 
                     ENABLE\_WINDOWS. This command does not affect binning.


\subsection {DISKSPACE}
Reports the available diskspace on the data disk.

\helpitem{Format:  } {\tt DISKSPACE}
\helpitem{Comments:} Reports free space in blocks and remaining quota for
                     the current data disk and the observer's home disk.


\subsection {ENABLE\_WINDOWS}
Enables windows previously disabled on a CCD detector.

\helpitem{Format:  } {\tt ENABLE\_WINDOWS <channel>}
\helpitem{Channel: } The name of the data-acquisition channel.
\helpitem{Examples:} {\tt ENABLE\_WINDOWS FOS}
\helpitem{Comments:} Where windowing the CCD has been disabled using the 
                     DISABLE\_WINDOWS command, this command re-enables them.


\subsection {FLASH}
Takes a single preflash frame (a zero-second exposure with preflash), and 
transfers the data plus headers to an HDS file on the system computer.

\helpitem{Format:  } {\tt FLASH <channel> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt FLASH RED "Test preflash level"}
\helpitem{Comments:} As for the RUN command, except that exposure time
                     will be zero, and the observation type is set in 
                     the headers as being a FLASH exposure.


\subsection {FLAT}
This is equivalent to the RUN command, but intended for exposures
of flat fields rather than astronomical targets

\helpitem{Format:  } {\tt FLAT <channel> <time> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Time:    } The exposure time in seconds.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt FLAT BLUE 1.5 "Tungsten flat 5500 Angstrom"}
\helpitem{Comments:} As for the RUN command, except that the observation type 
                     is set in the headers as FLAT.


\subsection {FINISH}
Terminate an exposure early, saving data and headers to disk.

\helpitem{Format:  } {\tt FINISH <channel>}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Examples:} {\tt FINISH RED }
\helpitem{Comments:} This command terminates the current CCD exposure, saving 
                     the data to disk as if the exposure had completed
                     normally.


\subsection {GLANCE}
Takes an exposure and transfers the data into the Detector Memory
System for inspection, but not to the system computer.

\helpitem{Format:  } {\tt GLANCE <channel> <time>}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Time:    } The exposure time in seconds.
\helpitem{Examples:} {\tt GLANCE RED ARC 5}
\helpitem{Comments:} This command is intended for a quick look at the data, to 
                     verify (for example) that the intensity level is as 
                     expected before carrying out a proper exposure. The data 
                     will be over-written when the next exposure is carried out 
                     on the same data-acquisition channel. To save the data, 
                     use the KEEP command.


\subsection {KEEP}
Copies a previously-completed exposure to disk on the system
computer, collecting headers and assigning a run number in the process.

\helpitem{Format:  } {\tt KEEP <channel> <obstype> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Obstype: } The observation type (\eg FLAT, ARC).
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt KEEP RED}
\helpitem{Comments:} The system will report the allocated run number.


\subsection {KILLMULT}
Stop a series of exposures started by MULTRUN {\it etc.}

\helpitem{Format:  } {\tt KILLMULT <channel>}
\helpitem{Channel: } The name of the data-acquisition channel
                     doing the exposure series.
\helpitem{Examples:} {\tt KILLMULT AUX}
\helpitem{Comments:} The current exposure in the series is left to complete 
                     normally and all pending exposures are cancelled.
                     The channel becomes ready for another command when the 
                     current exposure completes. KILLMULT can be followed by 
                     FINISH or ABORT (\qv ) for a complete stop.


\subsection {LOG\_CHANGE}
Log a change in the observing configuration. The change description is written
to the observing log and to the FITS headers.

\helpitem{Format:  } {\tt LOG\_CHANGE}
\helpitem{Comments:} An editor will be started to capture the change 
                     description.


\subsection {MAP}
This is equivalent to the RUN command, but intended for exposures taken to
map the geometry of an image. Such exposures might be required in order 
either to map geometric distortion of a detector, or to trace the curved
spectra obtained with FOS and UES.

\helpitem{Format:  } {\tt MAP <channel> <time> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Time:    } The exposure time in seconds.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt MAP FOS 1.5 "Trace"}
\helpitem{Comments:} As for the RUN command, except that the observation type 
                     is set in the headers as MAP.


\subsection {NEWTIME}
Alter the exposure time set for a CCD.

\helpitem{Format:  } {\tt NEWTIME <channel> <time> }
\helpitem{Channel: } The name of the CCD data-acquisition channel to be used.
\helpitem{Time:    } The new exposure time in seconds.
\helpitem{Examples:} {\tt NEWTIME RED 400}
\helpitem{Comments:} The system will not accept an exposure time that is
                     less than that currently set.


\subsection {PAUSE}
Pauses a CCD exposure.

\helpitem{Format:  } {\tt PAUSE <channel> }
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Examples:} {\tt PAUSE RED }
\helpitem{Comments:} This command suspends the current CCD exposure, closing
                     the CCD shutter. The command will be aborted if no 
                     exposure is in progress.


\subsection {PROMOTE}
Promotes a scratch datafile to the main data-area on the system computer,
assigning it a run number in the process.

\helpitem{Format:  } {\tt PROMOTE <filenum> }
\helpitem{Filenum: } The number of the scratch file.
\helpitem{Examples:} {\tt PROMOTE 5 }
\helpitem{Comments:} The system will report the allocated run number.
                     However, since the headers for the observation are
                     collected when the data is originally taken, the run
                     number will not appear in the headers.


\subsection {RAT\_WAIT}
Waits for an exposure to complete before returning control to ICL.

\helpitem{Format:  } {\tt RAT\_WAIT <channel> <timeout> }
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Timeout: } The maximum time to wait (seconds).
\helpitem{Examples:} {\tt RAT\_WAIT RED 90}
\helpitem{Comments:} The commands for carrying out CCD exposures normally
                     return control to ICL before they complete. Whilst
                     this is desirable in normal operation, it makes it 
                     impossible to write ICL procedures to carry out
                     a number of exposures sequentially (as in a focus
                     run for example). Such ICL procedures can be
                     produced using the RAT\_WAIT command.
                     The timeout parameter of the RAT\_WAIT
                     command forces it to return an error to ICL if
                     the exposure does not complete; it is recommended
                     that timeouts be made generous.


\subsection{READOUT\_SPEED}
Changes the readout speed of a CCD.

\helpitem{Format:  } {\tt READOUT\_SPEED <channel> <speed>}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Speed:   } The speed to be set: FAST or STANDARD.
\helpitem{Examples:} {\tt READOUT\_SPEED RED FAST}


\subsection {RUN}
Takes an exposure of an astronomical target, and transfers the
data plus headers to an HDS file on the system computer.

\helpitem{Format:  } {\tt RUN <channel> <time> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Time:    } The exposure time in seconds
\helpitem{Title:   } A title for the observation (optional)
\helpitem{Examples:} {\tt RUN RED 1.5 "NGC1068 nucleus"}
\helpitem{Comments:} This command takes a single exposure of an
                     astronomical target, collects header information
                     pertaining to that exposure, and transfers both data
                     and headers into an HDS file on the system computer.
                     During the observation the system will report the
                     run number allocated, and will announce the start
                     and end of the exposure. The user will be informed
                     once the data has been written to disk; until this
                     notification has been received, no further operations can
                     be carried out on this detector channel. Exposures cannot
                     be carried out until the detector has been set up using
                     the SETUP command.


\subsection {SCRATCH}
Takes an exposure, and transfers the data plus headers to a numbered 
HDS file in the scratch area on the system computer.

\helpitem{Format:  } {\tt SCRATCH <channel> <filenum> <obstype> <time> 
                     ["<title>"]}
\helpitem{Channel: } The name of the CCD data-acquisition channel to be used.
\helpitem{Filenum: } The number of the scratch file.
\helpitem{Obstype: } The observation type (\eg FLAT, ARC).
\helpitem{Time:    } The exposure time in seconds.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt SCRATCH RED 5 ARC 60}
\helpitem{Comments:} As for the RUN command, except that the data
                     is finally transferred not to the main data area on the 
                     system computer but to a scratch area. This command
                     is intended primarily for use with setup procedures.


\subsection {SETUP}
Sets up the default detector format, and prepares a channel for taking 
data.

\helpitem{Format:  }  {\tt SETUP <channel> <x-size> <y-size>}
\helpitem{Channel: }  The name of the data-acquisition channel to be used.
\helpitem{X-size:  }  The size of the required image in pixels.
\helpitem{Y-size:  }  The size of the required image in pixels.
\helpitem{Examples:}  {\tt SETUP RED}
\helpitem{Comments:}  The system will read the default detector format from
                      the configuration database, ask the user to verify
                      the image sizes and set the detector
                      up accordingly. The user will be informed when the
                      set-up is complete. No exposures can be made until 
                      the channel has been set up by this command.
                      In general, the format from the database should be used.
                      However, the CCD controllers can generate any size
                      of image for a given chip: pixels beyond the physical
                      extent of the chip are overscan and contain the bias
                      level only.


\subsection {SKY}
This is equivalent to the RUN command, but intended for sky flat fields
rather than observations of astronomical targets. 

\helpitem{Format:  } {\tt SKY <channel> <time> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Time:    } The exposure time in seconds.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt SKY TAURUS 1.5 "Twilight flat field; B filter"}
\helpitem{Comments:} As for the RUN command, except that the observation
                     type is set in the headers as being a sky flat field.


\subsection {STOP\_CHANNEL}
Interrupts a channel when hung and makes it able to accept new commands.

\helpitem{Format:  } {\tt STOP\_CHANNEL <channel> }
\helpitem{Channel: } The name of the data-acquisition channel to be used. 
\helpitem{Examples:} {\tt STOP\_CHANNEL FOS}
\helpitem{Comments:} If a channel is reported as ``busy'', this commmand
                     will free it. If the operation that the channel is 
                     performing has subsidiary actions in progress 
                     (\eg if an exposure is running on the CCD)
                     then these actions are allowed to continue.
                     However, no further subsidiary actions are started.
                     This command should be followed by SETUP.


\subsection {TARGET}
TARGET is a synonym for the RUN command. It takes an exposure of an 
astronomical target, and transfers the data plus headers to an HDS 
file on the system computer.

\helpitem{Format:  } {\tt TARGET <channel> <time> ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used.
\helpitem{Time:    } The exposure time in seconds
\helpitem{Title:   } A title for the observation (optional)
\helpitem{Examples:} {\tt TARGET RED 1.5 "NGC1068 nucleus"}
\helpitem{Comments:} As for the RUN command


\subsection {WINDOW}
Windows a CCD detector

\helpitem{Format:   } {\tt WINDOW <channel> <window-no> <x-size> <y-size>
                      <x-offset> <y-offset>}
\helpitem{Channel:  } The name of the data-acquisition channel to be windowed.
\helpitem{Window-no:} Number of the window to be set (from 1 to 10).
\helpitem{x-size:   } Size of window in pixels.
\helpitem{y-size:   } Size of window in pixels.
\helpitem{x-offset: } Offset of origin of window in pixels.
\helpitem{y-offset: } Offset of origin of window in pixels.
\helpitem{Examples: } {\tt WINDOW BLUE}
\helpitem{Comments: } The size and position of the window(s) are given in
                      {\em unbinned} CCD-pixels. 
                      Setting an $x$-size of zero deletes a window.\footnote{
                      At the time of writing the CCD D-tasks will not accept
                      zero sizes.}
                      Offsets of zero align the window with the left/bottom
                      edges of the image.\footnote{At the time of writing the 
                      CCD D-tasks will not accept zero offsets.}
                      This command enables any windows that were previously
                      disabled.
                      Windows that will not fit within the image format
                      defined by SETUP will be rejected.
                      Windows with sizes that are not multiples of the 
                      current binning factors will be rejected.


\subsection {WINK}
Takes a scratch exposure as for the SCRATCH command, except that no
headers are collected.

\helpitem{Format:  } {\tt SCRATCH <channel> <filenum> <obstype> <time> 
                     ["<title>"]}
\helpitem{Channel: } The name of the data-acquisition channel to be used. 
\helpitem{Filenum: } The number of the scratch file.
\helpitem{Obstype: } The observation type (\eg FLAT, ARC) .
\helpitem{Time:    } The exposure time in seconds.
\helpitem{Title:   } A title for the observation (optional).
\helpitem{Examples:} {\tt SCRATCH RED 5 ARC 60}
\helpitem{Comments:} As for the SCRATCH command, except that no headers
                     are collected.
%=============================================================================%





\appendix

\chapter{Publications describing the WHT CCD controller}
\label{PubCCD}

\chapter{Publications describing IPCS-2 on the WHT}
\label{PubIPCS}



\end{document}

    
%-----------------------------------------------------------------------------

% Useful sub-templates
    
% Main list
    
\begin{list}{$\bullet$}{\setlength{\itemsep}{0mm}}
 \item 
 \item 
 \item 
\end{list}

% Nested list

  \begin{list}{$\circ$}{\setlength{\itemsep}{0mm}}
   \item 
   \item 
   \item 
  \end{list}

% Figures

\begin{figure}[t]
\centering
\input %%%
\caption{\label{fig:context}}
\end{figure}



