%-----------------------------------------------------------------------
%;  Copyright (C) 2020
%;  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 30 June 2020 version

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

\newcommand{\AIPRELEASE}{June 30, 2020}
\newcommand{\AIPVOLUME}{Volume XL}
\newcommand{\AIPNUMBER}{Number 1}
\newcommand{\RELEASENAME}{{\tt 31DEC20}}
\newcommand{\NEWNAME}{{\tt 31DEC20}}
\newcommand{\OLDNAME}{{\tt 31DEC19}}

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

\newcommand{\MYSpace}{-11pt}

\normalstyle

\section{Happy 41$^{\rm st}$ birthday \AIPS\ and FITS, COVID-19}

The FITS format was devised in a meeting at the VLA site on March 27
and 28, 1979.  Don Wells (then of NOAO) and Eric Greisen (still of
NRAO) were the primary authors while Barry Clark and other NRAO staff
members provided valuable suggestions.  The FITS format, enhanced by
later extensions, is still in wide spread use in astronomy and is the
envy of other scientific fields.  Then the FITS format colored the
design of the \AIPS\ internal formats.  The \AIPS\ project was begun
officially on July 1, 1979 and has stood the test of time remarkably
well.

Due to the outbreak of the COVID-19 pandemic, the NRAO went to
``infectious disease operating status'' on March 16, 2020.  Telescope
operations (other than ALMA) continued with a skeleton support staff.
The rest of us were expected to work as best we could from home.  On
June 8 we began the first steps to return to the new normal.  Primarily,
this means that those employees who could not do their jobs properly
from home have returned to work with numerous safety precautions.  Those
of us who can work from home will continue to do so indefinitely.

This status means that your editor does find times when he would like
interesting things to do.  If you find any problems with \AIPS\ or have
any suggestions for new or improved functions, please do not hesitate to
e-mail me.

\subsection{\Aipsletter\ publication}

We have discontinued paper copies of the \Aipsletter\ entirely, at least
for this issue.  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 and mnj 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), and MacIntosh OS/X (Intel) systems may install
binary versions of recent releases.  Binary versions for Solaris and
MacIntosh (PPC) are available for the {\tt 31DEC17} release but not
for later 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.  For local versions,
use a copy of the task and its help file in a private disk area
instead.

\AIPS\ is now copyright \copyright\ 1995 through 2020 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.
There are six new tasks in \RELEASENAME.  They are {\tt UVRMS} to
compute statistics on a time series of selected averaged visibility
data, {\tt SPRMS} to plot the spectra of mean and standard deviation of
selected visibility data, {\tt MOD3D} to convert a set of facets' Clean
Component files into a single ``3-dimensional'' {\tt CC} table,  {\tt
  PDPLT} to plot polarization D-term spectra from multiple antennas
and/or data sets, {\tt DENAN} to report and remove NaNs from data sets,
{\tt MTARS} to compute rotation measure models for input to {\tt TARS}
(the test task for {\tt FARS}), and {\tt RMTFC} to plot the convolution
of the complex rotation measure transfer function with various RM
thickness models.  Further enhancements to rotation-measure analysis and
another task to print {\tt SY} table data are on the near horizon.

{\tt 31DEC20} contains a change to the TV display program {\tt XAS} that
makes it incompatible with previous releases when characters are
displayed.  {\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{UV-data}

\subsubsection{{\tt RLDLY}}

A serious error was found that has been in the code since March 2015!
If the visibility data were described with the ``new'' random parameters
{\tt ANTENNA1}, {\tt ANTENNA2}, and {\tt SUBARRAY} rather than the older
compound {\tt BASELINE}. then the only data used in the solution were
those in which the reference antenna was the higher numbered.  Thus
reference antenna 1 would never have data.  Since {\tt RLDLY} can
combine data from all baselines to the reference antenna, this bug
caused it to omit anywhere from all to none of the desired data
depending on the reference antenna number.  {\tt RLDLY} worked fine for
any old format data sets, but, by now, they are no longer common.

\subsubsection{{\tt UVFIX}}

The differential aberration correction requires the comparison of the
apparent position of the source to the apparent position of a point 10
asec North.  Since we treat the apparent position as fixed during the
run (it actually isn't), we need to do this comparison only once at the
same time that we compute the source apparent position.  In {\tt
  31DEC18} and previous, this was done but only for the first source
(with the result used for all sources).  In {\tt 31DEC19} and {\tt
  31DEC20}, the comparison was recomputed every time a source changed
which put a time change in the offset position but not the reference
position.  This made the correction a (false) function of time.
Furthermore, when the input file was in B1950, the {\tt EPOCH} variable
did not stay at 2000 for this comparison.  This could make the aberration
correction a factor of ~200 rather than 0.99992!  All these issues have
been corrected with the aberration correction now a function of source
but not time (except for planets).

\subsubsection{Calibration models}

Some model images of the standard calibration sources with Clean
Component tables are shipped with \AIPS\@.  Rick Perley has, however, a
very large set of such models for more sources and with better frequency
discrimination.  Access to these, from Rick's web sites, has been added.
Verb {\tt CALDIR} will list them and {\tt CALRD} will load them into
your data catalog.

Models for known sources scale the source-table fluxes by the flux found
within a central circle, ignoring Clean components outside.  That circle
was too small and has been increased a bit.  New sources, suitable for
calibration at low frequencies, were added to this algorithm (3C123,
3C196, 3C295, and 3C380).

Models at low frequency require making images over a rather wide field.
In \AIPS\ this is done with multiple overlapping facets.  If one has all
the facets and their ``2-dimensional'' {\tt CC} tables, the modeling
routines use the facet coordinates to compute a correct model for the
data.  Shipping a large number of facets is however prohibitive.
Therefore a new task {\tt MOD3D} was written.  It does the conversion of
the ``2-D'' tables into the ``3-D'' form needed by the modeling code and
then writes a ``3-dimensional'' {\tt CC} table.  All \AIPS\ use of these
tables was modified to handle the multiple formats that now arise.

\subsubsection{Miscellaneous}

\begin{description}
\myitem{CLCOR} got confused on {\tt OPCODE = 'EOPS'} when the input {\tt
          CT} table had multiple nearly identical entries.  This arises
          when {\tt FITLD} concatenates multiple data sets.  A simple
          fix allows this identical groups case to work along with the
          more complex cases with non-identical groups.
\myitem{The} header for visibility data now keeps track of the
          application of calibration ({\tt DOCAL}, {\tt DOBAND}, and
          {\tt DOPOL}).  This information will be displayed by {\tt
            IMHEADER} and is used to decide if warnings about a lack
          of polarization calibration are appropriate.
\myitem{CLIP} now reports the fraction of data flagged for each IF and
          polarization.  The counts of flagged cross-hand polarizations
          were corrected.
\myitem{EDITR} and other interactive editing tasks were changed to
          allow the user to enter only those values needed rather than
          requiring the maximum number of values at all times.
\myitem{BPEDT} was given the option to set the initial plot ranges when
          starting up.
\myitem{ELINT} was given the options to color the symbols by source, to
          plot all the data (not just that time range used to in the
          fitting), and to control the plot range.
\myitem{DENAN} is a new task to replace NaNs (if any) in a data set with
          zeros.
\myitem{EVAUV} was corrected to take into account changes made to lower
          level Q routines last year.
\myitem{UVHOL} was given the option to fit the peak and the sidelobes on
          each side and then to display the fit values and their ratio.
\myitem{PRTSY} was changed to sort both new and old format {\tt SY}
          tables correctly.
\end{description}

\subsection{VLBI}

\begin{description}
\myitem{APCAL} now appends new solutions to a pre-existing {\tt SN}
          table rather than replacing such tables.  A new {\tt PLOT
            OPCODE} is available to plot the model in {\tt TRECVR} and
          {\tt TAU0} with no model fitting.
\myitem{DELZN} was changed to pass its reference date to {\tt CLCOR} in
           case the reference date of the data set is different.
\end{description}

\subsection{Display and analysis}

\subsubsection{{\tt XAS} and new tasks}

The TV server program was changed to allow an intensity value when
writing characters to the display.  This enables the use of color in
standard plot characters through a new subroutine ({\tt G3CHAR})\@.
The new task {\tt PDPLT} uses this capability.  It over-plots spectra of
polarization D terms from multiple antennas and up to four different
data sets.  Color is used to distinguish antennas and data sets and
a plot label shows the colors used for each antenna.  {\tt PDPLT} is
being used to study the polarization characteristics of the VLA's
receivers.

New task {\tt UVRMS} averages selected visibility data in a sequence of
time intervals.  It then conducts a statistical analysis of the time
sequence, printing mean, standard deviation, median, first and third
quartiles, median absolute deviation, maximum, minimum, and more.  In
order to determine whether these statistics are valid, the task offers
the option to plot a histogram of the data and to plot the values as a
function of time.  A companion task {\tt SPRMS} has also been written.
It does a similar average to that in {\tt UVRMS} but keeps spectral
channels and IFs separate.  It then makes spectral plots of the mean and
standard deviation.

\subsubsection{{\tt XGAUS} and friends}

{\tt XGAUS}, {\tt ZEMAN}, {\tt RMFIT}, {\tt AGAUS} and {\tt ZAMAN}
received a variety of mostly minor improvements.  In the edit window,
which appears after the initial fitting of the models to the spectra,
the type and extrema of any displayed image are shown in the header to
the menu.  That menu now includes an option to {\tt RESET WINDOW} to
change the image display to its maximum extent and the option {\tt LABEL
WEDGE?} to turn on/off intensity labeling of the step wedge.  In model
fitting, the initial guess is now limited to those components that were
fit in the previous spectrum.  This saves work constantly telling the
task not to fit one or more components when that is appropriate.  This
is particularly important in {\tt ZEMAN} when using the Gaussian model.
Numerous other minor bugs and features were addressed.  The new menu
appearance was documented in revised versions of \AIPS\ Memos 118 and
122.

\subsubsection{Miscellaneous}

\begin{description}
\myitem{KNTR} and {\tt PCNTR} now have the adverb {\tt PVPLOT} to
          request a plot of a polarization vector within a box
          located in one of the corners.  The length of this vector in
          Jy/beam appears in one of the plot label lines.
\myitem{EXTLIST} lists the contents of extension files in some detail.
          It was updated for changes in some plot tasks and to add tasks
          that were missing including the new plot tasks.
\myitem{PLGET} is a verb that will get the adverbs used to make a
          particular plot file.  It was updated for missing and new
          tasks and changes in older ones.
\myitem{CLPLT} and {\tt CAPLT} were corrected to work when there is only
          one sample.  They now include the model when setting the
          default plot range.
\myitem{TARPL} was changed to plot the input files to {\tt TARS} as well
          as the outut files.
\myitem{MTARS} is a new task similar to {\tt MODIM} to compute models of
          polarization in a form suitable for input to {\tt TARS}, the
          Faraday rotation measure synthesis test task.
\myitem{RMTFC} is a new task to convolve the (complex) rotation measure
          transfer function with various simple models of RM thickness.
\end{description}

\subsection{General}

\begin{description}
\myitem{Compilation} \hspace{2em} procedures were changed to avoid an
         issue that prevented the compilation of {\tt XAS} during
         installation.
\myitem{fix\_aips\_elcap} \hspace{2em} was renamed and {\tt install.pl}
         changed since Mac users often thought that the fix applied only
         to the El Capitan (10.11) version of the operating system.
         It applies to all versions $\geq 10.11$.
\myitem{Help} files were written for adverbs that lacked same.
         Further improvements to adverb help files are in progress.
\myitem{\Cookbook} updates were made for the new calibration models
         and new tasks as well as other changes described above.
\end{description}

\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 patches:
\begin{enumerate}
  \item\ {\tt BPASS} had a bad call sequence causing aborts. {\it
    2020-01-22} 
  \item\ {\tt FACSET} did not include all the flux of standard
    calibration source models. {\it 2020-01-27}
  \item\ {\tt UVFIX} did not compute the aberration correction properly,
    especially when converting from B1950 to J2000.  {\it 2020-02-28} 
  \item\ {\tt EVAUV} did not compute the DFT subtraction model
    correctly, aborting due to a call sequence error.  {\it 2020-03-02} 
  \item\ {\tt RENUMBER} aborted if the catalog file required expansion.
    {\it 2020-03-03}
  \item\ {\tt CLIP} over counted cross-hand flags when cross-hands are
    flagged because of parallel hands.  {\it 2020-03-25} 
  \item\ {\tt CLPLT, CAPLT} died when trying to self-scale plots with
    only one point. {\it 2020-04-07}  
  \item\ {\tt VLBAUTIL}had an error when trying to use curl to fetch
    the EOP file.  {\it 2020-04-21}
  \item\ {\tt VLBARUN} had 2 errors when trying {\tt DOPLOT=2}  to
    make a very large number of plots.  {\it 2020-05-07} 
  \item\ {\tt RLDLY} had an error when selecting data.  {\it
    2020-06-10} 
  \item\ {\tt PRTSY} sorted on the wrong column when {\tt OPCODE} was
    set.  {\it 2020-06-12}
  \item\ {\tt CLCOR}  got confused on {\tt EOPS} when the {\tt CT}
    table had multiple nearly identical entries. {\it 2020-06-19} 
  \item\ {\tt OMFIT} had 3 {\tt FORMAT} statements that were improper
    when writing to character string variables. {\it 2020-06-29} 
\end{enumerate}
\vfill\eject

\section{Recent \AIPS\ Memoranda}

All \AIPS\ Memoranda are available from the \AIPS\ home page.  \AIPS\
Memo 117 was revised to describe changes to the Clean Components table,
Memos 118 and 122 were revised to show new interactive options in the
edit stage of operation.

\begin{tabular}{lp{5.8in}}
{\bf 117} & {\bf \AIPS\ FITS File Format}\\
   &  Eric W. Greisen, NRAO\\
   &  March 12, 2020 revision\\
   &  \AIPS\ has been writing images and $uv$ data in FITS-format files
  for a very long time.  While these files have been used widely in
  the community, there is a perception that a detailed document in
  still required.  This memo is an attempt to meet that perception.
  \AIPS\ FITS files for $uv$ are conventions layered upon the standard
  FITS format to assist in the interchange of data recorded by
  interferometric telescopes, particularly by radio telescopes such as
  the EVLA and VLBA\@.
\end{tabular}

\begin{tabular}{lp{5.8in}}
{\bf 118} & {\bf Modeling Spectral Cubes in \AIPS}\\
   &  Eric W. Greisen, NRAO\\
   &  May 6, 2020 revision\\
   &  \AIPS\ has done Gaussian fitting along the $x$-axis of image cubes
  with task {\tt XGAUS} since the 1980s.  That task has recently been
  overhauled to be much easier to use and much more capable.  In like
  fashion, new tasks {\tt ZEMAN} and {\tt RMFIT} have been developed.
  The former fits the standard leakage and scaling terms for Stokes V
  cubes, including a new option to do this for each of the Gaussians
  found by {\tt XGAUS}\@.  The latter fits polarization models to
  Stokes Q and U cubes, using the output of Faraday Rotation Measure
  Synthesis (\AIPS\ task {\tt FARS}) to assist with initial guesses.
  The models can contain multiple components each with a polarization
  flux, angle, rotation measure, and rotation measure ``thickness.''
  The present memo will describe the functions of these tasks in some
  detail with numerous graphical examples.  A revision of this memo
  discusses changes made for the {\tt 31DEC15} release and two new
  tasks to plot spectra with model fits and a number of tasks which
  make visibility and image model files.  The November 2017 revision
  includes new display options in {\tt RMFIT}\@.

\end{tabular}

\begin{tabular}{lp{5.8in}}
{\bf 122} & {\bf Modeling Absorption-line Cubes in \AIPS}\\
   &  Eric W. Greisen, NRAO\\
   &  May 6, 2020 revision\\
   &  \AIPS\ does Gaussian fitting of spectral lines with
  recently-overhauled task {\tt XGAUS} and can fit V polarization
  image cubes for Zeeman-splitting with the relatively new task
  {\tt ZEMAN}\@.  Both of these tasks are designed for emission
  spectra in which the noise is not a function of spectral channel.
  In absorption, however, the noise in optical depth becomes high when
  the optical depth is high.  Therefore, new tasks {\tt AGAUS} and
  {\tt ZAMAN} have been written to provide similar functions but with
  mathematics suitable for absorption lines.  This memo describes the
  new tasks in some detail and includes a description of a new,
  simplified modeling task {\tt MODAB} which may also be useful.
  That task has shown that the results of these four tasks are biased
  by the presence of the Zeeman splitting and need modest correction
  if they are meant to describe the actual pre-splitting line widths
  and magnetic field.
\end{tabular}

\vfill\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\@.  So
far in 2020 more than 278 IP addresses have downloaded the frozen form
of \OLDNAME, while more than 481 IP addresses have downloaded
\RELEASENAME\@.  A total of 736 different IP addresses have appeared in
one of our transaction log files.  These numbers are noticeably higher
than those of last year at this time.

\centerline{\resizebox{!}{4.5in}{\includegraphics{FIG/Plot1920a.eps}}}

\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}
