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