%-----------------------------------------------------------------------
%;  Copyright (C) 2023
%;  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 2023 version

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

\newcommand{\AIPRELEASE}{June 30, 2023}
\newcommand{\AIPVOLUME}{Volume XLIII}
\newcommand{\AIPNUMBER}{Number 1}
\newcommand{\RELEASENAME}{{\tt 31DEC23}}
\newcommand{\NEWNAME}{{\tt 31DEC23}}
\newcommand{\OLDNAME}{{\tt 31DEC22}}
\newcommand{\THISYEAR}{2023}
\newcommand{\NEWYEAR}{2024}
\newcommand{\OLDYEAR}{2022}

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

\newcommand{\MYSpace}{-11pt}

\normalstyle

\section{Happy 44$^{\rm th}$ birthday \AIPS\ and FITS}

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
the 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.  The FITS format then 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.

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 {\tt daip@nrao.edu}.

\subsection{\Aipsletter\ publication}

We have discontinued paper copies of the \Aipsletter\ entirely.  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 and ARM) systems
may install binary versions of recent releases.  The last, ``frozen''
(actually ``slushy'') 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
(``source'') 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.  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.

{\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
development release.

\AIPS\ is now copyright \copyright\ 1995 through \THISYEAR\ 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 are
nine new tasks in \RELEASENAME\@.  These are {\tt LISUN} which does a
{\tt LISTR OPTYPE 'SCAN'} listing with the addition of the angle from
each scan to the Sun, {\tt SNRMS} which does statistics on selected
columns in tables, {\tt BLPCL} which divides pre-computed full
polarization models into $uv$ data to determine a baseline-based
full polarization calibration, {\tt AVGWT} which computes the
average and rms weights of selected $uv$ data, {\tt SYFIX} which
corrects source numbers in the {\tt SY} table to match the $uv$ data,
{\tt BPPLT} which plots bandpass data as a function of time, {\tt TEPLT}
which plots the output table from {\tt TECOR}, {\tt MFIMG} which makes
images of \AIPS' magnetic field models and of TEC data downloaded for use
with {\tt TECOR}, and {\tt AMKAT} which changes antenna numbers in
MeerKAT data files to match the station numbers.  A new procedure, {\tt
  BLPOLCAL} implements a baseline-based calibration for polarization
data.  Numerous bug fixes and minor improvements have also been made.
Tests have confirmed that \AIPS\ works fine on computers with Apple's
new M2 version of the ARM chip using binaries computed on our M1 Mac
mini.  The performance is similar to the M1 chip, but that is very
good.

\subsection{Polarization}

The calibration of polarization received a lot of attention in this
6-month period.  It was realized that one must not apply second-order
D terms to the parallel polarizations if those D terms had not been used
when the parallel-hand gain calibrations were determined.  Doing this
correctly by measuring the D terms at the same time as the instrumental
gains are determined is beyond the scope of the current software.

Ionospheric Faraday rotation (``IFR'') is computed by {\tt TECOR} from
data of the total electron content (``TEC'') as provided by the cddis
data center run by Goddard Space Flight Center.  A bug in this task was
discovered that caused it to compute the location of the ionospheric
pierce point (of the line of sight to the source) incorrectly, with an
abrupt jump at zero hour angle.  {\tt TECOR} was changed thereafter to
write a {\tt TE} table containing all of the various parameters used in
computing the IFR and task {\tt TEPLT} was created to plot a selection
of these parameters as a function of time.

One of the important contributors to the computation of the IFR is the
model of the Earth's magnetic field.  \AIPS\ has had a simplified model
for some time.  A new time-dependent model was downloaded from {\tt
  ngdc.nasa.gov}, conveniently provided in Fortran.  After modification
to meet \AIPS\ software standards and the requirements of gfortran 11,
this model was added as an option in {\tt TECOR}\@.  The two models do
not differ a lot in the Northern Hemisphere, but are seriously different
for Southern observatories such as MeerKAT\@.  {\tt MFIMG} was written
to make global images of the two models. It also makes an image cube
from the TEC found in the data file downloaded for {\tt TECOR} with time
as the third axis.

Leonid Petrov (AJ, 2023 April, 165:188) has proposed a modification of
the formul\ae\ used in {\tt TECOR}\@.  Extensive tests of the current
{\tt TECOR} have been made on the numerous flux density data sets taken
over many years at L-band.  These data had IFRs up to 5 or more
radians/meter squared and appear to show that {\tt TECOR}'s IFR is
nearly correct without the approximately 15 per cent change suggested by
Petrov.  Further tests, including P band, are being made however.  The
procedures {\tt VLATECR} and {\tt VLBATECR}, found in {\tt RUN} files
{\tt VLAPROCS} and {\tt VLBAUTIL}, respectively, were upgraded to make
the new {\tt TECOR} options available.

The calibration of linear polarization was also changed significantly.
The parallactic angle and IFR were only applied to the data when the
visibilities were converted to true Stokes.  Unlike with circular
polarization, the observed visibilities were left in the antenna frame
rather than the sky frame even when {\tt DOPOL} was applied.  This has
changed.  The polarization application has become rather more
complicated, involving parallactic angles, IFRs, and a 4x4 matrix
multiplication,  so that the data are left in the sky frame.  Conversion
to true Stokes is then simple.  {\tt VHDIF} was modified to match this
change.

All of the studying of {\tt TECOR} has led to modest changes to the
formula for the polarization angle of 3C286 used by {\tt RLDIF}\@.
\[ \begin{array}{lllr}
     A = & 29.5 & \ & (F \leq\ 1.5 {\rm \ GHz}) \\
     A = & 32.6 - 7 / F^2 &\ & (1.5 < F \leq\ 10 {\rm \ GHz}) \\
     A = & 32.6 + 5.38 \times\ (\log_{10}(F) - 1.0) & & (10 < F \leq\ 45 {\rm \ GHz}) \\
     A = & 36.0 & & (F > 45 {\rm \ GHz})\\
   \end{array} \]


\subsection{UV data}

Interferometry correlators are very good, but slight imbalances may
remain.  Baseline-based calibration has been used to attempt to correct
for this issue.  While baseline-based calibration can force the data to
match {\it any} source model when done with a small {\tt SOLINT}, a much
less biased result may be had with a long integration time, typically
the full data set.  The continuum implementation of this is done by task
{\tt BLCAL} and the resulting {\tt BL} table factors are applied by the
standard calibration routines.  With the EVLA, however, it was
discovered that the calibration needs to be different for different
spectral channels, not just IFs.  Task {\tt BLCHN} can compute this
correction, writing both an output corrected data set and a {\tt BD}
table with the calibration values.  {\tt POSSM} and {\tt BPLOT} can plot
the {\tt BD} table and {\tt BDAPL} can apply it to another data set.

On the theory that correlators of cross-hand data, \eg\ RL, LR, VH, HV
visibilities also suffer from this issue, a new {\tt RUN} file named
{\tt BLPOLCAL} and task named {\tt BLPCL} were created.  The procedure
computes the model data sets matching the input data set from models of
I, Q, U, and, optionally, V Stokes.  The task then applies the models to
the input data and computes a full polarization {\tt BD} table and
writes out a corrected data set.  Initial tests on a high dynamic range
data set on 3C273 suggest that the data may be improved by this
function.

\begin{description}
\myitem{LISUN} is a new task which replicates the display of {\tt LISTR
        OPCODE = 'SCAN'} with the addition of the angle to the Sun for
        each scan.  It is a simpler means to this useful display but it
        does honor the {\tt SOURCES} and {\tt TIMERANG} adverbs, unlike
        {\tt LISTR}\@.
\myitem{CLIP} was given the option {\tt STOKES = 'PDIF'} to cause it to
        flag on the difference between the parallel-hand visibilities.
\myitem{FRING} has the option {\tt CHINC} to reduce the number of
        spectral channels and therefore the size of its computations.
        Procedure {\tt FINDCHIN} was added to return a recommended {\tt
          CHINC}.  It was then added to {\tt VLBARUN}, {\tt VLBAPCOR},
        {\tt VLBAFRNG}, {\tt VLBAFRGP}, and {\tt VLBAMPCL} as an option;
        {\tt CHINC = -1} requests the use of {\tt FINDCHIN}\@.
\myitem{FITLD} would sometimes make a mess of FITS IDI data when
        attempting to select only a range of IFs or spectral channels.
        An adjustment to the buffer handling corrected the problem.
\myitem{SPFLG} and {\tt FTFLG} were given a {\tt FLAG CHANNEL RANGE}
        option.
\myitem{UVFIX} was given the new {\tt SRCNAME} option to allow correcting
        the position of one source from a multi-source data set while
        computing $uvw$ for all sources.
\myitem{UVSUB} and {\tt OOSUB} were given the new option {\tt 'MODU'} to
        compute the source model for all visibility samples including
        those previously flagged.  Option {\tt 'MODL'} honors any
        flagging.  The handling of compressed data when computing models
        was corrected.
\myitem{SNRMS} is a new task to compute and display statistics of table
        data.  A wide range of tables and data types, similar to {\tt
          SNPLT}, are available.
\myitem{AVGWT} is a new task to display statistics about weights of
        selected $uv$ data.  Use it to help set {\tt DBCON} weights
        among other possible uses.
\myitem{UVADD} was changed to allow a spectral data set to be massaged
        by a continuum (single channel) data set.
\myitem{VBRFI} and {\tt VLBRF} were changed to also print and plot the
        actual rms as well as the rms divided by the mean.  {\tt PLRFI}
        and {\tt PRRFI} were changed to read both new and old format text
        files.  Plotting and labeling of the frequency axis were
        corrected.
\myitem{CLCOR} options {\tt 'ANTP'} and {\tt 'ANTC'} were changed so
        that the proper motion correction starts at the first time for
        the source rather than 0 hours on the start day.
\myitem{SYFIX} is a new task to correct the source numbers in {\tt SY}
        tables to match those in the data, a problem that arose with
        on-the-fly data.
\myitem{AMKAT} is a new task to renumber MeerKAT antennas to match their
        station numbers ($+1$), making a uniform nomenclature for all
        data sets.
\myitem{PP} table (output of {\tt RLDIF} and {\tt VHDIF}) copying was added
        to several tasks.
\end{description}

\subsection{Imaging and display}

The plot file format was changed to add a record following the adverb
values and preceding the plot instructions.  This record lists the
adverbs found in the {\tt INPUTS} section of the task help file.  The
sole use of this so far is for the verb {\tt PLGET} which fills in the
adverbs for the task that created the specified plot file.  With the
list of adverbs at the time of plot file creation, this function will
not suffer the confusion which previously arose whenever the task
adverbs were changed.  All \AIPS\ display tasks recognize both the old
and new formats.

{\tt POSSM} again received considerable attention in this period.  The
options {\tt POLPLOT = 'RMS'} or {\tt 'RMSN'} were added to have the rms
and rms divided by mean in each {\tt SOLINT} be plotted rather than the
mean.  It was changed to support multiple times in {\tt BD} tables from
{\tt BLCHN} and {\tt BLPCL}\@.  {\tt POSSM} attempts to label the
horizontal axis with frequencies or velocities computed across spectral
windows with dividers optionally plotted between spectral windows.
Several issues with this new capability, including for overlapping SPWs,
were corrected.

\begin{description}
\myitem{APCLN} and {\tt VTESS} would cause the \AIPS\ TV to die when
        using their {\tt DOTV} option.  The computation of the TV
        display was changed to that used elsewhere and the problem seems
        to have gone away.
\myitem{BPPLT} is a new task to display bandpass table values as a
        function of time; this is helpful when {\tt BPASS} is used to
        do the full calibration and {\tt CALIB} is not used.
\myitem{Mercator} coordinate axis labeling was corrected.
\myitem{TV} setting of Clean boxes could change the box coordinates of
        boxes other than those deliberately changed by the user when the
        image pixel increment was not 1.
\end{description}

\subsection{General}

\begin{description}
\myitem{SRCNAME}\hspace{1em} is a new adverb to be used by tasks that
       previously allowed only {\tt SOURCES(1)}\@.  It now appears in
       numerous tasks, most notably in {\tt IMAGR}\@.  Use {\tt
         COMPRESS} or {\tt RESTORE 0} if you have error messages
       regarding this adverb.
\myitem{GMRT} primary beam parameters are now available in \AIPS\@.
       They will be used for GMRT data wherever primary beam values
       are computed.
\myitem{CookBook} chapters were updated in early January primarily for
       polarization and late June primarily for the new tasks and more
       polarization.
\myitem{UVHOL} and {\tt HOLOG} were changed to handle on-the-fly
        holography observations.
\end{description}

\section{Patch Distribution for \OLDNAME}

Normally, this section lists the patches that have been released for
\OLDNAME\@.  This was based on the assumption that users would want to
download individual files to compile them locally.  However, the
``Midnight Job'' ({\tt \$HOME/do\_daily.}{\it hostname}) will do this
for you on locally-compiled installations.  It will also do a proper
update for binary installations.  Therefore there is no reason to
continue the old procedure.  Major bug corrections will be moved to
\OLDNAME\ as they occur and users should use the MNJ on occasion on both
the {\tt NEW} and {\tt TST} versions of \AIPS\@. The \OLDNAME\ release
has had a number of these ``patches'':
\begin{enumerate}
  \item\ {\tt VHDIF} lost the {\tt DOINVERS} true (add $180$ degrees)
         result when smoothing the output average {\tt PP}
         spectrum. {\it 2023-01-03}
  \item\ {\tt POSSM} failed to make IF divider lines in columns $> 1$.
         Added numeric labels to all subimages. {\it 2023-01-13}
  \item\ {\tt TADIF} had wrong length for units string and needed to
         trim the units and labels and take differences less
         seriously. {\it 2023-01-13}
  \item\ {\tt TECOR} had an error in geometry affecting the IFR.
         {\it 2023-01-23}
  \item\ {\tt LISTR} option {\tt POLD} (difference of polarizations)
         failed mysteriously. {\it 2023-02-10}
  \item\ {\tt UVPLT} would quit on a degenerate axis even if a plot range
         was specified. {\it 2023-02-16}
  \item\ {\tt FIXFR} had bad file references. {\it 2023-02-16}
  \item\ {\tt UVADD} did not copy essential tables (SU, FQ, AN, PO).
         {\it 2023-02-24}
  \item\ Mercator coordinates were not handled correctly. {\it
         2023-03-01}
  \item\ {\tt PCNTR} did not plot the polarization scale when requested
         if {\tt XYRATIO} was set. {\it 2023-03-20}
  \item\ {\tt FITLD} could overflow buffers when selecting IFs or
         channels with IDI format. {\it 2023-03-28}
  \item\ {\tt RLDIF} has a new formula for the position angle of 3C286.
         {\it 2023-03-28}
  \item\ {\tt SOUSP} used incorrect frequencies if IF selection was done
         after {\tt SETJY} was run. {\it 2023-03-29}
  \item\ {\tt POSSM} had several axis labeling issues. {\it 2023-04-14}
  \item\ {\tt VBRFI} and {\tt VLBRF} had errors in plotting data and in
         labeling the X axis. {\it 2023-04-24}
  \item\ {\tt IMAGR} had an array that limited the number of channels
         entering an image to about 2000. {\it 2023-04-28}
  \item\ {\tt UVMOD} was corrected to handle {\tt FQCENTER} properly.
         {\it 2023-05-24}
  \item\ {\tt UVSUB} and {\tt OOSUB} did not compute {\tt OPCODE 'MODL'}
         correctly for compressed data sets. {\it 2023-06-12}
  \item\ UV data sets without an {\tt FQ} table could get wrong
         frequencies. {\it 2023-06-14}
  \item\ {\tt POSSM} had horizontal axis labeling issues when not
         plotting all IFs and polarizations together ({\tt APARM(9)}
         $\neq 0$).  {\it 2023-06-26}
\end{enumerate}

\vfill\eject

\section{Recently revised \AIPS\ Memoranda}

All \AIPS\ Memoranda are available from the \AIPS\ home page.  Memo 117
was revised for the new {\tt TE} file format.

\begin{tabular}{lp{5.8in}}
{\bf 117} & {\bf \AIPS\ FITS File Format}\\
   &  Eric W. Greisen, NRAO\\
   &  February 1, 2023 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}

\section{\AIPS\ Distribution}

We log apparent MNJ accesses and downloads of the tar balls and binary
installations.  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 \THISYEAR\ more than 180 IP addresses have downloaded the
slushy form of \OLDNAME, while more than 307 IP addresses have
downloaded \RELEASENAME\@.  A total of 512 different IP addresses have
appeared in one of our transaction log files.  These numbers are about
the same as those of last year at this time.

\vspace{1em}
\centerline{\resizebox{!}{4.5in}{\includegraphics{FIG/Plot2223a.eps}}}

\vfill\eject
\hphantom{.}

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