NAME: 
  imqual
 PURPOSE:
  Generate a ``grade'' for image quality of input image.
 DESCRIPTION:
 CATEGORY:
  CCD data processing
 CALLING SEQUENCE:
  imqual,im,thresh,smofac,grade,usmim
 INPUTS:
  im     - The input image, 2-D only thus far.
  thresh - Fraction of peak in image that is considered for grading.
  smofac - Smoothing factor for the unsharp masked image.
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
 OUTPUTS:
  grade  - Grade, 0 is bad, bigger is better.  Units are arbitrary
  usmim  - The unsharp masked image.
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  94/08/16 - Written by Marc W. Buie, Lowell Observatory.