Name
       fwhm - Full Width at Half Maximum computation

Synopsis
       fwhm [options] image.fits

Description
       fwhm  computes the full width at half maximum around peaks
       in a FITS data cube.  For each plane in the input cube, it
       computes the fwhm in x, y, and an average of both measure-
       ments, around a single user-provided peak (see options  -x
       and  -y)  or  an automatically detected list of peaks (see
       options -d and -s).

Algorithm
       For each peak in each image of the input cube, the follow-
       ing algorithm is applied:

       1.  Check  the validity of the pixel box window and resize
       it if needed (and possible).

       2. Find the position of the pixel of maximum intensity and
       re-center  the  window on that pixel (resize the window if
       needed and possible). Check out that the maximum intensity
       still  lies  within  the new box. If it does not, output a
       warning and go on computing with the recentered  box.  The
       warning looks like:

       ***  peak  has  moved  with re-centering, new peak will be
       used
       *** window won't be shifted again

       3. Around that peak, on both the vertical  and  horizontal
       axis,  find  the  nearest  couple of points (on each side)
       where the closest point is above half max and the other is
       below.

       4. Use a linear interpolation to find more precisely where
       the half max is.

       5. Print out the results in arcseconds if the plate  scale
       is  known  (through  the  FITS header or the -p option) or
       print out the results in pixels.

Options
       -x value -y value
              to provide a single position in the image where  to
              compute  the  FWHM.  The same position will be used
              for all planes in the input cube.  Default value is
              the image center.

       -h value or --halfsize value
              to  provide  the  half size of the computation box.
              fwhm will center this pixel box on each peak,  find
              out  the  maximum pixel value in this box, and com-
              pute an FWHM around this position. For a data  cube
              in  which  the peak is offseted a lot from image to
              image, increase this value. Default  is  15  pixels
              (31x31 pixel box around peak value).

       -p value or --plate_scale value
              Plate scale in arc-seconds per pixel, for an output
              in arc-seconds.

       -t value or --threshold value
              Often for average Strehl  ratios  the  peak  my  be
              superposed  with  a  gaussian  and  the program may
              incorrectly find the floor of the  peak.  Use  this
              option  to  force the floor to a given (graphically
              determined) value.

       -d or --detpeak
              This option requests fwhm to find out the peaks  in
              each  image  by itself. The method which is used to
              determine bright objects in an image is the same as
              in detpeak.

       -s factor or --sigma factor
              to  be used only with the -d option, this specifies
              the sigma level to  use  for  detection  of  bright
              peaks in the image.

Examples
       To  determine  the  FWHM  of  an  star  that we know to be
       located in a window of  21x21  pixels  centered  on  pixel
       56,81  of image star.fits with a very unlikely plate scale
       of 2" per pixel and a floor you decided  to  set  to  1300
       ADU, use:

       > fwhm -x 56 -y 81 -h 10 -t 1300 -p 2 star.fits

       To  determine the FWHM around all peaks in an image, using
       the automatic detection, a  plate  scale  of  0.7"  and  a
       default pixel box size (31x31), use:

       > fwhm -d -p 0.7 star.fits

Files
       Files shall all comply with FITS format

See Also
       detpeak, stcube, strehl

Bugs
       The  ability  to  provide a list of peaks through an ASCII
       file would be much convenient. In a near future...