Institut für Astronomie und AstrophysikAbteilung AstronomieSand 1, D-72076 Tübingen, Germany |
GCNTRD
Compute the stellar centroid by Gaussian fits to marginal X,Y, sums
GCNTRD uses the DAOPHOT "FIND" centroid algorithm by fitting Gaussians to the marginal X,Y distributions. User can specify bad pixels (either by using the MAXGOOD keyword or setting them to NaN) to be ignored in the fit. Pixel values are weighted toward the center to avoid contamination by neighboring stars.
GCNTRD, img, x, y, xcen, ycen, [ fwhm , /SILENT, /DEBUG, MAXGOOD = , /KEEPCENTER ]
IMG - Two dimensional image array X,Y - Scalar or vector integers giving approximate stellar center
FWHM - floating scalar; Centroid is computed using a box of half width equal to 1.5 sigma = 0.637* FWHM. GCNTRD will prompt for FWHM if not supplied
XCEN - the computed X centroid position, same number of points as X YCEN - computed Y centroid position, same number of points as Y Values for XCEN and YCEN will not be computed if the computed centroid falls outside of the box, or if there are too many bad pixels, or if the best-fit Gaussian has a negative height. If the centroid cannot be computed, then a message is displayed (unless /SILENT is set) and XCEN and YCEN are set to -1.
MAXGOOD= Only pixels with values less than MAXGOOD are used to in Gaussian fits to determine the centroid. For non-integer data, one can also flag bad pixels using NaN values. /SILENT - Normally GCNTRD prints an error message if it is unable to compute the centroid. Set /SILENT to suppress this. /DEBUG - If this keyword is set, then GCNTRD will display the subarray it is using to compute the centroid. /KeepCenter By default, GCNTRD finds the maximum pixel in a box centered on the input X,Y coordinates, and then extracts a new box about this maximum pixel. Set the /KeepCenter keyword to skip the step of finding the maximum pixel, and instead use a box centered on the input X,Y coordinates.
Maximum pixel within distance from input pixel X, Y determined from FHWM is found and used as the center of a square, within which the centroid is computed as the Gaussian least-squares fit to the marginal sums in the X and Y directions.
Find the centroid of a star in an image im, with approximate center 631, 48. Assume that bad (saturated) pixels have a value of 4096 or or higher, and that the approximate FWHM is 3 pixels. IDL> GCNTRD, IM, 631, 48, XCEN, YCEN, 3, MAXGOOD = 4096
Written June 2004, W. Landsman following algorithm used by P. Stetson in DAOPHOT2.
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]