%-----------------------------------------------------------------------
%;  Copyright (C) 1995, 1998, 2000-2001, 2004-2005, 2007-2009,
%;  Copyright (C) 2013-2014, 2018, 2022
%;  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
%-----------------------------------------------------------------------
% Summary of standard aips calibration process.
% last edited by Eric Greisen for CookBook inclusion

\APPEN{Spectral-Line Data Analysis in \AIPS}{A Step-by-Step Guide to Spectral-Line Data Analysis in \AIPS}{line}
\renewcommand{\Chapt}{22}

\renewcommand{\titlea}{31-December-2008 (revised 3-May-2022)}
\renewcommand{\Rheading}{\AIPS\ \cookbook:~\titlea\hfill}
\renewcommand{\Lheading}{\hfill \AIPS\ \cookbook:~\titlea}
\markboth{\Lheading}{\Rheading}

\newcommand{\Lbtd}{\vspace{4pt}\pm\par
    \begin{tabular*}{\textwidth}[t]{p{0.351in}p{5.00in}p{1.15in}}}
\newcommand{\lbtd}{\vspace{-4pt}\pm\par
    \begin{tabular*}{\textwidth}[t]{p{0.351in}p{5.00in}p{1.15in}}}
\newcommand{\Letd}{\end{tabular*}\pd\par}
\newcommand{\Ldisp}[3]{\Lbtd#1\hfil&#2\hfil&\hspace{0.2in}{\bf #3}\hfil\Letd}
\newcommand{\ldisp}[2]{\lbtd\hfil&#1\hfil&\hspace{0.2in}{\bf #2}\hfil\Letd}
\newcommand{\Lline}[1]{\ps\par{\hspace{0.6in}{\tt #1}}}

\centerline{Initially contributed by Andrea L. Cox and Daniel Puche}

In this guide, we assume that the reader is familiar with the basic
tools of \AIPS; \eg\ {\tt MCAT} (\Sec{catalog}), {\tt GETN}
(\Sec{getname}), {\tt IMHEAD} (\Sec{header}) and other \AIPS\ tools
involving the manipulation of the data catalog are not mentioned.
This guide contains three main sections covering editing and
calibration of spectral-line data, making and Cleaning of map cubes,
and moment analysis and rotation curves of galaxies.  {\em It is
assumed through these sections that all sources in the data set were
observed at the same frequency; the final section of this guide
describes what you should do before beginning data reduction if this
is not the case.}

This is an outline of a typical reduction procedure for spectral-line
data from the VLA; different users may use slightly different
approaches.  This guide is a supplement to the \AIPS\ {\tt EXPLAIN}
and {\tt ABOUT} verbs (\Sec{help}) and the \AIPS\ \Cookbook.  Some of
the less obvious or more important parameters for each task will be
mentioned, but the user should {\em always} check to ensure that the
rest of the parameters are specified correctly.  When in doubt, the
defaults are usually fairly safe.  Words in boldface or typewriter
fonts represent \AIPS\ tasks and their inputs.  When you see a phrase
enclosed in brackets, replace the phrase and the brackets with the
correct input.  For example, to specify the source 0134+329
\Lline{SOURCE '$<source\_name>$'}
would be typed as
\Lline{SOURCE '0134+329'}
The text below is in a three-column format, showing a step number on
the left, a descriptive paragraph in the center, the name of the
\AIPS\ task or verb on the right.
\pd

\sects{Editing and calibrating spectral-line data}

\subsections{Loading the data}

\Ldisp{(1)}{Go to the VLA archive web page at
\Lline{{\tt https://data.nrao.edu/}}
\par log in wih your {\tt my.nrao.edu} account and locate the desired
data set using the basic retrieval tool.  Use the observing date,
program code, or observer's name to locate the data.  If the data are
within the proprietary period (usually 6 months), you will be allowed
access only if your login is recognized as an owner.  Select the data
file(s) desired and ask for them with \AIPS-friendly names.  Wait for
the e-mail notification that the files are ready and then follow the
supplied advice to copy the data files to your computer.}{\ }

\Ldisp{(2)}{Before starting {\tt AIPS}, create an environment variable
pointing at the disk directory containing the data files.  Use {\tt
cd $<data\_area>$} followed by {\tt setenv MYDATA `pwd`} if you use
C-shell or its variants or {\tt export MYDATA=`pwd`} if you use the
bash shell.  (Note the back tick marks surrounding the {\tt pwd}.)
Then start {\tt AIPS}\@.}{\ }
\vfill\eject

\Ldisp{(3)}{Load the data from the archive file(s) to \AIPS\ data
areas.  Use the defaults to load the data without further averaging.
The $m$ disk files will be named $<program\_name>\_i$ \hspace{1em} for
$i = n+1, \ldots, n+m$.
\Lline{VLAOBS '$<program\_name>$' ; DOWEIGHT 1}
\Lline{NFILES $n$ ; NCOUNT $m$}
\Lline{DATAIN 'MYDATA:$<program\_name>\_$'}}{FILLM}

\Ldisp{}{The data loaded to disk will normally be in two parts: One
will have the class ``{\tt CH0}'' and the other will have the class
``{\tt LINE}.''  The names of the files are thus
\Lline{DATE.CH0}
\Lline{DATE.LINE}
\par where ``{\tt DATE}'' is the date the observations began.  Each
file is a multi-source file, containing observations for all your
sources: flux calibrators, phase calibrators, and target sources.
Your spectral-line data are contained in the LINE file, while the CH0
file is a ``pseudo-continuum'' file; it is the average of the inner
75\%\ of the bandpass and will be used for gain and phase
calibration.}{}

\Ldisp{(4)}{List the ``scan summaries'' from the {\tt CH0} data.  {\em
Keep the output for future reference.}  Note that the frequency in the
header of a multi-source file is always the sky frequency
\underline{in the center of the band of the first scan of the
observation} (see \Sec{multifreq}).
\Lline{OPTYPE 'SCAN' ; DOCRT -1 ; OUTPRINT ' '}
\par to print on the line printer.  To make a text file instead
\Lline{OUTPRINT 'MYDATA:$<filename\_in\_all\_caps>$'}}{LISTR}

\Ldisp{(5)}{Print the antenna configuration file. {\em Keep the
output for future reference.}}{PRTAN}

\subsections{Inspecting and editing the data}

There are a number of different ways to isolate and edit bad \uv\
points from your data set.  The method described below is typical.
Other tasks of interest can be found by typing {\tt ABOUT EDITING} and
{\tt ABOUT UV} and by consulting \Sec{caledit}, \Sec{tvflg},
\Sec{edita}, \Sec{editr}, \Sec{spflg}, and \Sec{rflag} in the \AIPS\
\Cookbook.

\Ldisp{(6)}{Plot amplitude versus baseline length for your flux and
phase calibrators.  Inspect each source, Stokes, and IF separately.
Set {\tt XINC} so there are only a few thousand visibilities on the
output plot (the total number of visibilities is listed on the scan
summary sheets from Step 4).  Use the TV to save trees.
\Lline{BPARM 0 ; DOTV 1}
\par If there are anomalous amplitude points, continue to the next
step.  If your data points have a small scatter, you may not need to
edit and can skip to calibration (Step 10).}{UVPLT}

\Ldisp{(7)}{Determine if the anomalous data points are from a
particular baseline, antenna, Stokes, or IF, inspecting each Stokes and
IF separately.  The output of this task will be all points that have
anomalous amplitudes, based on your selection criteria.
\Lline{OPCODE 'CLIP' ; APARM(1) $<max\_flux>$}
\Lline{APARM(3) $<min\_flux>$}}{UVFND}

\Ldisp{(8)}{Once you have determined which data points to flag with
{\tt UVFND}, flag them with {\tt UVFLG}\@.  You can flag by
time-range, baseline, or antenna and you can flag any or all of the
Stokes parameters or IFs.  To assist in undoing flags, set a {\tt
REASON}\@.
\Lline{OPCODE 'FLAG' ; OUTFGVER 1}}{UVFLG}
\vfill\eject

\Ldisp{(9)}{Examine the \uv\ data for your calibrators on the TV to
check for any obvious problems which you might have missed; see
\Sec{tvflg}.  Check each IF and each Stokes separately and edit the
data more carefully, if necessary, before continuing.
\Lline{DOCAL -1 ; CALCODE '*' ; FLAGVER 1}}{TVFLG}

\subsections{Calibrating the data}

Steps 10--15 should be applied to the {\tt CH0} data alone, not to the
{\tt LINE} data.  To ensure that all inputs are set to their defaults
before continuing, type
\Lline{RESTORE 0}
\par Then, when you are satisfied with your editing, type
\Lline{RUN VLAPROCS}
\par to set up VLA-specific parameters and procedures for
calibration.  You may turn all adverbs for a specific $<task>$ to
their default values with
\Lline{DEFAULT $<task>$}
\par {\em If you have multi-frequency data, each frequency must be
calibrated separately; this can be done by specifying the {\tt FREQID}
parameter in each task (see \Sec{multifreq}).}  More information on
calibrating your data can be found by typing {\tt ABOUT CALIBRAT} and
{\tt HELP CALIBRAT} and consulting \Rchap{cal}.

\Ldisp{(10)}{Calculate the flux of the primary flux calibrator for the
channel zero ({\tt CH0}) data.
\Lline{SOURCE '$<flux\_calibrator>$' , ' ' ; OPTYPE
'CALC}}{SETJY}

\Ldisp{(11)}{Calculate gain and phase solutions for {\em all} of the
calibrators.  In this case, you must run this procedure once for each
source.  Check for the presence of an appropriate model with {\tt
CALDIR}\@.  For those sources having a model
\Lline{DOCALIB 1 ; UVRANGE 0 ; ANTENNAS 0}
\Lline{CALSOUR '$<flux\_calibrator\_1>$' , ' '}
\par For sources without a model, choose a {\tt UVRANGE} according to
the tables in the {\it VLA Calibration Manual}.  You may do more than
one source at a time, if they have the same {\tt UVRANGE}\@.  The
output of this procedure is a solution ({\tt SN}) extension table,
which is printed automatically.  Select a reference antenna ({\tt
REFANT}) which did not have any problems during the observing run and
which is located near the center of the array.
\Lline{DOCALIB  1 ; UVRANGE $<uv\_min>$ , $<uv\_max>$}
\Lline{CALSOUR '$<calibrator\_1>$' , $\ldots$ ,
   '$<calibrator\_n>$'}
\Lline{DOPRINT 1; OUTPRINT '$<filename\_in\_all\_caps>$'}
\par The output from {\tt VLACALIB} will include a list of closure
errors.  If there are too many large errors, edit your data carefully
using {\tt UVFND}, {\tt TVFLG}, or {\tt LISTR} as described above.
{\em Destroy old SN tables with} {\tt EXTDEST} and then re-run {\tt
VLACALIB} until the solutions are satisfactory.  The output will
include amplitudes and phases for each baseline; for each calibrator,
the amplitudes should be approximately constant and the phases should
vary smoothly over time.}{VLACALIB}

\Ldisp{(12)}{Calculate the flux densities of the secondary (phase)
calibrators from the primary (flux) calibrator, based upon the flux
densities in the source ({\tt SU}) table and the antenna gain
solutions in the solution ({\tt SN}) table.  {\em Destroy bad or
redundant versions of the {\tt SN} tables before using this task.}
Compare the computed fluxes with those listed in the {\it VLA
Calibration Manual}.
\Lline{SOURCES '$<phase\_cal\_1>$' , $\ldots$ ,
   '$<phase\_cal\_n>$'}
\Lline{CALSOUR '$<flux\_cal>$' , ' '}}{GETJY}

\Ldisp{(13)}{This procedure interpolates the solutions derived from
the calibrators into the calibration ({\tt CL}) table for {\em all}
sources.  Run this procedure once for each phase calibrator (which may
be used to calibrate multiple sources).
\Lline{SOURCES '$<phase\_cal>$' ,'$<source\_1>$' , $\ldots$ ,
   '$<source\_n>$'}
\Lline{CALSOUR '$<phase\_cal>$' , ' '}
\Lline{OPCODE 'CALI' ; INTERPOL '2PT'}
\Lline{OUTPRINT '$<filename\_in\_all\_caps>$'}
\par Note: if you are observing at low frequencies or there are gaps
in your observations of phase calibrators, you may want to use {\tt
SAMPTYPE 'BOX'} and review the other inputs carefully.  They have
changed.}{VLACLCAL}

\Ldisp{(14)}{Apply the calibration to the phase calibrators and
examine the amplitudes, which should be nearly constant, and the
phases, which should be nearly zero.
\Lline{SOURCES ' ' ; CALCODE '*'} \hfill$\Leftarrow${\it\ print
results for \underline{all} calibrators}
\Lline{OPTYPE 'MATX' ; DOCALIB 2 ; GAINUSE 2; DPARM 5, 1, 0}
\Lline{UVRANGE 0 ; DOCRT -1 ;
   OUTPRINT '$<filename\_in\_all\_caps>$'}}{LISTR}

\Ldisp{(15)}{Examine the \uv\ data for your {\em sources} on the TV to
check for any obvious problems which you may have missed.  Re-edit the
data (Steps 6--9) if necessary.
\Lline{DOCAL 2 ; GAINUSE 2 ; CALCOD '-CAL'}
\par If you have too many visibilities to fit on the TV screen, you
may want to set {\tt TIMERANG}, {\tt SOURCES} or {\tt DPARM(6)} (the
input averaging time) to limit the amount of data displayed.  There
are also interactive options to set the on-screen averaging time and
the time range currently displayed.}{TVFLG}

\Ldisp{(16)}{To calibrate the spectral-line data, simply copy the
calibration ({\tt CL}) table from the {\tt CH0} to the {\tt LINE}
data.
\Lline{INEXT 'CL' ; NCOUNT 1 ; INVERS 2}
\par Also be sure to copy the flagging ({\tt FG}) table
\Lline{INEXT 'FG' ; INVERS 1}}{TACOP}

Steps 17 and 18 should be applied to the {\tt LINE} data alone, not to
the {\tt CH0} data

\Ldisp{(17)}{Calibrate the bandpass for the {\tt LINE} data using the
primary (flux) calibrator.  The output from this task is a table ({\tt
BP}) of the bandpass spectrum.
\Lline{GET3NAME $<CH0 data>$}
\Lline{CALSOUR '$<flux\_cal>$' , ' '; CALCODE '*'}
\Lline{DOCALIB -1 ; FLAGVER 1}}{BPASS}

\Ldisp{(18)}{Examine the bandpass for each of the antennas on the TV.
\Lline{APARM(8) 2 ; DOTV 1 ; STOKES 'RR'}
\Lline{ANTENNAS 0 ; NCOUNT 4 \hfill$\Leftarrow${\it plot 4 antennas
at a time}}
\par Then do the LL Stokes.  After this, generate a plot ({\tt PL})
file of the total bandpass for each Stokes.
\Lline{NCOUNT 0 ; DOTV -1}}{POSSM}

\ldisp{Plot the bandpass on the laser printer; specify {\tt PLVER} for
each Stokes.}{LWPLA}

\Ldisp{(19)}{Now that the calibration is completed, write the
calibrated {\tt CH0} and {\tt LINE} data to tape.}{FITTP}

\ldisp{Print the contents of the tape(s) for your data.}{PRTTP}
\vfil\eject

\Ldisp{(20)}{Apply the calibration and editing tables, writing
single-source \uv\ files for imaging.
\Lline{CALCODE '-CAL' \hfill$\Leftarrow${\it write \uv\ for all
non-calibrator sources}}
\Lline{DOCALIB 2; GAINVER 2 ; DOBAND 1; BPVER 1}}{SPLIT}

\sects{Making and Cleaning image cubes}

\Ldisp{(21)}{Determine the imaging parameters needed for a full-field
image of the continuum.  Set the {\tt BPARM}s to cover the full
single-dish beam area (or more at 21-cm wavelength).
\Lline{IMSIZE 0 ; CELLSIZE 0}
\Lline{BOXFILE 'MYDATA:$<source_name>$.BOX'}
\par Delete the output {\tt BOXFILE} and re-run the task with your
chosen (more congenial or exact) {\tt CELLSIZE}\@.}{SETFC}

\Ldisp{(22)}{Make a {\tt CH0} image with a large field (set by {\tt
IMSIZE} and {\tt CELLSIZE} returned by {\tt SETFC}) to look for
strong continuum sources.  Use uniform weighting ({\tt UVWTFN ' '})
with {\tt ROBUST} of 0 or $-1$ if resolution is more important than
detecting significantly extended sources; set {\tt ROBUST} to 2 or
more if the converse is true.
\Lline{STOKES 'I' ; NITER 0}
\par Then make a dirty image cube of your {\tt LINE} data in the
center field only (unless more are needed for the line source).
\Lline{NFIELD 1 ; BCHAN 1 ; ECHAN 0}}{IMAGR}

\Ldisp{(23)}{Examine the cube on the TV to determine which channels
are free of line emission.}{TVMOVIE}

\Ldisp{(24)}{Calculate the noise in a few of the line-free
channels.}{}

\ldisp{Display a channel on the TV
\Lline{TBLC = 0 , 0 , $<channel\_number>$ ; TTRC 0}}{TVALL}

\ldisp{Select a large window that contains no continuum
sources.}{TVWIN}

\ldisp{Calculate the RMS noise inside the window.  The verb {\tt
TVSTAT} is helpful if there are no large rectangular windows free of
continuum emission.}{IMSTAT}

\ldisp{Having an initial guess of the signal-free RMS, you may attempt
to refine that estimate (see message generated) and also produce a
histogram plot.
\Lline{BLC 0 ; TRC 0; DOTV 1; DOHIST 1; NBOXES 256}}{IMEAN}

\Ldisp{(25)}{Remove the continuum emission by fitting a baseline in the
\uv\ plane to the line-free channels; see {\tt EXPLAIN UVLSF} and
\Sec{linecsub}.  If you don't want this task for flagging, but only
for continuum subtraction, the important parameters are
\Lline{ORDER 1 ; DOOUT 1 ; FLUX 0 ; CUTOFF 0}
\par Choose your line-free channels, normally avoiding the channels at
the edges of your bandpass since they are usually quite noisy.
\Lline{ICHANSEL $<begin_1> , <end_1> ,$, 0, 0, $<begin_2> , <end_2>$}
\par This task will also write a new continuum data set which is a
better estimate of the continuum than the {\tt CH0} file which
contains contributions from the line signals.  If there is a bright
continuum source far away from the phase center, you {\it will} want
to use {\tt SHIFT} to center it while running {\tt UVLSF}\@.  Multiple
interfering sources might even require {\tt UVSUB} with a good
continuum model rather than {\tt UVLSF}\@.}{UVLSF}

\Ldisp{(26)}{Make a dirty cube containing only the line emission.  Use
the same parameters as in Step 22, including usually only one
field --- but consider multi-scale Clean.}{IMAGR}

\Ldisp{(27)}{Calculate the noise in the line-free channels as in Step
24.}{}

\Ldisp{(28)}{Make a contour plot of the beam.}{}
\ldisp{Display a channel on the TV.
\Lline{TBLC = 0, 0, $<channel\_number>$ ; TTRC 0}}{TVALL}
\ldisp{Select a window containing the source (or beam) you want to
plot.}{TVWIN}
\ldisp{Display the contour plot on the TV\@.  For a beam plot,
good parameters are
\Lline{PLEV 10 ; LEVS -3,-1,1,3,5,7,9 DOTV 1}
\par When you are happy with the plot, generate a plot ({\tt PL})
extension file.
\Lline{DOTV -1}}{KNTR}
\ldisp{Send the plot file to the default printer.}{LWPLA}

\ldisp{Measure the beam diameter at half-power (FWHP) to get beam
parameters ({\tt BMAJ}, {\tt BMIN}, {\tt BPA}) for the Cleaning
process.  If you do not specify these, {\tt IMAGR} will choose them
automatically by fitting a Gaussian beam with an elliptical
cross-section. This is usually fine for uniformly-weighted images
({\tt ROBUST} around 0), but may not be desirable for
naturally-weighted images for which the beam is often rather
non-Gaussian.}{\ }

\Ldisp{(29)}{Select boxes containing all of the line emission in the
cube.  Use as many boxes as necessary (up to 50).  The better that you
constrain the locations of real emission, the faster the Cleaning
process will go.  Note that {\tt IMAGR} allows you to set the boxes
interactively when you run with {\tt DOTV 1}, which is important when
Cleaning reveals emission initially lost in the sidelobes of the
stronger objects.}{TVBOX}

\Ldisp{(30)}{Make a Clean cube of the line emission.  Start by
Cleaning just one or two channels (set with {\tt BCHAN} and {\tt
ECHAN}) to ensure that your inputs are set correctly.  If you don't
want to waste time, it is a good idea to Clean only those channels
with emission that is $\geq 4$ times the RMS noise (Step 20).  Use
{\tt SUBIM} and {\tt MCUBE} to construct a full cube of the images
later.  Use the same parameters as in previous runs of {\tt IMAGR},
but specify the beam parameters ({\tt BMAJ}, {\tt BMIN}, {\tt BPA})
and control the Cleaning depth with {\tt FLUX} and {\tt
NITER}\@.}{IMAGR}

\Ldisp{(31)}{Examine the Cleaned cube and do progressively deeper
cleaning with {\tt IMAGR} until you are satisfied with the result.
The {\tt DOTV 1} option in {\tt IMAGR} will help you reach this state
more quickly.  You can examine the Clean components with {\tt
PRTCC}\@.  You should Clean until the total Cleaned flux
converges.}{TVMOVIE}

\Ldisp{(32)}{Correct for attenuation away from the center of the
primary beam.  Use your Cleaned cube as the input, the default
parameters should be adequate, and the output is a corrected
cube.}{PBCOR}

\Ldisp{(33)}{Back up the Cleaned cubes and the cubes after {\tt PBCOR}
to tape.}{FITTP}

\ldisp{Print the contents of the tapes for your records.}{PRTTP}

\sects{Moment analysis and rotation curve of galaxies}

After correcting for primary beam attenuation with {\tt PBCOR}, the
noise in the images will depend upon position.  Because of this, you
should use the uncorrected line cube for moment analysis.

\Ldisp{(34)}{The frequency axis can be labeled in either frequency or
velocity units.  Make sure that the desired units are chosen; use {\tt
IMHEAD} to check.  Velocity is recommended for moment
analysis.}{ALTSW}

\Ldisp{(35)}{Transpose the axes to VEL-RA-DEC (or FREQ-RA-DEC) order.
\Lline{TRANSCOD '312'}}{TRANS}

\Ldisp{(36)}{Generate images of the total emission ({\tt MOM0}), the
velocity field ({\tt MOM1}), and the line width ({\tt MOM2}) using the
transposed cube as input.  Be sure to exclude the end channels as they
generally are very noisy.  Try various values for the flux cutoff {\tt
FLUX} and the width of the smoothing functions (set by {\tt CELLSIZE})
until you are satisfied with the results.}{MOMNT}

\Ldisp{(37)}{Correct for the attenuation away from the center of the
primary beam in the {\tt MOM0} image, as in Step 28.  If you computed
the moment images with a velocity axis, use {\tt ALTSW} to change to a
frequency axis before running {\tt PBCOR}.}{PBCOR}

\Ldisp{(38)}{Make contour plots of the {\tt MOM0} and {\tt MOM1}
images; see Step 24.  Note that {\tt KNTR} can superpose contour and
grey-scale plots as in \Rfig{linemom}.}{KNTR}

\Ldisp{(39)}{The task {\tt GAL} allows you to generate a
``tilted-ring'' model rotation curve of two types from a galaxy's
velocity field or to fit single-parameter rotation curves to annuli of
a specified width.  The {\tt EXPLAIN} file for this task describes all
of the parameters in detail and contains general advice on how to
obtain an optimum fit.}{GAL}

\ldisp{The task {\tt CUBIT}, written by Judith Irwin, allows you to fit
a rotating galaxy model to the full Cleaned image cube.  The {\tt
EXPLAIN} file for this task describes all of the parameters in detail
and contains general advice on how to obtain an optimum fit.}{CUBIT}

\Sects{Multi-frequency observations}{multifreq}

\subsections{General frequency information}

For any \uv\ data file, the frequency listed in the header information
is the sky frequency of the center of the band ({\tt LINE} or {\tt
CH0}) during the first scan of the observation.  This is true
regardless of whether you observed at a single frequency or multiple
frequencies.  After you {\tt SPLIT} a multi-source file into
single-source files, the frequency in the header refers to the sky
frequency at the center of the band during the first scan {\em on that
source}.

Corrections for the Doppler shift due to the rotation of the Earth
can be taken into account within \AIPS, if the data were observed at
fixed frequency.  Task {\tt CVEL} may be used, but it requires that
the spectra be well sampled in frequency.

\subsections{Multi-frequency \uv\ files}

{\bf A simple rule of thumb:} If you want to calibrate sources
together, load the data with the same value of {\tt FREQID} in
{\tt FILLM}\@.  If you want to calibrate sources separately, give
them different {\tt FREQID}s.  For multi-frequency files, you should
be sure to assign a different qualifier ({\tt QUAL}) to each observing
frequency (or velocity) with the OBSERVE program {\em before taking
the observations}.  There are essentially two types of multi-frequency
observations:

\xben
\Item \underline{Standard multi-frequency observations} in which you
want to do the entire calibration process separately for each
frequency.  When reading in such data with {\tt FILLM}, set {\tt
CPARM(7) = 0}.  This sets a different value of {\tt FREQID} to data
that differ by more than the maximum Doppler shift in a source in a
day.  During calibration, you can control which data you process by
choosing the appropriate values for {\tt FREQID} and {\tt QUAL}\@.
After calibration of each source/frequency, you may destroy the {\tt
SN} table to avoid using it to calibrate sources with different {\tt
FREQID}s.  For each source/frequency, you should create a new version
of the calibration ({\tt CL}) and bandpass ({\tt BP}) tables (\eg\ for
the second source/frequency, you will create version 3 of the {\tt CL}
table and version 2 of the {\tt BP} table).  (It principle, {\tt
FREQID}s may co-exist in single tables without interference, but if
they are in carefully specified separate tables they cannot interfere
with each other.)

\Item \underline{Observations of, or affected by, Galactic emission or
absorption}, in which you want to combine data at different
frequencies to do the calibration.  Normally, these are observations
in which the calibrator sources themselves are absorbed by Galactic HI
around 0 velocity.  It is {\em extremely important} that you assign a
different qualifier to each frequency with the OBSERVE program.  Then
load the data with {\tt FILLM} forcing a single value of {\tt FREQID}
by setting {\tt CPARM(7) = -1}.  In this case, the information that
two observations with the same {\tt FREQID} have different frequencies
will be contained only in the qualifiers.  Whatever data are loaded
with the same value of {\tt FREQID} will have the same reference
frequency; it should be possible to average over the observing
frequencies using the appropriate programs in \AIPS\ ({\tt CLCAL} and
{\tt BPASS}).

\xeen

\sects{Additional recipes}

\recipe{Banana breeze pie}

\bre
\Item {In a small saucepan, melt 1/3 cup {\bf butter} or {\bf
     margarine}.  Add 1/4 cup {\bf  sugar} and 1/2 teaspoon {\bf
     cinnamon}.  Stir constantly over low heat until bubbles form
     around the edges of pan.}
\Item{Remove from heat, add 1 cup {\bf corn flake cereal} crumbs and
     mix well.  Press mixture evenly into a 9-inch pie pan to form
     crust. Chill.}
\Item {Beat 8 ounces softened {\bf cream cheese} until light and
     fluffy.  Add 1 15-ounce can {\bf condensed milk} and blend
     thoroughly.  Add 1/3 cup {\bf lemon juice} and 1 teaspoon {\bf
     vanilla}.  Stir until thickened.}
\Item {Slice 3 ripe {\bf bananas} and line crust. Pour filling into
     crust and refrigerate for 2--3 hours or until firm.  Do not
     freeze.}
\Item {Slice 2 ripe {\bf  bananas}, dip in lemon juice and arrange on
     top of pie.  Note. for a change of pace, use lime juice.}
\ere

\recipe{Banana cutlets}

\bre
\Item {Peel 6 medium-ripe {\bf bananas} and halve them crosswise.}
\Item {Dip them in 1/3 cup {\bf lemon juice} and then roll in 1 cup
     crushed {\bf corn flake crumbs}.}
\Item {Saute them in 3 tablespoons {\bf butter} until a golden brown.}
\Item {Serve on lettuce.}
\ere
