NAME: 
  backsub
 PURPOSE: 
  Background subtraction from an image.
 DESCRIPTION:
  The background is determined from a robust fit of a line to each row
     or column in the image depending on the keywords.  If neither keyword
     is set, then the robust mean is used.  These lines or means are then
     subtracted from the input image.

  For each row (or column) that is fit, the 6 most extreme points (from
     the mean) are removed from the first pass fit.  See the docs for
     GOODPOLY and the NEX keyword.
 CATEGORY:
  CCD data processing
 CALLING SEQUENCE:
  backsub,image, [ROW,COLUMN]
 INPUTS:
     image - Image (2-d or 3-d) to subtract background from, image is
              modified in place.
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
     ROW    - Flag, if set, program assumes that image is flat along a row.
     COLUMN - Flag, if set, program assumes that image is flat along a column.

        Default is to assume that the image is flat along rows and columns.

     EXCLUDE- Scalar item or vector list of rows to exclude from background
                 fitting process.
     KEEPMEAN - Flag, if set this program will NOT subtract the constant
                 term from the image if using a polynomical of order >= 1.
  MAX_VALUE - The maximum value to be fitted.  If this keyword is provided,
                data values greater than MAX_VALUE are treated as missing
                and are not used in the fit for the background.
  MIN_VALUE - The minimum value to be fitted.  If this keyword is provided,
                data values greater than MIN_VALUE are treated as missing
                and are not used in the fit for the background.
     ORDER  - Order of polynominal to fit to background (ROW and COLUMN only),
              the default is 0 (mean of direction), 1 is linear, etc.
     SILENT - If set, disables chatty output to screen.
 OUTPUTS:
     image - Background subtracted image.
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
  Only one of ROW and COLUMN can be set.

 PROCEDURE:
 MODIFICATION HISTORY:
  93/11/12, Written by Marc W. Buie, Lowell Observatory
  95/03/23, MWB, added ORDER keyword.
  98/06/08, MWB, Added MIN/MAX_VALUE keywords.
  2002/12/12, MWB, Added KEEPMEAN keyword.
  2004/06/13, MWB, added support for UINT, ULONG, LONG64, ULONG64