PRO avglife,trima
;
;Estimate of average lifetime of objects suggested by Strous
;INPUT: TRIMA - result of otrim.pro
;FORMULA: avg_lifetime = p*m/n
; p - whole observing interval
; m - avg. number of objects in 1 frame
; n - number of new objects that apeared during p
;PARAMETER
p=69.5 ;minutes
si=size(trima)
nobj=fltarr(si(2))
for i=0,si(2)-1 do nobj(i)=n_elements(where(trima(0,i,*)))
m=total(nobj)/si(2)
print,'avg.number of objects in 1 frame:',m
n=si(3)-nobj(0)
print,'number of newly appeared objects:',n
print,'average lifetime (minutes): ',p*m/n
END