%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%.COPYRIGHT  (c)  1990-2007 European Southern Observatory
%.IDENT      subtratemp.hlq
%.AUTHOR     KB, IPG/ESO
%.KEYWORDS   MIDAS, help files, SUBTRACT/TEMPLATE
%.PURPOSE    On-line help file for the command: SUBTRACT/TEMPLATE
%.VERSION    1.0  29-JUN-2007 : Creation, KB (for DB, 20.2.1990)
%----------------------------------------------------------------
\se
SECTION./TEMP
\es\co
SUBTRACT/TEMPLATE				29-JUN-2007 DB
\oc\su
SUBTRACT/TEMPLATE in out template coords scale
	subtract a properly shifted and resampled template pattern
	from an image
\us\pu
Purpose:  
           Resample and shift a template pattern, scale it in intensity,
	   and subtract it from a given image.
\up\sub
Subject: 
           Cleaning
\bus\sy
Syntax: 
	   SUBTRACT/TEMPLATE in out template coords scale
\ys\pa
           in       = 2-dim input image
\ap\pa
           out      = result image
\ap\pa
           template = image with template pattern
\ap\pa
           coords   = world coords (x,y) to which origin of coordinate
		      frame (0,0) of template pattern shall be shifted
\ap\pa
           scale    = flux scaling factor applied to template before
		      subtraction
\ap\no
Note:      
           OJO: Input and template mages must have "same" stepsize, i.e. 
	   within 0.001 of a step.
	   The center of the template (peak) should be located at world
	   coords (0,0).
           This command is useful for, e.g. the PSF subtraction of stars
	   or other point sources from 2-dim images.
	   If, in that example, a star is located at coord (x,y), 
	   the point spread function must be located at (0,0) in the 
	   template image.
\on\sa
See also:
           COMPUTE/IMAGE
\as\exs
Examples:
\ex
           SUBTRACT/TEMPLATE contam decontam psf -312.81,18.324 17.86
             Shift and resample image `psf.bdf' such that coords (0,0) 
	     become (-312.81,18.324), scale intensity by factor 17.86, and
	     subtract from input image `contam.bdf'.
	     Result will be in `decontam.bdf'.
\xe \sxe
