; IMSTAT
;---------------------------------------------------------------
;! returns statistics of a sub-image
;# Verb Analysis
;-----------------------------------------------------------------------
;;  Copyright (C) 1995, 2003, 2009
;;  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
;-----------------------------------------------------------------------
IMSTAT    LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
IMSTAT:  Verb to find the mean, rms and maximum in an image
INNAME                             Image name (name)
INCLASS                            Image name (class)
INSEQ            0.0       9999.0  Image name (seq. #)
INDISK           0.0          9.0  Disk drive #
BLC              0.0       4096.0  Bottom left corner of image
                                     0=>entire image
                                     BLC(1)=-1 => circlular
TRC              0.0       4096.0  Top right corner of image
                                     0=>entire image
DOINVERS        -1.0          1.0  >0 => full image except for
                                     BLC-TRC, <= 0 => only
                                     BLC-TRC.
         @      Output adverbs:
PIXAVG   @                         Mean pixel value
PIXSTD   @                         RMS about mean pixel value
PIXVAL   @                         Peak pixel value
PIXXY    @                         Coordinates of peak (pixels)
PIX2VAL  @                         Minimum pixel value
PIX2XY   @                         Coords of minimum (pixels)
----------------------------------------------------------------
IMSTAT
Type: Verb
Use:  IMSTAT will read a portion of an image and print the mean and
      rms brightnesses found.  It also prints the location and value
      of the maximum and minimum brightness in that portion.  It
      returns these results in adverbs.  Rectangular or circular
      apertures may be used.
Adverbs (input):
  INNAME......Image name(name).        Standard defaults.
  INCLASS.....Image name(class).       Standard defaults.
  INSEQ.......Image name(seq. #).      0 => highest.
  INDISK......Disk drive # of image.   0 => any.
  BLC.........The Bottom Left-hand pixel of the subarray of the image
              to be analysed. The value (0,0) means (1,1).
              If BLC(1) = -1, then BLC(2) is taken to be a radius of a
              circular aperture centered on TRC(1),TRC(2).
  TRC.........The Top Right-hand pixel of the subarray of the image to
              be analysed.  The value (0,0) means the top right hand
              corner of the entire image.
              See note above for circular apertures.
  DOINVERS....If true (>0.0), find the statistics in the full image
              except for those pixels within the BLC to TRC 7-dim
              cube.  If false (<= 0.0), find the statistics within the
              BLC to TRC 7-dim cube.
Adverbs (output):
  PIXAVG......Mean pixel value found in subimage in the same
              units as the image (e.g. Jy/beam).
  PIXSTD......RMS in the pixel values about the mean in the
              subimage in the same units as the image.
  PIXVAL......Peak pixel value in the subimage.
  PIXXY.......Pixel coordinates of the pixel having the largest
              value within the subimage.
  PIX2VAL.....Minimum pixel value in the subimage.
  PIX2XY......Pixel coordinates of the pixel having the smallest
              value within the subimage.
----------------------------------------------------------------
