----- file created by makedoc on: Tue Feb 11 14:15:24 2003
----- Documentation for /scisoft/IDL/scisoft/xaid/src//fitset.pro -----

 NAME:
	FITSET

 PURPOSE:
	This procedure fits the part of the spectrum defined between 
	the limits in xrange with a polynomial using either the 
	Least square method or the SVD

 CATEGORY:
	XAID xafs data analysis package. 

 CALLING SEQUENCE:

	FITSET, set_in, set_out

 INPUTS:
	set_in:	fltarr(2,npints) set of input data

 OPTIONAL INPUTS:
	
 KEYWORD PARAMETERS:
	VERBOSE: when set to 1 prints the statistics of the fit
	PLOT: when selected, overplots the fitted set
	DEGREE: degree of polynomial for fitting (Default=1)
	METHOD: method for the fitting:
		[1] Polynomial Least-Square fit (Default) 
		[2] Polynomial Singular Value Decomposition
		[3] Victoreen fit (not working yet)

 OUTPUTS:
	set_out: set of output data (with the pre-edge fit)

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	None

 PROCEDURE:
	Uses the IDL procedures POLY_FIT (Least Squares) and
	SVDFIT (Singular Value Decomposition)

 EXAMPLE:

		FITSET, myset, myfit

 MODIFICATION HISTORY:
 	Written by:	Manuel Sanchez del Rio. ESRF
	February, 1993	
	93-04-08 MSR adds polynomial features
	93-05-24 MSR changes name from PREEDGE to FITSET; adds XRANGE

