; SOLCL
;---------------------------------------------------------------
;! adjust gains for solar data according to nominal sensitivity
;# Task Calibration
;-----------------------------------------------------------------------
;;  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
;-----------------------------------------------------------------------
;---------------------------------------------------------------
SOLCL     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
SOLCL     Apply nominal sensitivity to solar data
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 #
SOURCES                            Source list ' '=>all.
STOKES                             Polarization to correct.
SELBAND                            Bandwidth to select (kHz).
SELFREQ                            Frequency to select (MHz).
FREQID                             Freq. ID to select, 0=>all.
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                           Reference antennae.
SUBARRAY          0.0     9999.0   Subarray; 0 => 1.
GAINVER           0.0     9999.0   CL table version to update
----------------------------------------------------------------
SOLCL
Task:  Uses the nominal sensitivities for selected telescopes
       to modify the gains of solar data. The mean nominal
       sensitivity of the selected telescopes is used for those
       not in the list of selected antennae.
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.
  SOURCES....list of sources to process.
             '*' = all; a "-" before a source name
             means all except ANY source named.
  STOKES.....The hand(s) of polarization to correct:
             'R ', 'L ', 'RL': '  ' or 'LR' => 'RL'.
  SELBAND....Bandwidth (kHz) to select if FREQID is not set.
  SELFREQ....Frequency (MHz) to select if FREQID is not set.
  FREQID.....Frequency identifier to select (you may determine
             which is applicable from the OPTYPE='SCAN' listing
             produced by LISTR).
  BIF........First IF to process. 0 => all.
  EIF........Last 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 antennas with good nominal
             sensitivity measurements. All zeros means use all
             antennae. Note that this use of ANTENNAS is
             different from that is most other AIPS tasks:
             SOLCL will always correct the gains of all
             telescopes.
  SUBARRAY...The subarray to modify. Do only one at a time.
  GAINVER....The CL table version number which is to be updated.
             The default value is the highest CL table present.
             If this is 1, SOLCL, will copy table 1 to table 2
             and use the copy.
----------------------------------------------------------------
SOLCL:   Task to apply nominal sensitivity corrections to solar
         data from the VLA.
Documented by: C. Flatters (preliminary version)
Related programs: FILLM, LISTR, CLCOR and most calibration tasks

Since the Sun is much brighter than other radio sources VLA
antennae must be equipped with special high-temperature noise
sources in order to calibrate solar data. For most bands these
solar calibration sources are only available on a few antennae;
the antennae normally used are shown in the table below:

     BAND(S)                 ANTENNAS
     =======                 ========
     K, U, L, C              5, 11, 12, 18
     P                       7, 12, 21, 27
     X                       all


  The online system assigns an arbitrary system temperature
to antennae without solar cal and corrects the observed
visibilities using them. Unfortunately the on-line system
does not record which telescopes in the array have measured
system temperatures (from solar cal) and which have assumed
temperatures. Therefore FILLM removes the system temperature
correction from all data for all sources observed in solar
mode with a blank calibrator code.

  SOLCL allows the user to specify a list of antennae having
solar cal using the ANTENNAS adverb and modifies the gains
in the CL table according to the system temperature
corrections for these antennae. The mean system temperature
of the selected antennae is assumed for those not selected.

USAGE NOTES

System temperature corrections should be inspected before
running SOLCL. Use LISTR with OPTYPE='GAIN' and DPARM(1)=10
(note that entries are not really in Kelvin). System
temperature measurements are often bad at the beginning of
a scan. Edit out data for which there are no good system
temperature corrections using TVFLG, UVFLG or QUACK.

  FILLM assigns a system temperature correction of unity
to data for sources with a non-blank calibrator code. SOLCL
will not affect the gains for these sources.

CAVEATS

- SOLCL will create a CL table with version number 2 if only
  version 1 CL table is present.  GAINVER must point at an
  existing CL table, or be 0 which is taken to be the highest.

- SOLCL will produce bad gains if run twice on the same CL
  file unless disjoint data are selected (eg non-overlapping
  IF ranges or different frequency IDs).

REFERENCE

Bastian, T. "Solar Imaging with a Synthesis Telescope" in
"Synthesis Imaging in Radio Astronomy" (eds. Perley, R. A.,
Schwab, F. R. and Bridle A. H., Brigham Young University
Print Services, Provo, Utah, 1989).
