%-----------------------------------------------------------------------
%;  Copyright (C) 2016
%;  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
%-----------------------------------------------------------------------
%Body of intermediate AIPSletter for 31 December 2014 version

\documentclass[twoside]{article}
\usepackage{graphics}

\newcommand{\AIPRELEASE}{June 30, 2016}
\newcommand{\AIPVOLUME}{Volume XXXVI}
\newcommand{\AIPNUMBER}{Number 1}
\newcommand{\RELEASENAME}{{\tt 31DEC16}}
\newcommand{\NEWNAME}{{\tt 31DEC16}}
\newcommand{\OLDNAME}{{\tt 31DEC15}}

%macros and title page format for the \AIPS\ letter.
\input LET98.MAC
%\input psfig

\newcommand{\MYSpace}{-11pt}

\normalstyle

\section{Happy 37$^{\rm th}$ birthday \AIPS}

\subsection{\Aipsletter\ publication}

We have discontinued paper copies of the \Aipsletter\ other than for
libraries and NRAO staff.  The \Aipsletter\ will be available in
PostScript and pdf forms as always from the web site listed above.
New issues will be announced in the NRAO eNews mailing and on the
bananas list server.

\subsection{Current and future releases}

We have formal \AIPS\ releases on an annual basis.  While all
architectures can do a full installation from the source files,
Linux (32- and 64-bit), Solaris, and MacIntosh OS/X (PPC and Intel)
systems may install binary versions of recent releases.  The last,
``frozen'' release is called \OLDNAME\ while \RELEASENAME\ remains
under active development.  You may fetch and install a copy of these
versions at any time using {\it anonymous} {\tt ftp} for source-only
copies and {\tt rsync} for binary copies.  This \Aipsletter\ is
intended to advise you of improvements to date in \RELEASENAME\@.
Having fetched \RELEASENAME, you may update your installation whenever
you want by running the so-called ``Midnight Job'' (MNJ) which copies
and compiles the code selectively based on the changes and
compilations we have done.  The MNJ will also update sites that have
done a binary installation.  There is a guide to the install script
and an \AIPS\ Manager FAQ page on the \AIPS\ web site.

The MNJ for binary versions of \AIPS\ now uses solely the tool {\tt
  rsync} as does the initial installation.  For locally compiled
(``text'') installations, the Unix tool {\tt cvs} running with
anonymous ftp is used for the MNJ\@. Linux sites will almost
certainly have {\tt cvs} installed; but other sites may have to
install it from the web.  Secondary MNJs will still be possible using
{\tt ssh} or {\tt rcp} or NFS as with previous releases.  We have
found that {\tt cvs} works very well, although it has one quirk. If a
site modifies a file locally, but in an \AIPS-standard directory,
{\tt cvs} will detect the modification and attempt to reconcile the
local version with the NRAO-supplied version.  This usually produces a
file that will not compile or run as intended.  Use a copy of the task
and its help file in a private disk area instead.

\AIPS\ is now copyright \copyright\ 1995 through 2016 by Associated
Universities, Inc., NRAO's parent corporation, but may be made freely
available under the terms of the Free Software Foundation's General
Public License (GPL)\@.  This means that User Agreements are no longer
required, that \AIPS\ may be obtained via anonymous ftp without
contacting NRAO, and that the software may be redistributed (and/or
modified), under certain conditions.  The full text of the GPL can be
found in the \texttt{15JUL95} \Aipsletter, in each copy of \AIPS\
releases, and on the web at {\tt http://www.aips.nrao.edu/COPYING}.


\section{Improvements of interest in \RELEASENAME}

We expect to continue publishing the \Aipsletter\ approximately every
six months, but the publication is now primarily electronic.  There
have been several significant changes in \RELEASENAME\ in the last six
months.  Some of these were in the nature of bug fixes which were
applied to \OLDNAME\ before and after it was frozen.  If you are
running \OLDNAME, be sure that it is up to date; pay attention to the
patches and run a MNJ any time a patch relevant to you appears.  The
``Midnight Job'' was changed so that binary installations are no
longer required to use the {\tt cvs} tool.  Only {\tt rsync} is used
by default, although {\tt cvs} may be requested.  New tasks in
\RELEASENAME\ include {\tt TVSPC} to review the contents of spectral
cubes interactively, {\tt SLPRT} to print the contents of slice
files, and {\tt UVGIT} to fit models to $uv$ data.  The new verb {\tt
  DAYNUMBR} returns the day number in the year of the observation of
the cataloged file.

Tasks in preparation at the moment include an interactive $uv$ editor
much like {\tt EDITA} but using bandpass tables called {\tt BPEDT}\@.
VLBI correlators are now capable of producing numerous pulse cals per
spectral window.  Tasks to edit these tables interactively and to use
them for delay and phase calibration are in the planning stage.  The
old computer used to prepare the binaries for Mac OS/X will soon be
replaced.  It will have to run OS version El Capitan (10.11) but the
load modules will be prepared on a virtual machine of some,
yet-to-be-determined older version, probably 10.8.

{\tt 31DEC14} contains a change to the ``standard'' random parameters
in $uv$ data and adds columns to the {\tt SN} table.  Note, however,
that the random parameters written to FITS files have not been changed.
Older releases of \AIPS\ cannot handle the new {\it internal} $uv$
format and might be confused by the {\tt SN} table as well.  {\tt
  31DEC09} contains a significant change in the format of the antenna
files, which will cause older releases to do wrong things to data
touched by {\tt 31DEC09} and later releases.  You are encouraged to
use a relatively recent version of \AIPS, whilst those with recent VLA
data to reduce should get release \OLDNAME\ or, preferably, the latest
release.

\subsection{Analysis}

{\tt TVSPC} is a powerful new task to help you discover the contents
of your data cubes.  It takes as inputs one or two data cubes plus a
single plane image that is meaningful in the context of the cubes.
That plane image could be a moment zero image, a continuum image, a
total polarization image, or any other that has meaning to the user.
The image is displayed on the TV and a menu offers the option to
display spectra.  When invoked, the TV cursor on the 2-D image selects
a pixel in the cube and the spectrum at that pixel is displayed.  This
option is highly interactive, allowing you to explore quickly the
spectra throughout the cube.  A second cube may be explored
simultaneously when appropriate, such as in Zeeman observations (cubes
of I and V polarization) or rotation measure observations (cubes of Q
and U polarizations).  Spectra so displayed may be fit with Gaussians
and saved as slice files.

This task should make it easier to use the relatively new model
fitting tasks {\tt XGAUS}, {\tt RMFIT}, and {\tt ZEMAN}\@.  Advance
knowledge of the spectral structure of the cube can inform you about
how to divide up the fitting problem.  As with the fitting tasks, an
\AIPS\ Memo (number 120) has been written to detail the inputs and
functions of {\tt TVSPC}\@.

\begin{description}
\myitem{SLPRT} is a new task to print the contents of slice files
    including the model fit (if any).
\myitem{UVGIT} is a new task to fit models to visibility data.  It is
    a version of {\tt UVFIT} which employs a different mathematical
    fitting process and hence may converge when {\tt UVFIT} does not.
\myitem{UVMOD} now has a more clearly defined meaning for the {\tt
    FLUX} adverb setting the noise to be added.  Now, when the
    original data are omitted ({\tt FACTOR=0}), {\tt FLUX} is simply
    the noise level in Jy.
\myitem{TRANS} was altered to be more forgiving when parsing adverb
    {\tt TRANSCOD} while adding checks to make sure the transposition
    is specified fully and correctly.
\myitem{STARS} was enhanced to allow star positions in the form of
    {\tt RASHIFT}s and {\tt DECSHIFT}s.
\myitem{MFPRT} was changed to honor the adverb {\tt DOHMS} and to give
    it an added value meaning the shifts for the new option in {\tt
      STARS}\@.  It was also changed to use the component offsets to
    find the component pixel, a change that should make it immune to
    changes in image and cell size.
\end{description}

\subsection{UV-data}

\begin{description}
\myitem{FRING} was changed to solve for delays in more than one group
    of IFs while also solving for dispersion.
\myitem{PCAL} was corrected for an error in picking up the new antenna
    parameters.  It was changed to treat an absence of model at some
    time as a warning when the weight is zero and to avoid losing the
    ionospheric calibration data when doing the spectral mode.
\myitem{UVFIX} was corrected to compute $uvw$ in wavelengths at the
    header frequency rather than the actual observed frequency.
\myitem{RFLAG} now supports data pre-averaging with the {\tt YINC}
    adverb.
\myitem{TYAPL} now offers the option to flag {\tt SY}, {\tt TY}, and
    {\tt SN} tables when applying flags to the $uv$ data.
\myitem{TVFLG,} {\tt SPFLG}, and {\tt FTFLG} can now do all four
    polarizations on one execution if {\tt STOKES = 'FULL'}.
\myitem{EDITA,} {\tt EDITR}, and {\tt SNEDT} were corrected to take
    {\tt BIF} into account when doing 3-color plots and to use a
    better coloring when 2 polarizations are plotted with only one IF.
    They were corrected to handle source number zero from tables and
    to do a more reasonable expansion of times when writing flags.
\myitem{APCAL} was corrected to check gain table record differences
    correctly.
\myitem{DBCON} was corrected to stop re-instating flagged table rows.
\myitem{RLDLY} was corrected to write a new {\tt SN} table always.
\myitem{UVFLG} was changed to offer an option for the input text file
    that defines a frequency range to flag.  This will allow text
    files to be prepared for known RFI frequencies and then used with
    more than one $uv$ file.
\myitem{PBEAM} was changed to display {\tt IRING}-like plots of the
    beam data and model including differences and to print the fits
    in greater detail.
\end{description}

\subsection{Imaging}

There are users who wish to do self-calibration in \AIPS\ who have
source models (with or without spectral index) in the form of large
images.  The task {\tt IM2CC} was written some time ago to break the
model image into suitable facets with Clean Component files containing
all pixels above some specified level.  During the reporting period,
this task was revised to write only those facets with actual Clean
Components.  A procedure called {\tt IMSCAL} was written as part of
the {\tt OOCAL} {\tt RUN} file to execute {\tt IM2CC}, followed by
{\tt OOCAL}, and finally followed by a clean-up step.  {\tt OOCAL}
uses {\tt OOSUB} to divide the calibrator data by the model including
spectral index and then to run {\tt CALIB} on the divided data set,
finally copying the resulting {\tt SN} table to the input $uv$ file.

Tests of {\tt IMSCAL} revealed that the implementation of the model
division needed some generalizations.  The primary beam and spectral
index routines now read the spectral index image(s) into memory to
improve performance.  The routines also needed to be informed about
which frequencies were used in the model and in the spectral index
image.  In {\tt IMAGR} bandwidth synthesis, all frequencies enter into
the model and this is used to scale each component to the averaged
component value.  In {\tt IMSCAL}, however, the model is usually
computed for a specific frequency (or group of frequencies).

{\tt IMAGR} was corrected for an error which affected auto-boxing when
the $y$ image dimension was less than the $x$ dimension.  Components
would only be found on the left-hand side of the image.

Rick Perley has re-measured the primary beam patterns of the VLA
antennas at all bands and documented them in EVLA Memo 195.  He finds
that the new beam parameters depend on band but also on frequency
within the band.  This has been implemented in the {\tt PBCALC}
subroutine used extensively throughout \AIPS\@.  {\tt PATGN} was given
a new option to help select which primary beam is desired.  Tasks
which use this routine range from {\tt PBCOR} and {\tt FLATN} to model
fitting ({\tt SAD}, {\tt JMFIT}, {\tt IMFIT}, {\tt TVSAD}, {\tt
  SPIXR}) to moment fitting {\tt XMOM}, {\tt MOMNT}) to facet
preparation ({\tt BOXES}, {\tt FACES}, {\tt SETFC}) and to imaging
({\tt IMAGR}, {\tt OOSUB})\@.

\subsection{General}

Because of repeated unfortunate experiences, almost all \AIPS\ tasks
which are capable of printing directly to a line printer have been
changed.  They now determine how many lines will be printed before
printing any and require permission from the user to proceed if the
line count exceeds 500.  This means that print tasks resume {\tt AIPS}
promptly only when {\tt DOCRT $\leq 0$}, {\tt OUTPRINT} is not blank,
and, of course, {\tt DOWAIT} is false.

There really is no reason to require the ``Midnight Jobs'' of binary
installations to use {\tt cvs}.  The MNJ scripts have been changed to
use {\tt rsync} not just for binary files, but also for text files
including both source code and documentation.  The {\tt cvs} package
is no longer required for binary installations although it is used for
text installations.

The \Cookbook\ was updated to include {\tt TVSPC} and to overhaul the
low-frequency Appendix L\@.  The latter still needs further
improvements.  The FITS reading tasks {\tt IMLOD} and {\tt FITTP} were
changed to be able to read a file containing only a table.  Source
catalogs are frequently available in this form.  They often contain a
large number of columns.  \AIPS\ will read the first 127 columns
only.  A new verb {\tt DAYNUMBR} was written to return the day number
within the year corresponding to the observation date in a cataloged
$uv$ data set or image.

\section{Patch Distribution for \OLDNAME}

Important bug fixes and selected improvements in \OLDNAME\ can be
downloaded via the MNJ or from the Web beginning at:
\hspace{3em}{\tt http://www.aoc.nrao.edu/aips/patch.html}\\
Alternatively one can use {\it anonymous} \ftp\ to the NRAO server
{\tt ftp.aoc.nrao.edu}.  Documentation about patches to a release is
placed on this site at {\tt pub/software/aips/}{\it release-name} and
the code is placed in suitable sub-directories below this.  As bugs in
\NEWNAME\ are found, they are simply corrected since \NEWNAME\ remains
under development.  Corrections and additions are made with a midnight
job rather than with manual patches.  Because of the many binary
installations, we now actually patch the master version of \OLDNAME,
meaning that a MNJ run on \OLDNAME\ after the patch will fetch the
corrected code and/or binaries rather than failing.  Also,
installations of \OLDNAME\ after the patch date will contain the
corrected code.  The \OLDNAME\ release has had a number of important
patches:
\begin{enumerate}
   \item\ {\tt GC} table used to allow 200 values in the gain curve;
     restore this limit. {\it 2016-01-07, 2016-01-15}
   \item\ {\tt PBEAM} scaled Stokes I data incorrectly when adding
     right and left data files. {\it 2016-01-12}
   \item\ {\tt DBCON} re-instated flagged table rows. {\it 2016-01-28}
   \item\ {\tt DTSUM} did not handle the new internal UV format
     correctly. {\it 2016-02-09}
   \item\ {\tt PCAL} typo caused errors in antennas used with the new
     {\tt ANTENNA1}, {\tt ANTENNA2} format. {\it 2016-04-15}
   \item\ {\tt PCAL} lost Faraday Rotation calibration when doing
       {\tt SPECTRAL} solutions. {\it 2016-04-29}
   \item\ {\tt IMAGR} found automatic boxes in only part of the image
       when {\tt IMSIZE(2) < IMSIZE(1)}\@. {\it 2016-05-10}
   \item\ {\tt OOP} editing had trouble with source number zero
     sometimes found in tables. {\it 2016-05-19}
   \item\ {\tt UVFIX} used the actual observing frequency rather than
     the one in the header to scale $uvw$. {\it 2016-06-20}
   \item\ {\tt OOSUB} and other model subtraction/division could get
     the scaling between frequency channels wrong. {\it 2016-06-24}
\end{enumerate}
\eject

\section{\AIPS\ Distribution}

We are now able to log apparent MNJ accesses and downloads of the tar
balls.  We count these by unique IP address.  Since some systems
assign the same computer different IP addresses at different times,
this will be a bit of an over-estimate of actual sites/computers.
However, a single IP address is often used to provide \AIPS\ to a
number of computers, so these numbers are probably an under-estimate
of the number of computers running current versions of \AIPS\@. In
2016, there have been a total of 546 IP addresses so far that have
accessed the NRAO cvs master.  Each of these has at least installed
\AIPS\@.  During 2016 more than 159 IP addresses have downloaded the
frozen form of \OLDNAME, while more than 507 IP addresses have
downloaded \RELEASENAME\@.  The binary version was accessed for
installation or MNJs by 274 sites in \OLDNAME\ and 462 sites in
\RELEASENAME\@.  A total of 863 different IP addresses have appeared
in one of our transaction log files.  These numbers are significantly
lower than last year.

\centerline{\resizebox{!}{4.25in}{\includegraphics{FIG/PLOTIT16a.PS}}}

\section{Recent \AIPS\ Memoranda}

All \AIPS\ Memoranda are available from the \AIPS\ home page.  \AIPS\
Memo 120 describing the new \AIPS\ task {\tt TVSPC} has appeared.

\begin{tabular}{lp{5.8in}}
{\bf 120} & {\bf Exploring Image Cubes in \AIPS}\\
   &  Eric W. Greisen, NRAO\\
   &  January 22, 2016\\
   &  \AIPS\ has recently acquired powerful tasks to fit models to the
      spectral axis of image cubes.  These tasks are easier to run if
      the user is already familiar with the general structure of the
      data cube.  A new task {\tt TVSPC} has been written to assist in
      acquiring this familiarity.  This task provides an exploration
      tool within the \AIPS\ environment, rather than requiring users
      to export their cubes to one or more of the many excellent
      visualization tools now available.
\end{tabular}
\vfill\eject

% mailer page
% \cleardoublepage
\pagestyle{empty}
 \vbox to 4.4in{
  \vspace{12pt}
%  \vfill
\centerline{\resizebox{!}{3.2in}{\includegraphics{FIG/Mandrill.eps}}}
%  \centerline{\rotatebox{-90}{\resizebox{!}{3.5in}{%
%  \includegraphics{FIG/Mandrill.color.plt}}}}
  \vspace{12pt}
  \centerline{{\huge \tt \AIPRELEASE}}
  \vspace{12pt}
  \vfill}
\phantom{...}
\centerline{\resizebox{!}{!}{\includegraphics{FIG/AIPSLETS.PS}}}

\end{document}
