%-----------------------------------------------------------------------
%;  Copyright (C) 1995, 1998
%;  Associated Universities, Inc. Washington DC, USA.
%;
%;  This program is free software; you can redistribute it and/or
%;  modify it under the terms of the GNU General Public License as
%;  published by the Free Software Foundation; either version 2 of
%;  the License, or (at your option) any later version.
%;
%;  This program is distributed in the hope that it will be useful,
%;  but WITHOUT ANY WARRANTY; without even the implied warranty of
%;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%;  GNU General Public License for more details.
%;
%;  You should have received a copy of the GNU General Public
%;  License along with this program; if not, write to the Free
%;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
%;  MA 02139, USA.
%;
%;  Correspondence concerning AIPS should be addressed as follows:
%;          Internet email: aipsmail@nrao.edu.
%;          Postal address: AIPS Project Office
%;                          National Radio Astronomy Observatory
%;                          520 Edgemont Road
%;                          Charlottesville, VA 22903-2475 USA
%-----------------------------------------------------------------------
\input COOK82.MAC
\input psfig
\def\doFIG{T}
\def\titlea{15-Oct-1998 (revised 20-August-1998)}
\def\chapt{6}
\tsect{6.  DISPLAYING YOUR DATA}

     This chapter is concerned with the ways in which you may display
your data.  There are a number of tasks for generating ``plot files''
which contain graphics commands for the making of various displays of
your \uv\ and image data.  All of these now offer a ``preview'' option
to draw the plot directly on the \AIPS\ TV, rather than putting the
commands into a file.  Once the files are created, a variety of tasks
may be used to translate them into displays on various devices, such
as the \AIPS\ TV and graphics windows and PostScript printers and film
recorders.  There are also verbs to display and manipulate your images
on the \AIPS\ TV and a single task {\tt TVCPS} to capture that
display, if desired, into a PostScript file for printing, recording on
film, or even including in your scientific papers.

     Several indices of the \AIPS\ software are relevant to this
discussion.  To generate current lists of \AIPS\ functions on your
workstation window (or terminal) use {\us ABOUT HARDCOPY \CR}, {\us
ABOUT INTERACT \CR}, {\us ABOUT PLOT \CR}, {\us ABOUT TV-APPL \CR},
and {\us ABOUT TV \hbox{\CR}}.  The {\tt 15JAN95} versions of these
indices are reproduced in Chapter 13 of this \Cookbook.

\subsect{6.1.  Getting data into your \AIPS\ catalog}

     By the time you reach this chapter, most of your data will
probably already be loaded into your \AIPS\ catalog either by reading
an external tape or disk or by being generated by some \AIPS\ task.
Visibility data which are not presently on disk may be read by the
\AIPS\ tasks {\tt FILLM}, {\tt UVLOD} and {\tt FITLD}; see \Secs 4.1
and 5.1 for details.  Images that are generated by other imaging
systems, (\eg\ images from non-NRAO radio telescopes or non-radio
images) can be transported to \AIPS\ by writing them out of the other
imaging system on tape or disk in the standard FITS format.  The tasks
{\tt IMLOD} and {\tt FITLD} can then be used to read them into
\hbox{\AIPS}.  These tasks are also used to read images saved with
{\tt FITTP} from previous \AIPS\ sessions.

\subsubsect{6.1.1 {\tt IMLOD} and {\tt FITLD} from tape}

     {\tt \tndx{IMLOD}} and {\tt \tndx{FITLD}} will position tapes for
you using the {\tt NFILES} adverb.  It is safer to use {\tt AIPS}
verbs instead to position the tape and to check that positioning.
First, mount your tape in hardware and software as described in \Sec
3.9.  To move the tape forward by $nf$ file marks to position it at
the first interesting image, enter:
\dispt{INTAPE\qs {\it n} \CR}{to specify the tape drive labeled
             {\it n}.}
\dispt{NFILES\qs {\it nf} \CR}{to specify the number of file marks to
             move the tape.}
\dispt{AVFILE \CR}{to move the tape.}
\dispe{If {\it nf\ }$ > 0$, {\tt \tndx{AVFILE}} will advance the tape
the specified number of file marks.  If {\it nf} = 0, the tape is
moved backward to the beginning of the current file.  Once you have
moved part-way into a tape, you may use {\it nf\ }$ < 0$ to move
backwards to the abs({\it nf\/}) previous file.  In all cases, the
tape is left at the beginning of a file.  Task {\tt PRTTP} is an
invaluable aid to determine what is on your tape and where it is; see
\Secs 3.9.4 and 5.1.1.  If you happen to come across a CV-IBM format
tape from some astronomical museum, the verb {\tt AVMAP} may also be
needed.  Type {\us HELP AVMAP \CR} for details.  You must use {\tt
IMLOD} not {\tt FITLD} for such antiques.}

     To check that the tape is positioned where you expect, type:
\dispt{\tndx{TPHEAD} \CR}{ }
\dispe{Your terminal will then list information about the image header
at which the tape is positioned.  The tape position is not altered.
Once the tape has been positioned at the desired image, enter:}
\dispt{OUTDI\qs $n$ \CR}{to specify writing the image to your \AIPS\
             catalog on disk $n$.}
\disptt{OUTNAME\qs '{\it your-chosen-name}' \CR}{to specify the output
             disk file name in \AIPS; the default is the image name on
             tape if {\tt FITTP} was used to write the image to tape.}
\dispe{The string {\it your-chosen-name} can be any ($\le$
12-character) title that you want to use as the image name within
\AIPS\ and should be specified for images from other image-processing
software systems.  {\tt \tndx{FITLD}} also allows you to specify the
6-character image ``class'' parameter.  Use {\us OUTCLASS '{\it
abcdef\/}' \CR}, if you wish to change the class from that on your
input tape as the image is read or if the image comes from a
``foreign'' system.}
\disptt{OUTS\qs -1 \CR}{to keep the sequence number the same as that
              on tape; the default is the highest unique number for
              images with this name and class in your current \AIPS\
              catalog.}
\disptt{NFILES\qs 0 \CR}{to have no further files skipped --- {\bf
              important} if you have just used {\tt AVFILE} to
              position the tape!}
\disptt{NCOUNT\qs $m$ \CR}{to load $m$ images consecutively starting
              with the image at the current tape position; default is
              $m=1$.  If you use this option, do {\it not} specify the
              {\tt OUTNAME} unless you want the same name for all the
              new images in your catalog.}
\dispt{GO\qs FITLD \CR}{or {\tt \tndx{IMLOD}}, to run the task.}
\dispe{If {\tt OUTNAME} is left unspecified, it defaults to the
``name'' of the image read from the FITS header --- either the name
previously used in earlier image processing or the source name.  If
{\tt OUTCLASS} is unspecified, it defaults to the Class previously
used in earlier image processing or to a compound name (\eg\ {\tt
IMAP}, {\tt IBEM}, {\tt QMAP}, {\tt ICLN}) which attempts to describe
the image.  These defaults are frequently good ones when you are
loading multiple consecutive images with {\tt NCOUNT} $>0$. You may of
course change the \AIPS\ image and class names later by using {\tt
RENAME} (see \Sec 3.3.3 of this \Cookbook).}

     To load $m$ consecutive further images from the same tape using
the default {\tt OUTNAME} (the names from their FITS header), skipping
$n$ from the sequence:
\dispt{OUTNAME\qs ' '; OUTCL\qs ' ' \CR}{to ask for the system
              defaults.}
\dispt{NFILES\qs $n$ \CR}{to skip $n$ file marks.}
\dispt{NCOUNT\qs $m$ \CR}{to specify loading $m$ consecutive images
              after the skip.}
\dispt{GO\qs FITLD \CR}{or {\tt IMLOD}, to run the program.}
\dispe{To dismount the tape when {\tt FITLD} is done:}
\dispt{\tndx{DISMOUNT} \CR}{ }
\parskip\parsdef

\subsubsect{6.1.2. {\tt IMLOD} and {\tt FITLD} from FITS-disk}

     {\tt FITLD} and {\tt IMLOD} can also read FITS-format images from
external disk files into your \AIPS\ catalog.  This option is
indicated by setting the adverb {\tt INFILE} to a non-blank value.
The control parameters are the same as described above for reading
FITS tapes, except that {\tt INTAPE}, {\tt NFILES} and {\tt NCOUNT}
are ignored.  Disk image files must therefore be read in only one at a
time (per execution of {\tt IMLOD}).  {\tt INFILE} is a string of up
to 48 characters that must completely specify the disk, directory, and
name of the input disk file to your computer's operating system.  See
\Sec 3.10.3 for a discussion of \indx{FITS-disk} files.

        One ``feature" of \AIPS\ complicates this otherwise
straightforward disk analog of FITS tape reading.  {\tt AIPS}
translates all of your alphabetic inputs to upper case (this was
demanded by users who otherwise became confused between upper and
lower cases).  So if your computer distinguishes upper and lower cases
for disk, directory, or file names, you must do two things to prepare
for this before running \hbox{\AIPS}.  First, you must restrict your
external disk file names to upper-case characters and numbers.
Second, you must set an upper-case ``environment variable'' or
``logical'' to point to the disk and directory where your
\indx{FITS-disk} images are stored before you run \hbox{{\tt AIPS}}.
You may need help from your System Manager when doing this for the
first time.  A common strategy on UNIX machines is to create an
upper-case logical name after logging in but before starting up {\tt
AIPS}:
\dispx{{\tt \%\qs}setenv MYLOGICAL {\it myarea} \CR}{if using
              C-shell, or}
\dispx{{\tt \$\qs}export MYLOGICAL={\it myarea} \CR}{if using korn,
              bourne, or bash shells,}
\dispe{where {\us MYLOGICAL} is an all-upper-case string of your
choice and {\it myarea} is the full path name of the disk directory
that contains your FITS-disk data.  \AIPS\ usually provides a public
disk area known as {\tt FITS} which you may use.}

      Then, once inside {\tt AIPS}, tell {\tt \tndx{FITLD}} or {\tt
\tndx{IMLOD}}:
\dispt{INFILE\qs 'MYLOGICAL:IMAGE.DAT' \CR}{to read in the FITS-disk
      file {\it myarea}{\tt :IMAGE.DAT}.}
\pd

\subsect{6.2.  Printer displays of your data}

     The most old fashioned way to look at your data --- and the most
exact --- is simply to print it out and read the numbers.  \AIPS\
provides a variety of tasks and verbs to print visibility data, image
data, tabular data, and miscellaneous other information.  All of these
tasks and verbs allow you to specify where the printed output goes
using two adverbs, {\tt \tndx{DOCRT}} and \hbox{{\tt
\tndx{OUTPRINT}}}.  If {\tt DOCRT} $\le 0$ and {\tt OUTPRINT} is
blank, then the output is placed in a temporary file and queued to the
\indx{printer} you selected when starting \hbox{{\tt AIPS}}; see \Sec
2.2.3.  If {\tt DOCRT} $\le 0$, a non-blank {\tt OUTPRINT} specifies a
text file into which the output is to be written; see \Sec 3.10.1.
The current output is appended to the file if it already exists.
Thus, you can combine a number of printed outputs for later editing
and/or printing.  If {\tt DOCRT} $> 0$, the output is directed to your
workstation window or terminal. If {\tt DOCRT} $\ge 72$, its value is
taken as the width of the display window.  Since most print tasks
display more information on wider windows, we recommend widening your
window to 132 characters and specifying {\tt DOCRT = 132}, which is
the upper limit.  The print routines will pause whenever the screen is
full and offer you the choice of continuing or quitting.  Thus, you
can start what might be a very long print job, find out what you
wanted to know after a few screens full, and quit without using up any
trees.

\subsubsect{6.2.1.  Printing your visibility data}

     Before beginning calibration, it is a very good idea to make a
summary list of the contents of your data set.  {\tt \tndx{LISTR}}
with {\tt OPTYPE = 'SCAN'} will list the contents of each scan in the
data set. {\tt \tndx{DTSUM}} also produces a listing summarizing the
data set in either a condensed or full form.

     The most basic display of your visibility data is provided by
{\tt \tndx{PRTUV}} which lists selected correlators in the order they
occur in the data set:
\dispt{TASK\qs'PRTUV' ; INP \CR}{to review the inputs.}
\dispt{INDI\qs{\it n} ; GETN\qs {\it ctn} \CR}{to select the disk and
         data set to print.}
\dispt{CHANNEL\qs $c$ ; BIF\qs 1 \CR}{to print starting with channel
         $c$ from IF 1.}
\disptt{BCOUNT\qs $m$; XINC\qs $i$ \CR}{to print every $i^{\uth}$
         visibility starting with the $m^{\uth}$ visibility in the data
         set.}
\dispt{DOCRT\qs 132 ; GO \CR}{to run the task with display on the
         terminal.}
\dispe{When you have seen enough, enter {\us q \CR} or {\us Q \CR} at
the page-full prompt.}
\eject

\noindent You may limit the sources, range of projected baselines, and
times displayed and may select only one baseline or one antenna.  {\tt
PRTUV} does not apply calibration or flagging tables.  To get a
similar display with all ``standard'' calibration, flagging, and data
selection (optionally) applied, use the task \hbox{{\tt
\tndx{UVPRT}}}.  {\tt \tndx{LISTR}} also uses all of the calibration
options to list the data in simple lists or in a display showing all
the baselines at each time in a matrix form.  {\tt \tndx{SHOUV}} also
makes list of calibrated visibility data with options to average all
channels in each IF and to display closure rather than observed
phases.

     There are a number of tasks used to diagnose possible problems in
your data and to print information about them.  {\tt \tndx{UVFND}}
examines a data set for excess fluxes, excess apparent V-polarization,
or simply any data with a specified fringe spacing and position angle
or a specified range in $u$ and $v$. As it does this, it also checks
for bad antenna numbers, bad times, and (optionally) bad data weights.
{\tt \tndx{CORER}} examines a data set for excessive mean values and
rms in each correlator (after subtracting a point source at the
origin).  {\tt \tndx{RFI}} examines the rms fluctuations in the real
and imaginary visibilities of each correlator looking for (and
reporting) periods of apparent RF interference.  {\tt \tndx{UVDIF}}
directly compares two data sets reporting any excess differences.  It
is useful for determining whether your latest operations (flagging,
self-cal) have made a significant (or any) difference.

\subsubsect{6.2.2.  Printing your image data}

     The most basic display of an image is a print out of the numbers
it contains.  Such a display is provided by {\tt \tndx{PRTIM}}:
\dispt{TASK\qs 'PRTIM' ; INP \CR}{to review the inputs.}
\dispt{INDI\qs{\it n} ; GETN\qs {\it ctn} \CR}{to select the disk and
         image to print.}
\disptt{NDIG\qs 3 \CR}{to use 3 digits, printing numbers between -99
         and 999 with appropriate power of 10 scaling.}
\disptt{FACTOR\qs 10 \CR}{to raise the default scaling by a factor of
         10, overflowing regions of high values to see low valued
         regions better.}
\dispt{BLC\qs 0 ; TRC\qs 0 \CR}{to see the whole image.}
\dispt{XINC\qs 2 ; YINC\qs 2 \CR}{to see every other column and every
         other row.}
\dispt{DOCRT FALSE ; GO \CR}{to print the image on the selected
         \indx{printer}.}
\pd

     Other imaging tasks which use the printer are {\tt \tndx{BLSUM}}
and {\tt \tndx{ISPEC}}, which compute and print spectra by summing
over regions of each plane in a data cube (see \Sec 8.6), and {\tt
\tndx{IMFIT}}, {\tt \tndx{JMFIT}}, and {\tt \tndx{SAD}}, which fit one
or more Gaussians to an image (see \Secs 7.5).  {\tt \tndx{IMTXT}}
writes an ASCII-formatted file containing an image.

\subsubsect{6.2.3.  Printing your table data}

     If you have any doubts about the contents of tables in \AIPS\ it
is best to resolve them by looking at the contents of the tables
involved.  {\tt \tndx{PRTAB}} is a very general task which will print
the contents of any \AIPS\ table file.  For example, to print flag
table version 1:
\dispt{TASK\qs 'PRTAB' ; INP \CR}{to review the inputs.}
\dispt{INDI\qs{\it n} ; GETN\qs {\it ctn} \CR}{to select the disk and
         catalog entry to print.}
\dispt{INEXT\qs 'FG' ; INVERS\qs 1 \CR}{to select flag table version
         1.}
\dispt{BCOUNT\qs 0 ; ECOUNT\qs 0 ; XINC\qs 1 \CR}{to print everything.}
\dispt{DOHMS\qs TRUE \CR}{to print times in sexagesimal notation.}
\dispt{DOCRT\qs 132 ; GO}{to print the flag table on the terminal.}
\dispe{When you have seen enough, enter {\us q \CR} or {\us Q \CR} at
the page-full prompt.  For a table with a significant number of
columns, {\tt PRTAB} shows all rows for the first columns and then
loops for the next set of columns.  To see all columns for some rows,
set a low {\tt ECOUNT} value or be very patient.}
\eject

     Some of the tables have specialized printing programs.  These
include {\tt \tndx{PRTAN}} for antenna tables, {\tt \tndx{PRTCC}} for
Clean component tables, {\tt \tndx{LISTR}} with {\tt OPTYPE = 'GAIN'}
for calibration, solution, and system temperature tables, and {\tt
\tndx{PRTGA}} for gain tables of the type used by \hbox{{\tt ASCAL}}.
The verb {\tt \tndx{EXTLIST}} will list information about various
extension files, particularly plot files (see below), which may be
printed with \hbox{{\tt \tndx{PRTMSG}}}.  {\tt \tndx{OFMLIST}} is a
verb to print the contents of an \AIPS\ TV color table.  Finally, task
{\tt \tndx{TBDIF}} will compare columns of two tables and print
information about their differences.

\subsubsect{6.2.4.  Printing miscellaneous information}

     There is a variety of miscellaneous information which may also be
sent to the \indx{printer} in the same way.  Verb {\tt PRTMSG} prints
selected contents of the \AIPS\ message file; see \Sec 3.2.  Verb {\tt
\tndx{PRTHI}} prints selected lines from a history file; see \Sec 3.4.
Pseudoverb {\tt \tndx{ABOUT}} prints lists of \AIPS\ symbols by
category while pseudoverbs {\tt \tndx{HELP}} and {\tt \tndx{EXPLAIN}}
print information about a selected symbol; see \Sec 3.8.  Task {\tt
\tndx{PRTTP}} prints the contents of magnetic tape volumes; see \Sec
3.9.4.  Task {\tt \tndx{PRTAC}}, which may also be run in a
stand-alone mode, prints information selected from the \AIPS\
accounting file.

     Task {\tt \tndx{TXPL}} will attempt to represent an \AIPS\ plot
file (see below) on the printer.  This will not work well for
complicated plots, but, for simple plots, it may be the only way
someone running over a slow telephone line can see his/her data in
plot form.

\subsect{6.3.  Plotting your data}

     The basic concept in \AIPS' plotting is to use some task to
create and write a device-independent \Indx{plot file} as a PL
extension file to a cataloged image or visibility data set and then to
use some device-dependent task to interpret that file for the desired
output device.  Plot files are not overwritten by subsequent plot
tasks. Instead they make new plot files with higher ``version''
numbers.  The device-dependent tasks include {\tt \tndx{TVPL}} (\AIPS\
TV devices including {\tt \tndx{XAS}}), {\tt \tndx{TKPL}} (Tektronix
graphics devices including \AIPS' {\tt \tndx{TEKSRV}} server), {\tt
\tndx{TXPL}} (line printers), and {\tt \tndx{LWPLA}}
(\indx{PostScript} printer/plotters).  Tasks called {\tt PRTPL}, {\tt
QMSPL}, and {\tt CANPL} support Versatec, QMS, and Canon
printer/plotters if you still have one of these around.  To plot on a
PostScript printer/plotter:
\dispt{TASK\qs 'LWPLA' ; INP \CR}{to review the inputs.}
\dispt{INDI\qs{\it n} ; GETN\qs {\it ctn} \CR}{to select the disk and
         catalog entry to print.}
\dispt{PLVER\qs $n$ \CR}{to plot the $n^{\uth}$ plot file.}
\dispt{OUTFILE\qs ' ' ; GO \CR}{to do the plot immediately.}
\dispe{{\tt LWPLA} offers the option to save the file for later
plotting or inclusion as encapsulated PostScript in other documents.
It also has options to control scaling, output paper size, width and
darkness of lines, and transformation of grey-scale intensities.}

\Iodx{TV functions}
     All \AIPS\ plot tasks now offer a ``preview'' option.  If you set
{\tt \tndx{DOTV} = TRUE} when running any plot task, then the plot
appears immediately on the \AIPS\ TV display and no plot file is
generated. This option allows you to make sure that the parameters of
the plot are reasonable and lets you avoid making files and wasting
paper for quick-look plots.  Additional options allow you to control
which graphics channel is used for the line drawing ({\tt GRCHAN}) and
to select pixel scaling of the plot at your specified location on the
TV screen (\hbox{{\tt TVCORN}}).  These two options allow you to view
more than one plot at a time on the TV, usually for purposes of
comparison.  Each graphics channel on the TV has a different color and
a complementary color is used when two or more channels are on at the
same point.  This allows for a fairly detailed and effective
comparison of plots, all of which may be captured with task {\tt
\tndx{TVCPS}} (see below).  (Since the {\tt DOTV} option can be fairly
slow on complicated plots, you may prefer to use {\tt TKPL} on plot
files produced with {\tt DOTV \hbox{FALSE}}.)
\eject

     You can review the parameters of the plot files associated with a
given image or visibility data set by typing:
\dispt{INDI\qs{\it n} ; GETN\qs {\it ctn} \CR}{to select the disk and
         catalog entry to print.}
\dispt{INEXT\qs 'PL' ; \tndx{EXTLIST} \CR}{to list summaries of the
         plot file contents.}
\dispe{Plot files (and other ``extension files'') are automatically
deleted when an image is deleted by \hbox{{\tt ZAP}}.  However, large
plot files should be deleted as soon as they are no longer needed:}
\dispt{INP\qs \tndx{EXTDEST} \CR}{to review the inputs required.}
\disptt{INEXT\qs 'PL' ; INVERS\qs $m$ \CR}{to set the type to {\tt
         PL} (plot) and the version number to be deleted to $m$.
         $m = -1$ means all and $ m = 0$ means the most recent
         (highest numbered).}
\dispt{EXTDEST \CR}{to do the deletion.}
\dispt{INVERS\qs 0 \CR}{to reset the version number to its default ---
         usually advisable.}
\pd

\subsubsect{6.3.1.  Plotting your visibility data}

     The most basic plot program for visibility data is called
\hbox{{\tt \tndx{UVPLT}}}.  It allows you to select the $x$ and $y$
axes of the plot from real, imaginary, amplitude, and phase of the
visibility, time, and projected baseline length, position angle, $u$,
$v$, and $w$.  It offers all of the usual calibration and data
selection options and it plots the selected points individually or in
a controlled number of bins along the $x$ axis.  For example, to plot
calibrator phases as a function of time for all baselines to one
antenna:
\dispt{TASK\qs 'UVPLT' ; INP \CR}{to review the inputs.}
\dispt{INDI\qs{\it n} ; GETN\qs {\it ctn} \CR}{to select the disk and
         catalog entry of the data set.}
\disptt{BPARM = 11,2 \CR}{to plot time in hours on the $x$ axis and
         phase in degrees on the $y$ axis.}
\dispt{SOURCES\qs ' ' ; CALCODE\qs '*' \CR}{to select all calibrator
         sources.}
\dispt{XINC\qs 4 \CR}{to plot only every fourth selected sample.}
\dispt{ANTENNA\qs 2,0 ; BASELINE\qs 0 \CR}{to do all baselines with
         antenna 2.}
\dispt{DOCRT = -1 ; GO \CR}{to make a \Indx{plot file} of these data.}
\dispe{After {\tt UVPLT} is running, or better, after it has
finished:}
\dispt{PLVER\qs 0 ; GO\qs LWPLA \CR}{to plot the latest version on a
         PostScript printer/plotter.}
\pd

     There are several other tasks to plot your visibility data.  {\tt
\tndx{VPLOT}} is a new and faster version of {\tt \tndx{VBPLT}}, both
of which plot all of the parameters offered by {\tt UVPLT}, but one
baseline at a time with multiple baselines per page (\ie\ per plot
file) and multiple pages per execution.  {\tt \tndx{CLPLT}} is a
similar task but restricted to plotting closure phases as a function
of time.  All three of these can also plot a source model (based on
Clean components) as well as the observations.  For spectral-line
users, {\tt \tndx{POSSM}} plots visibility spectra averaged over
selected baselines and time intervals.  For VLBI users (primarily),
{\tt \tndx{FRPLT}} plots visibilities versus time or, more
importantly, the fringe rate spectrum.  To examine the statistical
distribution of your data, try {\tt \tndx{UVHGM}} which plots
histograms showing the number of samples or weights versus a wide
variety of parameters.

     Two plot programs actually convert visibility data to the image
plane for plotting.   Observers of point objects which might vary with
time either intrinsically or by scintillation (\eg\ stars, masers)
might wish to try {\tt \tndx{DFTPL}}, which plots the Fourier
transform of the data shifted to a selected position as a function of
time.  VLBI spectral-line observers may need to use {\tt
\tndx{FRMAP}}, which performs imaging via fringe-rate inversion and
plots the loci of possible source positions.

\vfill\eject

\if T\doFIG
   \centerline{\psfig{figure=FIG/UVPLTUV.PLT,height=3.5in}\hss
      \psfig{figure=FIG/UVPLTBF.PLT,height=3.5in}}
\vfill
\else
   \vbox to 3.5in{\vfill\omit\vfill}
\fi

{\Smpoint
\noindent {\tt \tndx{UVPLT}} displays of where the data were observed
in the \uv\ plane (left) and of the visibility amplitudes as a
function of baseline length (right).  The data on 3C336 were provided
by Alan Bridle from observations made with the vLA on 6 December 1987.
\Iodx{plot file}}

\subsubsect{6.3.2.  Plotting your image data}

     Plot symbols (\eg\ plus signs) may be drawn on the plots produced
by {\tt \tndx{CNTR}}, {\tt \tndx{PCNTR}}, {\tt \tndx{GREYS}}, {\tt
\tndx{KNTR}} and several of the other tasks mentioned below.  In these
tasks, the parameter which controls the plotting is {\tt STFACTOR}, a
scale factor for the symbols.  When using this option, there must be a
table of ``star'' positions associated with the image being plotted.
To create one, enter {\us EXPLAIN\qs \tndx{STARS} \CR} to learn the
format of the input data file and the parameters for the task.  See
also Appendix Z or your local equivalent for instructions on editing
text files.  A star file may also be created by {\tt \tndx{MF2ST}}
from a model fit file produced by task {\tt \tndx{SAD}} (see \Secs
7.5.5 and 10.4.3).

     All plots are drawn with labeled tick marks although these may be
suppressed with the {\tt LTYPE} parameter.  For plots having
significantly non-linear coordinate axes, \eg\ wide-field images, it is
useful to draw a full, non-linear coordinate grid rather than just
short lines at the edges of the plot.  Tasks like {\tt CNTR} and even
the verb {\tt \tndx{TVLABEL}} offer this option; enter {\us DOCIRC\qs
TRUE \hbox{\CR}}.

     Example outputs of the following three tasks are given on a
following page.

\vfill\eject
\subsubsect{6.3.2.1  Contour and grey-scale plots}

     The most basic contouring drawing task is \hbox{{\tt
\tndx{CNTR}}}.  In addition to the usual image selection parameters,
you may specify:
\dispt{TASK\qs 'CNTR' ; INP \CR}{to tell you what you may specify.}
\disptt{BLC 250 , 230 \CR}{to set the bottom left corner of plot
               at 250, 230 (in pixels with 1,1 at extreme bottom left
               of the image).}
\dispt{TRC 300, 330 \CR}{to set the top right corner of plot at
               300, 330.}
\dispt{CLEV\qs 0 ; PLEV\qs 1 \CR}{to get contour levels at 1$\%$ of
               the peak image value.}
\dispt{PLEV\qs 0 ; CLEV\qs .003 \CR}{to get contour levels at 3 mJy.}
\disptt{LEVS\qs -1, 1, 2, 4, 6 \CR}{to get actual contours at -1, 1,
               2, 4, and 6 times the basic level set by {\tt PLEV} or
               \hbox{{\tt CLEV}}.  {\tt LEVS} need not be integers,
               but very fine subdivisions cannot be represented
               accurately on the plot.}
\dispe{{\it N.B.,} if you request more than one negative level with
the {\tt LEVS} input, you {\it must} use commas between the negative
levels.  Otherwise the minus sign(s) will be treated as subtraction
symbols and the desired levels will be combined into a single negative
level by the {\tt AIPS} language processor.  {\tt BLC} and {\tt TRC}
can be initialized conveniently from the TV display using the cursor
with the {\tt TVWIN} instruction (see \Sec 6.4.4).  Then check:}
\dispt{INP \CR}{to review what you have specified.}
\dispt{GO \CR}{to run the task when you're satisfied with the inputs.}
\dispe{This generates a \Indx{plot file} as an extension to your image
file, with the parameters you have just specified.  Watch the \AIPS\
monitor (which, on some systems, is your terminal) to see the progress
of this task.  If the ``number of records used'' in the plot file is
over 200, the contour plot will be messy (unless the field is also
large).  In this case, check that you have not inadvertently set {\tt
PLEV} or {\tt CLEV}, for example, to unrealistically low values.
Printing a large, messy plot file on the printer can take a
considerable length of time and will inconvenience other users.
Consider plotting directly on the TV first ({\tt DOTV = TRUE}) to
check on your selection of contours.}

     {\tt \tndx{PCNTR}} plots \indx{polarization} vectors on top of
contours.  You may make a polarized-intensity image and a polarization
position-angle image from the Q and U images (see \Sec 7.1.2) or use
the Q and U images themselves.  Then:
\dispt{TASK\qs 'PCNTR' ; INP \CR}{to review the input parameters.}
\disptt{INDI\qs{\it n1} ; GETN\qs {\it ctn1} \CR}{where {\it n1} and
               {\it ctn1} select the disk and catalog numbers of the
               image to be contoured.}
\dispt{IN2DI\qs {\it n2} ; GET2N\qs {\it ctn2} \CR}{where {\it n2}
               and {\it ctn2} select the Q or polarized intensity
               image.}
\dispt{IN3DI\qs{\it n3} ; GET3N\qs {\it ctn3} \CR}{where {\it n3}
               and {\it ctn3} select the U or position-angle image.}
\disptt{PCUT\qs {\it nn} \CR}{to blank out vectors less than {\it nn}
               in the units of polarized intensity.}
\disptt{ICUT\qs {\it mm} \CR}{to blank out vectors at pixels where the
               total intensity (image 1) is less than {\it mm} in the
               units of image 1.}
\disptt{FACTOR\qs {\it xx} \CR}{to set the length of a vector of 1 (in
               units of total polarization) to {\it xx} cell widths.}
\dispt{DOCONT\qs 1 ; DOVECT\qs 1 \CR}{to request both contours and
               vectors.}
\disptt{INP \CR}{to review your inputs and remind you of others.  Most
               are similar to those in {\tt CNTR} and sensibly
               defaulted.}
\disptt{GO \CR}{to generate the plot file, which can then be routed to
               output devices via {\tt TKPL}, {\tt TVPL}, {\tt LWPLA}
               etc.}
\dispe{The lengths of the vectors are controlled by image 2 while the
directions of them are controlled by image 3.  Clearly this program
can also be used for other combinations of images, so long as one of
them represents an angle.}

     {\tt \tndx{GREYS}} creates a \Indx{plot file} of the grey-scale
intensities in the first input image plane and, optionally, a contour
representation of a second input image plane.  A sample set of inputs
could be:
\dispt{TASK\qs 'GREYS' ; INP \CR}{to review the inputs.}
\dispt{INDISK\qs {\it n1} ; GETN\qs {\it ctn1} \CR}{to select the
               grey-scale image.}
\dispt{BLC\qs 250 , 250 , 3 \CR}{to select the lower left corner and
               the plane in the first image.}
\disptt{TRC\qs 320 , 310 , 12 \CR}{to select the upper right corner in
               the first image and, with {\tt TRC(3)}, the plane in
               the second image.}
\dispt{DOCONT\qs TRUE \CR}{to specify that contours are to be drawn.}
\dispt{IN2D\qs {\it n2} ; GET2N\qs {\it ctn2} \CR}{to select the
               contour image.}
\dispt{PLEV\qs 0 ; CLEV\qs 0.005 \CR}{to select 5 mJy/beam contour
               increments.}
\dispt{LEVS\qs -3 , -1 , 1 3 10 30 100 \CR}{to plot contours at -15,
               -5, 5, 15, 50, 150, and 500 mJy/beam.}
\disptt{DOWEDGE\qs 2 \CR}{to plot a grey-scale step-wedge along the
               right-hand edge; 1 for along the top and 0 for no
               wedge.}
\dispt{DOCRT\qs FALSE ; GO \CR}{to make the plot file.}
\dispe{When {\tt GREYS} has finished, run {\tt LWPLA} to view the plot
file.  Note that {\tt LWPLA} has a variety of options which control
the plotting and scaling of the grey-scale images without having to
rerun \hbox{{\tt GREYS}}.}

     There are two other contour drawing tasks which offer additional
options.  {\tt \tndx{KNTR}} is able to draw multiple contour and/or
grey-scale images in a single plot file, primarily to show multiple
planes of a spectral-line cube; see \Sec 8.5.4.  It also has the
option to draw an image of the Clean beam.  {\tt \tndx{CCNTR}} is
virtually identical to {\tt CNTR} except that it can draw extra
symbols on the plot representing the locations and intensities of
source model components found in {\tt CC} (Clean component) or {\tt
MF} (model fit Gaussians from {\tt \tndx{SAD}}, see \Secs 7.5.5 and
10.4.3).

\subsubsectt{6.3.2.2  Row tracing plots}

     There are a number of tasks which plot rows directly.  Two of
these are for use with single image planes while others are more
intended for use with, \eg\ spectral-line data cubes transposed into
velocity-ra-dec order.  Of the former, {\tt \tndx{PLROW}} is the
simpler.  It makes a plot file of all selected rows in an image plane.
Each row is plotted as a slice offset a bit from the previous row.
Low intensities which are ``obscured'' by foreground (\ie\ lower row
number) bright features are blanked to keep the plot readable.
Example inputs would be:
\dispt{TASK\qs 'PLROW' ; INP \CR}{to review the inputs.}
\dispt{INDISK\qs {\it n} ; GETN\qs {\it ctn} \CR}{to select the image
               on disk {\it n} catalog slot {\it ctn}.}
\dispt{BLC\qs 100 ; TRC 300 \CR}{to select the subimage from (100, 100)
               to (300, 300).}
\dispt{YINC\qs 3 \CR}{to plot only every $3^{\urd}$ row.}
\dispt{PIXRANGE\qs -0.001 0.050 \CR}{to clip intensities outside the
               range $-1$ to 50 mJy.}
\disptt{OFFSET\qs 0.002 \CR}{to set the intensity scaling such that 2
               mJy separates rows of equal intensity.}
\dispt{INP \CR}{to check the inputs.}
\dispt{GO \CR}{to run {\tt PLROW}.}
\disptt{GO\qs LWPLA \CR}{to display the plot file on the laser printer
               after {\tt PLROW} has finished.}
%\vfill
\eject
\Iodx{plot file}
\vfill
\if T\doFIG
   \centerline{\psfig{figure=FIG/CNTR.PLT,height=3.5in}\hss
      \psfig{figure=FIG/PCNTR.PLT,height=3.5in}}
\vfill
\else
   \vbox to 3.5in{\vfill\omit\vfill}
\fi
\hbox to \hsize{\hss {\tt \tndx{CNTR}} \hss \hss {\tt \tndx{PCNTR}}
          \hss}
\vfill
\vfill
\if T\doFIG
   \centerline{\psfig{figure=FIG/GREYS.PLT,height=3.65in}\hss
      \psfig{figure=FIG/GREYC.PLT,height=3.65in}}
\else
   \vbox to 3.65in{\vfill\omit\vfill}
\fi
\vfill
\hbox to \hsize{\hbox to 0.5\hsize{\hss{\tt \tndx{GREYS}}\hss}\hss
\hbox to 0.5\hsize{\hss{\tt GREYS} with contours \hss}}
\eject

\dispe{The plot files produced by {\tt PLROW} are a simple, special
case of those produced by \hbox{{\tt \tndx{PROFL}}}.  This task makes
a plot file of a ``wire-mesh'' representation of an image plane
complete with user-controlled viewing angles and correct perspective.
Enter {\us EXPLAIN PROFL \CR} for a full description.  Both of these
tasks are especially useful where the signal-to-noise ratio is high
and examples of them are given on the following page.}

     In Chapter 8 we discuss the computation and use of ``slices,''
one-dimensional profiles interpolated along any line in an image
plane.  Once a slice has been computed, it may be plotted by {\tt
\tndx{SL2PL}} on the TV or into a device-independent \Indx{plot file}.

     Two other row-plotting tasks, {\tt \tndx{PLCUB}} and {\tt
\tndx{ISPEC}}, are designed primarily for  spectral-line and other
data ``cubes'' (see \Secs 8.5.4 and 8.6).  {\tt PLCUB} makes one or
more plot files showing the intensities in each selected row.  The row
subplots are positioned in a matrix in the coordinates of the
$2^{\und}$ and $3^{\urd}$ axes of the cube.  {\tt ISPEC} averages
rectangular areas in each plane of a cube and plots the resulting
spectrum.

\subsubsectt{6.3.2.3.  Miscellaneous image plots}

     {\tt \tndx{IMVIM}} allows a variety of image comparisons by
plotting the pixel values of one image against the pixel values of
another image. The special options include binning the values (and
plotting symbols proportional to the number of samples in a bin) and
shifting one of the images in $x$ and/or $y$ with respect to the
other.  The former reduces large scatter diagrams to more manageable
sets of numbers while the latter allows cross-correlation functions to
be developed.

     {\tt \tndx{IMEAN}} prints the mean, rms, and extrema over a
user-specified window in an image.  Beginning with the {\tt 15JAN95}
release, it also prints the intensity at, and rms of, the noise peak
in the histogram.  Optionally, it plots histograms of image
intensities over the user-specified window using a user-specified
number of boxes over a user-specified range of intensities.  An
example of this is also shown on the next page.

\subsubsect{6.3.3.  Plotting your table data}

     {\tt \tndx{TAPLT}} is a very general task to plot information
from \AIPS\ table extension files.  It can plot a histogram of a
function of the values in one or two columns of the table and it can
plot a function of one or two columns against another function of
another one or two columns.  The latter can be averaged in bins or
have every point plotted.  At first blush, the inputs seem rather
complicated, but the results may well justify some effort to
understand them. For example, to plot Clean component fluxes as a
function of radius from the image center:
\dispt{TASK\qs 'TAPLT' ; INP \CR}{to review the inputs.}
\dispt{INDISK\qs {\it n} ; GETN\qs {\it ctn} \CR}{to select the image
               on disk {\it n} catalog slot {\it ctn}.}
\dispt{INEXT\qs 'CC' ; XINC\qs 1 \CR}{to select every row in the Clean
               components file.}
\dispt{BCOUNT\qs 1 ; ECOUNT\qs 0 \CR}{to select all rows in the
               table.}
\disptt{APARM = 2 , 1, 3 , 1 , 16 , 1 , 1 \CR}{to plot the modulus of
               columns 2 and 3 on the $x$ axis (\ie\ $\sqrt{\Delta_x^2
               + \Delta_y^2}\,$) and column 1 on the $y$ axis
               (\ie\ component flux).}
\disptt{BPARM = 0 ; CPARM = 0 \CR}{to use self-scaling of the plot and
               no scaling of the column values.}
\dispt{DOTV\qs TRUE ; GO}{to plot the fluxes on the TV screen.}
\dispe{You may need to set the scaling with {\tt BPARM} after seeing
the preview plot in order, for example, to bring out the details in
the low-level components.}

\vfill\eject
\vglue 2pt
\vfill
\if T\doFIG
   \centerline{\hss\psfig{figure=FIG/PLROW.PLT,height=3.9in}\hss
      \psfig{figure=FIG/PROFL.PLT,height=3.9in}\hss}
\else
   \vbox to 3.9in{\vfill\omit\vfill}
\fi
\vfill
\hbox to \hsize{\hss {\tt \tndx{PLROW}} \hss \hss {\tt \tndx{PROFL}}
           \hss}
\vfill\vfill
\if T\doFIG
   \centerline{\hss\psfig{figure=FIG/IMVIM.PLT,height=3.8in}\hss
      \psfig{figure=FIG/IMEAN.PLT,height=3.8in}\hss}
\else
   \vbox to 3.8in{\vfill\omit\vfill}
\fi
\vfill
\hbox to \hsize{\hss {\tt \tndx{IMVIM}} (binned) \hss \hss {\tt
         \tndx{IMEAN}} \hss\Iodx{plot file}}
\eject

\vglue 2pt
\if T\doFIG
   \centerline{\hss\psfig{figure=FIG/SL2PL.PLT,height=3.65in}\hss
      \psfig{figure=FIG/TAPLT.PLT,height=3.65in}\hss}
\else
   \vbox to 3.65in{\vfill\omit\vfill}
\fi
\vskip 8pt
\hbox to \hsize{\hss {\tt \tndx{SL2PL}} \hss \hss {\tt \tndx{TAPLT}}
    \hss}

     There are a few tasks intended to make plotting specific kinds of
tables rather easier.  {\tt \tndx{SNPLT}} plots calibration, solution,
and system temperature tables for selected antennas as a function of
time, antenna elevation, hour angle, or sidereal time.  It will make
several plots per page (one antenna per plot) and multiple pages if
needed, or you can plot the most discrepant value over all antennas in
a single plot.  {\tt \tndx{POSSM}} will plot bandpass tables when {\tt
APARM(8)} is set to 2.  It can also do multiple plots per page with
all the usual data selection adverbs.  {\tt \tndx{GAPLT}} plots the
gain tables produced by {\tt ASCAL}, the old self-calibration task.
It too can do multiple plots per page and the like.  {\tt
\tndx{GNPLT}} plots the extrema of the solutions from all antennas at
each time, again as found by \hbox{{\tt ASCAL}}.

\subsubsect{6.3.4.  Plotting miscellaneous information}

     There are a few other tasks which create \Indx{plot file}s, but
which do not fit into the categories above.  {\tt \tndx{CONPL}} is a
task created for the {\tt 15JAN95} release which plots \AIPS\
convolving functions (used by various \uv-data gridding tasks such as
{\tt \tndx{IMAGR}}) and their Fourier transform, expected
signal-to-noise ratio, or convolution with a user-specified Gaussian.
{\tt \tndx{IRING}} integrates an image in concentric annulli about the
user-specified object center with specified major axis position angle
and inclination.  The results may be placed in a plot file for later
display.  {\tt \tndx{GAL}} calculates the orientation and rotation
curve parameters of a galaxy from an image of the predominant
velocities.  The observed rotation curve is plotted together with the
fitted model curve.

\vfill\eject
\subsect{6.4.  Interactive TV displays of your data}

     The \AIPS\ TV display allows you to look at your image data in
detail and to set parameters by pointing at interesting feature
visible on the screen.  Although \AIPS\ will run on a variety of
hardware display devices (\eg\ \IIS\ Models 70, 75 and IVAS and
DeAnza), it is now used almost exclusively with the X-Windows
TV-simulation program called \hbox{{\tt \tndx{XAS}}}.  See \Sec 2.3.2
for information on using this basic \AIPS\ tool.  Information on TV
verbs and tasks may be found by entering {\us ABOUT TV \CR}, {\us
ABOUT INTERACT}, and {\us ABOUT TV-APPL \CR}, or by consulting the
corresponding sections of Chapter 13 of this \Cookbook. \Iodx{TV
functions}

\subsubsect{6.4.1.  Loading an image to the TV}

     The simplest way to load an image from your catalog to the TV and
then to manipulate the display is with the procedure called \hbox{{\tt
\tndx{TVALL}}}:
\dispt{INP\qs TVALL \CR}{to review the input parameters.}
\dispt{INDI\qs $n$ ; GETN\qs {\it ctn} \CR}{to select the disk and
             image name parameters from the catalog.}
\dispe{Use one of the following commands to specify the initial
transfer function that converts your image file intensities to display
pixel intensities:}
\dispt{FUNC\qs 'LN' \CR}{linear---this is the default.}
\dispt{FUNC\qs 'LG' \CR}{logarithmic.}
\dispt{FUNC\qs 'NE' \CR}{negative linear.}
\dispt{FUNC\qs 'NG' \CR}{inverse logarithmic.}
\disptt{PIXRA\qs {\it x1}, {\it x2} \CR}{to load only image intensities
             {\it x1} to {\it x2} in the units of the image.  The
             default is to load the full range of intensities in the
             image.}
\dispe{(The slopes and intercepts of the display transfer functions
can be modified later, but the above options let you choose initially
between linear, logarithmic, and negative linear displays and restrict
the range of intensities that is loaded).  Then:}
\dispt{TVALL \CR}{to load the selected image.}
\dispe{The image should appear on the TV screen in black-and-white.
If you see a new image but it is not what you expected, hit button
{\tt D} to end {\tt TVALL} and then review your inputs with:}
\dispt{INP\qs TVALL \CR}{ }
\dispe{If no image appears, make sure that {\tt AIPS} started up with
your workstation assigned as the display; see \Sec 2.2.3 for
information on starting up {\tt AIPS} and assigning the TV display.}

     After your image has been displayed on the TV by {\tt TVALL},
your trackball with its buttons (which should be labeled {\tt
A}, {\tt B}, {\tt C}, and {\tt D}) --- or your workstation mouse with
keyboard buttons {\tt A}, {\tt B}, {\tt C}, and {\tt D}) --- can be
used to modify the display transfer functions, coloring and zoom.
Pressing button {\tt A} alone enables black-and-white and
color-contour coding of the image intensities, successively.  Adjust
the cursor position on the TV (using the trackball or mouse) to vary
the slope and intercept of the display transfer function.  {\tt TVALL}
will superpose a calibrated horizontal wedge on the image.  This
should help you to choose the optimum cursor setting for the display.
Black-and-white displays are generally much more suitable than color
for high-dynamic-range images, while color contouring may be used to
accentuate interesting features.  Note also that a much wider range of
image-coloring options is available outside {\tt TVALL} by invoking
{\tt \tndx{TVPSEUDO}} and \hbox{{\tt \tndx{TVPHLAME}}}.  Pressing
buttons {\tt B} and {\tt C} adjusts the zoom of the display: {\tt B}
to increase the magnification and {\tt C} to decrease it.  When these
buttons are enabled, the cursor controls the position of the center of
the zoomed field of view. Magnification factors of 1 through 16 are
available on most workstations.  Note that your terminal issues
instructions when buttons are pressed, but that it is in the
death-like grip of {\tt TVALL} otherwise until you press button {\tt
D} to exit from it.

     The size of the image which can be displayed depends on the size
(in pixels) of your workstation screen or TV display and some other
parameters which can vary from site to site.  A typical Sun
workstation can display up to 1024 by 900 pixels.  Then, if the image
is larger than about 800 pixels or so in the $y$-direction, portions
of the labeling of the wedge (the units) will be omitted or superposed
on top of the wedge (the tick numeric values).  A useful technique for
displaying large images is to load only alternate pixels.  The command:
\dispt{TXINC\qs 2 ; TYINC\qs 2 \CR}{to load every other $x$ and $y$
       pixel.}
\dispe{before {\tt \tndx{TVALL}} would do this.  Also use:}
\dispt{TBLC = {\it n1}, {\it n2}, {\it n3}, $\ldots$ \CR}{bottom
                                   left pixel to load.}
\dispt{TTRC = {\it m1}, {\it m2}, {\it n3}, $\ldots$ \CR}{top
                                   right pixel to load.}
\dispe{to limit the displayed field.  A small image may be interpolated
to fill the TV screen by setting {\us TXINC = -1 ; TYINC = -1 \CR}.}

     {\tt TVALL} is a procedure that insures that the desired graphics
and TV channels are on and cleared and the others off, then loads the
image with verb {\tt \tndx{TVLOD}}, loads a wedge with {\tt
\tndx{TVWEDGE}}, and labels the wedge with \hbox{{\tt
\tndx{TVWLABEL}}}.  You do not have to use {\tt TVALL}, which can be
rather slow, simply to load a new image on the \hbox{TV}.  Use {\tt
TVLOD} instead.  {\tt TVWEDGE} has a variety of options concerning the
width of the wedge and its position; type {\us HELP TVWED \CR} for
details.  \Iodx{TV functions}

\subsubsect{6.4.2.  Manipulating the TV display}

      There are a number of verbs which allow you to manipulate the
display, including:
\disptt{\tndx{TVINIT} \CR}{to initialize the entire TV and TV image
         catalog.  This should be done when you first start using a
         workstation display since the catalog will remember things
         that are no longer there and since the current {\tt XAS}
         can have different parameters than a previous one.}
\disptt{\tndx{TVON} $n$ \CR}{to turn on TV grey channel $n$; you may
         have to turn off other channels to see $n$ since {\tt XAS}
         can only display one channel at a time.}
\disptt{\tndx{TVOFF} $m$ \CR}{to turn off channel $m$, where $m$ is
         ``decimal coded,'' meaning that $m = 12$ refers to both
         channel 1 and channel 2.}
\disptt{\tndx{GRON} $n$ \CR}{to turn on one or more of the 4 graphics
          channels, where $n$ is decimal coded.}
\dispt{\tndx{GROFF} $m$ \CR}{to turn off one or more graphics
          channels.}
\dispt{TVCHAN\qs $n$ ; \tndx{TVCLEAR} \CR}{to zero one or more TV
          channels.}
\dispt{GRCHAN\qs $m$ ; \tndx{GRCLEAR} \CR}{to zero one or more
          graphics channels.}
\disptt{\tndx{TVZOOM} \CR}{to set the zoom magnification and center
          interactively, follow instructions on the screen.}
\dispt{\tndx{OFFZOOM} \CR}{to reset the zoom and zoom center to null.}
\disptt{\tndx{TVPOS} \CR}{to read the TV cursor position, returning
          adverbs for use in procedures or other verbs.}
\pd

\vfill\eject
\subsubsect{6.4.3.  Intensity and color transfer functions}

     The \AIPS\ model of a TV postulates two intensity transfer
functions, called the LUT and the OFM, which are basically
multiplicative.  In most circumstances, the LUT is used for
black-and-white enhancements and the OFM for coloring, but both can be
used for either.  To manipulate the LUT interactively, while leaving
the pseudo-coloring alone, use the {\tt \tndx{TVTRAN}} verb.  The
cursor position controls the slope and intercept of the transfer
function, buttons {\tt A} and {\tt B} switch a plot of the transfer
function on and off, button {\tt C} switches the sign of the slope,
and button {\tt D} (as always) exits.  To turn the LUT back to normal,
enter \hbox{{\tt \tndx{OFFTRAN}}}.

     A rich zoo of color coding is available with {\tt
\tndx{TVPSEUDO}}, which alters the OFM while leaving the LUT alone.
Repeated hits on button {\tt A} select a variety of color triangles,
button {\tt B} selects a circle on hue, and repeated hits on button
{\tt C} select a variety of color contours.  First-time users should
experiment with the \AIPS\ coloring options until they develop an
intuitive feel for the effects of cursor settings on the image
appearance.  The wedge displayed by {\tt \tndx{TVALL}} adjusts to the
alternative colorations selected with {\tt TVPSEUDO}, and it is
helpful to watch changes in both the wedge and the image.  A
flame-like coloring is available with {\tt \tndx{TVPHLAME}}, or
variations on the scheme with repeated hits on buttons {\tt A} or
\hbox{{\tt B}}.  In both these verbs the cursor position controls
aspects of the coloring such as enhancements, richness, or cycles of
hue.  To turn off pseudo-coloring, enter \hbox{{\tt
\tndx{OFFPSEUD}}}.

     A set of less well-known verbs is available to allow you to
create, manipulate, and save desirable versions of the OFM table.
{\tt \tndx{OFMSAVE}} allows you to save a named OFM, {\tt
\tndx{OFMDIR}} lists all saved OFMs belonging to you or generally
available from the \AIPS\ distribution, {\tt \tndx{OFMGET}} loads a
name OFM, {\tt OFMZAP} deletes a named OFM, and {\tt OFMLIST} prints
the current \hbox{OFM}.  {\tt \tndx{OFMCONT}} is an elaborate
interactive verb which allows you to set the hue, intensity, and
saturation of the OFM divided up into a number of color contours.
Each of these contours can be a constant level or a step wedge.  {\tt
OFMADJUS} is another elaborate interactive verb to alter pieces of the
OFM, while {\tt \tndx{OFMTWEAK}} is a simpler verb to stretch the
\hbox{OFM}.  \Iodx{TV functions}

\subsubsect{6.4.4.  Setting parameters with the TV}

     One reason to load the image to the TV is to set adverbs for use
by other verbs and tasks.  Verbs which use the TV cursor to set
adverbs include:
\disptt{\tndx{TVNAME} \CR}{to set {\tt INDISK}, {\tt INNAME}, etc.~to
            the name parameters of the image currently visible.  If
            there is an ambiguity, you will be asked to move the
            cursor to the desired image and press a button.}
\disptt{\tndx{TVWIN} \CR}{reads pixel coordinates from the next two
            cursor positions at which a trackball button is depressed.
            The TV graphics shows the current shape and position of
            the window.  Button A allows you to switch to (re)setting
            the other corner while the other buttons exit after both
            corners have been set. {\tt TVWIN} uses the pixel
            coordinates to set up the bottom left ({\tt BLC}) and top
            right ({\tt TRC}) corners of an image subsection, \eg\ for
            input to the contouring programs {\tt CNTR} and {\tt
            PCNTR}, to the mean/rms calculator {\tt IMEAN}, and to
            many other tasks.}
\disptt{\tndx{SETXWIN} ({\it dx},{\it dy}) \CR}{reads pixel coordinate
            of the center of a {\it dx}-pixel by {\it dy}-pixel window
            and sets the adverbs {\tt BLC} and {\tt TRC}.}
\disptt{\tndx{TVBOX} \CR}{is similar to {\tt TVWIN} above except that
            it is used to set up pixel coordinates to define
            rectangular {\it or circular} Cleaning areas for the
            \AIPS\ Clean tasks.  The adverbs {\tt NBOXES} and {\tt
            CLBOX} are set. The circular option appeared in the {\tt
            15JUL95} release and is not supported by {\tt
           \tndx{APCLN}} and {\tt \tndx{MX}}.}
\disptt{\tndx{REBOX} \CR}{allows revision using the TV of the Cleaning
            areas set previously with {\tt TVBOX}.  Revises {\tt
            NBOXES} too.}
\disptt{\tndx{FILEBOX} \CR}{is {\tt REBOX} for boxes in the text file
            used with {\tt \tndx{IMAGR}}; multiple fields and many
            more boxes are allowed.}
\disptt{\tndx{TVSLICE} \CR}{works like {\tt TVWIN} above to set {\tt
            BLC} and \hbox{{\tt TRC}}.  Instead of a rectangle
            however, the display shows a diagonal line which is useful
            for setting the ends of slices.}
\pd

\subsubsect{6.4.5.  Reading image values from the TV}

     There are several facilities for reading out intensity and
position information from displayed images using the TV cursor:
\disptt{\tndx{IMPOS} \CR}{reads out the two coordinate values (\eg\ RA
              and Dec) from the cursor position when any button is
              depressed.}
\disptt{\tndx{IMXY ; IMVAL} \CR}{reads out the image intensity and the two
              coordinate values (\eg\ RA and Dec) from the cursor
              position and when any button is depressed.}
\disptt{\tndx{TVFLUX} \CR}{reads out image intensities and coordinates
              whenever a TV button is pressed, looping until button
              {\tt D} is pressed.}
\disptt{\tndx{TVMAXFIT} \CR}{whenever a TV button is pressed, fits a
              quadratic function to the image to find the position and
              strength of an extremum, looping until button D is
              pressed.}
\disptt{\tndx{CURVAL} \CR}{continuously reads out pixel coordinates
              and the pixel intensity in user-recognizable units at
              the position selected by the TV cursor.  The pixel
              parameters are displayed in the upper left corner of the
              image.}
\disptt{\tndx{TVSTAT} \CR}{determines the mean, rms, extrema and
              integrated intensity (if appropriate) in user-defined
              ``blotch'' regions within the image currently displayed
              on the \hbox{TV}. The regions are irregular polygons
              selected with the TV cursor.  Type {\us EXPLAIN\qs
              TVSTAT \CR} for details.}
\pd

\subsubsect{6.4.6.  Labeling images on the TV}

     There are a number of facilities for labeling images on the TV
including:\Iodx{TV functions}
\disptt{\tndx{TVLABEL} \CR}{to draw standard axis labels around the
              visible image.  You may control the type of labeling and
              whether coordinates are shown as a grid or short tick
              marks.  If more than one image is visible, you will be
              asked to indicate which one you want with the cursor and
              any button.}
\dispt{\tndx{TVWLABEL} \CR}{to draw axis labels around the visible
              intensity wedge.}
\disptt{\tndx{TVANOT} \CR}{to draw a text string into a grey-scale
              channel or a graphics plane at a location specified via
              an adverb or via the TV cursor.}
\disptt{\tndx{TVLINE} \CR}{to draw a straight line into a grey-scale
              channel or a graphics plane at locations specified in
              part or in whole via adverbs or via the TV cursor.}
\disptt{\tndx{COSTAR} \CR}{to plot a ``star'' positions at a
              user-specified coordinate on the TV image.}
\eject
\disptt{\tndx{TVSTAR} \CR}{to plot ``star'' positions from an {\tt ST}
              file on top of the visible image; see \Sec 6.3.2.}
\disptt{\tndx{GREAD} \CR}{to read the current color of a specified
              graphics overlay channel into \hbox{{\tt RGBCOLOR}}.}
\disptt{\tndx{GWRITE} \CR}{to change the color of a graphics overlay
              channel to that specified by  \hbox{{\tt RGBCOLOR}}.
              This may be done for aesthetic reasons or because the
              default colors may not show up well when captured by
              {\tt TVCPS} and printed on a color printer or film
              recorder.}
\pd

\subsubsect{6.4.7.  Comparing images on the TV}

     It is often useful to compare two images, \eg\ to decide whether
one contains artifacts that are not present in another at the same
frequency, or to look for frequency-dependent features at constant
resolution.  \AIPS\ provides several tools for such image comparisons.
\Iodx{TV functions}

      The first tool is a capability for loading multiple images to
the same plane (or channel) of the TV device.  The parameter {\tt
TVCORN} specifies where the bottom left corner of the image or image
subsection will be positioned in the TV frame by {\tt \tndx{TVLOD}} or
\hbox{{\tt TVALL}}.  If {\tt TVCORN} is left at zero, {\tt TVLOD} and
{\tt TVALL} adjust it to center the displayed image.  You may however
use {\tt TVCORN} to control loading successive images to different
regions of the display with successive executions of \hbox{{\tt
TVLOD}}.  For example, the following commands would load two 512 by
512 pixel images from slots 1 and 2 on disk 1 {\it side-by-side} on
channel 1 of a 1024 by 900 TV display:
\dispt{INDI\qs 1; GETN\qs 1 \CR}{to select the input disk and the
            first image.}
\dispt{TVCH\qs 1 \CR}{to select TV channel 1 for the loading.}
\dispt{TVCORN\qs 1 193 ; TVLOD \CR}{to load the first image.}
\dispt{GETN\qs 2 \CR}{to select the second image.}
\dispt{TVCORN\qs 513 193; TVLOD \CR}{to load the second beside the
            first.}
\dispe{You could then adjust the color coding, transfer function,
etc.~for both images simultaneously with {\tt TVFIDDLE} or \hbox{{\tt
\tndx{TVTRAN}}}. You may load as many as 256 images to a single TV
plane with this technique, which is therefore a powerful method for
making ``montages.''  The number of simultaneous images is limited
mostly by your image sizes, the need to avoid overlaps (which are
allowed if you want) --- and your ability to do the arithmetic for
appropriate {\tt TVCORN} settings!  You are also limited by the need
for all the images in one plane to share that plane's transfer
function. Judicious use of the {\tt PIXRANGE} and {\tt FUNC} inputs to
{\tt TVLOD} permits making useful montages of disparate images,
however.}

     A second tool is the classic ``blink" technique from optical
astronomy.  {\tt \tndx{TVBLINK}} allows you to load images to two
different planes of the TV memory and then to alternate the display
rapidly between the two.  The two images described above could
be``blinked" against each other by the following command sequence:
\dispt{INDI 1; GETN 1 \CR}{to select the input disk and first image.}
\dispt{TVINIT; TVCORN 0}{to clear the TV and restore the default
               positioning.}
\dispt{TVCH 1; TVLOD \CR}{to load the first image on plane 1.}
\dispt{GETN 2 \CR}{to select the second image.}
\dispt{TVCH 2 ; TVLOD \CR}{to load the second image on plane 2.}
\dispt{TVCH 12 ; TVBLINK \CR}{to blink planes 1 and 2.}
\dispe{The rate and duty cycle of the blinking, and the transfer
functions applied to the planes, are controlled interactively with the
TV cursor.  Instructions for these operations appear on your terminal
while {\tt TVBLINK} is running.}

     In {\tt 15JUL95} and later releases, the task {\tt \tndx{PLAYR}}
provides a menu-driven method to enhance and blink two images and to
develop and save TV color tables (``OFMs'').

     For data cubes (\eg\ frequency or time sequences of images), the
verbs {\tt \tndx{TVMOVIE}} and {\tt \tndx{TVCUBE}} combine the two
previous techniques.  These are described in more detail in \Sec
8.5.4.  Both verbs load one or more image planes with as many planes
from the cube as possible (and as requested).  Then they display each
frame in sequence with interactive controls over the frame rate in
movie mode, the chosen frame in single-frame mode, and the brightness,
contrast, and color of the displayed images.  {\tt TVMOVIE} makes a
somewhat more efficient movie sequence, but {\tt TVCUBE} makes a
better montage by using a more normal arrangement of the image planes.

     Certain real TV displays used to provide powerful tools to
compare images using color as well as intensity to represent real
information.  Unfortunately, most workstations can display only 256
simultaneous colors (or even fewer), and {\tt \tndx{XAS}} was
constructed with that limit in mind.  There are two tasks, also
discussed in \Sec 8.6, which attempt to recover much of this
capability by trying to optimize color assignments over the limited
range available.  The first of these, {\tt \tndx{TVHUI}} produces a
composite display in which the intensity is set by one image, the hue
is derived from another image, and the saturation is optionally
derived from a third image.  An interactive menu allows you to enhance
each of the images individually, to select linear or logarithmic
transfer functions for the intensity image, to select the subimage
used during interactive enhancements, to repaint the full image, and
to exit with or without writing out the final three-color image.  A
number of uses for this are obvious, including spectral-line moment
images (velocity setting color, line width setting saturation),
polarization images (polarization angle setting color in a circular
scheme, polarization intensity setting saturation), and depolarization
observations (color set by a two-frequency depolarization image).
\Iodx{TV functions}

     {\tt TVHUI} can be instructed to write out a three-color image
cube containing one plane for red, one for green and one for blue.  It
does this using the transfer functions established interactively, but
with full accuracy unlimited by the TV display.  There is also an
\AIPS\ task called {\tt \tndx{TVRGB}} which writes three-color cubes
using weighted sums over a data cube.  Three-color cubes also arise
when digitizing color photographs of real scenes.  The second task,
{\tt \tndx{TVRGB}}, can be used to display these three-color cubes or
to generate a three-color display from any three \AIPS\ image planes.
Common examples of the latter are the superposition of radio continuum
and/or line data on optical or X-ray images, and color-coding of
effective temperatures or spectral indices from 3-channel continuum
data.  {\tt TVRGB} can also be used to color-code different types of
depolarization effects from multi-frequency polarimetry.  Like {\tt
TVHUI}, {\tt TVRGB} offers a simple menu to enhance each of the images
individually or all together, to select the window specifying the
subimage which is used during interactive enhancements, to repaint the
full image on the TV, and to exit.  {\tt TVRGB} does not write an
output image per se, but, as of the {\tt 15JAN96} release, it can be
instructed to write out a full 24-bit color \indx{PostScript} plot
file to be sent to a color printer or film recorder.  Its display (or
any other TV display including that of {\tt TVHUI}) can be captured
and sent to a \indx{color printer} or \indx{film recorder}; see \Sec
6.4.9 below.

\subsubsect{6.4.8.  Other functions using the TV}

     There are a number of tasks which use the TV to give the user
real interactive input to the operation based on the images displayed
by the task on the \hbox{TV}.  These include {\tt \tndx{BLANK}} (\Sec
8.6) to blank out non-signal portions of an image, {\tt \tndx{BLSUM}}
(\Sec 8.6) to sum images over irregular blotch regions printing out
summed spectra, {\tt \tndx{TVFLG}} (\Sec 4.4.3) to edit visibility
data based on grey-scale displays of some function of the visibility
with baseline on the $x$ axis and time on the $y$ axis, {\tt
\tndx{SPFLG}} (\Secs 8.1, 10.2.2) to edit visibility data based on
grey-scale displays of some function of the visibility with spectral
channel on the $x$ axis and time on the $y$ axis, {\tt \tndx{EDITR}}
(\Sec 5.5.2) to edit visibility data based on plots of visibility
versus time, 1--11 baselines at a time, {\tt \tndx{EDITA}} (\Sec
4.4.2) to edit visibility data based on plots of system temperature
({\tt TY} tables) or antenna gains ({\tt SN} or {\tt CL} tables), and
{\tt \tndx{SNEDT}} to edit {\tt SN} and {\tt CL} tables.

     In {\tt 15JUL95} and later releases, the imaging tasks, {\tt
\tndx{IMAGR}} and {\tt \tndx{SCMAP}} display the results of the
computation at its current stage on the TV and provide a menu of
interactive options to the user.  The menu includes the usual display
enhancements, the ability to choose among the images being computed,
the ability to set Clean windows in those images, and the ability to
end the computation at its current stage.  The computation will resume
when instructed via the menu or after a period of inactivity.  A
number of older iterative tasks use the TV to display the results of
the computation so far and then prompt the user to hit button {\tt D}
within some number of seconds to stop the computation.  Tasks that do
this include {\tt \tndx{APCLN}}, {\tt \tndx{MX}}, {\tt \tndx{SDCLN}},
{\tt \tndx{VTESS}}, and several less significant tasks. {\tt
\tndx{UVMAP}} uses the TV simply to draw a picture indicating which
cells are sampled in the \uv\ plane.  All of these tasks are described
in Chapter 5.

%\eject
\subsubsect{6.4.9.  Capturing the TV}

     Having done all the work to prepare the absolutely perfect
display on your TV screen, it would be a good idea to capture it
before someone, such as the local power company, does a \hbox{{\tt
TVINIT}}.  See \Sec Z.1.2.2 for a discussion of Unix tools to do this.
We recommend, however, {\tt \tndx{TVCPS}} to capture the image on your
TV, optionally including graphics overlay channels whether or not they
are on, and to write the result to an encapsulated \indx{PostScript}
file. This file can be printed immediately on a black-and-white or
\indx{color printer} or on any other device which understands
PostScript, such as NRAO's \indx{film recorder}s.  It can also be
saved for later printing or inclusion in other documents.  (See \Sec
Z.1.2.3 for a method by which \AIPS\ users may have their pictures
recorded on film for them using the Charlottesville film
recorder.\iodx{Pat Smiley})  {\tt TVCPS} was used to make the picture
on the title page of this \Cookbook, the picture of {\tt TVFLG}'s
display in Chapter 4, and the picture of a right ascension - velocity
- declination data cube in Chapter 9.  {\tt TVCPS} bases its picture
on the current size of your TV display.  If you are using a
workstation with {\tt XAS}, be sure to adjust the size of the display
window to encompass all of your image plus a modest border.  If you
leave a large border, you will get a large border in your output.
Your {\tt TVCPS} session could look like:
\dispt{TASK\qs 'TVCPS' ; INP \CR}{to review the inputs.}
\disptt{OUTFILE\qs 'MYAREA:TV.PIX \CR}{to save the output in a file
           called {\tt TV.PIX} in an area defined by the logical {\tt
           MYAREA}; see \Sec 3.10.1.}
\dispt{GRCHAN\qs 1234 \CR}{to include all graphics channels.}
\dispt{OPCODE\qs 'COL' \CR}{to make a color picture.}
\disptt{APARM\qs 7.5 , 11 \CR}{to set the output device size to 7.5 by
           11 inches, appropriate to the film recorder.}
\dispt{APARM(8)\qs 1 \CR}{to suppress labeling by user number.}
\dispt{GO \CR}{to run the task when the inputs are set.}
\dispe{{\tt TVCPS} has an option to add a character string below the
image with adverb \hbox{{\tt REASON}}.  If your image is too large to
fit on the TV, you can instruct {\tt TVCPS} to read the image from
disk with {\us DOTV = -2 \CR}, using adverbs {\tt TBLC}, {\tt TTRC},
{\tt TXINC}, and \hbox{{\tt TYINC}}.  When doing this, you should turn
off the graphics display ({\us GRCHAN 0 \CR}) since it is not aligned
properly.  Some color printers and recorders have rather different
transfer characteristics than the workstation screen.  {\tt TVCPS}
offers the option to remove the ``gamma correction'' used for your
workstation and to apply a different one appropriate to your color
recorder.  To see the effects of the gamma correction, try the verb
{\tt \tndx{GAMMASET}} in \hbox{{\tt AIPS}}.  You may need to use {\tt
\tndx{GWRITE}} to select better colors for the graphics overlay planes
as well.} \Iodx{TV functions}

\vfill\eject
\subsect{6.5.  Graphics displays of your data}

\Iodx{graphics functions}
     In the dim dark past, Tektronix invented some nice graphical
display devices and an inconvenient but functional way to talk to
them.  This communication language became so imbedded in software that
workstation vendors now provide X-Windows windows that understand it.
\AIPS\ also arose from this dim dark past and once upon a time talked
to those lovely green screens.  To retain the graphics capability, we
now provide a {\tt \tndx{TEKSRV}} server which will provide a
Tektronix-like graphics screen on which certain \AIPS\ tasks and verbs
plot.  When {\tt AIPS} starts up on workstations, it brings up a
window called \hbox{{\tt TEKSRV}}.  Leave this window in its iconic
state; it is only a marker for the presence of the server.  The first
time you write to {\tt TEKSRV}, it will create and open a window
called {\tt TEKSRV (Tek)} in which the plot is done.  You can resize
this window within some limits and the plot will automatically resize
itself. When the workstation cursor is in the Tek window, it changes
to a diagonal arrow pointer.  When an \AIPS\ task or verb tries to
read from the Tek window, this pointer becomes a plus sign.  You
should position the pointer to the desired location {\it without}
touching the keyboard or the mouse buttons.  When the pointer is
exactly where you want it, press any mouse button or any key ({\it
except} {\tt RETURN}) to return the pointer position to the program.
Note that the functions using the graphics display are not quite as
friendly as those on the \hbox{TV}.  This is due to the inability to
erase a piece of a plot without erasing all of it.

\subsubsect{6.5.1.  Plotting data and setting values with the graphics
                       display}

     {\tt \tndx{TKPL}} interprets \AIPS\ plot files to the graphics
window or device.  Experienced \AIPS\ users like it because it is much
faster than the TV for complicated line drawings, \eg\ those produced
by {\tt UVPLT}, and because it is of higher resolution than many of
the TV plots.  The graphics screen can be used to read back data
values and set adverbs, much like the TV:\Iodx{graphics functions}
\disptt{TKXY \CR}{to read the graphics cursor position, setting adverb
             {\tt PIXXY}; requires a contour or comparable image to be
             shown on the screen.}
\disptt{\tndx{TKXY ; IMVAL} \CR}{to read the graphics cursor position and
             return the image value and coordinates of the selected
             position.}
\disptt{\tndx{TKPOS} \CR}{to read the graphics cursor position and
             return the image coordinates of the selected position.}
\disptt{\tndx{TKWIN} \CR}{to read the graphics cursor position twice,
             first setting {\tt BLC} and then setting {\tt TRC}.}
\disptt{TKBOX($i$) \CR}{to read the graphics cursor position twice,
             first setting the lower left and then the upper right of
             Clean box $i$.}
\disptt{TKNBOXS($n$) \CR}{to set {\tt NBOXES} to $n$ and then set all
             $n$ Clean boxes using the graphics cursor.}
\dispe{All of these verbs require a graphics display of a plot file
produced by {\tt CNTR}, {\tt PCNTR}, {\tt GREYS}, or \hbox{{\tt
SL2PL}}.  The window procedures don't make much sense with a slice
plot, but they will work.}

\subsubsect{6.5.2.  Slice files and the graphics display}

     In Chapter 8 we discuss the computation and use of ``slices,''
one-dimensional profiles interpolated along any line in an image
plane.  Once a slice has been computed, it may be plotted by {\tt
\tndx{TKSLICE}} on the graphics display.  A second slice may be plotted on
top of the first with \hbox{{\tt \tndx{TKASLICE}}}.  The graphics
display is used to prepare initial guesses for {\tt SLFIT}, which fits
Gaussians to slices.  The verbs involved are:
\dispt{\tndx{TKVAL} \CR}{to return the flux level pointed at by the
             graphics cursor.}
\eject
\disptt{NGAUS\qs $n$ ; \tndx{TKSET} \CR}{to set the number of
           Gaussians to be fitted to $n$ and then to prepare an
           initial guess at the parameters by pointing at the peaks
           and half width points on a graphics plot of the slice.}
\disptt{TK1SET\qs $j$ \CR}{to revise the initial guess for the
             $j^{\uth}$ Gaussian.}
\disptt{\tndx{TKGUESS} \CR}{to plot the initial guess of the model on
             the graphics device, erasing any previous plot.}
\disptt{TKAGUESS \CR}{to add a plot of the initial guess of the model
             to the current slice plot on the graphics device.}
\disptt{\tndx{TKMODEL} \CR}{to plot the fit model on the graphics
             device, erasing any previous plot.}
\disptt{TKAMODEL \CR}{to add a plot of the fit model to the current
             slice plot on the graphics device.}
\disptt{\tndx{TKRESID} \CR}{to plot the data minus the fit model on
             the graphics device, erasing any previous plot.}
\disptt{TKARESID \CR}{to add a plot of the residuals (data minus model)
             to the current slice plot on the graphics device.}
\dispe{The units for the slice model parameters are fairly
problematic, so we recommend using these graphical input and output
functions.  At least, they all have the same strange ideas.}

\subsubsect{6.5.3.  Data analysis with the graphics display}

     There is a set of related tasks for analysis of data cubes
transposed so that the first axis is the one on which baselines or
Gaussians are to be fit.  In the case of a spectral-line cube, the
image would be transposed so that velocity is the first axis.  It is a
good idea to use {\tt \tndx{XPLOT}} first to get an idea of what the
profiles really look like.  It uses a flux cutoff to determine which
profiles to display and prompts you for permission to continue after
each plot. {\tt \tndx{XBASL}} is used to remove $n^{\uth}$-order
polynomial baselines from each spectrum.  It has a batch mode of
operation and an interactive mode which uses the graphics display to
plot each spectrum and to accept guidance on which channels to use in
determining the baselines.  {\tt \tndx{XGAUS}} is a similar task, with
the rather harder job of fitting up to four Gaussians plus a linear
baseline to each profile.  In its interactive mode it plots each
selected spectrum on the graphics device and accepts guidance on the
baseline regions and the initial guesses for the Gaussians.  {\tt
XGAUSS} writes images of the fit Gaussian parameters and {\tt XBASL}
can be asked to write images of the baseline parameters.
Unfortunately, these tasks require you to do the full cube in a single
execution, which is rather an endurance contest. \Iodx{graphics
functions}

\subsect{6.6. Additional \indx{recipe}:  Bananes r\^ oties}

\hanstart{50pt}
\enumerate{1}{Preheat oven to $375\deg$.}
\enumrnext{Place 6 (peeled) {\tt \indx{bananas}} in a baking dish.}
\enumrnext{Sprinkle bananas with juice of 1/2 {\tt lemon}.}
\enumrnext{Pour 2 tablespoons melted {\tt butter} and 2 tablespoons
   {\tt dark rum} over the bananas.  Sprinkle with 2 tablespoons
   {\tt brown sugar}.}
\enumrnext{Place in oven for 10 minutes.}
\enumrnext{Pour on 2 more tablespoons {\tt melted butter} and 2 more
           tablespoons {\tt dark rum} and bake for 5 minutes more.}
\enumrnext{Serve at once, spooning some sauce over each banana.}
\par\hanend
\eject
\end
\vfill\end
