; UVHGM
;---------------------------------------------------------------
;! Plots statistics of uv data files.
;# TASK UV PLOT
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 1999
;;  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
;-----------------------------------------------------------------------
UVHGM     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
UVHGM:  Task to produce histograms summarizing uv data.
USERID      -32000.0      32000.0  User identification number,
                                         0 -> current user
                                     32000 -> all users
INNAME                             uv name
INCLASS                            uv class
INSEQ            0.0       9999.0  uv sequence number
INDISK           0.0          9.0  uv disk number
STOKES                             Stokes parameter: I, Q, U, V,
                                   RR, LL, RL, or LR - must be
                                   in data (no conversion)
BCHAN            0.0       9999.0  First spectral channel: 0->1
ECHAN            0.0       9999.0  Last spectral channel: 0->max
BIF              0.0       9999.0  First IF to use
EIF              0.0       9999.0  Last IF to use
DOALL           -1.0          1.0  > 0 => plot 2 curves/plot,
                                   upper includes flagged data
NBOXES           0.0       1024.0  Number of histogram bins.
PIXRANGE                           Use fixed x-axis range
AXTYPE                             Selection code (see help)
                                     U = u,  V = v,  W = w
                                     R = SQRT(u*u + v*v)
                                     D = SQRT(u*u + v*v + w*w)
                                     O = baseline position angle
                                     T = time
                                     B = baseline antenna pair
                                     S = source id number
                                     F = frequency id number
                                     H = real,  I = imaginary
                                     A = amplitude,  P = phase
                                     C = weight
                                     X = amplitude * sqrt(wt)
OPCODE                             CLIN: linear by count
                                   CLOG: log10  by count
                                   WLIN: linear by weight
                                   WLOG: log10  by weight
LTYPE         -10.0        10.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.
----------------------------------------------------------------
UVHGM
Type: Task
Use:  UVHGM produces histograms which summarize the content of a uv data
      set.  The values of "bad" (flagged) data may be included in the
      plots as an additional histogram plotted above the one which
      includes only unflagged data.
Adverbs:
  USERID......User ID of owner of image.  0=>current user
                32000=>all users
  INNAME......uv name,             Standard defaults.
  INCLASS.....uv class,            Standard defaults.
  INSEQ.......uv sequence number,  0 -> highest.
  INDISK......uv disk number,      0 -> any.
  STOKES......Stokes parameter: I, Q, U, V, RR, LL, RL, or LR.
              The default is the first correlator.  Note that UVHGM
              plots single correlators; it cannot convert to other
              Stokes types.  Exceptions are:
                 'RRLL'  plot both RR and LL on same plot
                 'RLLR'  plot both RL and LR on same plot
                 RR plus LL can be converted to I or V.
  BCHAN.......First frequency channel number, 0 -> 1.
  ECHAN.......Last frequency channel to include.  < BCHAN +> max
              All included channels and IFs appear in each histogram.
  BIF.........First IF band to include.  0 => 1.
  EIF.........Last IF band to include.  < BIF => max
  DOALL.......True (> 0) means to plot histograms for unflagged and for
              all data on the same plot.  False (<= 0) means to count
              and plot only "good" data.
  NBOXES......Number of histogram bins.  The product of NBOXES and the
              number of histograms specified by AXTYPE must not exceed
              4096.  The default is 128.
  PIXRANGE....Range of x-axis values to be binned and plotted.  Note
              that one PIXRANGE applies to all AXTYPEs plotted (which
              may not be a good idea).
  AXTYPE......Selection code.  Up to eight of the following codes may be
              specified per execution.
                 U = u,  V = v,  W = w,  R = SQRT(u*u + v*v)
                 D = SQRT(u*u + v*v + w*w),
                 O = baseline position angle
                 T = time,  B = baseline antenna pair
                 S = source identification number
                 F = frequency identification number
                 H = real part of the visibility
                 I = imaginary part
                 A = visibility amplitude,  P = visibility phase
                 C = visibility weight
                 X = visibility amp * sqrt(visibility weight)
              Since D measures the physical separation between each
              antenna pair it should be invariant.
  OPCODE......A code for the way the histograms are to be constructed.
              The bins may be linear or logarithmic (base 10), and the
              data can be added as a simple count of the visibilities,
              or as the sum of the weights recorded with visibility.
              The weight is usually the length of the sample period
              measured in tens of seconds.  Recognized codes are 'CLIN',
              'CLOG', 'WLIN', and 'WLOG'.  All  others => 'CLIN'
  LTYPE.......Labelling type: 1 = border, 2 = no ticks, 3 - 10 =
              standard, with  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.
  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).  If more than one page of
              plot is to be done, then the task pauses 30 seconds
              between plots (or continues sooner if you hit button A, B,
              or C).  Button D in that interval tells the task to stop.
  GRCHAN......Graphics channel (1 - 7) to use for line drawing.  0 => 1.
----------------------------------------------------------------
