; BLPLT
;---------------------------------------------------------------
;! Plots BLCAL tables in 2 dimensions as function of baseline and IF
;# Task SPECTRAL UV CALIBRATION PLOT
;-----------------------------------------------------------------------
;;  Copyright (C) 2019-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
;-----------------------------------------------------------------------
BLPLT     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
BLPLT     Plots BLCAL tables as profiles wrt baseline
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 #
INVERS            0.0              Table version to plot
FREQID            0.0              Frequency ID code to plot.
SUBARRAY          0.0              Subarray to plot; 0 => 1
BIF               0.0       90.0   Lowest IF plotted
EIF               0.0       90.0   Highest IF plotted
STOKES                             'R...', 'L...', else both
TIMERANG                           Limit times plotted
ANTENNAS                           Include these antennas only
                                   0 => all; < 0 exclude list
CODETYPE                           'AMP ', 'PHAS', 'REAL',
                                   'IMAG', 'DIFA', 'DIFP',
                                   'ADIF', 'PDIF', 'DIFR',
                                   'DIFI'
PIXRANGE                           Clip at these intensities.
                                   0,0=> map min, max.
                                   PIXR(2) < PIXR(1) -> each
                                   panel self scales
FACTOR          0.0                Scale each profile from the
                                   default by FACTOR
DO3COLOR       -1.0         2.0    3-color lines: 0 no, 1 yes
                                   to separate time/antenna,
                                   2 to distinguish intensity
LTYPE        -410.0       410.0    Type of labeling: 1 border,
                                   2 no ticks, 3 standard, 4 rel
                                   to center, 5 rel to subim cen
                                   6 pixels, 7-10 as 3-6 with
                                   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
----------------------------------------------------------------
BLPLT
Type:  Task
Use:   To create one or more plots (on the TV or plot files) of the
       selected BLCAL (BL) table.  The plots will be a set of profiles
       separated on the vertical axis by an increment in second antenna
       number one plot per first antenna.  Normally, BLCAL is run to
       have a single solution averaged over all times, but BLPLT will
       plot multiple times if they are present.  All baselines for the
       first time are plotted followed by all baselines for the second
       time, and so forth.  Both polarizations will appear on each plot
       if they are present and requested.
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.
  INVERS.....Specifies the version of the BP, BD, PD, or CP table to
             be read as input.   0 -> highest.
  FREQID.....Specifies which freqiency ID to plot.  0 => 1.
  SUBARRAY...The subarray number to be plotted.  0 => 1.
  BIF........Lowest IF to be plotted.  0 => 1
  EIF........Highest IF to be plotted.  0 => highest.
  STOKES.....If the first character is R or L then only that
             polarization is plotted.  Otherwise both are plotted if
             present.
  TIMERANG...Time to be plotted: start day, hour, min, sec, end day,
             hour, min, sec.  T1 = T2 => plot and average all times.
             T1 < T2 => average over T1 through T2 and plot T1 through
             T2; T1 > T2 => average all times but plot only T2 through
             T1.
  ANTENNAS...A list of antennas to be included.  all 0 => include all
             If any in the list is negative, then include all antennas
             except and that appear (in absolute value) in the list.
             Thus ANTEN = 3,-5,7 includes all antennas except 3, 5,
             and 7.
  CODETYPE...'AMP ' to plot the amplitude of the BL values.
             'PHAS' to plot the phase of the BL values.
             'REAL' to plot the real part of the BL values.
             'IMAG' to plot the imaginary part of the BL values.
             'DIFA' to plot the amplitude of the vector difference
                    between the current BL values and the average
                    BL values for the selected time and first antenna
             'DIFP' to plot the phase of the vector difference between
                    the current BL values and the average BL values for
                    the selected time and first antenna.  WARNING: if
                    all the values are similar, then this vector
                    difference phase can have values all over the map.
             'DIFR' to plot the real part of the vector difference
                    between the current BL values and the average
                    BL values for the selected time and first antenna
             'DIFI' to plot the imaginary part of the vector
                    difference between the current BL values and the
                    average BL values for the selected time and first
                    antenna
             'ADIF' to plot the difference in the amplitude of the
                    current BL values and the average BL values for the
                    selected time and first antenna.
             'PDIF' to plot the difference in the phase of the current
                    BL values and the phase of the average BL values
                    for the selected time and first antenna.
             The average BL values is done with a scalar average for
             amplitudes and a vector average for phases.
  PIXRANGE...Clip plotted values with PIXRANGE.  0 => self-scale with
             the max min for all solutions in the plot.
             If PIXRANGE(2) < PIXRANGE(1), each small plot will be
             self-scaled within its own plot area.  Else all small
             plots share the same scaling (which is frequently what
             you will actually want).
             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.
  FACTOR.....Controls the plot scale for each profile.
  DO3COLOR...<= 0 => use a single line drawing color (TYPE 2).
             =1 => the various BL values drawn are in a range of
                colors from blue for the first BL values plotted (at
                the bottom) to red for the last BL values plotted (at
                the top).  Color distinguishes the second antenna.
             =2 => use color as an additional separator of intensity.
                The intensity range is assigned colors from blue at
                the lowest value to red at the highest.  Each point on
                the plot gets the color appropriate to its intensity.
             These color options allow the drawings to be more crowded
             and still somewhat distinguishable.
  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.
----------------------------------------------------------------
