pro dad_plustc,filename,ldata,rdata

;2001,8-11,bao

l1=intarr(523,363)
r1=intarr(523,363)
I=intarr(512,512)
data2=fltarr(523,363)
type='l4*.dad'
read,type,prompt=('dad data:')
filename=findfile(type)



num=n_elements(filename)

for i=0,num-1 do  begin 
read_hr_dad,filename(i),ldata,rdata,info
I=ldata
l=intarr(1,2)
r=intarr(1,2)
l=size(ldata,/DIMENSIONS)
r=size(rdata,/DIMENSIONS)
xl=l(0,0)
yl=l(1,0)
xr=r(0,0)
yr=r(1,0)
print,'size:',xl,yl,xr,yr
xdim=523
ydim=363
;print,size(ldata)
smooth=3
ldata=smooth(ldata,smooth)
ldata=congrid(ldata,xdim,ydim,/interp)
;ldata(i)=intarr(523,363)
;ldata(i)=ldata
l1=l1+ldata
;print,size(l1)
rdata=smooth(rdata,smooth) 
rdata=congrid(rdata,xdim,ydim,/interp)
;rdata(i)=bytarr(523,363)
;rdata(i)=rdata
r1=r1+rdata
window,0,xs=xdim,ys=ydim
tvscl,l1
window,1,xs=xdim,ys=ydim
tvscl,r1
;acpole,ldata,rdata
if (i eq num-1) then begin
data1=rdata-ldata
data2=ldata
print,max(ldata),min(ldata),mean(ldata)
;data=data1/data2
window,3,xs=xdim,ys=ydim,title='mono'
tvscl,ldata
I=congrid(I,523/3,363/3,/interp)
!p.position=[0.,0.,1.,1.]
;=========design contour
v=[7000,8000,9200,13000,14000,17500,19000,21000]
contour,I,levels=v,c_linestyle=(v lt 0.),ticklen=0,$
		/noerase,xst=5,yst=5


;data=data*6000
window,2,xs=xdim,ys=ydim,title='magnetogem'
tvscl,data1
xyouts,5,ydim-12,size=1.2,'!6 Date:     '+$
	info(1),/device
xyouts,185,ydim-12,size=1.2,'!6 Time:         '+$
	info(2)+'UT',/device

endif
endfor
end
