; VLBACALA
;---------------------------------------------------------------
;! applies a-priori amplitude corrections to VLBA data
;# PROCEDURE VLBI UTILITY CALIBRATION
;-----------------------------------------------------------------------
;;  Copyright (C) 2000-2003, 2013, 2015
;;  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
;-----------------------------------------------------------------------
VLBACALA  LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
VLBACALA: Applies a-priori amplitude and sampling corrections
INNAME                             Input file name
INCLASS                            Input file class
INSEQ                              Input file sequence number
INDISK                             Disk number for input file
FREQID                             Frequency ID to correct
                                     0 => 1
SUBARRAY                           Subarray to correct. 0=>ALL
DOFIT                              Fit for opacity correction
BADDISK                            Disks to avoid for scratch

          VLBACALA is defined in the VLBAUTIL run file.
          VLBACALA is obsolete, please see explain file
----------------------------------------------------------------
VLBACALA
Type: Procedure
Use:  !   VLBACALC is obsolete, there is a new amplitude    !
      !   calibration scheme that is prefered.  See explain !
      !   file for details.                                 !

      VLBACALA is a procedure that applies a-priori amplitude corrections and
      digital sampling corrections to VLBA data. These corrections are added
      to the corrections in the highest numbered CL table.

      VLBACALA assumes that you already have GC and TY tables and that you
      have at least one CL table.

      Type RUN VLBAUTIL to define the VLBACALA procedure.

  INNAME.....The name of the file to be corrected. Wildcard characters are
             allowed.
  INCLASS....The class of the file to be corrected. Wildcard characters are
             allowed.
  INSEQ......The sequence number of the file to be corrected. Zero defaults
             to the highest sequence number of a file matching INNAME,
             INCLASS, and INDISK.
  INDISK.....The disk drive number of the file to be corrected. Zero defaults
             to any disk.
  FREQID.....The frequency ID to correct. Zero defaults to frequency ID 1.
  SUBARRAY...The subarray to correct. Zero defaults to doing all.
  DOFIT......Do opacity correction in APCAL.  This is recommended
             for high frequency experiments (freq >= 15~GHz) if the
             accuray of the source flux is important.
  BADDISK....A list of disks on which scratch files are not to
             be placed.  This will not affect the output file.
----------------------------------------------------------------
VLBACALA:           Procedure to apply a-priori amplitude corrections
Documentor:         Chris Flatters
Related Programs:   VLBAUTIL, ACCOR, APCAL, SNSMO, CLCAL

VLBACALC is obsolete, there is a new amplitude calibration scheme
that is prefered.  This redesign of the amplitude calibration path is
based on VLBA Scientific Memo #37 (Craig Walker).  The new recommended
steps for amplitude calibration are:
  1) Do preliminary calibration steps that are necessary (e.g., VLBAFIX,
      VLBAEOPS, VLBATECR...).
  2) VLBACCOR -- digital sampling corrections
  3) VLBAMPCL (or VLBAPCOR) -- remove instrumental delay
  4) VLBABPSS -- do bandpass and correct auto-correlations
  5) VLBAAMP -- a priori amplitude calibration
  6) Continue with calibration.

VLBACALA determines amplitude corrections for digital sampling effects and
 a-priori amplitude corrections from the gain curves and system
temperature measurements, removes bad points, and applies these corrections
to the highest numbered calibration (CL) table attached to the input file.
Note that interpolation type 'SELF' is used for the a-priori amplitude
calibration, to avoid interpolating between sources at different
elevations, among other things.

You should run VLBACALA after correcting the polarization labels (if
necessary) and loading any gain curves or system temperature data for non-
VLBA antennas using ANTAB.
