[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Focus indication




  Rob asked:

> I have the centroid, but am unsure on the interpolation from the centroid to
> calculate the FWHM.  Theoretically, I believe I should fit a gaussian to the
> marginal sums (x and y, from star pixels only).  Is this the only way, the
> wrong way, or is there a simpler way?  Strongly looking for the simpler
> way...

  Simple way:

         - round centroid to integer (row, col)
         - define "peak value" as the value of pixel at (row, col)
                     (after subtracting background)
         - walk down rows in the negative direction until you reach
                     a pixel with half the peak.
                     Call this distance in pixels "d1"
         - walk up rows in the positive direction until you reach
                     a pixel with half the peak
                     Call this distance in pixels "d2"
         - walk down cols in the negative direction until you reach
                     a pixel with half the peak.
                     Call this distance in pixels "d3"
         - walk up cols in the positive direction until you reach
                     a pixel with half the peak
                     Call this distance in pixels "d4"

         - calculate
                     FWHM = (d1 + d2 + d3 + d4) / 2

  Complicated way:

         - form the marginal sums in the row and column direction
         - fit a gaussian to the 1-D marginal sum in row direction
                     Set "d1" = 2.35*sigma of gaussian
         - fit a gaussian to the 1-D marginal sum in col direction
                     Set "d2" = 2.35*sigma of gaussian
 
         - calculate
                     FWHM = (d1 + d2) / 2


  The first way is really easy and really fast.  Don't forget to 
subtract the background from all pixels before starting, though.

                                                Michael Richmond