; CSCOR
;---------------------------------------------------------------
;! applies specified corrections to CS tables
;# Task Calibration SingleDish
;-----------------------------------------------------------------------
;;  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
;-----------------------------------------------------------------------
CSCOR     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CSCOR     Task which applies various corrections to CS tables.
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 #
STOKES                             Stokes type to process
BIF               0.0      100.0   Lowest IF number 0=>all
EIF               0.0      100.0   Highest IF number 0=>all
TIMERANG                           Time range to use.
ANTENNAS                           Beam numbers to correct.
SUBARRAY          0.0     9999.0   Subarray; 0 => 1.
GAINVER           1.0     9999.0   CS table version to update
GAINUSE           2.0     9999.0   Output CS table
OPCODE                             Operation code.
BPARM                              Parameters (see HELP CSCOR).
BADDISK           0.0     9999.0   Disks to aviod for scratch
----------------------------------------------------------------
CSCOR
Task:  This task makes a number of corrections to a CS table.
       NOTE: Only data modified are written to the output table.
       If only a subset of the records are to be modified then
       copy the old file to a new copy using TACOP and then run
       CSCOR with GAINVER=GAINUSE.  If all records are to be
       modified; even if several runs of CSCOR are required,
       then GAINVER and GAINUSE may differ.
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.
  STOKES.....The desired Stokes type of the output data:
             'R ', 'L ', 'RL', '  '=> 'RL'.
  BIF........First IF to process. 0=>all.
  EIF........Highest IF to process. 0=>all higher than BIF
  TIMERANG...Time range of the data to be used. In order:
             Start day, hour, min. sec,
             end day, hour, min. sec. Days relative to ref.
             date.
  ANTENNAS...A list of the beam numbers to be modified.
             All 0 => use all.
  SUBARRAY...The subarray to modify. Do only one at a time.
  GAINVER....The input CS table version number.
             NOTE: There is NO default value.
  GAINUSE....The output CS table version no. 0 => create new
             table.
  OPCODE.....Operation code (see also EXPLAIN CSCOR):
             'OPAC' => apply atmospheric opacity amplitude
                       corrections using zenith opacity of
                       BPARM(1) nepers.
             'GAIN' => Correct using polynominal gain curve for
                       antenna gain as a function of the zenith
                       angle (ZA) in degrees.
                       correction = BPARM(1) + ZA * BPARM(2) +
                          ZA * ZA * BPARM(3) ...
             'PTRA' => Correct Right ascension *
                       cos(declination) by a polynomial in
                       zenith angle (ZA) in degrees:
                       correction(arcsec) = BPARM(1) +
                          ZA*BPARM(2) + ZA*ZA*BPARM(3)...
                       The correction is added to the old
                       position .
             'PTDC' => Correct declination position by a
                       polynomial in zenith angle (ZA) in
                       degrees:
                       correction(arcsec) = BPARM(1) +
                          ZA*BPARM(2) + ZA*ZA*BPARM(3)...
                       The correction is added to the old
                       position .
  BPARM......Parameters: see above.
  CPARM......CPARM(1) = Antenna longitude in degrees (if no AN file)
             CPARM(2) = Antenna latitude in degrees (if no AN file)
             If there is no antenna file and these are not given, the
             task has to die.
  BADDISK....A list of disks on which scratch files are not to
             be placed.  This will not affect the output file.
----------------------------------------------------------------
