restore,'pb_and_totb.sav',/ver

image=totb[*,*,20]

;runn_diff
diff_run=totb[*,*,20]-totb[*,*,19]
;base_runn
base_run=totb[*,*,20]-totb[*,*,0]



;atrous
atrous,image,decomp=wt,/mirror


diff_sob = (sobel(image))
diff_rob = (roberts(image))

;canny_atrous
canny_atrous2d, image, modgrad, alpgrad, rows=rows, columns=columns

dmod=modgrad[0:511,200:711,6]
dang=alpgrad[0:511,200:711,6]

dmodlog=fltarr(512,512)
dmodlog(where(dmod NE 0))=alog(dmod[where(dmod NE 0)])
dmodlog(where(dmod eq 0))= MIN(dmodlog)

;dmod[where(dmod Lt 10)]=10
;dmod[where(dmod Gt 50)]=50




dangcolor=FIX(256*(dang/max(dang)))

pix_step=3
window_magnify=2

win_xsize=512*window_magnify
win_ysize=512*window_magnify

window,0,xsize=win_xsize,ysize=win_ysize

;dmod_show=win_xsize*dmod/MAX(dmod)
loadct,6


FOR i=0,win_xsize-1,pix_step*window_magnify DO $
    FOR j=0,win_ysize-1,pix_step*window_magnify DO $
    	IF  dmod[i/window_magnify,j/window_magnify] Gt 5 THEN $
	    arrow2,i,j,$
	    	dang[i/window_magnify,j/window_magnify],dmod[i/window_magnify,j/window_magnify]$
		    ,/angle,/device,hsize=3,color=dangcolor[i/window_magnify,j/window_magnify]
	    
	    

loadct,0
!p.background=255
window,1,xsize=500,ysize=100
!p.background=0
loadct,6
colorbar,divisions=4,ticknames=['0','90^','180','270','360'],pos=[0.1,0.5,0.9,0.9]
xyouts,[0.1,0.3,0.5,0.7,0.9],[0.2,0.2,0.2,0.2,0.2],['right','up','left','down','right'],/norm

mask=fltarr(101,101)+1
	for i=0,100 do begin & $
    		for j=0,100 do begin & $
    			xoff=(i-50) & $
			yoff=(j-50) & $
			mask[i,j] = atan(xoff,yoff ) & $
    	    	 endfor & $
	endfor
mask=rot(mask,270)
mask?rotate


window,0,xsize=win_xsize,ysize=win_ysize
loadct,6
plot_image,dangcolor,/sc
loadct,0
contour,dmodlog,levels=[1,2,3,4],/over,c_thick=[1,2,3,4]
	    
loadct,8 & gamma_ct,0.2
tvim,dmod,/sc
loadct,0
contour,dmodlog,levels=[1,2,3,4],/over,c_thick=[1,2,3,4]
	    
	    
;PARTVELVEC or velovect or plot_field

loadct,6
tvlct,rr,gg,bb,/get

rrr=rr*0
ggg=rrr
bbb=rrr


for i=0,255,64 do $
    rrr[i:63+i]=rebin(rr,64)

for i=0,255,64 do $
    ggg[i:63+i]=rebin(gg,64)

for i=0,255,64 do $
    bbb[i:63+i]=rebin(bb,64)
   
rrr[0:63]= rrr[0:63]/4.  
rrr[64:127]= rrr[64:127]/2.  
rrr[128:191]= 3.*rrr[128:191]/4.  
 
ggg[0:63]= ggg[0:63]/4.  
ggg[64:127]= ggg[64:127]/2.  
ggg[128:191]= 3.*ggg[128:191]/4.  

bbb[0:63]= bbb[0:63]/4.  
bbb[64:127]= bbb[64:127]/2.  
bbb[128:191]= 3.*bbb[128:191]/4.  
 
tvlct,rrr,ggg,bbb    

dmodlog_quarters=dmodlog
dmodlog_quarters(where(dmodlog Gt 3))=1

dmodlog_quarters(where(dmodlog Gt 2 AND dmodlog le 3))=2

dmodlog_quarters(where(dmodlog Gt 1 AND dmodlog le 2))=3

dmodlog_quarters(where(dmodlog Gt 0 AND dmodlog le 1))=4

dmodlog_quarters(where(dmodlog le 0))=0

tvlct,rrr,ggg,bbb    
plot_image,ratio(dangcolor,dmodlog_quarters)


;;**
;;begin figure ***whatever

;fudge alert**

image = image + (-1.*MIN (image))

plot_hist,image,x1,h1,bin=100
plot_hist,rows[*,*,7],x2,h2,bin=10
plot_hist,columns[*,*,7],x3,h3,bin=10
plot_hist,modgrad[*,*,7],x4,h4,bin=10
plot_hist,alpgrad[*,*,7],x5,h5,bin=10
;plot,x1,h1,psym=10,/ylog,xrange=[-500,1500]


plot,x2,h2,psym=10/ylog,xrange=[-200,200]
oplot,x3,h3,psym=10



mult,1,1
window,0,xsize=500,ysize=900

tvim,image,range=[0,1600]
tvim,rows[*,*,7],range=[-100,100],pos=[0,700,100,800]
tvim,columns[*,*,7],range=[-100,100]
tvim,modgrad[*,*,7],range=[0,75]
tvim,alpgrad[*,*,7],range=[0,360]

plot_image,rows[*,*,7],range=[-100,100],pos=[0,700,100,800],/device,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,7],range=[-100,100],pos=[100,700,200,800],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,7],range=[0,75],pos=[200,700,300,800],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,7],range=[0,360],pos=[300,700,400,800],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']


plot_image,rows[*,*,6],range=[-100,100],pos=[0,600,100,700],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,6],range=[-100,100],pos=[100,600,200,700],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,6],range=[0,75],pos=[200,600,300,700],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,6],range=[0,360],pos=[300,600,400,700],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,5],range=[-100,100],pos=[0,500,100,600],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,5],range=[-100,100],pos=[100,500,200,600],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,5],range=[0,75],pos=[200,500,300,600],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,5],range=[0,360],pos=[300,500,400,600],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,4],range=[-100,100],pos=[0,400,100,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,4],range=[-100,100],pos=[100,400,200,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,4],range=[0,75],pos=[200,400,300,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,4],range=[0,360],pos=[300,400,400,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,3],range=[-100,100],pos=[0,300,100,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,3],range=[-100,100],pos=[100,300,200,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,3],range=[0,75],pos=[200,300,300,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,3],range=[0,360],pos=[300,300,400,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,2],range=[-100,100],pos=[0,200,100,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,2],range=[-100,100],pos=[100,200,200,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,2],range=[0,75],pos=[200,200,300,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,2],range=[0,360],pos=[300,200,400,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,1],range=[-100,100],pos=[0,100,100,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,1],range=[-100,100],pos=[100,100,200,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,1],range=[0,75],pos=[200,100,300,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,1],range=[0,360],pos=[300,100,400,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,0],range=[-100,100],pos=[0,0,100,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,0],range=[-100,100],pos=[100,0,200,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,0],range=[0,75],pos=[200,0,300,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,0],range=[0,360],pos=[300,0,400,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']


;wihtout the forced ranges
plot_image,rows[*,*,7],pos=[0,700,100,800],/device,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,7],pos=[100,700,200,800],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,7],pos=[200,700,300,800],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,7],range=[0,360],pos=[300,700,400,800],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']


plot_image,rows[*,*,6],pos=[0,600,100,700],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,6],pos=[100,600,200,700],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,6],pos=[200,600,300,700],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,6],range=[0,360],pos=[300,600,400,700],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,5],pos=[0,500,100,600],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,5],pos=[100,500,200,600],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,5],pos=[200,500,300,600],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,5],range=[0,360],pos=[300,500,400,600],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,4],pos=[0,400,100,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,4],pos=[100,400,200,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,4],pos=[200,400,300,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,4],range=[0,360],pos=[300,400,400,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,3],pos=[0,300,100,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,3],pos=[100,300,200,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,3],pos=[200,300,300,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,3],range=[0,360],pos=[300,300,400,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,2],pos=[0,200,100,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,2],pos=[100,200,200,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,2],pos=[200,200,300,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,2],range=[0,360],pos=[300,200,400,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,1],pos=[0,100,100,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,1],pos=[100,100,200,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,1],pos=[200,100,300,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,1],range=[0,360],pos=[300,100,400,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,0],pos=[0,0,100,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,0],pos=[100,0,200,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,0],pos=[200,0,300,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,0],range=[0,360],pos=[300,0,400,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

;;end figure ** whatever
;;;;



image=totb[*,*,17]

;canny_atrous
canny_atrous2d, image, modgrad, alpgrad, rows=rows, columns=columns

md5=reform(modgrad[*,*,5]) & al5=reform(alpgrad[*,*,5])

calc_wtmm2,md5,al5,wtmm5
chain_wtmm, wtmm5, md5, al5, chains5, linked_wtmm5



;FIGURE 1
;the image and pixel intensity distribution for image, log of image, and gamma corrected image

plot_hist,image,xim,him,bin=10
plot_hist,alog(image),xlog,hlog,bin=0.1
plot_hist,(image)^0.2,xgamma,hgamma,bin=0.1

!p.charsize=1.0
!p,.charthick=1.0
window,1,xsize=600,ysize=400

tvim,image,/noaxis,pos=[100,300,400,800],/noerase

toggle,file='fig1.ps'
;mult,3,2
tvim,image,/noaxis,pos=[0.1,0.75,0.35,0.95],tit='!6(a) pB '
tvim,alog(image),/noaxis,pos=[0.4,0.75,0.65,0.95],tit='!6(b) log(pB)'
tvim,image^0.1,/noaxis,pos=[0.7,0.75,0.95,0.95],tit='!6(c) (pB)^(0.1}'
plot,xim,him,psym=10,charthick=2.0,color=128,pos=[0.1,0.53,0.35,0.73],/norm,/noerase,$
    ytickv=[0,100000,200000,300000,400000,500000],ytickname=['0','1','2','3','4','5'],yticks=6,$
    ytit='!6Number of pixels (X 10^5)'
plot,xlog,hlog,psym=10,color=128,pos=[0.4,0.53,0.65,0.73],/norm,/noerase,$
    ytickv=[0,100000,200000,300000,400000,500000],ytickname=[' ',' ',' ',' ',' ',' '],yticks=6,$
    xrange=[0,5]
    
plot,xgamma,hgamma,psym=10,color=128,pos=[0.7,0.53,0.95,0.73],/norm,/noerase,$
    ytickv=[0,100000,200000,300000,400000,500000],ytickname=[' ',' ',' ',' ',' ',' '],yticks=6,$
    xrange=[1,5]
    
toggle
$gv fig1.ps

;FIGURE 2
;the image and pixel intensity distribution for running and base difference

bd=image-pb[*,*,0]
rd=image-pb[*,*,16]

plot_hist,bd,xbd,hbd,bin=10
plot_hist,rd,xrd,hrd,bin=5

toggle,file='fig2.ps'
;mult,3,2
tvim,bd,/noaxis,pos=[0.1,0.75,0.35,0.95],tit='!6(a) base difference '
tvim,rd,/noaxis,pos=[0.4,0.75,0.65,0.95],tit='!6(b) running difference)'
plot,xbd,hbd,psym=10,charthick=2.0,color=128,pos=[0.1,0.53,0.35,0.73],/norm,/noerase,$
    ytickv=[0,200000,400000,600000,800000],ytickname=['0','2','4','6','8'],yticks=5,$
    ytit='!6Number of pixels (X 10^5)'
plot,xrd,hrd,psym=10,color=128,pos=[0.4,0.53,0.65,0.73],/norm,/noerase,$
    ytickv=[0,200000,400000,600000,800000],ytickname=[' ',' ',' ',' ',' ',' '],yticks=5

toggle
$gv fig2.ps

;FIGURE 3
;the sobel and roberts filters

sob=sobel(image)
rob=roberts(image)

plot_hist,rob,xrob,hrob,bin=5
plot_hist,sob,xsob,hsob,bin=5

toggle,file='fig3.ps'
tvim,sob^0.5,/noaxis,pos=[0.1,0.75,0.35,0.95],tit='!6(a) Sobel '
tvim,rob^0.5,/noaxis,pos=[0.4,0.75,0.65,0.95],tit='!6(b) Roberts'
plot,xsob,hsob,psym=10,charthick=2.0,color=128,pos=[0.1,0.53,0.35,0.73],/norm,/noerase,$
    ytickv=[0,100000,200000,300000,400000,500000],ytickname=['0','1','2','3','4','5'],yticks=6,$
    ytit='!6Number of pixels (X 10^5)'
plot,xrob,hrob,psym=10,color=128,pos=[0.4,0.53,0.65,0.73],/norm,/noerase,$
    ytickv=[0,100000,200000,300000,400000,500000],ytickname=[' ',' ',' ',' ',' ',' ',' '],yticks=6

toggle
$gv fig3.ps


;FIGURE 3
;the sobel and roberts filters
md7=reform(modgrad[*,*,7]) & al7=reform(alpgrad[*,*,7])
calc_wtmm2,md7,al7,wtmm7
wtmm7bin=binary_mask(wtmm7)

md6=reform(modgrad[*,*,6]) & al6=reform(alpgrad[*,*,6])
calc_wtmm2,md6,al6,wtmm6
wtmm6bin=binary_mask(wtmm6)

md5=reform(modgrad[*,*,5]) & al5=reform(alpgrad[*,*,5])
calc_wtmm2,md5,al5,wtmm5
wtmm5bin=binary_mask(wtmm5)

md4=reform(modgrad[*,*,4]) & al4=reform(alpgrad[*,*,4])
calc_wtmm2,md4,al4,wtmm4
wtmm4bin=binary_mask(wtmm4)

md3=reform(modgrad[*,*,3]) & al3=reform(alpgrad[*,*,3])
calc_wtmm2,md3,al3,wtmm3
wtmm3bin=binary_mask(wtmm3)

md2=reform(modgrad[*,*,2]) & al2=reform(alpgrad[*,*,2])
calc_wtmm2,md2,al2,wtmm2
wtmm2bin=binary_mask(wtmm2)

md1=reform(modgrad[*,*,1]) & al1=reform(alpgrad[*,*,1])
calc_wtmm2,md1,al1,wtmm1
wtmm1bin=binary_mask(wtmm1)



toggle,file='fig4.ps'
plot_image,rows[*,*,7],min=-15,max=15,pos=[1000,20000,4000,23000],/device,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,7],min=-15,max=15,pos=[4000,20000,7000,23000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,7],min=0,max=10,pos=[7000,20000,10000,23000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,7],min=0,max=360,pos=[10000,20000,13000,23000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,wtmm7,min=0,max=10,pos=[13000,20000,16000,23000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,6],min=-15,max=15,pos=[1000,17000,4000,20000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,6],min=-15,max=15,pos=[4000,17000,7000,20000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,6],min=0,max=10,pos=[7000,17000,10000,20000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,6],min=0,max=360,pos=[10000,17000,13000,20000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,5],min=-15,max=15,pos=[1000,14000,4000,17000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,5],min=-15,max=15,pos=[4000,14000,7000,17000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,5],min=0,max=10,pos=[7000,14000,10000,17000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,5],min=0,max=360,pos=[10000,14000,13000,17000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,4],min=-15,max=15,pos=[1000,11000,4000,14000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,4],min=-15,max=15,pos=[4000,11000,7000,14000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,4],min=0,max=10,pos=[7000,11000,10000,14000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,4],min=0,max=360,pos=[10000,11000,13000,14000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,3],min=-15,max=15,pos=[1000,8000,4000,11000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,3],min=-15,max=15,pos=[4000,8000,7000,11000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,3],min=0,max=10,pos=[7000,8000,10000,11000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,3],min=0,max=360,pos=[10000,8000,13000,11000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,2],min=-15,max=15,pos=[1000,5000,4000,8000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,2],min=-15,max=15,pos=[4000,5000,7000,8000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,2],min=0,max=10,pos=[7000,5000,10000,8000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,2],min=0,max=360,pos=[10000,5000,13000,8000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,1],min=-15,max=15,pos=[1000,2000,4000,5000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,1],min=-15,max=15,pos=[4000,2000,7000,5000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,1],min=0,max=10,pos=[7000,2000,10000,5000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,1],min=0,max=360,pos=[10000,2000,13000,5000],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
toggle
$gv fig4.ps






plot_image,rows[*,*,4],range=[-100,100],pos=[0,400,100,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,4],range=[-100,100],pos=[100,400,200,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,4],range=[0,75],pos=[200,400,300,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,4],range=[0,360],pos=[300,400,400,500],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,3],range=[-100,100],pos=[0,300,100,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,3],range=[-100,100],pos=[100,300,200,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,3],range=[0,75],pos=[200,300,300,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,3],range=[0,360],pos=[300,300,400,400],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,2],range=[-100,100],pos=[0,200,100,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,2],range=[-100,100],pos=[100,200,200,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,2],range=[0,75],pos=[200,200,300,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,2],range=[0,360],pos=[300,200,400,300],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,1],range=[-100,100],pos=[0,100,100,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,1],range=[-100,100],pos=[100,100,200,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,1],range=[0,75],pos=[200,100,300,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,1],range=[0,360],pos=[300,100,400,200],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']

plot_image,rows[*,*,0],range=[-100,100],pos=[0,0,100,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,columns[*,*,0],range=[-100,100],pos=[100,0,200,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,modgrad[*,*,0],range=[0,75],pos=[200,0,300,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']
plot_image,alpgrad[*,*,0],range=[0,360],pos=[300,0,400,100],/device,/over,/noerase,$
    xticks=1,xtickname=[' ',' '],yticks=1,ytickname=[' ',' ']