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

 NAME:
	GETE0

 PURPOSE:
	This function calculates the Eo or edge of a xafs spectrum

 CATEGORY:
	XAID xafs data analysis package. 

 CALLING SEQUENCE:

	my_e0 = GETE0 (myset)

 INPUTS:
	set:	fltarr(2,npoints) set of data

 OPTIONAL INPUTS:
	
 KEYWORD PARAMETERS:
	METHOD:	0 Returns the maximum of the derivative (default)
		1 The Eo is selected by the user using the mouse from
		  the derivative shown
	SORT:	When set, sorts and eliminates duplicated points prior
		to the calculation. 

       The  following keywords are only valid when METHOD=0: 

	INDEX: set to a named variable to store the index of the 
		point with E0. 
	DELTA_E0: set to a named variable to store the indetermination
		in e0 (i.e. if the e0 is found at the index point i, 
		the indetermination is delta_e0=(x[i+1]-x[i-1])/2).
	SPL: when set, performs a second iteration to get a better 
		e0 value. For that, it makes either an interpolation or
		a spline of the interval containing 21 points around
		the first e0. The resulting interpolation/spline
		contains 500 points. Use:
		SPL=1 for interpolation method; and
		SPL=2 for spline.

 OUTPUTS:
	This function returns the Eo value

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	None

 PROCEDURE:
	The Eo is calculated as the most important inflexion point
	of the spectrum, that is the maximun value of the derivative

 EXAMPLE:

		mye0 = gete0(myset)

 MODIFICATION HISTORY:
 	Written by:	Manuel Sanchez del Rio. ESRF
	February, 1993	
	98-10-13 srio@esrf.fr adds sort keyword.
	98-11-02 srio@esrf.fr uses catch, IDL function MAX, and
	  introduce the keywords that are only valid when METHOD=0.

