NAME: 
  mkbias
 PURPOSE: 
  Collect and combine CCD bias frames into a superbias frame
 DESCRIPTION:

  The files are assumed to be named as 'root'NNN where 'root' is the
  root of the file name that you supply and NNN is a three digit number.
  If your file name has an imbedded '.' then add it to the root.

  The specified range of files are all read in from FITS files.  Then each
  image has the overscan mean subtracted (if desired), cropped (as indicated).
  These images are then averaged.  The averaging is done with AVGCLIP.PRO
  which does a robust average of the image stack so that cosmic rays or
  other transient image defects are eliminated.

  When done, the resulting bias image is returned to the caller and the image
  is saved to a FITS file with the specified output filename.

 CATEGORY:
  CCD data processing
 CALLING SEQUENCE:
  mkbias,root,outsuf,start,nframes,bias
 INPUTS:
  root    - Root of the file name (you must include . in the name).
  outsuf  - The suffix of the final output file.
  start   - First frame number to read (integer or long).
               Start can also be a vector of explicit frame numbers to load.
               In this case, nframes need not be specified and in fact will
               be ignored.
               Additionally, start can also be a string array containing the
               file names of all files to be read.  In this case, set nframes
               to 0 or someother innocuous integer.  Exclude is treated
               differently.  In this case, exclude is a vector of the same
               length as start and is 0 if the file is to be used, 1 if not.
  nframes - Number of frames to average.
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:

   CROP     = region of original image to save, default=no cropping.
                 [x1,x2,y1,y2]

   DDIR     = Directory to look for raw data in.  Default = ''

   EXCLUDE - Optional vector of image numbers that should be excluded from
                average.  Default is to include all frames.

   OVERSCAN = column overscan region to use for frame bias level,
                 default=no overscan subtraction.

   RDNOISE  - Read noise of CCD [in DN], default=10

 OUTPUTS:
  bias - Final robust averaged/cropped bias image.
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  95/03/09 - Initial crude version written, Marc W. Buie, Lowell Observatory
  95/06/13, MWB, added OVERSCAN and CROP keywords
  95/11/22, MWB, add EXCLUDE keyword
  2000/02/02, MWB, rewrite to add support for multigroup FITS files.
  2000/02/28, MWB, added support for frame numbers > 999.
  2001/02/23, MWB, added option to provide input file list.
  2001/04/28, MWB, added DDIR keyword.
  2005/01/04, MWB, changed so .fits tag can come and go in file names.
  2006/07/14, MWB, added RDNOISE keyword
  2006/10/23, MWB, fixed output header keyword problem (remove BSCALE/BZERO)
  2007/06/20, MWB, fixed minor bug with image list for start