; BPLOT
;---------------------------------------------------------------
;! Plots bandpass tables in 2 dimensions as function of time
;# Task SPECTRAL UV CALIBRATION PLOT
;-----------------------------------------------------------------------
;;  Copyright (C) 1996, 2003, 2006, 2008-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
;-----------------------------------------------------------------------
BPLOT     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
BPLOT     Plots bandpass tables as profiles wrt time or antenna
USERID                             User 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        9.0   Input UV file disk unit #
INEXT                              'BD', 'PD', 'CP' else 'BP'
INVERS            0.0              Table version to plot
FREQID            0.0              Frequency ID code to plot.
SUBARRAY          0.0              Subarray to plot; 0 => 1
TIMERANG                           Range of times to include
                                   T2 < T1 => plot T2 -> T1 but
                                   average all times
BCHAN            -1.0     8192.0   Lowest channel plotted
ECHAN             0.0     8192.0   Highest channel plotted
BIF               0.0       90.0   Lowest IF plotted
EIF               0.0       90.0   Highest IF plotted
STOKES                             'R...', 'L...', else both
                                   BP also does 'I', 'V'
ANTENNAS                           Include these antennas only
                                   0 => all; < 0 exclude list
CODETYPE                           'AMP ', 'PHAS', 'DIFA',
                                   'DIFP', 'ADIF', 'PDIF'
SORT                               'TA', other => 'AT'
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
----------------------------------------------------------------
BPLOT
Type:  Task
Use:   To create one or more plots (on the TV or plot files) of the
       selected bandpass-like table.  The plots will be a set of
       profiles separated on the vertical axis by an increment in time
       or antenna number (depending on the sort selected).  More than
       one plot for more than one antenna or more than one time may be
       generated.  Multiple IFs and polarizations will be plotted
       along the horizontal axis if they are present in the BP table
       and selected by the adverbs.

       Bandpass-like tables generated by BLCHN and PCAL may also be
       displayed.  BLCHN tables are much like BP tables and BPLOT
       functions normally for them.  PCAL tables do not have time as a
       variable.  The D terms will appear in a single plot with
       antenna number as the Y axis.  the source polarizations will
       also appear in a single plot of Q/I and U/I with source number
       as the vertical axis.
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.
  INEXT......Type of table: 'BD' from BLCHN, 'PD' from PCAL (antenna
             D terms), or 'CP' from PCAL (source polarization), else
             'BP' is used
  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.
  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.
  BCHAN......Lowest channel of a range of channels to be plotted.
             0 => 1.
  ECHAN......Highest channel number to be plotted.  0 => highest.
  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.  If two Stokes are present, 'I' will plot
             (R+L)/2 and 'V' will plot (R-L)/2 for BP tables only.
  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 inlcudes all antennas except 3, 5,
             and 7.
  CODETYPE...'AMP ' to plot the amplitude of the bandpass.
             'PHAS' to plot the phase of the bandpass.
             'REAL' to plot the real part of the bandpass.
             'IMAG' to plot the imaginary part of the bandpass.
             'DIFA' to plot the amplitude of the vector difference
                    between the current bandpass and the average
                    bandpass for the selected time or antenna
             'DIFP' to plot the phase of the vector difference between
                    the current bandpass and the average bandpass for
                    the selected time or antenna
             'DIFR' to plot the real part of the vector difference
                    between the current bandpass and the average
                    bandpass for the selected time or antenna
             'DIFI' to plot the imaginary part of the vector
                    difference between the current bandpass and the
                    average bandpass for the selected time or antenna
             'ADIF' to plot the difference in the amplitude of the
                    current bandpass and the average bandpass for the
                    selected time or antenna.
             'PDIF' to plot the difference in the phase of the current
                    bandpass and the average bandpass for the selected
                    time or antenna.
             The average bandpass is done with a scalar average for
             amplitudes and a vector average for phases.
  SORT.......Sort order for table.  If SORT = 'TA', then each plot will
             show all antennas at a particular time.  Otherwise, each
             plot will show all times for a particular antenna.
             Ignored for PD and CP tables (PCAL).
  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 bandpasses drawn are in a range of
                colors from blue for the first bandpass plotted (at
                the bottom) to red for the last bandpass plotted (at
                the top).  Color distinguishes baseline when SORT='TA'
                and distinguishes times otherwise.
             =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.
----------------------------------------------------------------
