pro pr_sdml, wid, out, file=file
;
;
;
indir = '/ydb/sdml'
infil = concat_dir(indir, 'sdml' + wid)
;
restgen, out, file=infil
n = n_elements(out)
nimg = max(out.sdm_imgnum)+1
;
qoutfil = keyword_set(file)
if (qoutfil) then file_append, file, 'PR_SDML  Program Run: ' + !stime, /new
last = 99
for i=0,n-1 do begin
    out0 = out(i)
    if (out0.sdm_imgnum ne last) then begin
	ss = where(out.sdm_imgnum eq out0.sdm_imgnum, nss)
	str = string(out0.res, out0.dpe, nss, format="('----------- Res:', i1, ' DPE:',i2, "+$
					"' #Img:', i3, ' ----------')")
	print, str
	if (qoutfil) then file_append, file, str
	last = out0.sdm_imgnum
    end
    ;
    str = fmt_tim(out0) + string(out0.fms, out0.tim2week_cen/86400., out0.time_weight, out0.avg, out0.dev, $
						format='(5f8.3)') + '  ' + string(out0.st$filename)
    print, str
    if (qoutfil) then file_append, file, str
end
;
end
