; SDCAL
;---------------------------------------------------------------
;! Task to apply single dish calibration
;# TASK SINGLEDISH CALIBRATION
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 2000
;;  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
;-----------------------------------------------------------------------
SDCAL     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
SDCAL     Task to apply single dish calibration
INNAME                             Input SD file name (name)
INCLASS                            Input SD file name (class)
INSEQ             0.0     9999.0   Input SD file name (seq. #)
INDISK            0.0        9.0   Input SD file disk unit #
TIMERANG                           Time range to copy
STOKES                             Stokes type to pass.
BIF               0.0      100.0   Lowest IF number 0=>all
EIF               0.0      100.0   Highest IF number 0=>all
BCHAN             0.0     2048.0   Lowest channel number 0=>all
ECHAN             0.0     2048.0   Highest channel number
SUBARRAY          0.0     1000.0   Subarray, 0=>all
DOCALIB          -1.0        2.0   If >0 calibrate data
GAINUSE                            CL (or SN) table to apply
FLAGVER                            Flag table version
OUTNAME                            Output SD file name.
OUTCLASS                           Output SD file name (class)
OUTSEQ           -1.0     9999.0   Output SD file name (seq. #)
OUTDISK           0.0        9.0   Output SD file disk unit #.
APARM                              Control information:
                                     1 > 0 => average data over
                                       frequency and IF
                                     3 > 0 => Drop subarrays
BADDISK           0.0     9999.0   Disks to avoid for scratch
----------------------------------------------------------------
SDCAL
Task:  Apply single-dish calibration to the input data, writing a
       calibrated and flagged output data set.
Adverbs:
  INNAME.....Input SD file name (name).      Standard defaults.
  INCLASS....Input SD file name (class).     Standard defaults.
  INSEQ......Input SD file name (seq. #).    0 => highest.
  INDISK.....Disk drive # of input SD file.  0 => any.
  TIMERANG...Time range of the data to be copied. In order: Start day,
             hour, min. sec, end day, hour, min. sec. Days relative to
             reference date.
  STOKES.....The desired Stokes type of the output data:
             'I','V','Q','U','IQU','IQUV','IV','RR','LL','RL','LR',
             'HALF' (=RR,LL), 'FULL' (=RR,LL,RL,LR)
  BIF........First IF to copy. 0=>all.
  EIF........Highest IF to copy. 0=>all higher than BIF
  BCHAN......First channel to copy. 0=>all.
  ECHAN......Highest channel to copy. 0=>all higher than BIF
  SUBARRAY...Subarray number to copy. 0=>all.
  DOCALIB....If true (>0) then calibrate the data using information in
             the specified calibration (CS) table.
  GAINUSE....Version number of the CS table to apply.  0 => highest.
  FLAGVER....Specifies the version of the flagging table to be applied.
               0 => highest numbered table.
             < 0 => no flagging to be applied.
  OUTNAME....Output SD file name. Standard defaults.
  OUTCLASS...Output SD file name (class).    Standard defaults.
  OUTSEQ.....Output SD file name (seq. #).   0 => highest unique
  OUTDISK....Disk drive # of output SD file. 0 => highest with
             space for the file.
  APARM......Control information:
             APARM(1) > 0 => all frequency channels in all IFs will be
                averaged in the output.  <= 0 => no averaging.
             APARM(3) > 0 => drop the subarray code from the visibility
                records.
  BADDISK....A list of disks on which scratch files are not to be
             placed.  This will not affect the output file.
----------------------------------------------------------------
