[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Sand 1, D-72076 Tübingen, Germany
[Uni logo]


GCNTRD Source code in gcntrd.pro

GCNTRD

Name
       GCNTRD
Purpose
       Compute the stellar centroid by Gaussian fits to marginal X,Y, sums
Explanation
       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.
Calling Sequence
       GCNTRD, img, x, y, xcen, ycen, [ fwhm , /SILENT, /DEBUG, MAXGOOD = ,
                            /KEEPCENTER ]
Input Parameters
       IMG - Two dimensional image array
       X,Y - Scalar or vector integers giving approximate stellar center
Optional Input Parameters
       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
Output Parameters
       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.
Optional Keyword Output
       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.
Procedure
       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.
Example
       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
Revision History
       Written June 2004, W. Landsman  following algorithm used by P. Stetson
             in DAOPHOT2.

Last modified by pro2html on 2004 September 11 at 04:43 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically