pro broad, y_in, y_out, width
;+
;                           BROAD
;
;  Procedure to convolve a data array with a Gaussian profile of full-width
;  equal to parameter 'width' in data points.
;
;  Input:
;         y_in             input array to be broadened
;         width            sigma of broadening Gaussian in data points
;
;  Output:  
;         y_out            the broadened data array
;
;
;  Use:
;        IDL> plot, in
;        IDL> broad, in, out, wid
;        IDL> oplot, out
;
;
;   CDP  Feb 92
;
;-

;
;  size of kernal array = f(width)
;
fw = 3*fix(width)
if fw - (fw/2)*2 eq 0 then fw = fw + 1
kernal = fltarr(fw)
;
;  std definition
;
sigma = width/2.0
;
;  load x array and set Gaussian centre
;
xm = (n_elements(kernal)/2.0) + 1.0
x = findgen(n_elements(kernal))+1.0

;
;  scale so result has unit area
;
scale = 1.0/(2.50663*sigma)
;
;  array to do convolution
;
kernal = scale*exp(-(x-xm)*(x-xm)/(2.0*sigma*sigma))

;
;  do the convolution
;
y_out = convol(y_in,kernal)


end
