; VPLOT
;---------------------------------------------------------------
;! Plots uv data and model from CC file
;# TASK UV VLBI PLOT
;-----------------------------------------------------------------------
;;  Copyright (C) 1995-2011, 2014, 2018-2020
;;  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
;-----------------------------------------------------------------------
VPLOT     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
VPLOT     Plots data from a u,v data base, model from a CC file
USERID       -32000.0    32000.0   File owner number - ignored
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        3.0   Input UV file disk unit #
IN2NAME                            Input CC file name (name)
IN2CLASS                           Input CC file name (class)
IN2SEQ            0.0     9999.0   Input CC file name (seq. #)
IN2DISK           0.0        3.0   Input CC file disk unit #
IN2VERS           0.0     46655.0  Input CC file version #
NCOMP                              # comps to use for model.
                                   1 value per field
                                   total 200000 CCs maximum
FLUX                               Lowest CC component used.
NMAPS           -4096.0   4096.0   # clean maps (fields).
                                   0 => no model
                                   >0 => model at samples
                                   <0 => model smoothly
                                   Data selection:
SOURCES                            Source list
QUAL            -10.0              Source qualifier -1=>all
CALCODE                            Calibrator code '    '=>all
SELBAND                            Bandwidth to select (kHz)
SELFREQ                            Frequency to select (MHz)
FREQID                             Freq. ID to select.
BCHAN             0.0     4096.0   Lowest channel number 0=>1
ECHAN             0.0     4096.0   Highest channel number
AVGCHAN          -1.0        1.0   > 0 => average BCHAN-ECHAN
BIF               0.0      100.0   Lowest IF number 0=>1
EIF               0.0      100.0   Highest IF number 0=>high
AVGIF            -1.0        1.0   > 0 => average IFs
CROWDED          -1.0        3.0   Plot chans/IFs together or
                                   separately?  0 separate,
                                   3 all together, 1 & 2 partly
DO3COLOR         -1.0        1.0   Plot separate IFs in separate
                                   colors.
XINC              0.0     9999.0   Plot every XINC'th visibility
                                   0 => 1
UVRANGE           0.0              Range of projected spacings
                                   (thousands of wavelengths)
TIMERANG                           Time: start day,hr,min,sec
                                         stop day,hr,min,sec.
STOKES                             Stokes' parameters
ANTENNAS                           Antennas to be plotted
BASELINE                           Baselines with ANTENNAS
                                   See explanation.
DOCALIB          -1.0      101.0   > 0 calibrate data & weights
                                   > 99 do NOT calibrate weights
GAINUSE                            CL (or SN) table to apply
DOPOL            -1.0       10.0   If >0 correct polarization.
PDVER                              PD table to apply (DOPOL>0)
BLVER                              BL table to apply.
FLAGVER                            Flag table version
                                   See explanation.
DOBAND           -1.0       10.0   If >0 apply bandpass cal.
                                   Method used depends on value
                                   of DOBAND (see HELP file).
BPVER                              Bandpass table version
SMOOTH                             Smoothing function. See
SUBARRAY                           Subarray number 0=>1.
                                   -1 => all, but beware!
DOEBAR                             If > 0, plot error bars,
                                   else don't
SOLINT                             Time over which to average
                                   data before plotting (mins)
                                   =0 => no averaging
                                   >0 SOLINT=MIN(SOLINT, SCAN)
                                   <0 SOLINT=ABS(SOLINT)
                                      average through scans
OPTYPE                             'AUTO' => autocorrelation
                                    else  =>crosscorrelation
OPCODE                             Type of plot:
                                   'IFRA' => ratio BIF and EIF
                                    else  => plot requested IF
APARM                              Control parameters
                                   1 : > 0 => edit bad
                                       amplitude points.
                                       BPARM(2)=0, or 1
                                       = 0 => do not edit
                                       bad amplitude points.
                                       Number of averaged points
                                       for each baseline has to
                                       be more than 10.
                                   2 : number of sigmas outside
                                       of which bad points are
                                       clipped (See HELP); 0=>3.
                                   3 : > 0 plot min/max range
                                       with average
                                       = 0 do not plot min/max
                                       lines
                                   4 : = 0 min/max over selected
                                       IFs after averaging
                                       selected CHs
                                       > 0 min/max over all
                                       selected CH/IFs
                                   5 : > 0 scalar average
                                       = 0 vector average
                                   6 : used with APARM(1)>0
                                       >0 flag the bad points
                                          for all channels
                                       =0 flag the bad points
                                          only for the selected
                                          channels
                                   7 : est total plot points
                                   8 : > 0 mark scan boundaries
BPARM                              Control parameters
                                   1 : X-axis type code 0 -> 12
                                   2 : Y-axis type code 0 -> 1
                                       <0 => both AMP & PHASE
                                       1=> amplitude (Jy)
                                       2=> phase (degrees)
                                       3=> uv dist. (klambda)
                                       4=> uv p.a. (deg N->E)
                                       5=> time (IAT days)
                                       6=> u (klambda)
                                       7=> v (klambda)
                                       8=> w (klambda)
                                       9=> Re(Vis) (Jy)
                                       10=> Im(Vis) (Jy)
                                       11=> time (GST)
                                       12=> time (IAT hours)
                                       13=> source number
                                       14=> freqid
                                       15=> integration time
                                       16=> weight
                                       17=> rms (SOLINT > 0)
                                       18=> HA (hours)
                                       19=> elevation (deg)
                                       20=> parallactic angle
                                       21=> azimuth (deg)
                                       22=> log(amplitude)
                                   3 : >0.0 => fixed scale
                                       <0.0 => fixed range
                                        0.0 => sep. scales
                                   4 : Xmin (fixed scale)
                                   5 : Xmax (fixed scale)
                                   6 : Ymin (fixed scale)
                                   7 : Ymax (fixed scale)
                                   8 : PHmin (fixed scale)
                                   9 : PHmax (fixed scale)
                                   10:  > 0 -> plot models for
                                       baselines with no data
ALIAS                              Antenna alias selection
                                   If ALIAS(1) is non-zero, any
                                   antennas matching ALIAS(2-30)
                                   are treated as if they were
                                   actually ALIAS(1)
REFANT          0.0         90.0   > 0 -> use REFANT for hour
                                   angle, elevation, et al.
NPLOTS                             Max number of plots per page.
                                   0 => 3; If bparm(2)<0 =>
                                   Max number of pairs of plots.
POLPLOT                            Option to display various
                                   ratios of polarizations:
                                   see help for allowed values
                                   other = plot data directly
SYMBOL          0.0        24.0    Symbol to use when plotting.
                                   0 => X (FACTOR >= 0)
                                     => none (FACTOR < 0)
                                   1 - 23, standard types
FACTOR                             Scale symbol by FACTOR
                                   < 0 => connect with lines
LTYPE        -410.0       410.0    Type of labeling: 1 border,
                                   2 no ticks, 3 - 6 standard,
                                   7 - 10 only tick labels
                                   <0 -> no date/time
DOTV           -1.0         1.0    > 0 Do plot on the TV, else
                                   make a plot file
GRCHAN          0.0         8.0    Graphics channel 0 => 1.
XYRATIO         0.0                X/Y ratio 0 -> fit TV or 1 PL
BADDISK                            Disks to avoid for scratch
----------------------------------------------------------------
VPLOT
Type: Task
Use:  Plots data from a u,v data base making a plot file.  Also, if a
      valid CLEAN map is specified the model values wlll be plotted.
      Plotting is done one baseline per plot with the number of plots
      per page specified by NPLOTS.  The plots are written one page
      per plot file so in general several plot files will be created.
      Model types recognized are: points, elliptical gaussians and
      uniform spheres.  This task is the fast version of VBPLT. The
      option of plotting amplitude and phase together has been added.

      VPLOT can handle images made with the DO3DIMAG option of IMAGR.
      It recognizes them automatically and does the proper CC model
      computation.  It also can handle multi-scale images; set
      NMAPS = NFIELD * NGAUSS.
Adverbs:
  USERID.....Input file user number.  Ignored
  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.
  IN2NAME....Name of desired CLEAN components to be used.
             If this file is not found no model will be plotted
             Uses Standard defaults.
  IN2CLASS...Class of CLEAN map.            Standard defaults.
  IN2SEQ.....Sequence number of CLEAN map.  0 => highest.
  IN2DISK....Disk number of CLEAN map.      0 => any.
  IN2VERS....CLEAN component file version (CC tables)   0 => highest.
             The same version number is used for the all selected
             image files. Use task TACOP to provide the same numbers
             for desired CC tables.
             For a multi-source file, the flux of the clean components
             selected for the model are summed and scaled to the source
             flux found in the SU table.  If that flux is zero, no
             scaling is done.
  NCOMP......Number of Clean components to use for the model, one
             value per field.  If all values are zero, then all
             components in all fields are used.  If any value is not
             zero, then abs(NCOMP(i)) (or fewer depending on FLUX and
             negativity) components are used for field i, even if
             NCOMP(i) is zero.  If any of the NCOMP is less than 0,
             then components are only used in each field i up to
             abs(NCOMP(i)), FLUX, or the first negative whichever
             comes first.  If abs(NCOMP(i)) is greater than the number
             of components in field i, the actual number is used.  For
             example
                   NCOMP = -1,0
             says to use one component from field one unless it is
             negative or < FLUX and no components from any other
             field.  This would usually not be desirable.
                   NCOMP = -1000000
             says to use all components from each field up to the
             first negative in that field.
                   NCOMP = -200 100 23 0 300 5
             says to use no more than 200 components from field 1, 100
             from field 2, 23 from field 3, 300 from field 5, 5 from
             field 6 and none from any other field.  Fewer are used if
             a negative is encountered or the components go below
             FLUX.   *** This option is limited to the first 200000
             Clean components encountered.  ***
  FLUX.......Only components > FLUX in absolute value are used in the
             model.
  NMAPS......Number of image files to use for model.  For multi-scale
             models, set NMAPS = NFIELD * NGAUSS to include the Clean
             components of the extended resolutions.  If more than one
             file is to be used, the NAME, CLASS, DISK and SEQ of the
             subsequent image files will be the same as the first file
             except that the LAST 3 or 4 characters of the CLASS will
             be an increasing sequence above that in IN2CLASS.  Thus,
             if INCLASS='ICL005', classes 'ICL005' through 'ICLnnn'
             or 'ICnnnn', where nnn = 5 + NMAPS - 1 will be used.  Old
             names (in which the 4'th character is not a number) are
             also supported: the last two characters are '01' through
             'E7' for fields 2 through 512.  In old names, the highest
             field number allowed is 512; in new names it is 4096.
             = 0 => do not plot a model
             > 0 => plot the model at each data sample.  In this mode,
                    the u,v,w are known from the data sample, but the
                    sampling for each baseline may be coarse and
                    irregular.
             < 0 => plot a model at 200 regularly sampled points for
                    each baseline.  In this mode, the u,v,w's are
                    computed from the times and antenna locations and
                    may have subtle (or not so subtle) complications
                    (with precession, u-v rotation, times) causing the
                    plotted model to fail to match the plotted data.
  SOURCES....Source list.  If the data is a multi-source file
             VPLOT will plot the visibility for the first
             source specified. If the data is a single
             source file no source name need be specified.
  QUAL.......Only sources with a source qualifier number in the
             SU table matching QUAL will be used if QUAL is not
             -1.
  CALCODE....Calibrators may be selected on the basis of the
             calibrator code:
                  '    ' => any calibrator code selected
                  '*   ' => any non blank code (cal. only)
                  '-CAL' => blank codes only (no calibrators)
                  anything else = calibrator code to select.
             NB: The CALCODE test is applied in addition to the
             other tests, i.e. CALSOUR and QUAL, in the
             selection of sources for which to determine
             solutions.
  SELBAND....Bandwidth of data to be selected. If more than
	     one IF is present SELBAND is the width of the
	     first IF required. Units = kHz, 0=> all
  SELFREQ....Frequency of data to be selected. If more than
	     one IF is present SELFREQ is the frequency of the
	     first IF required. Units = MHz, 0=> all
  FREQID.....Frequency identifier to select (you may determine
	     which is applicable from the OPTYPE='SCAN' listing
	     produced by LISTR. If either SELBAND or SELFREQ
	     are set their values overide that of FREQID,
	     however setting SELBAND and SELFREQ may occasionally
	     result in an ambiguity, in which case the task will
	     request that you use FREQID.
  BCHAN......Start channel. 0 => 1
  ECHAN......End channel. 0 => BCHAN  (NB: non-standard default)
  AVGCHAN....> 0 => Average the spectral channels BCHAN through ECHAN
                    before plotting.
             <=0 => Plot the channels separately
  BIF........Start IF number to plot. 0 => 1
  EIF........End IF number to plot. 0 => highest
             If OPCODE = 'IFRA' will plot ratio of visibilities
             at BIF and EIF.
  AVGIF......> 0 => IFs BIF through EIF will be averaged before
             plotting, otherwise they will be plotted separately.
  CROWDED....<= 0  => Plot IFs and spectral channels individually
                      multiple polarizations, if requested, do appear
                      in the same panel.
             =  1  => Plot spectral channels together in one panel but
                      separate panels for separate IFs
             =  2  => Plot IFs together in one panel but separate
                      panels for each spectral channel
             =  3  => Plot spectral channels and IFs together in one
                      panel (per baseline)
  DO3COLOR..> 0 => plot the separate polarizations, spectral channels,
            and IFs in different colors, otherwise they are done in
            the same color.  Done only to differentiate things plotted
            in the same panel.  The scheme is:
                COLOR = 0
                DO POL = 1,Npol
                   DO IF = 1,Nif
                      DO CHAN = 1,Nchan
                        set and use COLOR
                        COLOR = COLOR + DeltaColor
                        END DO CHAN
                     END DO IF
                  END DO POL
             where COLOR=0 is pure red, DeltaColor is set so that the
             last value of COLOR is 1 which is pure blue.  Npol is the
             number of requested polarizations, Nif is the number of
             IFs plotted in the panel (BIF to EIF if CROWDED > 1, else
             1), and Nchan is the number of spectral channels plotted
             in the panel (1 unless AVGCHAN<=0 and CROWDED is 1 or 3).
             Thus, if there are 4 IFs, one spectral channel (average),
             and one polarization, the plot will be of red, yellow,
             cyan, and blue for IFs 1 through 4, resp. If there are 2
             IFs and 2 polarizations (RR and LL say), then red is RR
             in IF 1, yellow is RR in IF 2, cyan is LL in IF 1, and
             blue is LL in IF 2.  Note that the blue is plotted after
             the blue and so may overlap and obscure the red.
  XINC.......Plot every XINC'th visibility
             which might be plotted.  0 => 1
  UVRANGE....Range (min, max) of projected baselines to include
             0,0 => all baselines
  TIMERANG...The specified time range.
     1 = Start IAT day (day 0 = first day in data base)
     2 = Start IAT hour
     3 = Start IAT minute
     4 = Start IAT second
     5 = Stop IAT day (day 0 = first day in data base)
     6 = Stop IAT hour
     7 = Stop IAT minute
     8 = Stop IAT second
         stop IAT = 0 => beginning
         stop IAT = 0 => end.
                    of time.
     Note that multi-subarray data are separated by 5 days for each
     subsequent subarray if the data are DBCON's output.
     VPLOT does not remove this time shift starting May 1, 2001.
     So pay attention on this fact selecting the TIMERANG.
  STOKES.....Specifies the stokes type to be plotted - usually only 1
             Recognized values are 'I', 'Q', 'U', 'V',   '    ' => 'I'
             'RR', 'LL', 'LR', 'RL', 'XX', 'YY', 'XY', 'YX'
             'RRLL', 'XXYY', 'RLLR', 'XYYX', 'IV', 'HALF', 'FULL'
                 will plot 2 polarizations at once
             'IQU' plots 3 and 'IQUV' plots 4 at once
  ANTENNAS...A list of the antennas to be plotted.
             If OPTYPE = 'auto' then the specified channels and/or IFs
             from the self-spectra of the selected ANTENNAS are plotted
             (and BASELINE should be 0 or the same as ANTENNAS).
  BASELINE...Baselines between antennas named in ANTENNAS and those
             named in BASELINE are selected..  There are four possible
             combinations of ANTENNAS and BASELINE:
             1. ANTENNAS = 0; BASELINE = 0.
                All possible baselines are selected.
             2. ANTENNAS <>0; BASELINE = 0.
                a)All ANTENNAS > 0
                  Baselines including an antenna in the ANTENNAS list
                  are selected;
                b)Some ANTENNAS < 0
                  All baselines NOT including an antenna in the ANTENNAS
                  list are selected;
             3. ANTENNAS = 0; BASELINE <> 0.
                a)All BASELINE > 0
                  Baselines including an antenna in the BASELINE list
                  are selected;
                b)Some BASELINE < 0
                  All baselines NOT including an antenna in the BASELINE
                  list are selected;
             4. ANTENNAS <> 0; BASELINE <> 0.
                a)All ANTENNAS>0 and all BASELINE>0
                  Baselines between antennas named in ANTENNAS and those
                  named in BASELINE are selected.
                b)Some ANTENNAS<0 .OR. some BASELINE<0
                  Baselines between antennas named in ANTENNAS  and
                  those named in BASELINE are DE-selected, all others
                  are selected.
  DOCALIB....If true (>0), calibrate the data using information in the
             specified Cal (CL) table for multi-source or SN table for
             single-source data.  Also calibrate the weights unless
             DOCALIB > 99 (use this for old non-physical weights).
  GAINUSE....version number of the CL table to apply to
             multisource files or the SN table for single
             source files.  0 => highest.
  DOPOL......If > 0 then correct data for instrumental polarization as
             represented in the AN or PD table.  This correction is
             only useful if PCAL has been run or feed polarization
             parameters have been otherwise obtained.  See HELP DOPOL
             for available correction modes: 1 is normal, 2 and 3 are
             for VLBI.  1-3 use a PD table if available; 6, 7, 8 are
             the same but use the AN (continuum solution) even if a PD
             table is present.
  PDVER......PD table to apply if PCAL was run with SPECTRAL true and
             0 < DOPOL < 6.  <= 0 => highest.
  BLVER......Version number of the baseline based calibration
             (BL) table to appply. <0 => apply no BL table,
             0 => highest.
  FLAGVER....specifies the version of the flagging table to be
             applied.
             0 => highest numbered table.
             <0 => no flagging to be applied.
             If APARM(1)>0 then
                if FLAGVER>0 => the specified table is copied to
                   the next highest version and recognized bad points
                   are added to this table
                if FLAGVER=0 => the highest numbered table is copied
                   to the next highest version and recognized bad
                   points are added to this table
                if FLAGVER<0 => Recognized bad points
                   are recorded in a new FG table
  DOBAND.....If true (>0) then correct the data for the shape of the
             antenna bandpasses using the BP table specified by BPVER.
             The correction has five modes:
             (a) if DOBAND=1 all entries for an antenna in the table
             are averaged together before correcting the data.
             (b) if DOBAND=2 the entry nearest in time (including
             solution weights) is used to correct the data.
             (c) if DOBAND=3 the table entries are interpolated in
             time (using solution weights) and the data are then
             corrected.
             (d) if DOBAND=4 the entry nearest in time (ignoring
             solution weights) is used to correct the data.
             (e) if DOBAND=5 the table entries are interpolated in
             time (ignoring solution weights) and the data are then
             corrected.
  BPVER......Specifies the version of the BP table to be applied
              0 => highest numbered table.
             <0 => no bandpass correction to be applied.
  SMOOTH.....Specifies the type of spectral smoothing to be applied to
             a uv database . The default is not to apply any smoothing.
             The elements of SMOOTH are as follows:
             SMOOTH(1) = type of smoothing to apply: 0 => no smoothing
               To smooth before applying bandpass calibration
                 1 => Hanning, 2 => Gaussian, 3 => Boxcar, 4 => Sinc
               To smooth after applying bandpass calibration
                 5 => Hanning, 6 => Gaussian, 7 => Boxcar, 8 => Sinc
             SMOOTH(2) = the "diameter" of the function, i.e. width
               between first nulls of Hanning triangle and sinc
               function, FWHM of Gaussian, width of Boxcar. Defaults
               (if < 0.1) are 4, 2, 2 and 3 channels for SMOOTH(1) =
               1 - 4 and 5 - 8, resp.
             SMOOTH(3) = the diameter over which the convolving
               function has value - in channels.  Defaults: 1,3,1,4
               times SMOOTH(2) used when input SMOOTH(3) < net
               SMOOTH(2).
  SUBARRAY...The subarray number desired. 0=> 1.
             To have all subarrays plotted, give -1.  Be aware that the
             station names and model plotted will be for subarray 1
             only.  Elevations, hour angles, parallactic angles, and
             azimuths are also computed wrt SUBARRAY (or 1 if = 0).
  DOEBAR.....If = 0 => do not plot error bars on data
             if = 1 => do plot error bars.
  SOLINT.....Time over which to pre-average data before plotting
             (minutes).      =0 => no pre-averaging.
             If SOLINT<0, then SOLINT = ABS(SOLINT) and averaging will
             cross source boundaries.  Otherwise, it does not.
             All axis types are now available.
  OPTYPE.....Specify whether the user wishes to plot data from
             the cross-power spectra (OPTYPE is anything but 'AUTO')
             or the self-spectra (OPTYPE='AUTO')
  OPCODE.....Type of plot:
             'IFRA' => ratio between IF's (BIF and EIF)
             else   => will plot each requested IF
  APARM......Control parameters:
     1 : > 0 => edit bad amplitude points during the pre-average and
                write FG entries to delete them.
                If autocorrelation is selected (OPTYPE='AUTO') then
                all baselines with selected antennas are flagged
                for the bad amplitudes.
         = 0 => do not edit bad amplitude points
     2 : number of sigma (rms) used in deciding if a point should be
         flagged.
         If APARM(2)=0 then APARM(2)=3

         Regime APARM(1)>0 is used in an average mode (in time,
         IFs, Channels) and can be useful for the editing of points
         with large amplitude deviation.

	 Regime APARM(1) works only with plotting of amplitude.
         BPARM(2)=0, or 1.

         The amplitude of each individual point in the average
         interval is compared with the mean value.
         The rms is estimated for the solution interval
         simultaneously.
         !!Number of averaged points for each baseline has to be
         !! more than 10.
         If the deviation of the amplitude from the mean is
         larger than the specified multiple of the rms then that
         point is marked in a new flag table.
         The new flag table is a copy of the specified flag
         table. If FLAGVER=0 the highest numbered flag table is
         copied and added to.
         If a flag table does not exist or FLAGVER<0, a new flag
         table is created. See FLAGVER section above..
         Plots are not generated in the bad point recognition mode.

     3 : > 0 plot a vertical line that specifies the minimum and
         maximum of the amplitudes (or phase or real or image)
         found in the domain of averaging.
         The minimum and maximum values of the average are stored
         for each baseline as well as mean values.
         Vertical lines with lower and upper limits corresponding
         to the minima and maxima are plotted together with mean
         values. This mode is useful for recognition of the points
         with a large deviation of amplitude or phase. Such points
         are usually hidden in averaging.

         = 0 do not plot min/max line when averaging and displaying
         amplitudes.

     4:  = 0 Min/Max for the vertical line is found over
         all points in time, IFs, Channels domain.
         > 0 Min/Max for the vertical line is found over
         points in time, IFs domain after averaging selected channels.

     5 : > 0 scalar average    used when SOLINT not 0
         = 0 vector average 	

     6 : used with APARM(1)>0.
         If APARM(6)=0 flag the bad points for the selected channels.
         If APARM(6)>0 flag the bad points for all channels.
         The option APARM(6)>0 is useful in self calibration, of
         a spectral line project when one channel is selected for
         self calibration. This channel is edited but the editing
         result should be applied to all channels

     7 : Estimated total number of samples:  0 -> number of vis in the
         data set which can be way too much if averaging or various
         data selections are being made.  This is used to set the size
         of dynamic memory created and can limit the number of points
         plotted.

     8 : > 0 mark scan boundaries, >= 2 divider crosses whole plot
         only when BPARM(1) = 5 or 12

  BPARM......Control parameters:
     1 = type of X-axis (where  1 = amplitude, 2 = phase, 3 = uv
         distance, 4 = uv p.a. (CCW from u-axis), 5 = time (IAT)
         6 = u, 7 = v, 8 = w, 9 = real part, 10 = imaginary part
         11 = time (GST), 12 = time (IAT hms), 13 = source no.,
         14 = freqid, 15 = int. time, 16 = weight, 17 = rms
         (can only do if SOLINT > 0), 18 = hour angle (hours),
         19 = elevation (degrees), 20 = parallactic angle (deg),
         21 = azimuth (deg), 22 = log10(amplitude).     0 => 12
     2 = type of Y-axis (as above).       0 => 1;
         If <0 => Both Amplitude and phase are plotted.
         -22 => log10(amplitude) and phase are plotted
     3 = if greater than zero, use BPARM(4) - BPARM(8) as the
         ranges of the axes.  If less than zero, use the BPARMs
         to limit the range of the axes, but self-scale the axes
         within that range.  If 0.0, scale the Y axis separately
         for each baseline.
     4 = Minimum of X-axis.  See note below on units.
     5 = Maximum of X-axis (if = BPARM(4) do self-scale in X).
     6 = Minimum of Y-axis.  See note below on units.
     7 = Maximum of Y-axis (if = BPARM(6) do self-scale in Y).
     8 = PHmin (fixed scale) is used for plotting both Amp and
                             phase together (BPARM(2) <0)
     9 = PHmax (fixed scale) is used for plotting both Amp and
                             phase together (BPARM(2) <0)
         Note that phase is initially computed in the range -180 to
         180 degrees, but will be plotted in the range 0 to 360 if
         specified as such.  In self-scaled phase plots, the plot with
         the smaller total range of those two possibilities is used.
         Values > 360 or < -180 are not available.
     10= Control of plotting for baselines with no data samples:
         > 0  => plot such baselines if a model is being plotted
         <= 0 => don't plot them - such baselines are never
         plotted if there is not a model being plotted.

    Units to use in BPARM(4) - BPARM(7):
        axis type = 1, 9, 10     Jy
                    2, 4         Degrees
                    3, 6, 7, 8   Kilo wavelengths
                    5, 12        Days from start of observation
                   11            Hours
    The axes will be labeled in appropriately scaled units, with axis
    types 11 and 12 expressed in sexagesimal (hours, minutes, seconds as
    needed).  NOTE: two models will be plotted if the x axis type is 3,
    6, 7, or 8 (uv distance, u, v, w) since the x axis value determines
    the baseline only with an ambiguity.  Models are plotted only if the
    y-axis type is 1, 2, 9, or 10 and the x-axis type is NOT 1, 2, 9, or
    10 (and if NITER > 0 and there is an appropriate CC file).

  ALIAS.......Any antenna that appears in ALIAS(2...30) will be treated
              as if it was actually the antenna specified in ALIAS(1).
              e.g. ALIAS = 3 7 9 1 0 results in antennas 1,3, 7 and 9
              being treated as if they were actually one antenna [which
              is labelled antenna 3].
  REFANT......Hour angle, elevation, parallactic angle, and azimuth
              are actually antenna parameters not baseline parameters.
              If REFANT > 0, these plot parameters will be those
              evaluated at antenna REFANT.
              If REFANT = 0, these parameters are
              evaluated at each antenna of an antenna pair and averaged
              for plotting purposes.
  NPLOTS......Max number of plots per page. 0 => 3.  If AMP and
              PHASE are plotted together (BPARM(2) < 0), NPLOTS
              equals max. number of pairs of plots per page.
  POLPLOT.....An option to display the ratio of various correlated
              values. Allowed combinations are: 'RL/RR', 'RL/LL',
              'LR/RR', 'RL/LL', 'RR/LL', 'LL/RR', 'XY/XX', 'XY/YY',
              'YX/XX', 'XY/YY', 'XX/YY', 'YY/XX', 'Q/I', 'U/I', 'V/I'
              other => don't use this option.
  SYMBOL......Symbol to use when plotting.
              1: Plus sign           12: Five pointed star
              2: Cross (X)           13: Star of David
              3: Circle              14: Seven-pointed star
              4: Box                 15: Eight-pointed star
              5: Triangle            16: Nine-pointed star
              6: Diamond             17: Ten-pointed star
              7: Pentagon            18: 11-pointed star
              8: Hexagon             19: 12-pointed star
              9: Septagon            20: 13-pointed star
              10: Octagon            21: 14-pointed star
              11: Nine-gon           22: Plus with gap
                                     23: Vertical line
                                     24: Cross (X) with gap
              0 => 2 Cross (X) (FACTOR >=0) or
                   no point plotting (FACTOR < 0).
  FACTOR......0 => 1.  Scale symbol size by FACTOR.
              FACTOR < 0 => connect points with lines, scale points by
              -FACTOR.  Line drawing is disabled when plotting a model
              or when x,y are two of u,v,w.
  LTYPE.......Labelling type, see HELP LTYPE for details:
              1 = border, 2 = no ticks, 3 or 7 = standard, 4 or 8 =
              relative to ref. pixel, 5 or 9 = relative to subimage
              (BLC, TRC) center, 6 or 10 = pixels.  7-10 all labels
              other than tick numbers and axis type are omitted.
              Less than 0 is the same except that the plot file
              version number and create time are omitted.
              Add n * 100 to alter the metric scaling.


  DOTV........> 0 => plot directly on the TV device, otherwise
              make a plot file for later display on one or
              more devices (including the TV if desired).
  GRCHAN......Graphics channel (1 - 7) to use for line drawing.
              0 => 1.
  XYRATIO.....Scale the X axis longer than the Y by XYRATIO.
              If DOTV >  0, 0 -> fit to the TV window
              If DOTV <= 0, 0 -> 1.
  BADDISK....The disk numbers to avoid for scratch files (sorting
             tables mostly).
----------------------------------------------------------------
