; RESEQ
;---------------------------------------------------------------
;! Resequence antennas
;# TASK UV CALIBRATION VLBI
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 1997
;;  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 sorts 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                             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 for which to renumber
ANTENNAS                           List of antennas to be
                                   resequenced, all antennas
                                   resequenced to first antenna
                                   on list
INFILE                             Resequencing numbers may be
                                   entered via INFILE, see HELP
                                   RESEQ
----------------------------------------------------------------
RESEQ
Type:  Task
 Use:  To resequence antenna numbers, for space VLBI.  All
       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.
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 antenna numbers to be renumbered.  All
             antennas appearing on this list are renumbered into
             the first antenna appearing on the list.
  INFILE.....Alternate technique for specifying antenna
             renumbering function.  specifying an INFILE
             overrides the ANTENNAS adverb.  Try HELP RESEQ for
             info on the structure of the INFILE.
----------------------------------------------------------------
RESEQ:  Task which resequences antenna numbers
DOCUMENTOR: K.M.Desai (NRAO/VLA)
RELATED PROGRAMS: NONE

                         PURPOSE

     RESEQ will convert all antenna numbers specified through the
ANTENNAS adverb into the first antenna number on the list.  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 first antenna specified is used to replace all other
antennas appearing in the list.  This replacement occurs in the
visibility baseline numbering as well as in tables.  This
adverb is ignored if an INFILE is specified.

INFILE:
     A more general mapping function maybe specified using
INFILE.  This file, in KEYIN format, specifies a list of
antennas and a list of antenna numbers.  The file should be
terminated by a forward slash '/' character.  Below is an
example INFILE:

! This line begins the example infile
!
! any line beginning with an exclamation mark is a comment line
!     and is ignored.
!
! these two lists specify that:
!    antenna VLBA_PT is to be renumbered to become antenna 1
!    antenna VLBA_LA is to be renumbered to become antenna 4
!    antenna VLBA_MK is to be renumbered to become antenna 7
!
STATIONS = VLBA_PT, VLBA_LA, VLBA_MK
ANTENNAS =    1   ,   4       7
/ ! a final entry of a forward slash ends this sample infile
! This line ends the example infile

*NB* some editors allow a file to be written without a
terminating end-of-line character.  to be safe, always include
an extra comment line _AFTER_ the terminating line of the endfile.
-this will help you avoid _much_ grief!!!!
