% @(#)averagkapp.hlq	19.1 (ESO-IPG) 02/25/03 14:02:58 
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990 European Southern Observatory
%.IDENT      averagkapp.hlq
%.AUTHOR     KB, IPG/ESO
%.KEYWORDS   MIDAS, help files, AVERAGE/KAPPA
%.PURPOSE    On-line help file for the command: AVERAGE/KAPPA
%.VERSION    1.0  19-JUL-1990 : Creation, KB
%.VERSION    1.1  11-OCT-1991 : Update, KB
%----------------------------------------------------------------
\se
SECTION./KAPP
\es\co
AVERAGE/KAPPA						19-JUL-1990  KB
\oc\su
AVERAGE/KAPPA [in_specs] [out_specs] [out_opt] [draw_flag] [no_iter]
	compute average (kappa-sigma clipping) over subimage
\us\pu
Purpose: 
          Compute average of all pixels in a subimage via kappa-sigma 
          clipping algorithm.
\up\sy
Syntax: 
          AVERAGE/KAPPA [in_specs] [out_specs] [out_opt] [draw_flag] [no_iter]
\ys\pa
          in_specs  = input specifications, 
\\
             (a) CURSOR, if subimages are chosen via the cursor rectangle,
\\
             (b) image,table if subimages are defined in a table in the columns
                 labeled :XSTART, :XEND, :YSTART and :YEND,
\\
                 defaulted to CURSOR
\ap\pa
          out_specs = output specifications,
\\
             (c) :label indicating that the result value should be stored in
                 column :label of the table given in in_specs (b)
\\
             (d) table,:label for cursor input (a) only,
\\
             (e) descriptor if the results should be stored in a real descr.
                 of the involved image, data will be stored as xstart, ystart,
                 xend, yend and average value of subimage
\\
             (f) if omitted, to just display values on the terminal
\ap\pa
          out_opt = A, append data to a descriptor, else start at the
             beginning, for (e) only
\\
             = C, store also x-,y-center into columns labeled :XCEN and :YCEN
             of given table, for (c) + (d)
\ap\pa
          draw_flag = Y(es) or N(o) for drawing or not drawing the subimages
             in the overlay plane
\ap\pa
          no_iter = no. of iterations for 2*sigma clipping, defaulted to 1
\ap\sa
See also:
          AVERAGE/AVERAGE, AVERAGE/MEDIAN, AVERAGE/WEIGHTS, AVERAGE/IMAGE,
\\
          AVERAGE/COLUMN, AVERAGE/ROW
\as\no
Note:
          Currently,this command is not implemented for 1-dim frames.
\\
          When using the cursor input option, a cursor rectangle will appear
          on the screen.
\\
          Press ENTER button on the mouse to start calculation on subimage.
          Use the mouse to move cursor window. Use the arrow keys to change
          the size of the cursor window. 
          To exit press the EXIT button on the mouse.
\\
          Kappa = 2, i.e. we reject all pixels with values differing more than
          two sigma from the mean.
\on\exs
Examples:
\ex
          (1) AVERAGE/KAPPA
             Use cursor to define subimages and display start- and end-coords
             of subimage and average value on terminal only.
\xe\ex
          (2) AVERAGE/KAPPA cursor VALUES
             As (1)  but write data to the beginning of real descriptor VALUES
             of displayed image.
\xe\ex
          (3) AVERAGE/KAPPA CURSOR values A
             As (2) but append data to the end of real descriptor values.
\xe\ex
          (4) AVERAGE/KAPPA CURSOR values,:MEAN
             As (1) but store data into column labeled :MEAN of new table
             `values.tbl'.
\xe\ex
          (5) AVERAGE/KAPPA CURSOR values,:MEAN C
             As (4) but store also center coordinates into columns labeled
             :XCEN and :YCEN.
\xe\ex
          (6) AVERAGE/KAPPA ccd001,flats
             Use columns :XSTART, :YSTART, :XEND and :YEND of table `flats.tbl'
             to define the subimages of frame `ccd001.bdf'. Just display the
             results.
\xe\ex
          (7) AVERAGE/KAPPA ccd001,flats values
             As (2) but input from table as in (6).
\xe\ex
          (8) AVERAGE/KAPPA ccd001,flats :MEAN
             As (7) but store result into column :MEAN of table `flats.tbl'.
\xe \sxe
