pro timsmoo,movin,movout,optio ; SMOOTHING in time of a movie in a 3-D array MOVIN, ; result is a 3-D array MOVOUT. ; Method: floating average over n = OPTIO frames. ; ------------------------------------------------------------------- smov=size(movin) if smov(0) ne 3 then begin print,' Input must be a 3-D array! STOPPED, type RETALL' stop endif nima=smov(3) print,'number of frames:',nima movout=movin*0 optio=optio>3 optio=optio0 ; lower limit ul=ll+fix(optio)-1 ; upper limit if ul gt (nima-1) then begin ul=fix(nima-1) ll=ul-fix(optio)+1 endif ref=total(movin(*,*,ll:ul),3)/optio ; total returns float if smov(4) eq 1 then ref=byte(ref) ; conversion to bytes if smov(4) eq 2 then ref=fix(ref) ; conversion to integer movout(*,*,i)=ref endfor end