;+ ; NAME: ; NBOX ; ; PURPOSE: ; This function computes the number of tracked particles ; in each frame of the movie. ; ; CALLING SEQUENCE: ; Result = NBOX(t) ; ; INPUTS: ; t: The result of TRACK.PRO ; ; KEYWORD PARAMETERS: ; ; - None - ; ; OUTPUTS: ; ; Result[0,*] Time-ordered number of tracked particle in each frame ; ; EXAMPLE: ; The array t is the output of tracking ; nb = NBOX(t) ; Calculate STDDEV(nb)/MEAN(nb) to check you perform a constant density ; tracking. ; ; REFERENCE: ; - None - ; ; MODIFICATION HISTORY: ; Written by: Thierry Savin @ Doyle Group @ MIT - June 2006 ;- FUNCTION NBOX, tr Dim_t = N_ELEMENTS(tr[*,0]) Ind_Time = Dim_t - 2 t = tr[Ind_Time,*] t = t[SORT(t)] u = UNIQ(t) res = u - SHIFT(u,1) res[0] = u[0] + 1 RETURN,res END