pro seq_frame_stats2, info, fmt, tit, arr, dve=dve
;
;
;
labels = ['    Number of moves:                                 ', $
	  '    Unique locations:                                ']
if (keyword_set(dve)) then labels = ['    Number of times DVE Errors:              ', $
				     '    List of values seen:                     ']
;
uu = uniq(arr)
nmoves = n_elements(uu)-1
upos = strtrim(fix(arr(uniq(arr, sort(arr)))), 2)
;
;;fmt2 = '(a40, a)'
;;info = [info, ' ', tit, $
;;	string(labels(0), nmoves, format=fmt), $
;;	string(labels(1), arr2str(upos), fmt2)]
fmt2 = '(4x, a15, 5x, i8, 5x, a)
info = [info, $
	string(tit+'                 ', nmoves, arr2str(upos), format=fmt2)]
;
end
;----------------------------------------------------------------------------
pro seq_frame_stats, sttim, entim, info, mat=mat, qprint=qprint, outfil=outfil, inmat=inmat
;
;	seq_frame_stats, '3-feb-96 15:00', '3-feb-96 22:00'
;	27-Feb-96  (DBG)- patched a check for no data available
;
;
seq_frame_info, sttim, entim, mat
if n_elements(mat) eq 1 then begin
  info='No data available for seq_frame_stats'
  return
end
expos = (mat(*,5)-mat(*,4))/256.
n = n_elements(expos)
;
breaks = [0, 0, 19, 21, 40.0, 40.1, 150.0, 150.16, 150.22, 150.4, 99999]
nb = n_elements(breaks)
blabs  = ['Darks',	$		;0-0
	'??? (0-19 msec)', $		;0-19
	'Double Exposures!!!', $	;19-21
	'??? (21-40 msec)', $		;21-40
	'Anamalous short 8x8 bin', $	;40-40.1
	'Normal short 8x8 bin',	$	;40.1-150
	'High resolution', $		;150-150.16
	'Anomalous short 1x1', $	;150.16-150.22
	'Normal 1x1', $			'150.22-150.4
	'??? (over 150.4 msec)']
exp_typarr = intarr(nb)
;
for i=0,nb-2 do begin
    ss = where((expos ge breaks(i)) and (expos le breaks(i+1)), nss)
    exp_typarr(i) = nss
end
;
fmt = '(a40, i8)'
info = [string('Total number of exposures:                   ', n, format=fmt)]
for i=0,nb-2 do begin
    str = string('    # of ' + blabs(i)+'                          ', exp_typarr(i), format=fmt)
    if (exp_typarr(i) eq 0) and (strmid(blabs(i), 0, 3) eq '???') then begin
	;don't list it
    end else begin
	info = [info, str]
    end
end
;
info = [info, ' ', 'Mechanism Moves          #moves      Unique Locations']
seq_frame_stats2, info, fmt, 'PAW Wheel', mat(*,6)
seq_frame_stats2, info, fmt, 'CAL Wheel #1', mat(*,9)
seq_frame_stats2, info, fmt, 'CAL Wheel #2', mat(*,10)
seq_frame_stats2, info, fmt, 'Michelson #1', mat(*,7)
seq_frame_stats2, info, fmt, 'Michelson #2', mat(*,8)
;
info = [info, ' ', 'Sequence Errors          #errors      Types of errors']
seq_frame_stats2, info, fmt, 'DVE', mat(*,12), /dve
;
if (keyword_set(qprint)) then prstr, info
if (keyword_set(outfil)) then prstr, info, file=info
end
