;function marathon_badval takes a running average of a data set. Badvals in ;the averaging window are not used. Leading and trailing (n-1)/2 points will ;be output with value equal to zero. If there are no good points in the ;averaging window the average is returned as a badval. ;Use is as follows: ; out=marathon_badval(in,w,badval); ;Where ; in = input data vector ; w = number of points to average over (must be odd #) ; badval = bad point value to ignore in averaging ; ; out = output averaged data vector ; ;Written by BWBerger 6/12/00 based heavily on marathon.pro function marathon_badval,x,w,badval rw=row(x) cl=col(x) n=len(x) nn=(w-1)/2 y=fltarr(cl,rw) for i=0,n-w do begin y(i+nn)=meanbadval2(x(i:i+w-1),badval) endfor return,y end