; MULTI
;---------------------------------------------------------------
;! Task to convert single-source to multi-source UV data
;# TASK CALIBRATION UV
;-----------------------------------------------------------------------
;;  Copyright (C) 1995
;;  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
;-----------------------------------------------------------------------
;---------------------------------------------------------------
MULTI     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
MULTI     Task to convert single-source to multi-source UV data
INNAME                             Input UV file name (name)
INCLASS                            Input UV file name (class)
INSEQ             0.0     9999.0   Input UV file name (seq. #)
INDISK            0.0        9.0   Input UV file disk unit #
OUTNAME                            Output UV file name (name)
OUTCLASS                           Output UV file name (class)
OUTSEQ           -1.0     9999.0   Output UV file name (seq. #)
OUTDISK           0.0        9.0   Output UV file disk unit #.
SOURCES                            Source name (16 char. max.)
                                   (Def.: extract from header)
APARM                              (1) CL time interval (min.)
                                       (Def.: 1 minute)
----------------------------------------------------------------
MULTI
Task:  This task will take an existing time-ordered UV dataset
       in single-source format and copy it as a new UV dataset
       in multi-source format, and create the required SU and
       CL tables.
Adverbs:
  INNAME.....Input UV file name (name).      Standard defaults.
  INCLASS....Input UV file name (class).     Standard defaults.
  INSEQ......Input UV file name (seq. #).    0 => highest.
  INDISK.....Disk drive # of input UV file.  0 => any.
  OUTNAME....Output UV file name (name).     Standard defaults.
  OUTCLASS...Output UV file name (class).    Standard defaults.
  OUTSEQ.....Output UV file name (seq. #).   0 => highest unique
  OUTDISK....Disk drive # of output UV file. 0 => highest with
             space for the file.
  SOURCES....Name of source (16 char. max.)  Default is to
             extract the source name from the catalog header.
  APARM(1)...CL time interval (minutes). Default is 1 minute.
----------------------------------------------------------------
MULTI:  Task to copy a UV database in single-source format to a
        UV database in multi-source format, with creation of the
        attendant SU and CL tables.
Documentor: Kevin R. Lind

This task is required in a limited number of circumstances, when
the AIPS task to be run intrinsically requires a multi-source
UV datbase, or (hopefully rarely) the single-source version is
acting up.  After running this routine, you should run INDXR to
create an NX table.  Any other tables are either already
attached to the input database, and are copied over to the
output database, or will be created at need in the AIPS package.

In general, this will have to be run before running CLCAL,
which applies the apriori antenna-based calibrations to the
data.  All fringe-fitting and self-calibration steps may be
carried out in either format unless you are applying corrections
obtained from a calibrator source to a weak source; in this
case, you will have to complete the fringe-fitting before
splitting the data into single-source datasets.

A WARNING:  This task was written rather quickly, in order to
allow the continuation of continuum VLBI processing in AIPS.
It should support polarization and subarrays, and at most two
IFs.  If this is not acceptable, please complain early so that
I have plenty of time to get around to upgrading it!  Also, the
treatment of time intervals in the CL table is not as elegant
as it could be; any errors in applying fringe-fitting or
self-calibration should be reported IMMEDIATELY.
