def gauss_weighted_stats(x, yarray, x_new, fwhm):
sigma = fwhm / (<NUM_LIT:2> * np.sqrt(<NUM_LIT:2> * np.log(<NUM_LIT:2>)))<EOL>mask = np.zeros((x.size, yarray.shape[<NUM_LIT:1>], x_new.size))<EOL>for i, xni in enumerate(x_new):<EOL><INDENT>mask[:, :, i] = gauss(x[:, np.newaxis], <NUM_LIT:1>, xni, sigma)<EOL><DEDENT>nmask = mask / mask.sum(<NUM_LIT:0>)  <EOL>av = (nmask * yarray[:, :, np.newaxis]).sum(<NUM_LIT:0>)  <EOL>diff = np.power(av - yarray[:, :, np.newaxis], <NUM_LIT:2>)<EOL>std = np.sqrt((diff * nmask).sum(<NUM_LIT:0>))<EOL>se = std / np.sqrt(mask.sum(<NUM_LIT:0>))<EOL>return av, std, se<EOL>
Calculate gaussian weigted moving mean, SD and SE.

Parameters
----------
x : array-like
    The independent variable
yarray : (n,m) array
    Where n = x.size, and m is the number of
    dependent variables to smooth.
x_new : array-like
    The new x-scale to interpolate the data
fwhm : int
    FWHM of the gaussian kernel.

Returns
-------
(mean, std, se) : tuple