% @(#)deconvimag.hlq	19.1 (ESO-IPG) 02/25/03 14:03:13 
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990 European Southern Observatory
%.IDENT      deconvimag.hlq
%.AUTHOR     KB, IPG/ESO
%.KEYWORDS   MIDAS, help files, DECONVOLVE/IMAGE
%.PURPOSE    On-line help file for the command: DECONVOLVE/IMAGE
%.VERSION    1.0  02-OCT-1985 : Creation, KB
%----------------------------------------------------------------
\se
SECTION./IMAG
\es\co
DECONVOLVE/IMAGE					02-OCT-1985  KB
\oc\su
DECONVOLVE/IMAGE frame psf result [no_iter] [cont_flag]
	deconvolve image with point spread function
\us\pu
Purpose: 
          Deconvolve image with given point spread function using an iterative
          algorithm published by L.B.Lucy in the Astronomical Journal,
          vol. 79., 1974.
\up\sy
Syntax:  
          DECONVOLVE/IMAGE frame psf result [no_iter] [cont_flag]
\ys\pa
          frame = name of input image
\ap\pa
          psf = name of point spread function, number of axes must be not
                greater than the one of input image
\ap\pa
          result = name of result frame
\ap\pa
          no_iter = number of iterations; defaulted to 3
\ap\pa
          cont_flag = C for continuing iteration; defaulted to NO
\ap\sa
See also:
          CONVOLVE/IMAGE
\as\no
Note: 
          The PSF must be centered at 0.0 (in world coordinates). Please, note, 
          that it is not enough that e.g. a CENTER/GAUSS command confirms that;
          the actual test in the program (e.g. for x) is:
\\
          endx = startx + (xpix-1)*stepx
\\
          t = abs(startx) - abs(endx); and the value of t must be close to 0.0
\\
          Here, startx = descr. START(1), xpix = NPIX(1), stepx = STEP(1)
\\
          so you must use WRITE/DESCR to toggle descriptor START such that `t'
          as defined above  gets close to 0.0 for x and y.
\\
          For example, if you create a PSF via:
          CREATE/IMAGE psf 2,256,256 ? gauss
\\
          You get a perfectly centered PSF but the peak is around the world
          coord pair (128.0,128.0). Changing the start values from (0,0) to
          (-127.5,-127.5) via: WRITE/DESCR psf start -127.5,-127.5
          will move the peak to the world coords (0.5,0.5). And we get, for x,
          endx = -127.5 + (255 * 1.0) = 127.5, and thus t = 0.
\\
          Currently only 1- or 2-dim frames may be processed.
\\
          Setting no_iter = 0, will result in the convolution of the input
          image with the point spread function!
\\
          If cont_flag = C, it is assumed, that the output frame holds already
          the results of a previous iteration.
\on\exs
Examples:
\ex
          DECONVOLVE/IMAGE myframe mypsf result
            Deconvolve image `myframe.bdf' with psf `mypsf.bdf',
            use 3 iterations and store result into newly created image 
            `result.bdf'.
\xe\ex
          DECONVOLVE/IMAGE myframe mypsf result ? C
            As above, but use the values of frame `result.bdf' as start for
            iteration.
\xe\ex
          DECONVOLVE/IMAGE a psf b 0
            Convolve image `a.bdf' with point spread function `psf.bdf' and 
            store resulting image into frame `b.bdf'.
\xe \sxe
