; PDPLT
;---------------------------------------------------------------
;! Plots selected contents of PD tables
;# Task UV Calibration Plot Polarization
;-----------------------------------------------------------------------
;;  Copyright (C) 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
;-----------------------------------------------------------------------
PDPLT     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
PDPLT:  Plots selected contents of a PD table
INNAME                             UV data (name).
INCLASS                            UV data (class).
INSEQ             0.0    9999.0    UV data (seq. #).  0 => high
INDISK            0.0       9.0    Disk unit #.  0 => any
INEXT                              Input 'PD'
INVERS                             Input table file version no.
IN2NAME                            UV data (name). comparison
IN2CLASS                           UV data (class).
IN2SEQ            0.0    9999.0    UV data (seq. #).  0 => high
IN2DISK           0.0       9.0    Disk unit #.  0 => any
IN2VERS                            Input table file version no.
IN3NAME                            UV data (name). comparison
IN3CLASS                           UV data (class).
IN3SEQ            0.0    9999.0    UV data (seq. #).  0 => high
IN3DISK           0.0       9.0    Disk unit #.  0 => any
IN3VERS                            Input table file version no.
IN4NAME                            UV data (name). comparison
IN4CLASS                           UV data (class).
IN4SEQ            0.0    9999.0    UV data (seq. #).  0 => high
IN4DISK           0.0       9.0    Disk unit #.  0 => any
IN4VERS                            Input table file version no.
ANTENNAS                           Antennas from INNAME
BPARM                              Antennas from IN2NAME
CPARM                              Antennas from IN3NAME
DPARM                              Antennas from IN4NAME
FREQID                             Freq. ID to plot, -1=>all
SUBARRAY         -1.0              Limit to subarray; 0 -> 1
                                      -1 -> all
STOKES                             Stokes type to plot:
                                      R, L, RR, LL, RRLL,
                                      X, Y, XX, YY, XXYY
BIF               0.0      100.0   First IF to plot, 0=>1.
EIF               0.0      100.0   Last IF to plot 0 -> highest
BCHAN             0.0              Min channel to plot
ECHAN             0.0              Max channel to plot
OPTYPE                             Data to be plotted:
                                   'PHAS','AMP ','A&P'
PIXRANGE                           Range to plot: 0 => self
                                   scale each antenna separately
APARM                              (1,2) Phase plot range A&P
                                   (3) > 0 label with frequency
                                   (4) > 0 omit IF dividers
OVERLAP                            > 0 => plot all antennas on
                                       one plot
DO3COLOR         -1.0        2.0   > 0 use 3-color symbols to
                                   separate antennas
SYMBOL          0.0        24.0    Plot symbol number: 1 - 24
FACTOR        -10.0        10.0    Scale plot symbols by FACTOR
                                   <0 => connect points too
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
XYRATIO         0.0                X/Y ratio 0 -> fit TV or 1 PL
----------------------------------------------------------------
PDPLT
Type:  Task
Use:   Plots selected data versus frequency from a PD (spectral
       polarization D term) table.
Adverbs:
  INNAME.....UV file name (name).       Standard defaults.
  INCLASS....UV file name (class).      Standard defaults.
  INSEQ......UV file name (seq. #).     0 => highest.
  INDISK.....Disk unit #.               0 => any.
  INEXT......'PD' is assumed for now
  INVERS.....Version number of table to plot, 0=>highest no.
  IN2NAME....UV file name (name).       Standard defaults.
                Fill the 2 adverbs only if you want to compare
                two different PD tables.
  IN2CLASS...UV file name (class).      Standard defaults.
  IN2SEQ.....UV file name (seq. #).     0 => highest.
  IN2DISK....Disk unit #.               0 => any.
  IN2VERS....Version number of table to plot, 0=>highest no.
  IN3NAME....UV file name (name).       Standard defaults.
                Fill the 3 adverbs only if you want to compare
                three different PD tables.
  IN3CLASS...UV file name (class).      Standard defaults.
  IN3SEQ.....UV file name (seq. #).     0 => highest.
  IN3DISK....Disk unit #.               0 => any.
  IN3VERS....Version number of table to plot, 0=>highest no.
  IN4NAME....UV file name (name).       Standard defaults.
                Fill the 4 adverbs only if you want to compare
                four different PD tables.
  IN4CLASS...UV file name (class).      Standard defaults.
  IN4SEQ.....UV file name (seq. #).     0 => highest.
  IN4DISK....Disk unit #.               0 => any.
  IN4VERS....Version number of table to plot, 0=>highest no.
  ANTENNAS...A list of the antennas to be plotted. All 0 => all.
             (The use of negative to omit is not done in this task.)
             These antenna numbers apply to the first data set.
  BPARM......A list of antenna numbers in the second data set where
             BPARM(i) corresponds to ANTENNAS(i).  If BPARM(1) is
             zero, ANTENNAS is used for the second data set.
  CPARM......A list of antenna numbers in the third data set where
             CPARM(i) corresponds to ANTENNAS(i).  If CPARM(1) is
             zero, ANTENNAS is used for the third data set.
  DPARM......A list of antenna numbers in the fourth data set where
             DPARM(i) corresponds to ANTENNAS(i).  If DPARM(1) is
             zero, ANTENNAS is used for the fourth data set.
  FREQID.....Frequency identifier to select (you may determine which is
             applicable from a PRTAB on the PD table)
  SUBARRAY...Limit display to specific subarray.  0 -> 1.
  STOKES.....The desired Stokes type of the displayed data:
             'R' = RCP, 'L' = LCP, 'RL' or 'RRLL' both RCP and LCP
             'X' = XLP, 'Y' = YLP, 'XY' or 'XXYY' both XLP and YLP
  BIF........First IF IF to plot
  EIF........Last IF to plot.
  OPTYPE.....Data to be plotted:
             1.  'PHAS' = phase,
             2.  'AMP ' = amplitude,
             3.  'A&P ' = both together
  PIXRANGE...If PIXR(1) < PIXR(2), all plots will be from  PIXR(1) to
             PIXR(2) (amplitude, phase, or in A&P, amplitude).
             Otherwise each plot will be self-scaling.
  APARM......(1) For A&P, if APARM(1) < APARM(2), use these to control
                 the phase plot range.
             (3) If > 0, plot frequency labels on the x axis
                 If the 2 files have different frequencies then this
                 option is forced as is APARM(4) and no divider is
                 plotted.
             (4) If > 0, omit IF dividers.  A divider without ticks
                 will still be plotted if there is a discontinuity in
                 the frequency axis.
  DO3COLOR...<= 0 => use line type 4 for all points plotted.
             > 0 => use 3-color to separate antennas
             > 1.5 => use 3-color to separate each antenna in ANTENNAS
                      but use the same color for BPARM(i), CPARM(i),
                      and DPARM(i) as is used for ANTENNAS(i).
  SYMBOL.....1: Plus sign (default)   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 with gap
  FACTOR.....Scale plot symbols by FACTOR     0 -> 1.
             If FACTOR < 0, draw lines between the points and use
             abs(FACTOR) to scale the points plotted.  To have
             no points plotted, set -0.2 <=FACTOR < 0.
  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.
             A value of 0 causes more than one graphics channel to be
             used.
  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.
----------------------------------------------------------------
