; VLARUN - Lorant Sjouwerman, NRAO - FEB 13 03
; Ver 1.0 : Oct 14 2002, without HLP version
; Ver 2.0 : Jan 18 2003, made a help file for, and using it
; Ver 2.1 : Feb 13 2003, added DOCONT, all VLA AMP cals, and cosmetics
; Ver 2.2 : Feb 19 2003, more cosmetics and better explanations
; Ver 2.3 : Jan 22 2004, Michael Rupen had some comments - included
;---------------------------------------------------------------
;! calibrating amplitude and phase, and imaging VLA data
;# RUN POPS VLA UTILITY CALIBRATION IMAGING
;---------------------------------------------------------------
;;  Copyright (C) 2002-2004
;;  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
;---------------------------------------------------------------
VLARUN    LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
VLARUN : Applies 1st amplitude and phase calibration to VLA data

          This procedure does quick and dirty VLA calibration
          and imaging of line and continuum data, including high
          frequency data, but without full polarization calibra-
          tion. The assumptions made in this procedure may not
          be the best - but it is a great help for lazy people.

          To run this procedure you MUST type
          > RUN VLARUN  (I recommend typing 'RESTORE 0' first)
          to define the procedure (only once) in AIPS, and then
          > VLARUN
          to actually execute it (after reviewing the inputs!)

          Do FILLM and visibility FLAGGING before VLARUN (and
          also split the data into single-frequency files).

          This is the input dialog to the quick VLA pipeline
          There are NO DEFAULTS! It assumes you have observed
          3C286 or another VLA amplitude calibrator (see HELP)
          for absolute amplitude calibration. It will use up
          to 2 sources (may be 3C286 etc) for bandpass in LINE,
          and can use up to 8 possible phase calibrator names.

          Bandpass calibrators defined by CALSOUR can be any
          (but maximum 2) sources in your data. It is only used
          for line data sets.

          When you run VLARUN with DOCONT < 1 the procedure will
          STOP once (very soon after starting) in the beginning,
          after GETJY so you can check your calibrator fluxes.

          When you run VLARUN with DOALL > 0 the procedure will
          do the imaging for you using IMSIZE, NITER and FLUX
          for target sources until NITER or FLUX is reached.
          Calibrator images will use minimum(256,IMSIZE) pixels,
          and with minimum(500,NITER) iterations, minding FLUX

          The procedure also makes plot files at critical stages
          of the calibration. View plots on the original multi-
          source files (also LINE) with: getn [catno]; allplot

                                   -----------------------------
BADDISK                            Disks to avoid for scratch
INDISK                             Working disk, thus in/outdisk
NCOUNT                             Catalog number of the UV-file
                                    must be 'ch 0' for line data
SOLINT                             Solution interval for CALIB
REFANT                             Good reference antenna number
DOARRAY                            Max baseline in kilometers:
                                    A=35.4, B=10.8, C=3.3, D=1
                                    Pixelsize=17.5/(GHz*doarray)
UVRANGE                            Range for primary calibrator
                                    pre-defined; either one of:
                                    3C48,3C138,3C147,3C286,3C295
                                    or its IAU name, see HELP
                                    Edit the procedure for other
CALSOUR                            Bandpass calibrators (max 2)
                                    CALSOUR only used for LINE
SOURCES                            Phase calibrators (max 8, or
                                    '*' = any calcode CONTINUUM)
                                    All others are your targets!
DOCONT                             Continue after GETJY, no stop
DOALL                              Also do a split and imaging?
                                   -- ONLY USED IF DOALL > 0 --
IMSIZE                             Square size of image (pixels)
NITER                              Max number of iterations/chan
CUTOFF                             Min flux to consider in clean

----------------------------------------------------------------

VLARUN
Type: Procedure
Use:  VLARUN is the procedure that applies VLA calibration

$----------------------------------------------------------------------------

      Type RUN VLARUN to define the VLARUN procedure

CLEAN STARTING CONDITIONS
      Make sure only one frequency-ID is present (otherwise use UVCOP to
      split them apart and INDXR to index the files). Can process both
      continuum and line data, but the line files must have inclass 'CH 0'
      and 'LINE'. The flags must be made in the highest numbered FG table
      on the continuum or 'CH 0' files, so if you flag the 'LINE' data
      you have to copy the line flags/flag-table to the 'CH 0' file

LIST OF ALL NAMES RECOGNIZED AS A VLA AMPLITUDE CALIBRATOR IN SETJY
      3C48  is also known as: 0134+329, 0137+331, or J0137+3309
      3C138 is also known as: 0518+165, 0521+166, or J0521+1638
      3C147 is also known as: 0538+498, 0542+498, or J0542+4951
      3C286 is also known as: 1328+307, 1331+305, or J1331+3030
      3C295 is also known as: 1409+524, 1411+522, or J1411+5212
      At least one of these names (3C or other) must be in the data set for
      the amplitude calibration. If a different source is used, then you have
      to edit the procedure twice (guidelines provided in the procedure).
$---------------------------------------------------------------------------
VLARUN :            Procedure to calibrate VLA data blindly.
Documentor:         Lorant Sjouwerman, lsjouwerman@aoc.nrao.edu.
Related Programs:   VLA calibration, imaging and plotting routines

----------------------------------------------------------------------------
