; REIFS
;---------------------------------------------------------------
;! Breaks spectral windows into multiple spectral windows (IFs)
;# Task UV SPECTRAL VLA
;-----------------------------------------------------------------------
;;  Copyright (C) 2013
;;  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
;-----------------------------------------------------------------------
REIFS     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
REIFS    Makes more IFs with fewer channels across IF boundaries
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 #
BCHAN             0.0              First channel included
                                   SPECIAL COUNTING RULES APPLY
ECHAN             0.0              Last channel included
                                   SPECIAL COUNTING RULES APPLY
NIF               1.0       90.0   Break into NIF IFs
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 #.
----------------------------------------------------------------
REIFS
Task:  This task is designed to change a data set with multiple
       spectral windows each having multiple spectral channels into a
       data set with NIF spectral windows ("IFs") each with
       appropriately fewer spectral channels.  Some calibrations and
       normalizations are done on an IF basis (e.g., CALIB solutions,
       BPASS normalizations) and this task allows those to be done
       over a smaller range of frequency or spectral channel number.
       ** NOTE however that REIFS allows you to combine more than one
       input IF into one output IF.  The averaging of IF-dependent
       calibration numbers in such cases is at best problematical. **

       Task NOIFS may be used to reduce all IFs to a single one.  This
       causes a loss of information for on-line tables with
       IF-dependent columns such as the SysPower and CalDevice
       tables.  This was then followed by MORIF to break into small
       IFs in order to handle spectral index variations better.  This
       task combines the two, taking an appropriate average of the
       table data should a new spectral window contain portions of
       more than one old spectral window.

       REIFS requires the input IFs to cover the frequency range
       fully, without overlap and with the channel separations in each
       IF being the same.  MORIF does not have these restrictions.
       If you want NIF out = 1, NOIFS can handle cases involving gaps
       and overlaps in the spectral windows although all inncrements
       must be the same.

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.
  BCHAN......Lowest channel included where channels are counted from 1
             in the lowest IF to Nchan * Nif in the highest IF.
  ECHAN......Highest channel included in this same special counting
             mode.
  NIF........Number of output spectral windows (IFs).  The total
             number of included channels (ECHAN - BCHAN + 1) must be
             an integer multiple of NIF.  If ECHAN is too high to meet
             this requirement, the highest numbered channels will be
             omitted (with a suitable warning message).
  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.
----------------------------------------------------------------
