% @(#)modifypixe.hlq	19.1 (ESO-IPG) 02/25/03 14:03:30 
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990 European Southern Observatory
%.IDENT      modifypixe.hlq
%.AUTHOR     KB/RNH, IPG/ESO
%.KEYWORDS   MIDAS, help files, MODIFY/PIXELS
%.PURPOSE    On-line help file for the command: MODIFY/PIXELS
%.VERSION    1.0  23-SEP-1988 : Creation, KB/RNH
%----------------------------------------------------------------
\se
SECTION./PIXE
\es\co
MODIFY/PIXELS					26-SEP-2000  KB
\oc\su
MODIFY/PIXELS [source] [resfram] [arfacts] [xdeg,ydeg,niter] [drawflg]
              [noise] [ima_sec]
	approximate pixel-area in an image
\us\pu
Purpose: 
          Modify pixel values in an image by approximation over the 
          surrounding area.
\up\sy
Syntax:  
          MODIFY/PIXELS [source] [resfram] [arfacts] [xdeg,ydeg,niter]
                        [drawflg] [noise] [ima_sec]
\ys\pa
          source = specifies how the pixel areas we modify will be defined:
\\
               (a) CURSOR to use displayed frame + cursor rectangle to define
                   pixel areas which are to be modified 
\\
               (b) frame,table[,flag] to use frame + table to define areas,
                     flag: PIXEL may be appended in order to work with frame
                     pixels otherwise world coordinates of the input frame 
                     will be used - see the Notes for column labels; 
\\
                     by default `flag' is omitted, i.e. we use world coords.
\\
               (c) frame  to first load that frame into the display and then 
                   use the CURSOR option;
\\
               defaulted to CURSOR (a)
\ap\pa
          resfram = name of result frame, will be a copy of the input frame
               except for the "cleaned" areas;
\\
               defaulted to input frame or displayed frame;
\\
               i.e. the input frame will be modified
\ap\pa
          arfacts = factors to determine size of surrounding area from cursor
               area; e.g. if cursors define a 5x5 pixel area, the surface used
               in the interpolation will be 15*15 (factors are of type REAL);
\\
               max. size of surrounding area is currently set to:
	       4096 x-pixels, 1024 y-lines,
	       but not more than 204800 pixels in total;
\\
               defaulted to 3,3
\ap\pa
          xdeg,ydeg,niter = degree of fitting polynomial in x, y and no. of
               iterations;
\\
               defaulted to 2,2,5
\ap\pa
          drawflg = 1, the cursor defined rectangle is also drawn into the
               overlay channel;
\\
               2, the modified area is loaded immediately after into the image
               display;
\\
               3, 1 and 2 above,
\\
               0, nothing of the above;
\\
               defaulted to 3 for parameter `source' = (a), (c);
\\
               defaulted to 0 for parameter `source' = (b)
\ap\pa
          noise = Y or N, whether the replaced region is to have artificial,
               Gaussian noise added to make it look more natural;
\\
               defaulted to Y
\ap\pa
          ima_sec = specifies the image section of the frame on which
               the surface fits are allowed to be done. Areas completely
               outside this section will be ignored. In case the surrounding
               area is too big it will be cut off at the image section limits.
\\
               The image section is defined in usual MIDAS syntax,
               defaulted to full image
\ap\sa
See also:
          MODIFY/AREA, MODIFY/ROW, MODIFY/COLUMN, REPLACE/IMAGE, GET/CURSOR
\as\no
Note:
          (a) Cursor input:
\\
            Use the mouse to move the cursor rectangle and the arrow keys on 
            the keyboard to adjust the size. The leftmost button on the mouse
            is the ENTER button. The next button to the right of the ENTER
            button is the EXIT button (the RETURN key also serves as EXIT
            button).
\\
            All pixels inside the cursor_rectangle will be interpolated.
            Interpolation is done with a 2-dim surface fitted to pixels around
            the cursor_rectangle.
            A kappa*sigma clipping is applied if "iter" > 0 to delete
            unwanted point sources from the surface.
\\
            The size of the cursor rectangle will be the one from the last
            usage of the cursor rectangle and could be too large (cf. the
            description of par. `arfacts' above). So you may have to modify
            that size first. 
\\
          (b) Table input:
\\
            Columns which have to be labeled :XSTART, :XEND, :YSTART and :YEND
            containing world coords. are used to define the areas.
            If table flag is set to PIXEL then the columns labeled :XSTARTPIX,
            :XENDPIX, :YSTARTPIX and :YENDPIX containing frame pixels are used,
            instead.
\\
            All the columns specified above are e.g. created in the command
            GET/CURSOR with table output.
\\
            For frames with a non-linear world coord-system the PIXEL option
            should be used!
\\
          Currently, the command is NOT working on 1-dim images.
\on\exs
Examples:
\ex
          MODIFY/PIXELS ? zacatecas
            Use the cursor rectangle to define the pixel area(s) in the
            displayed frame and put results into frame `zacatecas.bdf'.
\xe\ex
          MODIFY/PIXELS delicias,torreon chihuahua
            Obtain from table `torreon.tbl' the pixel area(s) of frame
            `delicias.bdf', put results into `chihuahua.bdf'.
\xe\ex
          MODIFY/PIXELS veracruz monterrey
            Load frame `veracruz.bdf' into the image display. Then, use the
            cursor rectangle to define the pixel area(s) in the
            displayed frame and put results into frame `monterrey.bdf'.
\xe\ex
          MODIFY/PIXELS antofagasta,arica taltal p7=[@17,<:@2064,>]
            Use the area(s) as specified in the columns :XSTART,
            :XEND, :YSTART and :YEND of table `arica.tbl' for
            `antofagasta.bdf', omit the pre- and postscan regions of the CCD
            in the calculations and put results into `taltal.bdf'.
\xe\ex
          MODIFY/PIXELS parranal,delicias,pixel cuautemoc
            Use the pixel area(s) as specified in the columns :XSTARTPIX,
            :XENDPIX, :YSTARTPIX and :YENDPIX of table `delicias.tbl' for
            FORS frame `parranal.bdf' (which has a non-linear world coord-sys), 
            and put results into `cuautemoc.bdf'.
\xe \sxe
