; PCHIS
;---------------------------------------------------------------
;! Generates a histogram plot file from text input, e.g. from PCRMS
;# TASK PLOT VLBI
;-----------------------------------------------------------------------
;;  Copyright (C) 2017, 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
;-----------------------------------------------------------------------
PCHIS     LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
PCHIS:  Task to generate a histogram plot file from text file
INNAME                             Image name(name).
INCLASS                            Image name(class).
INSEQ           0.0      9999.0    Image name(seq. #). 0=>high
INDISK          0.0         9.0    Disk drive #. 0=>any
INTEXT
                                   Text file with plot info
APARM                              Controls over plot
                                   (1,2) Column value plot
                                      range
                                   (3,4) Histogram value plot
                                      range
                                   (5) which of the N to plot
                                   (6) how many sigma 0 -> 4
FUNCTYPE                           'LG' else linear
NBOXES                             Number boxes <= 1024
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
XYRATIO         0.0                XYratio scale plot
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.
----------------------------------------------------------------
PCHIS
Type: Task
Use:  PCHIS will write commands to a plot file for the execution of a
      histogram plot for an arbitrary data file.  The input text file
      contains up to 100 columns of numbers and APARM(5) selects which
      column is used to produce the histogram plot.  The mean and rms
      of the histogram are computed and the mean and 5 * rms to each
      side of the mean are plotted.

      This task was written to plot the output of PCRMS but is
      sufficiently general that it may have other applications.
Adverbs:
  INNAME......Image name (name).       Standard defaults.  The plot file
              is attached to this AIPS file which is otherwise ignored.
  INCLASS.....Image name (class).      Standard defaults.
  INSEQ.......Image name (seq. #).     0 => highest.
  INDISK......Disk unit #.             0 => any.
  INTEXT......Text file containing columns of numbers.  Each line in
              the file may be up to 1000 characters in length and may
              contain up to 100 numbers.  The first invalid number on
              the line terminates the parsing of the line.  The file
              may contain up to 100000 lines.  It may contain comment
              lines which must start with $ or # in column 1.
  APARM.......(1,2) Column value range.  If APARM(2) <= APARM(1),
                    self scale.
              (3,4) Histogram value range.  If APARM(4) <= APARM(3),
                    self scale.
              (5) which column to plot 0 -> 1
              (6) how many sigma out to count as excess 0 -> 4
  FUNCTYPE....'LG' do log histogram, else linear
              Note APARM(3) and APARM(4) are in log10 of the
              histogram value on 'LG'.
  NBOXES......Number boxes in histogram 0 -> 128  (<= 1024)
  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.
----------------------------------------------------------------
