if (n_elements(indir) eq 0) then indir = '/md60/morrison/sci160k'
;ff = file_list(indir, '950329_000458_*.heads', /bydate)
;ff = file_list(indir, '950329_235350_*.heads', /bydate)

if (keyword_set(qrdtfr)) then list = file_list(indir, '*_10.tfr', /cd, file=files) $
		else list = file_list(indir, '*_01.heads', /cd, file=files)
choice = string(indgen(n_elements(files))) + '  ' + files
prstr, choice, /nomore
read, 'Enter your option ', ii
 ff = file_list(indir, strmid(files(ii),0,13)+'*.heads', /bydate)
print,n_elements(ff), ' files'
;
if (keyword_set(qrdtfr)) then begin
    infil = strmid(list(ii), 0, strlen(list(ii))-7)
    read_mdi, infil, xx, nimg, /nimages
    print, nimg, ' Images'
    if (nimg gt 2000) then stop
    read_mdi, infil, indgen(nimg), img, fits_head, tfr=head, /nodata
end else begin
    rd_strip_heads, ff, head, fits_head, fil_arr
end
n=n_elements(head(0,*))
;
head0 = head
head = head and 'ff'x
!p.multi=[0,1,2]
plot, head(123,*)	& pmm, head(123,*)
plot, head(223,*)

t = long(byte(head(45:48,*)),0,n)
dec2sun, t
tim = anytim2ints('1-jan-58', off=double(t))

pause
 plot,t,/ynoz
 plot,deriv_arr(t)

; head_debug,head0,ff(223),550,580,/hc
ss = where(head(123,*) ne 30) & print,ss
print,n_elements(ff), ' files'
print,n,              ' images'

clearplot
end