NAME:
  gradebias
 PURPOSE:   (one line only)
  Automatic quality grading of a set of CCD bias images against a superbias
 DESCRIPTION:
 CATEGORY:
  CCD data processing
 CALLING SEQUENCE:
  gradebias,cube,bias,grade
 INPUTS:
  cube - 3-d cube of original bias images, if you need to subtract overscan
              and crop, this should be done prior to building the cube
  bias - 2-d image which is the superbias frame
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  MAXBAD   - Maximum number of bad rows allowed per frame before flagging
               the cube as bad.  (default=25)
 OUTPUTS:
  grade - This is the number of images that fail the test of being consistent
             with the ensemble of images.
 KEYWORD OUTPUT PARAMETERS:
  ROWTEST - array with a length equal to the number of rows in the image
             This contains the number of frames that fail the goodness test
             for each row.   This metric is rather hard to use but provided
             for completeness.
  FILETEST - array with a length equal to the number of images.  This array
               records the number of rows in each image that fail the
               goodness test.
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  Written by Marc W. Buie, Southwest Research Institute, 2015/05/03