pro lifetimf,inp,out ; Procedure to compute a time correlation curve between patterns ; stored in a 3-d array INP. ; OUT is a 1-d array with the values ; of correlation, normalized to 1. ; 30 Nov 1995 on_error,1 msiz=size(inp) if msiz(0) ne 3 then message,'ERROR: Input array must be 3-D' n=msiz(3) out=fltarr(n) arr=float(inp) arr(*,*,0)=float(inp(*,*,0))-mean(float(inp(*,*,0))) den=total(arr(*,*,0)*arr(*,*,0)) out(0)=1. for i=1,n-1 do begin arr(*,*,i)=float(inp(*,*,i))-mean(float(inp(*,*,i))) ;den=sqrt(total(arr(*,*,i)*arr(*,*,i))*den) ; otra formula out(i)=total(arr(*,*,0)*arr(*,*,i))/den endfor end