NSTAR
Name
NSTAR
Purpose
Simultaneous point spread function fitting (adapted from DAOPHOT)
Explanation
This PSF fitting algorithm is based on a very old (~1987) version of
DAOPHOT, and much better algorithms (e.g. ALLSTAR) are now available
-- though not in IDL.
Calling Sequence
NSTAR, image, id, xc, yc, mags, sky, group, [ phpadu, readns, psfname,
magerr, iter, chisq, peak, /PRINT , /SILENT, /VARSKY, /DEBUG ]
Inputs
image - image array
id - vector of stellar ID numbers given by FIND
xc - vector containing X position centroids of stars (e.g. as found
by FIND)
yc - vector of Y position centroids
mags - vector of aperture magnitudes (e.g. as found by APER)
If 9 or more parameters are supplied then, upon output
ID,XC,YC, and MAGS will be modified to contain the new
values of these parameters as determined by NSTAR.
Note that the number of output stars may be less than
the number of input stars since stars may converge, or
"disappear" because they are too faint.
sky - vector of sky background values (e.g. as found by APER)
group - vector containing group id's of stars as found by GROUP
Optional Input
phpadu - numeric scalar giving number of photons per digital unit.
Needed for computing Poisson error statistics.
readns - readout noise per pixel, numeric scalar. If not supplied,
NSTAR will try to read the values of READNS and PHPADU from
the PSF header. If still not found, user will be prompted.
psfname - name of FITS image file containing the point spread
function residuals as determined by GETPSF, scalar string.
If omitted, then NSTAR will prompt for this parameter.
Optional Outputs
MAGERR - vector of errors in the magnitudes found by NSTAR
ITER - vector containing the number of iterations required for
each output star.
CHISQ- vector containing the chi square of the PSF fit for each
output star.
PEAK - vector containing the difference of the mean residual of
the pixels in the outer half of the fitting circle and
the mean residual of pixels in the inner half of the
fitting circle
Optional Keyword Inputs
/SILENT - if set and non-zero, then NSTAR will not display its results
at the terminal
/PRINT - if set and non-zero then NSTAR will also write its results to
a file nstar.prt. One also can specify the output file name
by setting PRINT = 'filename'.
/VARSKY - if this keyword is set and non-zero, then the sky level of
each group is set as a free parameter.
/DEBUG - if this keyword is set and non-zero, then the result of each
fitting iteration will be displayed.
Procedures Used
DAO_VALUE(), READFITS(), REMOVE, SPEC_DIR(), STRN(), SXPAR()
Common Block
RINTER - contains pre-tabulated values for cubic interpolation
Revision History
W. Landsman ST Systems Co. May, 1988
Adapted for IDL Version 2, J. Isensee, September, 1990
Minor fixes so that PRINT='filename' really prints to 'filename', and
it really silent if SILENT is set. J.Wm.Parker HSTX 1995-Oct-31
Added /VARSKY option W. Landsman HSTX May 1996
Converted to IDL V5.0 W. Landsman September 1997
Replace DATATYPE() with size(/TNAME) W. Landsman November 2001
Assume since V5.5, remove VMS calls W. Landsman September 2006