idlastro / DAOPHOT-Type Photometry Procedures: SUBSTAR

[Source code]

NAME
SUBSTAR
PURPOSE
Subtract a scaled point spread function at specified star position(s).
EXPLANATION
Part of the IDL-DAOPHOT photometry sequence
CALLING SEQUENCE
SUBSTAR, image, x, y, mag, [ id, psfname, /VERBOSE] 
INPUT-OUTPUT
IMAGE -  On input, IMAGE is the original image array.  A scaled
        PSF will be subtracted from IMAGE at specified star positions.
        Make a copy of IMAGE before calling SUBSTAR, if you want to
        keep a copy of the unsubtracted image array
INPUTS
X -   REAL Vector of X positions found by NSTAR (or FIND)
Y -   REAL Vector of Y positions found by NSTAR (or FIND)        
MAG - REAL Vector of stellar magnitudes found by NSTAR (or APER)
        Used to scale the PSF to match intensity at star position.
        Stars with magnitude values of 0.0 are assumed missing and 
        ignored in the subtraction.
OPTIONAL INPUTS
ID -  Index vector indicating which stars are to be subtracted.  If
        omitted, (or set equal to -1), then stars will be subtracted 
        at all positions specified by the X and Y vectors.
PSFNAME - Name of the FITS file containing the PSF residuals, as
        generated by GETPSF.  SUBSTAR will prompt for this parameter
        if not supplied.      
OPTIONAL INPUT KEYWORD
VERBOSE - If this keyword is set and nonzero, then SUBSTAR will 
        display the star that it is currently processing      
COMMON BLOCKS
The RINTER common block is used (see RINTER.PRO) to save time in the
PSF calculations
PROCEDURES CALLED
DAO_VALUE(), READFITS(), REMOVE, SXOPEN, SXPAR(), SXREAD()
REVISION HISTORY
Written, W. Landsman                      August, 1988
Added VERBOSE keyword                     January, 1992
Fix star subtraction near edges, W. Landsman    May, 1996
Assume the PSF file is in FITS format  W. Landsman   July, 1997
Converted to IDL V5.0   W. Landsman   September 1997