; RESEQ
;---------------------------------------------------------------
;! Renumber antennas
;# TASK UV CALIBRATION VLBI
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 1997, 2005
;;  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
;-----------------------------------------------------------------------
RESEQ     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
RESEQ:  Task which renumbers antennas
INNAME                             Input UV file name (name)
INCLASS                            Input UV file name (class)
INSEQ             0.0    9999.0    Input UV file name (seq. #)
INDISK                             Disk unit # of input UV data
OUTNAME                            Sorted UV file name (name)
OUTCLASS                           Sorted UV file name (class)
OUTSEQ           -1.0    9999.0    Sorted UV file name (seq. #)
OUTDISK                            Disk unit # of sorted UV data
                                     0 => highest with space
                                   If outfile spec. equals the
                                   infile spec., output will
                                   overwrite the input
SUBARRAY                           Subarray to be renumbered
ANTENNAS          0.0              New antenna numbers
BASELINE          0.0              Old antenna numbers
----------------------------------------------------------------
RESEQ
Type:  Task
Use:   Generally, to renumber antennas.  Specifically, for space VLBI,
       antennas used as tracking stations can be renumbered as one
       antenna corresponding to VSOP.  To be used when most space VLBI
       specific-calibration is completed.

       Do this very carefully, but you can renumber a bunch of
       antennas at the same time.  In fact if you want to swap antenna
       numbers 2 and 14 (say) then you must do that in the same job
       with
            ANTEN = 2,14; BASELINE = 14,2
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.    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.  0 => highest with space
             If the outfile specification equals the infile
             specification, the output data file will overwrite
             the input data file.
  SUBARRAY...Subbarray whose antennas are to be renumbered.
             Only one subarray may be processed at a time.
             0 => subarray 1 .
  ANTENNAS...List of new antenna numbers.
  BASELINE...Corresponding list of old antenna numbers.
----------------------------------------------------------------
RESEQ:  Task which resequences antenna numbers
DOCUMENTOR: K.M.Desai (NRAO/VLA), Eric W. Greisen
RELATED PROGRAMS: NONE

                         PURPOSE

     RESEQ will convert all antenna numbers specified through the
BASELINE adverb to those specified by the ANTENNAS adverb.  This
is expected to be useful for space vlbi work.

                         COMMENTS

OUTNAME, OUTCLASS, OUTSEQ, OUTDISK:
     If the outfile specification is identical to the infile
specification (including defaults used in both file
specifications), then the sorted data will overwrite the input
data.  Make sure the input data set is properly backed up before
you overwrite since a computer crash may destroy the input data
set.

SUBARRAY:
     Only antennas in a single subarray are processed in one run
of RESEQ.  The subarray is chosen via this adverb.  SUBARRAY 0
defaults to SUBARRAY 1.

ANTENNAS:
     The output antenna numbers.  If ANTENNA(i)=0, ANTENNA(1) is used.

BASELINE:
     Input antenna number BASELINE(i) is renumbered ANTENNA(i).  A
     complicated pattern is legitimate, e.g.
          ANTENNAS 1,2,3,4,5,6,7,8,9,10
          BASELINE 3 5 7 9 2 4 6 8 10 1
     to renumber all of the antennas in a VLBA data set.


