;  
; make a mean image from all 
; SWRI calibrated eclipse images

pixX = 1024
pixY = 256
window,0,xsize=pixX,ysize=pixY
img = intarr(pixX,pixY)
fimg = fltarr(pixX,pixY)
x=0.
y=0.

loadct,9
 
filenm=' '
listfile='~/donlist'
 
    close,13 & openr,13,listfile

    ii=0 
    while ( not eof(13) ) do begin ;{
	img=intarr(pixX,pixY)
        readf,13,filenm
	print,filenm
	close,1 & openr,1,filenm
	readu,1,img
	fimg = fimg + float(img)
	tv,fimg/(16.*float(ii+1))
        ii=ii+1
;    stop
    endwhile ;} 
 
    close,13
    fimg = fimg/float(ii+1)
    tv,fimg/16.

    stop
    close,1 & openw,1,'meaneclimg' & writeu,1,fix(fimg) & close,1

end 
