% @(#)rectifimag.hlq	19.1 (ESO-IPG) 02/25/03 13:30:33 
\se
SECTION./IMAG
\es\co
RECTIFY/IMAGE                                               20-AUG-1985  DB/KB
\oc\su
RECTIFY/IMAGE in out table [nrep] [deconvol_flag]
	rectify geometrically a distorted direct image
\us\pu
Purpose: 
          Geometrically rectify a distorted direct image (e.g. obtained
          with an image tube).
\up\sy
Syntax:   
          RECTIFY/IMAGE in out table [nrep] [deconvol_flag]
\ys\pa
          in = input frame
\ap\pa
          out = output frame
\ap\pa
          table = table with the following columns
\\
                \#1 :  theoretical "x"-coordinates of reseau marks
\\
                \#2 :  theoretical "y"-coordinates of reseau marks
\\
                \#3 :  measured "x"-coordinates of reseau marks
\\
                \#4 :  measured "y"-coordinates of reseau marks
\\
                All coordinates are expected in units of pixels of the image.
\ap\pa
          nrep = additional sub-stepping factor (cf. "Note" below);
\\
                default: 1, maximum: 5
\ap\pa
          deconvol_flag = deconvolution flag. Y=YES, N=NO. Default: N
\ap\sa
See also:
          RECTIFY/SPECTRUM, COMPUTE/GRID
\as\no
Note:     
          A very CPU-time intensive program! 
\\
          The photometric accuracy per pixel is thought to be better than
          about 1% for a PCD or ST-FOC frame with constant uniform flux.
          The flux conservation is perfect if also nearest neighbours are
          considered. At the expense of further CPU time consumption, the
          said 1% level can be reduced to 0.1% if `nrep' is increased to 5.
          This seems justified only for observations of the highest S/N.
          The programme routinely performs a simple "deconvolution"
          assuming a fixed point spread function (PSF) of about one pixel
          which appears appropriate for a wide range of applications.
          This can be suppressed (deconvol_flag = N) for test purposes
          or low-resolution data, i.e. data with a FWHM of the PSF of a
          few pixels, but even for high-resolution data the results are
          not bad. With deconvol_flag = N (and nrep = 1), the execution
          time is reduced by a factor of 5 !
\on\exs
Examples:
\ex
          For a demo use the command COMPUTE/GRID (no parameters).
\\
          This will create a distorted grid image (GRID.bdf) as well as the 
          relevant table (GRID.tbl) containing the theoretical and measured 
          reseau marks.
\\
          You can then try the algorithm on these test inputs, e.g.:
\\
          RECTIFY/IMAGE GRID outgrid GRID
          Load the result image outgrid.bdf to see the effect of RECTIFY/IMAGE .
\xe \sxe
