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

 NAME:
	XAID_Resample

 PURPOSE:
	This function resamples a data set (i.e., makes some kind of
	smoothed interpolarion).

 CATEGORY:
	XAID xafs data analysis package. 

 CALLING SEQUENCE:

	yNew = Xaid_resample(x,y,xNew)

 INPUTS:
	x,y the abscissas and coordinates of data to be resampled.
	xNew the abscissas array for the resampled data.

 OPTIONAL INPUTS:
	
 KEYWORD PARAMETERS:

 OUTPUTS:
	yNew: the resampled data array.

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:

 SIDE EFFECTS:
	The data ate sorted and removed duplicated abscissas before
	making the operations.

 RESTRICTIONS:
	None

 PROCEDURE:
	For each point x[i] of xNew it calculates yNew consisting in
	the average y values of all points (x,y) sitting in the 
	interval [x[i]-0.5*step1,x[i]+0.5*step2], with step1=x[i]-x[i-1]
	and step2=x[i+1]-x[i]. In the case that step1 or step2 are
	undefined (first and last points) we used step=[x[1]-x[0]] instead 
	step1 or step2.


 MODIFICATION HISTORY:
 	Written by:	Manuel Sanchez del Rio. ESRF
	May 10, 2000

