FUNCTION ave_t_fun, t_fun_set, n_t_funs, ndata, trial ; Returns an aveaged transfer function and its standard ; deviation as (ndata, 2) complex array ; ; Author: Robert Kessel ; Electro-Optics Technology Section ; Code 8123 ; Naval Research Laboratory ; Washington, D.C. 20375-5354 ; email: kessel@ncst.nrl.navy.mil ; ; This code was written for Bill Palya's and Don Walter's ; use at JSU. However, anyone else who finds it useful ; should feel free to use it, rewrite it, or whatever else, ; save charging any money, goods or services from any other ; person for the code or use thereof. ; 10/21/03 ; compute average t_fun_ave = COMPLEXARR(ndata) t_fun_sd = COMPLEXARR(ndata) t_fun_out = COMPLEXARR(ndata, 2) FOR i=0,ndata-1 DO BEGIN t_fun_stats = MOMENT(t_fun_set[i,0:n_t_funs-1]) t_fun_ave[i] = t_fun_stats[0] t_fun_sd[i] = SQRT(t_fun_stats[1]/n_t_funs) ENDFOR t_fun_out[0:ndata-1, 0] = t_fun_ave[0:ndata-1] t_fun_out[0:ndata-1, 1] = t_fun_sd[0:ndata-1] RETURN, t_fun_out END