; CORER
;---------------------------------------------------------------
;! calculates correlator statistics and flags bad ones
;# Task UV
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 1999
;;  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
;-----------------------------------------------------------------------
;---------------------------------------------------------------
CORER     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CORER     Task to calculate correlator stats and flag bad ones
USERID       -32000.0    32000.0   Data set owner number
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 #.
DOOUTPUT         -1.0        1.0   > 0 => write flagged output
DOCRT            -1.0      132.0   > 0 => print on terminal
                                   > 72 => terminal width
OUTPRINT
                                   Printer disk file to save
CHANNEL           0.0     4096.0   Spectral line channel #
UVRANGE           0.0              Range of projected spacings
                                   in kilowavelengths
TIMERANG                           Start time:
                                     TIMER(1-4) = day,hh,mm,ss
                                   Stop time:  (0 => 9999)
                                     TIMER(5-8) = day,hh,mm,ss
CPARM             0.0              (1) Print flag IPOL points
                                       having mean > FLUX times
                                       expected error in mean.
                                       <= 0 => 4.0.
                                   (2) As (1) for cross POLs.
                                   (3) = ok IPOL rms in Jy, bad
                                       ones printed & deleted,
                                       0 => 1.0E9
                                   (4) As (3) for cross POLs.
                                   (5) = Flux of point source to
                                       subtract
----------------------------------------------------------------
CORER
Task:  Task to print the mean, rms, max, and min for all
       baselines and up to 4 correlators within a UV data set.
       Optionally, it will write an output file with all of the
       printed correlators flagged as bad.  Data are printed and
       deleted only if their mean exceed some multiple of the
       expected errors in the mean or if their rms is excessive.
Adverbs:
  USERID.....Input UV file owner number. 0 => logon user,
             32000 => any user.
  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.
  DOOUTPUT...> 0 => write the flagged output file.  Else just
             do the printing.
  DOCRT......False (<= 0) use the line printer if OUTPRINT = ' '
                   else write named OUTPRINT file only.
             True  (> 0) use the terminal interactively.  The task will
                   use the actual terminal width as a display limit
                   unless 72 < DOCRT < width.  In that case, the display
                   limit will be DOCRT characters.
  OUTPRINT...Disk file name in which to save the line printer output.
             ' ' => use scratch and print immediately for interactive
             jobs - batch jobs use OUTPRINT = 'PRTFIL:BATCHjjj.nnn'
             (jjj= job #, nnn = user #).  When OUTPRINT is not blank,
             multiple outputs are concatenated, and the file is not
             actually printed.
  CHANNEL....Starting spectral-line channel number 0 => 1.
  UVRANGE....Print and flag only data having projected spacing
             between UVRANGE(1) and UVRANGE(2) in
             kilowavelengths.  0 => all.
  TIMERANG...Start time: TIMERA(1-4) = day, hour, minute, second
             Stop time:  TIMERA(5-8) = day, hour, minute, second
  CPARM......CPARM(1) Print and flag IPOL correlators having
                mean > CPARM(1) * the expected error in the
                mean.     0 => 4.
             CPARM(2) As CPARM(1) for cross polarizations.
             CPARM(3) = IPOL cutoff level in the rms (Jy).
                Print and flag all data having rms > CPARM(3).
                0 -> 1E9.
             CPARM(4) As CPARM(3) for cross polarizations.
             CPARM(5) = flux of unpolarized point source at the
                origin to be subtracted before summing things.
----------------------------------------------------------------
