%% File %M%, version %R%.%L%, released  %E% at %U% 
%latex AIPS++ DISH description
%HISTORY
%050214 GIL update for changes in AIPS++/GBT 
%021216 GIL add Jay's comments
%021028 GIL add Jim B's comments
%021025 GIL reorganize figures
%021023 GIL initial version based on Joe McMullin's work
\documentclass{article}
\newcommand{\lastedit}{{\it 2002 December 16}}
\parskip 3mm                   \textwidth 7.0in
\linewidth 7.0in               \marginparsep 0in
\oddsidemargin -.25in          \evensidemargin -.25in
\topmargin -.5in               \headheight 0in
\headsep 0.25in                \textheight 9in
\headheight 0.25in             \pretolerance=10000
\parindent 0in
\begin{document}

\newcommand{\DISH}{{\tt dish}~}
\newcommand{\MYTITLE}{\DISH~ Users Guide
}
\newcommand{\MYBTITLE}{\DISH}

\pagestyle{myheadings}
\newcommand{\HEADING}{\MYBTITLE \hfill AIPS++ \hfill Page~~}
\markboth{\HEADING}{\HEADING}
\vskip -.5cm            \pretolerance 10000 
\listparindent 0cm      \labelsep 0cm
\setcounter{page}{1}

\newcommand{\uv}{{\it uv}}            
\newcommand{\etal}{{\it et al.}~}
\newcommand{\normalstyle}{\baselineskip 7mm \parskip 3mm \large}
\newcommand{\tablestyle}{\baselineskip 4mm \parskip 0mm \normalsize }

\newcommand{\ie}{{\it i.e.}}
\newcommand{\ft}{{\ifmmode {'}\else $'$\fi}}
\newcommand{\FT}{{\ifmmode {'}\else $'$\fi}}
\newcommand{\PM}{{\ifmmode {\pm}\else $\pm$\fi}}
\newcommand{\arcs}{{\ifmmode {''}\else $''$\fi}}
\newcommand{\arcm}{{\ifmmode {'}\else $'$\fi}}
\newcommand{\mysec}[1]{\vskip .25in \centerline{{\bf #1}} \vskip .1in}
\newcommand{\mysubs}[1]{\vskip .15in \centerline{{\it #1}} \vskip .05in}
\newcommand{\comp}[1]{{\tt {#1}}}
\normalstyle

\centerline{\Large \MYTITLE}
\vskip .5in
\centerline{Version 3.0}
\vskip .5in
\section{Introduction to \DISH}
\DISH is a fully capable tool for reducing Single Dish Radio Astronomy Data
efficiently.  \DISH builds on the AIPS++ capacities with tools
specifically designed to meet the needs of astronomers when
interpreting spectra and images from observations with single
radio telescopes.  \DISH provides all the capabilities of the
UNIPOPS package used to reduce 140ft data.  In addition,
\DISH has capabilities to optimally reduce different
types of observations, having special functions for Beam Switched
and Frequency Switched observing modes.  Important new
capabilities to flag selected ranges of spectra and produce
spectral images are illustrated.

Section 2 presents the capabilities of \DISH by showing
complete data reduction session for a simple
GBT spectral line observation, where an astronomical 
measurement is completed in a small number of simple steps.
Section 3 shows the lower level functions for examining individual
integrations of an observing scan.
Section 4 shows the flagging capabilities, including the
graphical user interface.
Section 6 describes in detail the calibration equations used
Section 7 describes the data analysis functions for averaging
and fitting models to the data.
Section 8 presents the mapping capabilities of \DISH.
Section 9 summarizes all of the \DISH capabilities in a 
handy reference.
Section 10 presents the \DISH capabilities for an observer
familiar with UNIPOPS.
Appendix A describes the GBT data structure.

\subsection{Other Help!}
The starting point for all web documentation is the AIPS++ home page:
\vskip .1in
{\tt http://aips2.aoc.nrao.edu/docs/user/documentation.html}

The best way to learn is by doing.  The web site:
\vskip .1in
{\tt http://aips2.aoc.nrao.edu/docs/recipes/Recipes/index.html}
\vskip .1in
has simple, step by step, guides for standard data reduction
scenarios.  Also data are provided! 

\subsection{Starting up \DISH}

The AIPS++ \DISH package is started under Unix by first setting
up the environment, by "source-ing" some shell scripts.  It is also
strongly recommended that the user work in an empty sub-directory,
as many files will be created.

In the first example, OH mega-maser data will be reduced, and
the working directory is assigned name {\tt OH}.  Also note
that \DISH will run more efficiently if the working directory
is mounted locally on the machine running \DISH.

\begin{verbatim}
% mdkir OH                                    # Create an empty work directory
% cd OH                                       # Go to it
% gbdish                                      # script to setup environment
\end{verbatim}

After starting \DISH (via {\tt gbdish}), a number of messages are printed in the window.
Three new Graphical User Interfaces appear; 1) message log,
2) PG plotter and 3) \DISH record browser.
The AIPS++ prompt is the ``-'' and the
AIPS++ comment symbol is \#.  After each command execution,
AIPS++ returns true, {\tt T}, if the command is successful.
The prompts and {\tt T}s are dropped in the listing below.

\section{Loading Data into \DISH}
This first example session shows how GBT data are loaded into
\DISH and the first examination of the observing parameters.
In later executions more data will be averaged and fit.

The data used in this section are from an OH mega maser survey
run by Jim Braatz of NRAO (Braatz@nrao.edu)  
as a background program at the GBT.  The survey
selects sources found in both the IRAS 100 micron catalog and the 
NRAO NVSS 1.4 GHz VLA survey as candidates for OH mega-maser sources.

The survey uses the GBT 1-2 GHz receiver and the full IF electronics
chain to connect to the Spectral Processor located in the Equipment room
(See http://www.gb.nrao.edu/GBT for a complete description of the
GBT electronics).  The OH survey uses the Spectral processor
configured for dual polarization to produce 5 MHz bandwidth spectra
having 1023 channels.  The Spectral processor controlled turning on
and off a calibration noise diode continually during the observation.
The laboratory measurements of the noise diode values are used to
calibrate the astronomical observation.

The goal of this recipe is to determine whether redshifted
OH maser emission
is present in the 1665.4018 and 1667.359 MHz lines.
The only the AIPS++ plotter window is used in this recipe.  

The process of dish analysis is importing the data into a 
Measurement Set (MS), calibrating individual scans and accumulating
them into a single {\tt globalscan}.  This {\tt globalscan} may 
be saved for later analysis.  The \DISH program assumes the observations
are organized into scans.  A scan may contain any number of integrations.
An integration is a set of intensities or spectra for each of the
back-end inputs (such as dual polarizations and/or multiple beams).

\clearpage
\begin{figure}[h]
\hrule
\hrule
\special{psfile=IRAS0956-17-RAW.PS
angle=-90 hoffset=-25 voffset=-10 vscale=40 hscale=40}
\special{psfile=IRAS0956-18-CAL.PS
% angle=-90 hoffset=-50 voffset=-220 vscale=80 hscale=80}
angle=-90 hoffset=235 voffset=-10 vscale=40 hscale=40}
\vskip 3.5in
\hrule
\caption{
Left: Raw reference spectra for scan 17 of the OFF-ON pair of scans 17,18
for observations towards RAS09539+0857.  
The dual polarization plots of the data in counts are
presented.  The spectral shape is due to the variation IF
gain across the band.
Right: 
Calibrated spectra from a single OFF-ON pair of scans towards
IRAS09539+0857}
\end{figure}

%\begin{figure}
%\hrule\hrule
%\vskip 2in
%\special{psfile=iras0956nvss.ps
%hoffset=-80 voffset=-150 vscale=50 hscale=50}
%%\vskip -3in
%\special{psfile=iras0956iras100.ps
%hoffset=100 voffset=-150 vscale=50 hscale=50}
%%%\vskip -3in
%\special{psfile=iras0956dds2Red.ps
%%hoffset=280 voffset=-150 vscale=50 hscale=50}
%\vskip .5in
%%\caption{A series of 8' square images of the region centered on
%09h56m33.21 8d43'04.2'' (J2000).  Left is from the 1.4 GHz NRAO NVSS
%%VLA survey, center is the IRAS 100 micron survey and right is from the 
%second Digitized Sky Survey Red.  The GBT FWHM beam width is 8' at 1.66 GHz.
%%This field is centered on interacting galaxies, barely visible
%in the optical image.}
%%\hrule
%\end{figure}
%%

The user inputs for data calibration are shown below.  The steps
include loading the data into AIPS++, plotting the raw data (Figure 1 left),
calibrating and plotting the calibrated data (Figure 1 right).

\input dishCommandsA.tex

\clearpage

\begin{figure}[h]
\hrule
\hrule
\special{psfile=IRAS0956-AVE-BL.PS
angle=-90 hoffset=-25 voffset=-10 vscale=40 hscale=40}
\special{psfile=IRAS0956-AVE-SUB.PS
% angle=-90 hoffset=-50 voffset=-220 vscale=80 hscale=80}
angle=-90 hoffset=235 voffset=-10 vscale=40 hscale=40}
\vskip 3.5in
\hrule
\caption{Right: Dual polarization spectra of IRAS09539+0857
with the results of the third order baseline fit shown. 
Left: Dual polarization observation of 
IRAS09539+0857, with baseline fit subtracted.}
\end{figure}

After analysis of a single pair of OFFON scans, another pair is
calibrated and averaged.  Next a baseline is fit to the
two polarization spectra (Figure 2 left) and subtracted to
show the detected OH emission (Figure 2 right).

\input dishCommandsB.tex

\clearpage

\begin{figure}[t]
\hrule
\hrule
\special{psfile=IRAS0956-AVE-FIT.PS
% angle=-90 hoffset=-50 voffset=-220 vscale=80 hscale=80}
angle=-90 hoffset=-30 voffset=-10 vscale=40 hscale=40}
\special{psfile=IRAS0956-VEL-FIT.PS
% angle=-90 hoffset=-50 voffset=-220 vscale=80 hscale=80}
angle=-90 hoffset=240 voffset=-10 vscale=40 hscale=40}
\vskip 3.5in
\hrule
\caption{Left: Gaussian Fits to the baseline subtracted, calibrated spectra 
from the average spectra towards IRAS09539+0857, X axis units are
GHz.  
Right: Same as Left, except that X axis units are km/sec.}
\end{figure}

\subsection{Re-load Saved Spectra; Fit components}

Now we re-open the previously imported measurement set and 
restore the saved average spectra.  In this step the spectra are
fit with two Gaussian components, and displayed twice.  One
display shows a Intensity versus Frequency display (Figure 3, left)
and the other display shows Intensity versus Velocity (Figure 3, right).

\input dishCommands2A.tex

The OH survey observations towards IRAS09539+0857 were made to confirm the 
observing setup for weak sources.  These GBT observations show
a peak of emission at 1.47757 GHz.  The Arecibo survey of 
Darling and Giovanelli (2001, {\it AJ}, {\bf 121}: 1278) 
had previously detected IRAS09539+0857 and measured
a velocity of 38,673 km/sec (optical heliocentric), 
consistent with the observations presented here.
(Note that $v_{opt}$ = 38,673 km/sec [optical definition] corresponds
to $v_{rad} = \frac{1477.57}{1667.4018} v_{opt}$ = 34,270 km/sec [radio
definition]).

\input dishCommands2B.tex

\end{document}






