include HESSMakefile
#=============================
#Figures
lab= titlesz=8 title=' ' label1='depth (m)' label2='distance (m)'
ps = pstexpen 
ps1= color=y fat=1 fatmult=1.5 invras=n force=  invras=y  
#raw:
#remake figs
rm-figs:
	#rm -rf *-2759
remake-figs: #DO NOT UNCOMMENT UNLESS YOU HAVE RUN COMMANDS TO GENERATE THE *H files!!!!
	rm -rf *-2759
	make -n raw-2759 amp-2759 flat-2759 hs-2759 dm-dip-2759 raw-2759 dmhl-inv-2759 dmhl-rwarp-2759 dmhl-warp-2759 dmhl-flat-2759 dmhl-amp-2759 dmhl-dmult-2759 dmhl-raw-2759 rwarp-2759 dip-dmult-2759 rwarp-2759 inv-2759 dmhl-dat-2759
#diag and fft
hess-fig-%:
	Window3d min8=0 max8=13025 < $(wk)/test_hess.H | Transp > $@-06.H
	Window3d min8=0 max8=13025 < $(wk)/test_hess-sxgx.H | Transp > $@-08.H
	Math file1=$@-06.H file2=$@-08.H exp="(file2*file2)/((file1*file2)+1e-9)" | Grey wantscalebar=y color=j newclip=1 eclip=1 bclip=0.2 color= polarity=-1 >/dev/null out=$R/$@-full-g-rat.v ;$(ps) $R/$@-full-g-rat.v $R/$@-full-g-rat.ps $(ps1)
	Math file1=$@-06.H file2=$@-08.H exp="(file2*file2)/((file1*file2)+1e-9)" | Grey wantscalebar=y color=j newclip=1 eclip=1 bclip=0.2 		       >/dev/null out=$R/$@-full-rat.v   ;$(ps) $R/$@-full-rat.v   $R/$@-full-rat.ps   $(ps1)
	Window3d min1= 500 n1=545 min3=1550 max3= 4005 < hes-$*-hes1.H | Transp | Grey color=j newclip=1 >/dev/null out=$R/$@-06.v; $(ps) $R/$@-06.v $R/$@-06.ps $(ps1)
	Window3d min1= 500 n1=545 min3=1550 max3= 4005 < hes-$*-hes2.H | Transp | Grey color=j newclip=1 >/dev/null out=$R/$@-08.v; $(ps) $R/$@-08.v $R/$@-08.ps $(ps1)
	Math file1=hes-$*-hes1.H file2=hes-$*-hes2.H exp="(file2*file2)/((file1*file2)+1e-9)" | Window3d min1= 500 n1=545 min3=1550 max3= 4005 | Transp | Grey wantscalebar=y color=j newclip=1 eclip=1 bclip=0.65 >/dev/null out=$R/$@-rat.v;$(ps) $R/$@-rat.v  $R/$@-rat.ps $(ps1)
	Window3d min8=3000 n8=1 min10=2000 n10=1 < $(hess-2759)    | Transp | Interp d2out=5 | Grey color= j newclip= 1 pclip=99.5 >/dev/null out=$R/$@-offd-06.v; $(ps) $R/$@-offd-06.v $R/$@-offd-06.ps $(ps1) 
	Window3d min8=3000 n8=1 min10=2000 n10=1 < $(hess-h-2759)  | Transp | Interp d2out=5 | Grey color= j newclip= 1 pclip=99.5 >/dev/null out=$R/$@-offd-08.v; $(ps) $R/$@-offd-08.v $R/$@-offd-08.ps $(ps1)  
	Window3d f1=111 n1=821 < $(mt)/hess-fft-06.H   | Grey color=j newclip=1 wantscalebar=y eclip=4000 bclip=0 >/dev/null out=$R/$@-fft-06.v; $(ps) $R/$@-fft-06.v $R/$@-fft-06.ps $(ps1) 
	Window3d f1=111 n1=821 < $(mt)/hess-fft-08.H   | Grey color=j newclip=1 wantscalebar=y eclip=4000 bclip=0 >/dev/null out=$R/$@-fft-08.v; $(ps) $R/$@-fft-08.v $R/$@-fft-08.ps $(ps1) 
	Window3d f1=111 n1=821 < $(mt)/hess-fft-diff.H | Grey color=j newclip=1 wantscalebar=y eclip=2000 bclip=0 >/dev/null out=$R/$@-fft-diff.v; $(ps) $R/$@-fft-diff.v $R/$@-fft-diff.ps $(ps1) 
	Math file1=$(mt)/hess-fft-06.H file2=$(mt)/hess-fft-08.H exp="(file2*file2)/((file1*file2)+1e-9)" | Grey wantscalebar=y color=j newclip=1 eclip=1 bclip=0.2  >/dev/null out=$R/$@-fft-rat.v   ;$(ps) $R/$@-fft-rat.v   $R/$@-fft-rat.ps   $(ps1)

#Velocity
ag1 = sfgrey3 titlesz=8 title=  label1=depth unit1=m label2=distance unit2=m label3=ang unit3=deg frame1=211 frame2=235 frame3=61  point1=.75 point2=.8 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color=   crowd2=.3 n3tic=30 < 
ag2 = sfgrey3 titlesz=8 title=  label1=depth unit1=m label2=distance unit2=m label3=ang unit3=deg frame1=261 frame2=115 frame3=61  point1=.75 point2=.8 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color=j  crowd2=.3 n3tic=30 < 
ag3 = sfgrey3 titlesz=8 title=  label1=depth unit1=m label2=distance unit2=m label3=ang unit3=deg frame1=261 frame2=115 frame3=61  point1=.75 point2=.8 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color=   crowd2=.3 n3tic=30 < 
cg3 = Cubeplot titlesz=8 title=  label1=depth label2=distance label3=ang frame1=261 frame2=115 frame3=61  point1=.75 point2=.8 titlesz=8 title=  labelsz=5 wantaxes= color=j wantscalebar=y  crowd2=.3< 
ag4 = sfgrey3 titlesz=8 title=  label1=depth unit1=m label3=q unit2= label2=distance unit3=m frame1=140 frame3=60 frame2=338  point1=.7 point2=.9 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color=i  crowd2=.3 n3tic=30 < 
ag5 = sfgrey3 titlesz=8 title=  label1=depth unit1=m label3=q unit2= label2=distance unit3=m frame1=140 frame3=49 frame2=338  point1=.7 point2=.9 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color=i  crowd2=.3 n3tic=30 < 
#data-space demultipled data
base-dmult-2759   = /home/goayeni/research.ln/Norne/work/mig-norne-dmult-flat-warp-2759-06.H
moni-dmult-2759   = /home/goayeni/research.ln/Norne/work/mig-norne-dmult-flat-warp-2759-08.H
base-h-dmult-2759 = /home/goayeni/research.ln/Norne/work/mig-norne-hole-sxgx-dmult-flat-warp-2759-06.H
moni-h-dmult-2759 = /home/goayeni/research.ln/Norne/work/mig-norne-hole-sxgx-dmult-flat-warp-2759-08.H

monin-dmult-2759   = /home/goayeni/research.ln/Norne/work/mig-shift-norne-dmult-flat-warp-2759-08-s.H
monin-h-dmult-2759 = /home/goayeni/research.ln/Norne/work/mig-shift-norne-hole-sxgx-dmult-flat-warp-2759-08-s.H

hess-dmult-2759    = /data/sep/goayeni/workspace/hessss-dmult-offd-norne-06-2759/hess/hs1-882.H
hess-h-dmult-2759  = /data/sep/goayeni/workspace/hessss-hole-sxgx-dmult-offd-norne-06-2759/hess/hs1-882.H

lab1 = titlesz=8 label1='depth (m)' label2='distance (m)' crowd2=0.4 title=" " 
c4d= newclip=1 bclip=-6000 eclip=6000 
cl1 = newclip=1 eclip=`Attr < 4d-clip.H want=all param=1 | Get maxval parform=n` bclip=-`Attr < 4d-clip.H want=all param=1 | Get maxval parform=n` 
#figures----
#vel
vel-%:
	Window3d min1=0 max1=13025 < $(wk)/vel-norne-hx-mig-08-2759.H n1=460 | Transp | Grey color=j newclip=1 wantscalebar=y $(lab1) barlabel="m/s">/dev/null out=$R/$@.v; cd $R; make $@.pdf 
	make fsync 
	touch $@
dm-dip-%:
	Window3d min1=0 n1=460 min3=1500 n3=501 < mign-dmult-2759-06.H | Transp > $@-modl.H 
	Grey < $@-modl.H titlesz=8 title='infile'      wantscalebar=y pclip=99.6 >/dev/null out=$@.v  
	/home/goayeni/Research/Source/Dips/Dip/Sdip rect1=5 rect2=2 < $@-modl.H  | Smooth rect1=2 rect2=2 > $@.H
	#Sdip rect1=5 rect2=2 < $@-modl.H  | Smooth rect1=2 rect2=2 > $@.H
	Grey color=j newclip=1 eclip=1.9 bclip=-1.9 $(lab1) < $@.H >/dev/null out=$R/$@.v; cd $R; make $@.pdf 
	Transp reshape=1,3,4 < $@.H > $@-t.H
	make fsync 
	touch $@
clip-%:
	Math file1=$(wk)/mig-norne-dmult-flat-warp-2759-06.H file2=$(wk)/mig-shift-norne-dmult-flat-warp-2759-08-s.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=445 | Transp > 4d-clip.H 
#raw
raw-%:
	Window3d < /data/sep/goayeni/workspace/norne-nodmult-hx-06-$*/modl/norne-nodmult-hx-06-$*-ang.H > $@-06.H;  Window3d min1=1550 max1=4005 n3=445 < $@-06.H | Grey eout=1 gainpanel=a pclip=98  title=' ' | Transp plane=23 > $@-06.T ; $(ag3) $@-06.T  > $R/$@-06.v titlesz=8 title=" "  "Raw baseline data"; cd $R; make    $@-06.pdf  &
	Window3d < /data/sep/goayeni/workspace/norne-nodmult-hx-08-$*/modl/norne-nodmult-hx-08-$*-ang.H > $@-08.H;  Window3d min1=1550 max1=4005 n3=445 < $@-08.H | Grey eout=1 gainpanel=a pclip=98  title=' ' | Transp plane=23 > $@-08.T ; $(ag3) $@-08.T  > $R/$@-08.v titlesz=8 title=" "  "Raw monitor data"; cd $R; make    $@-08.pdf  &
	Window3d <$@-06.H  | Stack3d > $@-06-stk.H 
	Window3d <$@-08.H  | Stack3d > $@-08-stk.H 
	Grey color=i pclip=96 $(lab1) < $@-06-stk.H >/dev/null out=$R/$@-full-g-06.v; cd $R; make $@-full-g-06.pdf
	Grey color=G pclip=96 $(lab1) < $@-06-stk.H >/dev/null out=$R/$@-full-06.v  ; cd $R; make $@-full-06.pdf
	Window3d min1=1550 max1=4005 n2=445 < $@-06-stk.H | Grey color=G pclip=96 $(lab1) >/dev/null out=$R/$@-06-stk.v  ; cd $R; make $@-06-stk.pdf
	Math file1=$@-06-stk.H file2=$@-08-stk.H exp=file2-file1 | Window3d min1=1550 max1=4005 min2= n2=445 | Grey color=i pclip=99.9 $(cl1) $(lab1) titlesz=8 title=" " "4d image: raw">/dev/null out=$R/$@-g-4d.v; cd $R; make $@-g-4d.pdf  &
	Math file1=$@-06-stk.H file2=$@-08-stk.H exp=file2-file1 | Window3d min1=1550 max1=4005 min2= n2=445 | Grey color=G pclip=99.9 $(cl1) $(lab1) titlesz=8 title=" " "4d image: raw" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf   
	make fsync 
	touch $@
#dmult
dmult-%: raw-%
	Window3d < /data/sep/goayeni/workspace/norne-dmult-hx-06-$*/modl/norne-dmult-hx-06-$*-ang.H > $@-06.H;  Window3d min1=1550 max1=4005 n3=445 < $@-06.H | Grey eout=1 gainpanel=a pclip=98  title=' ' | Transp plane=23 > $@-06.T ; $(ag3) $@-06.T > $R/$@-06.v titlesz=8 title=" "  "Demultipled baseline data"; cd $R; make    $@-06.pdf  &
	Window3d < /data/sep/goayeni/workspace/norne-dmult-hx-08-$*/modl/norne-dmult-hx-08-$*-ang.H > $@-08.H;  Window3d min1=1550 max1=4005 n3=445 < $@-08.H | Grey eout=1 gainpanel=a pclip=98  title=' ' | Transp plane=23 > $@-08.T ; $(ag3) $@-08.T > $R/$@-08.v titlesz=8 title=" "  "Demultipled monitor data"; cd $R; make    $@-08.pdf  &
	Window3d < /data/sep/goayeni/workspace/norne-dmult-hx-06-$*/modl/norne-dmult-hx-06-$*-ang.H | Stack3d > $@-06.H ; < $@-06.H   Window3d min1=1550 max1=4005 n2=445 | Grey color=G pclip=96 $(lab) title=" "  "Demultipled-baseline">/dev/null out=$R/$@-06-stk.v  ; cd $R; make $@-06-stk.pdf
	Window3d < /data/sep/goayeni/workspace/norne-dmult-hx-08-$*/modl/norne-dmult-hx-08-$*-ang.H | Stack3d > $@-08.H ; < $@-08.H   Window3d min1=1550 max1=4005 n2=445 | Grey color=G pclip=96 $(lab) title=" "  "Demultipled-monitor ">/dev/null out=$R/$@-08-stk.v  ; cd $R; make $@-08-stk.pdf
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=445 | Grey color=i pclip=99.9 $(cl1) $(lab1) titlesz=8 title=" " "4d image: after radon demultiple">/dev/null out=$R/$@-g-4d.v; cd $R; make $@-g-4d.pdf  &
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=445 | Grey color=G pclip=99.9 $(cl1) $(lab1) titlesz=8 title=" " "4d image: after radon demultiple" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf   
	make fsync 
	touch $@
#amp
amp-%: dmult-% 
	Window3d < $(wk)/norne-dmult-negpos-$*-b4mult-06.H     min1=1550 max1=4005 n3=445 | Stack3d > junk-$@-1.H ; < junk-$@-1.H Grey color=G pclip=95. title=" " $(lab1) >/dev/null out=$R/$@-06.v ; cd $R; make $@-06.pdf 
	Window3d < $(wk)/norne-dmult-negpos-$*-b4mult-amp-08.H min1=1550 max1=4005 n3=445 | Stack3d > junk-$@-2.H ; < junk-$@-2.H Grey color=G pclip=95. title=" " $(lab1) >/dev/null out=$R/$@-08.v ; cd $R; make $@-08.pdf 
	Math file1=junk-$@-1.H file2=junk-$@-2.H exp=file2-file1 | Grey color=G pclip=99.9 $(cl1) $(lab1) titlesz=8 title=" "  "4d image: after amplitude balancing" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf 
	make fsync 
	touch $@

#flat
flat-%: amp-%
	Window3d min1=1550 max1=4005 n3=445 < $(wk)/norne-dmult-negpos-2759-b4mult-06.H  | Transp plane=23 >$@-06.H;   < $@-06.H   Grey eout=1 gainpanel=a pclip=99 > $@-06.T 
	$(ag3) $@-06.T > $R/$@-06.v titlesz=8 title=" "  "Before RMO"; cd $R; make    $@-06.pdf  &
	Window3d min1=1550 max1=4005 n3=445 < $(wk)/norne-dmult-flat-negpos-06-2759-s.H  | Transp plane=23 >$@-06-s.H; < $@-06-s.H Grey eout=1 gainpanel=a pclip=99 > $@-06-s.T 
	$(ag3) $@-06-s.T > $R/$@-06-s.v titlesz=8 title=" "  "After  RMO"; cd $R; make    $@-06-s.pdf  &
	Window3d min1=1550 max1=4005 n3=445 < $(wk)/norne-dmult-flat-negpos-06-2759-ts.H | Transp plane=23 | Median_me.x nodes=12 wind1=2 wind2=0 wind3=5 |  Grey eout=1 gainpanel=a pclip=99 > $@-06-ts.T 
	$(ag2) $@-06-ts.T > 		 $R/$@-06-ts.v  allpos=y titlesz=8 title=" "  "Moveout"; cd $R; make $@-06-ts.pdf   &
	$(cg3) $@-06-ts.T >/dev/null out=$R/$@-06-ts2.v allpos=y titlesz=8 title=" "  "Moveout"; cd $R; make $@-06-ts2.pdf  &
	make fsync 
	touch $@
#warp
warp-%: flat-%
	Window3d min3=1550 max3=4005 n1=445     < $(wk)/norne-dmult-flat-warp-2759-08.H  | Transp reshape=2,3,5 | Grey eout=1 gainpanel=a pclip=99 > $@-08-b4.T 
	$(ag3) $@-08-b4.T > $R/$@-08-b4.v titlesz=8 title=" "  "Before Prestack-warp"; cd $R; make    $@-08-b4.pdf  &
	Window3d min3=1550 max3=4005 n1=445     < $(wk)/norne-dmult-flat-warp-2759-08-s.H  > $@; < $@ Transp reshape=2,3,5 > $@-08-s.H; < $@-08-s.H  Grey eout=1 gainpanel=a pclip=99 > $@-08.T 
	$(ag3) $@-08.T    > $R/$@-08.v    titlesz=8 title=" "  "After  Prestack-warp"; cd $R; make    $@-08.pdf     &
	Window3d min3=1550 max3=4005 n1=445 n4=1< $(wk)/norne-dmult-flat-warp-2759-08-ts.H > $@ ; < $@ Transp reshape=2,3,5 >  $@-08-ts.H; 
	< $@-08-ts.H Grey eout=1 gainpanel=a pclip=94 > $@-08-ts.T 
	$(ag2) $@-08-ts.T > 		 $R/$@-08-ts.v  allpos=y titlesz=8 title=" "  "Apparent vertical displacements";cd $R;  make   $@-08-ts.pdf  &
	$(cg3) $@-08-ts.T >/dev/null out=$R/$@-08-ts2.v allpos=y titlesz=8 title=" "  "Apparent vertical displacements";cd $R;  make   $@-08-ts2.pdf  &
	Window3d min1=1550 max1=4005 n3=445 n4=1< $(wk)/norne-dmult-flat-negpos-06-2759-ts.H | Transp plane=23			      >  $@-06-ts.H; < $@-06-ts.H Grey eout=1 gainpanel=a pclip=94 > $@-06-ts.T 
	Math file1=$@-06-ts.H file2=$@-08-ts.H exp=file2-file1 | Grey eout=1 gainpanel=a pclip=94 > $@-08-rflat-ts.T 
	$(ag2) $@-08-rflat-ts.T >              $R/$@-08-rflat-ts.v  allpos=y titlesz=8 title=" "  "Apparent vertical displacements"; cd $R;  make   $@-08-rflat-ts.pdf & 
	$(cg3) $@-08-rflat-ts.T >/dev/null out=$R/$@-08-rflat-ts2.v allpos=y titlesz=8 title=" "  "Apparent vertical displacements"; cd $R;  make   $@-08-rflat-ts2.pdf  &
	Math file1=$(wk)/norne-dmult-flat-warp-$*-06.H file2=$(wk)/norne-dmult-flat-warp-$*-08-s.H exp=file2-file1 | Stack3d | Transp | Window3d min1=1550 max1=4005 n2=445 | Grey color=G pclip=98.2 $(cl1) $(lab1) titlesz=8 title=" " "After RMO + warping">/dev/null out=$R/$@-4d.v ;cd $R; make $@-4d.pdf 
	make fsync 
	touch $@
#rwarp
rwarp-%: warp-%
	Window3d min3=1550 max3= 4005 min1=0 n1=445 n4=1 < $(wk)/mig-shift-norne-dmult-flat-warp-$*-08-ts.H | Transp | Grey color=j newclip=1 eclip=12 bclip=-12                $(lab1) >/dev/null out=$R/$@-ts.v  titlesz=8 title=" "  "Apparent residual vert. displacements"; cd $R; make  $@-ts.pdf  &
	Window3d min3=1550 max3= 4005 min1=0 n1=445 n4=1 < $(wk)/mig-shift-norne-dmult-flat-warp-$*-08-ts.H | Transp | Grey color=j newclip=1 eclip=12 bclip=-12 wantscalebar=y $(lab1) >/dev/null out=$R/$@-ts2.v titlesz=8 title=" "  "Apparent residual vert. displacements"; cd $R; make  $@-ts2.pdf  &
	Math file1=$(wk)/mig-norne-dmult-flat-warp-2759-06.H file2=$(wk)/mig-shift-norne-dmult-flat-warp-2759-08-s.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=445 | Transp | Grey color=G pclip=99.98 $(cl1) $(lab1) titlesz=8 title=" "  "After RMO + (Pre+Post stack) warping">/dev/null out=$R/$@-4d.v ;cd $R;  make $@-4d.pdf 
	make fsync 
	touch $@
#inv
inv-%: rwarp-% 
	Window3d < dinvo-2-1.H min3=1550 max3= 4005 n1=445 | Transp | Grey color=G pclip=98 $(lab1) titlesz=8 title=" " "Baseline image (inversion)">/dev/null out=$R/$@-06.v; cd $R; make  $@-06.pdf 
	Window3d < dinvo-2-2.H min3=1550 max3= 4005 n1=445 | Transp | Grey color=G pclip=98 $(lab1) titlesz=8 title=" " "Monitor image (inversion) ">/dev/null out=$R/$@-08.v ; cd $R; make  $@-08.pdf 
	Math file1=dinvo-2-1.H file2=dinvo-2-2.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=445 | Transp | Grey color=G pclip=100 $(lab1) titlesz=8 title=" " "After inversion" >/dev/null out=$R/$@-4d.v ; cd $R; make  $@-4d.pdf 
	make fsync 
	touch $@

#Hessian
#diag and fft
hs-%:
	#Window3d min8=0 n8=445 < $(wk)/dmult_hess.H      | Scale | Transp > $@-06.H
	#Window3d min8=0 n8=445 < $(wk)/dmult_hess-sxgx.H | Scale | Transp > $@-08.H
	Math file1=$@-06.H file2=$@-08.H exp="file2*file1" | Smooth rect1=3 rect2=3 > junk$@-12.H 
	Math file1=$@-08.H               exp="file1*file1" | Smooth rect1=3 rect2=3 > junk$@-22.H 
	Math file1=junk$@-22.H file2=junk$@-12.H exp="(file1)/(file2+1e-16)"  | Grey allpos=y polarity= -1 wantscalebar=y color=j newclip= 1 eclip=1 bclip=0.2 color=  $(lab1) title=" " >/dev/null out=$R/$@-full-g-rat.v ; cd $R;make  $@-full-g-rat.pdf 
	Math file1=junk$@-22.H file2=junk$@-12.H exp="(file1)/(file2+1e-16)"  | Grey allpos=y polarity= -1 wantscalebar=y color=j newclip= 1 eclip=1 bclip=0.2 	      $(lab1) title=" " >/dev/null out=$R/$@-full-rat.v   ; cd $R;make  $@-full-rat.pdf   
	Window3d min1= 500 n1=445 min3=1550 max3= 4005 < hes-dmult-$*-hes1.H | Transp | Grey allpos=y polarity= -1 color=j newclip= 1 $(lab1) title=" " >/dev/null out=$R/$@-06.v; cd $R; make  $@-06.pdf 
	Window3d min1= 500 n1=445 min3=1550 max3= 4005 < hes-dmult-$*-hes2.H | Transp | Grey allpos=y polarity= -1 color=j newclip= 1 $(lab1) title=" " >/dev/null out=$R/$@-08.v; cd $R; make  $@-08.pdf 
	Math file1=hes-dmult-$*-hes1.H file2=hes-dmult-$*-hes2.H exp="(file2*file2)/((file1*file2)+1e-9)" | Window3d min1= 500 n1=445 min3=1550 max3= 4005 | Transp | Grey $(lab1) allpos=y polarity= -1 wantscalebar= y color=j newclip=1 eclip=1 bclip=0.65 >/dev/null out=$R/$@-rat.v; cd $R;make  $@-rat.pdf 
	Window3d min8=2600 n8=1 min10=2600 n10=1 min3=-200 n3=17 < $(hess-dmult-2759)    |  Transp  | Interp d2out=5  > $@-offd-06.H; 
	Window3d min8=2600 n8=1 min10=2600 n10=1 min3=-200 n3=17 < $(hess-h-dmult-2759)  |  Transp  | Interp d2out=5  > $@-offd-08.H;
	Math file1=$@-offd-06.H file2=$@-offd-08.H exp=file2-file1 |  Grey allpos= y crowd1=.70 crowd2=.70 n1tic=3 nd2tic=1 labelsz=12 label1='z_off (m)' label2='x_off (m)' title=' ' newclip=1 eclip=`Attr param=1 < $@-offd-06.H |Get parform=n maxval` bclip=-`Attr param=1 < $@-offd-06.H |Get parform=n maxval` >/dev/null out=$R/$@-offd-diff.v; cd $R; make  $@-offd-diff.pdf  
	Grey allpos= y polarity=-1 crowd1=.70 crowd2=.70 n1tic=3 n2tic=1 labelsz=12 label1='z_off (m)' label2='x_off (m)' < $@-offd-06.H title=' ' newclip=1 eclip=`Attr param=1 < $@-offd-06.H |Get parform=n maxval` bclip=-`Attr param=1 < $@-offd-06.H |Get parform=n maxval` >/dev/null out=$R/$@-offd-06.v; cd $R; make  $@-offd-06.pdf  
	Grey allpos= y polarity=-1 crowd1=.70 crowd2=.70 n1tic=3 n2tic=1 labelsz=12 label1='z_off (m)' label2='x_off (m)' < $@-offd-08.H title=' ' newclip=1 eclip=`Attr param=1 < $@-offd-06.H |Get parform=n maxval` bclip=-`Attr param=1 < $@-offd-06.H |Get parform=n maxval` >/dev/null out=$R/$@-offd-08.v; cd $R; make  $@-offd-08.pdf   
	Window3d min2=-0.05 max2=0.051 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-06.H   | Grey allpos=y polarity= -1 title=" " crowd1=.70 crowd2=.70 n1tic=3 d2num=0.04 labelsz=12 color=j newclip= 1 wantscalebar=y eclip=800 bclip=0 label1="(1/m)" label2="(1/m)" >/dev/null out=$R/$@-fft-06.v; cd $R; make  $@-fft-06.pdf  
	Window3d min2=-0.05 max2=0.051 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-08.H   | Grey allpos=y polarity= -1 title=" " crowd1=.70 crowd2=.70 n1tic=3 d2num=0.04 labelsz=12 color=j newclip= 1 wantscalebar=y eclip=800 bclip=0 label1="(1/m)" label2="(1/m)" >/dev/null out=$R/$@-fft-08.v; cd $R; make  $@-fft-08.pdf  
	Window3d min2=-0.05 max2=0.051 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-diff.H | Grey allpos=y polarity= -1 title=" " crowd1=.70 crowd2=.70 n1tic=3 d2num=0.04 labelsz=12 color=j newclip= 1 wantscalebar=y eclip=800 bclip=0 label1="(1/m)" label2="(1/m)" >/dev/null out=$R/$@-fft-diff.v; cd $R; make $@-fft-diff.pdf  
	Window3d min2=-0.05 max2=0.051 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-06.H   > junk$@-1.H 
	Window3d min2=-0.05 max2=0.051 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-08.H   > junk$@-2.H
	Math file1=junk$@-1.H file2=junk$@-2.H exp="file2*file1" | Smooth rect1=3 rect2=5 > junk$@-12.H 
	Math file1=junk$@-2.H                  exp="file1*file1" | Smooth rect1=3 rect2=5 > junk$@-22.H 
	Math file1=junk$@-22.H file2=junk$@-12.H exp="(file1)/(file2+1e-16)"  |  Grey allpos=y polarity=-1 wantscalebar=y crowd1=.70 crowd2=.70 n1tic=3 d2num=0.04 labelsz=12 title=" " color=j newclip= 1 eclip=1 bclip=0.05  label1="(1/m)" label2="(1/m)" label1='z_off (m)' label2='x_off (m)' >/dev/null out=$R/$@-fft-rat1.v   ; cd $R;make  $@-fft-rat1.pdf   
	Math file1=$(mt)/hess-dmult-fft-06.H file2=$(mt)/hess-dmult-fft-08.H exp="(file2*file2)/((file1*file2)+1e-6)" | Window3d min1=-0.02505 max1=0.0001 min1=-0.026 max1=0.0261 |  Grey polarity=-1 allpos=y crowd1=.70 crowd2=.70 n1tic=3 d2num=0.04 labelsz=12 title=" " label1="(1/m)" label2="(1/m)" label1='z_off (m)' label2='x_off (m)' wantscalebar=y color= j newclip= 1 eclip=1 bclip=0.05  >/dev/null out=$R/$@-fft-rat.v   ; cd $R;make  $@-fft-rat.pdf   
	make fsync 
	touch $@

#
##
#Figures======holed
cli = newclip=1 eclip=`Attr < dmhl-4d-clip.H want=all param=1 | Get maxval parform=n` bclip=-`Attr < dmhl-4d-clip.H want=all param=1 | Get maxval parform=n` 
dmhl-clip-%:
	Math file1=$(wk)/mig-norne-hole-sxgx-dmult-flat-warp-2759-06.H file2=$(wk)/mig-shift-norne-hole-sxgx-dmult-flat-warp-2759-08-s.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=445 | Transp > dmhl-4d-clip.H

dmhl-raw-%: 
	#Window3d min1=1550 max1=4005 n4=445< /data/sep/goayeni/workspace/norne-nodmult-hx-06-$*/modl/norne-nodmult-hx-06-$*-ang.H 		      > $@-06.H; < $@-06.H Grey eout=1 gainpanel=a pclip=98  | Transp plane=23 > $@-06.T ; $(ag3) $@-06.T > $R/$@-06.v titlesz=8 title=" " "Raw data"; cd $R; make    $@-06.pdf  &
	#Window3d min1=1550 max1=4005 n4=445< /data/sep/goayeni/workspace/norne-hole-sxgx-nodmult-hx-08-$*/modl/norne-hole-sxgx-nodmult-hx-08-$*-ang.H > $@-08.H; < $@-08.H Grey eout=1 gainpanel=a pclip=98  | Transp plane=23 > $@-08.T ; $(ag3) $@-08.T > $R/$@-08.v titlesz=8 title=" " "Raw data"; cd $R; make    $@-08.pdf  &
	#Window3d <$@-06.H  | Stack3d > $@-06-stk.H 
	#Window3d <$@-08.H  | Stack3d > $@-08-stk.H 
	Math file1=$@-06-stk.H file2=$@-08-stk.H exp=file2-file1 | Grey color=i $(cl1) pclip=98.2 $(lab1) titlesz=8 title=" " "4d image: raw" >/dev/null out=$R/$@-g-4d.v; cd $R; make $@-g-4d.pdf  &
	Math file1=$@-06-stk.H file2=$@-08-stk.H exp=file2-file1 | Grey color=G $(cl1) pclip=98.2 $(lab1) titlesz=8 title=" " "4d image: raw" >/dev/null out=$R/$@-4d.v  ; cd $R; make $@-4d.pdf   
	make fsync 
	touch $@
#dmult
dmhl-dmult-%: dmhl-raw-%
	#Window3d < /data/sep/goayeni/workspace/norne-dmult-hx-06-$*/modl/norne-dmult-hx-06-$*-ang.H | Stack3d > $@-06.H 
	#Window3d < /data/sep/goayeni/workspace/norne-hole-sxgx-dmult-hx-08-$*/modl/norne-hole-sxgx-dmult-hx-08-$*-ang.H | Stack3d > $@-08.H 
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=445 | Grey color=i pclip=98.2 $(cl1) $(lab1) titlesz=8 title=" " "4d image: after radon demultiple">/dev/null out=$R/$@-g-4d.v; cd $R; make $@-g-4d.pdf  &
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=445 | Grey color=G pclip=98.2 $(cl1) $(lab1) titlesz=8 title=" " "4d image: after radon demultiple" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf   
	make fsync 
	touch $@
#amp
dmhl-amp-%: dmhl-dmult-% 
	Window3d < $(wk)/norne-hole-sxgx-dmult-negpos-$*-b4mult-06.H     min1=1550 max1=4005 n3=445 | Stack3d > junk-$@-1.H ; < junk-$@-1.H Grey color=G pclip=95. $(lab1) >/dev/null out=$R/$@-06.v ; cd $R; make $@-06.pdf 
	Window3d < $(wk)/norne-hole-sxgx-dmult-negpos-$*-b4mult-amp-08.H min1=1550 max1=4005 n3=445 | Stack3d > junk-$@-2.H ; < junk-$@-2.H Grey color=G pclip=95. $(lab1) >/dev/null out=$R/$@-08.v ; cd $R; make $@-08.pdf 
	Math file1=junk-$@-1.H file2=junk-$@-2.H exp=file2-file1 | Grey color=G pclip=98.2 $(cl1) $(lab1) titlesz=8 title=" " "4d image: after amplitude balancing" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf 
	make fsync 
	touch $@

#flat
dmhl-flat-%: dmhl-amp-%
	Window3d min1=1550 max1=4005 n3=445 < $(wk)/norne-dmult-negpos-2759-b4mult-06.H  | Transp plane=23 >$@-06.H;   < $@-06.H   Grey eout=1 gainpanel=a pclip=99 > $@-06.T 
	$(ag3) $@-06.T > $R/$@-06.v titlesz=8 title=" " "Before RMO"; cd $R; make    $@-06.pdf  &
	Window3d min1=1550 max1=4005 n3=445 < $(wk)/norne-dmult-flat-negpos-06-2759-s.H  | Transp plane=23 >$@-06-s.H; < $@-06-s.H Grey eout=1 gainpanel=a pclip=99 > $@-06-s.T 
	$(ag3) $@-06-s.T > $R/$@-06-s.v titlesz=8 title=" " "After  RMO"; cd $R; make    $@-06-s.pdf  &
	Window3d min1=1550 max1=4005 n3=445 < $(wk)/norne-dmult-flat-negpos-06-2759-ts.H | Transp plane=23 | Median_me.x nodes=12 wind1=2 wind2=0 wind3=5 |  Grey eout=1 title=" " gainpanel=a pclip=99 > $@-06-ts.T 
	$(ag2) $@-06-ts.T > 		 $R/$@-06-ts.v  titlesz=8 title=" " "Moveout"; cd $R; make $@-06-ts.pdf   &
	$(cg3) $@-06-ts.T >/dev/null out=$R/$@-06-ts2.v titlesz=8 title=" " "Moveout"; cd $R; make $@-06-ts2.pdf  &
	make fsync 
	touch $@
#warp
dmhl-warp-%: dmhl-flat-%
	Window3d min3=1550 max3=4005 n1=445     < $(wk)/norne-hole-sxgx-dmult-flat-warp-2759-08.H  | Transp reshape=2,3,4 | Grey eout=1 gainpanel=a pclip=99 title=" "  > $@-08-b4.T 
	$(ag3) $@-08-b4.T > $R/$@-08-b4.v titlesz=8 title=" " "Before Prestack-warp"; cd $R; make    $@-08-b4.pdf  &
	Window3d min3=1550 max3=4005 n1=445     < $(wk)/norne-hole-sxgx-dmult-flat-warp-2759-08-s.H  > $@; < $@ Transp reshape=2,3,4 > $@-08-s.H; < $@-08-s.H  Grey eout=1 gainpanel=a pclip=99 > $@-08.T 
	$(ag3) $@-08.T    > $R/$@-08.v    titlesz=8 title=" " "After  Prestack-warp"; cd $R; make    $@-08.pdf     &
	Window3d min3=1550 max3=4005 n1=445 n4=1< $(wk)/norne-hole-sxgx-dmult-flat-warp-2759-08-ts.H > $@ ; < $@ Transp reshape=2,3,4 >  $@-08-ts.H; 
	< $@-08-ts.H Grey eout=1 gainpanel=a pclip=94 > $@-08-ts.T 
	$(ag2) $@-08-ts.T > 		 $R/$@-08-ts.v  titlesz=8 title=" " "Apparent vertical displacements";cd $R;  make   $@-08-ts.pdf  &
	$(cg3) $@-08-ts.T >/dev/null out=$R/$@-08-ts2.v titlesz=8 title=" " "Apparent vertical displacements";cd $R;  make   $@-08-ts2.pdf  &
	Window3d min1=1550 max1=4005 n3=445 n4=1< $(wk)/norne-dmult-flat-negpos-06-2759-ts.H | Transp plane=23			      >  $@-06-ts.H; < $@-06-ts.H Grey eout=1 gainpanel=a pclip=94 > $@-06-ts.T 
	Math file1=$@-06-ts.H file2=$@-08-ts.H exp=file2-file1 | Grey eout=1 gainpanel=a pclip=94 title=" " > $@-08-rflat-ts.T 
	$(ag2) $@-08-rflat-ts.T >              $R/$@-08-rflat-ts.v  titlesz=8 title=" " "Apparent vertical displacements"; cd $R;  make   $@-08-rflat-ts.pdf & 
	$(cg3) $@-08-rflat-ts.T >/dev/null out=$R/$@-08-rflat-ts2.v titlesz=8 title=" " "Apparent vertical displacements"; cd $R;  make   $@-08-rflat-ts2.pdf  &
	Math file1=$(wk)/norne-hole-sxgx-dmult-flat-warp-$*-06.H file2=$(wk)/norne-hole-sxgx-dmult-flat-warp-$*-08-s.H exp=file2-file1 | Stack3d | Transp | Window3d min1=1550 max1=4005 n2=445 | Grey color=G pclip=98.2 $(cl1) $(lab1) titlesz=8 title=" " "After RMO + warping">/dev/null out=$R/$@-4d.v ;cd $R; make $@-4d.pdf 
	touch $@
#rwarp
dmhl-rwarp-%: dmhl-warp-%
	Window3d min3=1550 max3= 4005 min1=0 n1=445 n4=1 < $(wk)/mig-shift-norne-hole-sxgx-dmult-flat-warp-$*-08-ts.H | Transp | Grey color=j newclip=1 eclip=12 bclip=-12                >/dev/null out=$R/$@-ts.v  titlesz=8 title=" " "Apparent residual vert. displacements"; cd $R;  make $@-ts.pdf  &
	Window3d min3=1550 max3= 4005 min1=0 n1=445 n4=1 < $(wk)/mig-shift-norne-hole-sxgx-dmult-flat-warp-$*-08-ts.H | Transp | Grey color=j newclip=1 eclip=12 bclip=-12 wantscalebar=y >/dev/null out=$R/$@-ts2.v titlesz=8 title=" " "Apparent residual vert. displacements"; cd $R;  make $@-ts2.pdf  &
	Math file1=$(wk)/mig-norne-hole-sxgx-dmult-flat-warp-2759-06.H file2=$(wk)/mig-shift-norne-hole-sxgx-dmult-flat-warp-2759-08-s.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=445 | Transp | Grey color=G pclip=98.2 $(cl1) $(lab1) titlesz=8 title=" " "After RMO + (Pre+Post-stack) warping">/dev/null out=$R/$@-4d.v ;cd $R;  make $@-4d.pdf 
	make fsync 
	touch $@
#inv
dmhl-inv-%: dmhl-rwarp-% 
	Window3d < dinv-2-1.H min3=1550 max3= 4005 n1=445 | Transp | Grey color=G pclip=96 $(lab1) titlesz=8 title=" " "Baseline image (inversion)">/dev/null out=$R/$@-06.v; cd $R; make  $@-06.pdf 
	Window3d < dinv-2-2.H min3=1550 max3= 4005 n1=445 | Transp | Grey color=G pclip=96 $(lab1) titlesz=8 title=" " "Monitor image (inversion)">/dev/null out=$R/$@-08.v ; cd $R; make  $@-08.pdf 
	Math file1=dinv-2-1.H file2=dinv-2-2.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=445 | Transp | Grey color=G pclip=99.99999 $(lab1) titlesz=8 title=" " "After inversion" >/dev/null out=$R/$@-4d.v ; cd $R; make  $@-4d.pdf 
	make fsync 
	touch $@

dg3 = sfgrey3 titlesz=8 title=  label1=time unit1=s label2=sx unit2=m label3=offset unit3=m frame1=211 frame2=235 frame3=5  point1=.55 point2=.7 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color= < 
dmhl-dat-%:
	#Window3d min3=500 max_memory=1000 max3=8000 min2=-3200 max2=12.5  max1=5.0 < /data/sep/goayeni/workspace/norne-nodmult-hx-08-2759/dat-norne-nodmult-hx-08-2759.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@-b4.T &
	#Window3d min3=500 max_memory=1000 max3=8000 min2=-3200 max2=12.5  max1=5.0 < /data/sep/goayeni/workspace/norne-dmult-hx-08-2759/dat-norne-dmult-hx-08-2759.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@.T &
	#Window3d min3=500 max_memory=1000 max3=8000 min2=-3200 max2=12.5  max1=5.0 < /data/sep/goayeni/workspace/norne-hole-sxgx-nodmult-hx-08-2759/dat-norne-hole-sxgx-nodmult-hx-08-2759.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@-b4-hole.T 
	#Window3d min3=500 max_memory=1000 max3=8000 min2=-3200 max2=12.5  max1=5.0 < /data/sep/goayeni/workspace/norne-hole-sxgx-dmult-hx-08-2759/dat-norne-hole-sxgx-dmult-hx-08-2759.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@-hole.T
	$(dg3) $@-b4.T 	     > $R/$@-b4.v;  	 cd $R; make  $@-b4.pdf;
	$(dg3) $@.T 	     > $R/$@.v;  	 cd $R; make  $@.pdf; 
	$(dg3) $@-b4-hole.T  > $R/$@-b4-hole.v;  cd $R; make  $@-b4-hole.pdf; 
	$(dg3) $@-hole.T     > $R/$@-hole.v;     cd $R; make  $@-hole.pdf;
	make fsync
	touch $@
dg4 = sfgrey3 titlesz=8 title=  label1=\tau unit1=s label2=cmp unit2=m label3=slowness unit3=s/m frame1=101 frame2=300 frame3=181  point1=.55 point2=.7 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color= < 
dat-dmult-mod-%:
	#Window3d min3=2500 max3=10000 < /data/sep/goayeni/workspace/multiples3/norne-dmult-06-2759/modl/norne-dmult-06-2759-qm0.74-qd0.995-eps0.51.mod1_h.H | Transp plane=23 | Envelope tc1=1 tc2=3 tc3=3 | Grey eout=1 pclip=99.99 > $@.T 
	$(dg4) $@.T 	     > $R/$@.v;  	 cd $R; make  $@.pdf; 
#
#
##################################
#non-reservoir 9300
#non-reservoir 6000
#reservoir 2800
lab2= legendtitle='0-baseline, 1-monitor' legend=n y legendloc='tr' legendsz=6 title="cmp-$*(m)" crowd1=0.2 label1="depth(m)"  d1num=300 grid=1  
lab3= legendtitle='0-baseline, 1-monitor' legend=n y legendloc='tr' legendsz=6 title="cmp-$*(m)" crowd1=0.2 label1="depth(m)"  d1num=300 grid=1  min1=2600 max1=3100  
compare:
#	Rm $@*H
	make $@-2350
	make $@-5650
	make $@-9300
compare-%:
	Window3d min2=$* n2=1 min1=1550 n1=491 < dmult-raw-fig-2759-06-stk.H > $@-raw-1.H
	Window3d min2=$* n2=1 min1=1550 n1=491 < dmult-raw-fig-2759-08-stk.H > $@-raw-2.H
	Cat3d $@-raw-1.H $@-raw-2.H axis=2 | Graph transp=y yreverse=y min2=-40000 max2=40000 $(lab2) >/dev/null out=$R/$@-raw-1.v; cd $R; make $@-raw-1.pdf
	Cat3d $@-raw-1.H $@-raw-2.H axis=2 | Graph transp=y yreverse=y min2=-20000 max2=20000 $(lab3) >/dev/null out=$R/$@-raw-2.v; cd $R; make $@-raw-2.pdf
	Cat3d $@-raw-1.H $@-raw-2.H axis=2 | Graph transp=y yreverse=y min2=-40000 max2=40000 $(lab3) >/dev/null out=$R/$@-raw-3.v; cd $R; make $@-raw-3.pdf
	Math file1=$@-raw-1.H file2=$@-raw-2.H exp=file2-file1     | Graph transp=y yreverse=y grid=1 min2=-15000 max2=15000 $(lab2)> /dev/null out=$R/$@-raw.v; cd $R; make $@-raw.pdf
	Window3d min2=$* n2=1 min1=1550 n1=491 < dmult-dmult-fig-2759-06.H > $@-dmult-1.H
	Window3d min2=$* n2=1 min1=1550 n1=491 < dmult-dmult-fig-2759-08.H > $@-dmult-2.H
	Cat3d $@-dmult-1.H $@-dmult-2.H axis=2 | Graph transp=y yreverse=y min2=-40000 max2=40000 $(lab2) >/dev/null out=$R/$@-dmult-1.v; cd $R; make $@-dmult-1.pdf
	Cat3d $@-dmult-1.H $@-dmult-2.H axis=2 | Graph transp=y yreverse=y min2=-20000 max2=20000 $(lab3) >/dev/null out=$R/$@-dmult-2.v; cd $R; make $@-dmult-2.pdf
	Cat3d $@-dmult-1.H $@-dmult-2.H axis=2 | Graph transp=y yreverse=y min2=-40000 max2=40000 $(lab3) >/dev/null out=$R/$@-dmult-3.v; cd $R; make $@-dmult-3.pdf
	Math file1=$@-dmult-1.H file2=$@-dmult-2.H exp=file2-file1 | Graph transp=y yreverse=y grid=1 min2=-15000 max2=15000 $(lab2)> /dev/null out=$R/$@-dmult.v; cd $R; make $@-dmult.pdf 
	Window3d min2=$* n2=1 < junk-dmult-amp-fig-2759-1.H > $@-amp-1.H 
	Window3d min2=$* n2=1 < junk-dmult-amp-fig-2759-2.H > $@-amp-2.H
	Cat3d $@-amp-1.H $@-amp-2.H axis=2 | Graph transp=y yreverse=y min2=-40000 max2=40000 $(lab2) >/dev/null out=$R/$@-amp-1.v; cd $R; make $@-amp-1.pdf
	Cat3d $@-amp-1.H $@-amp-2.H axis=2 | Graph transp=y yreverse=y min2=-20000 max2=20000 $(lab3) >/dev/null out=$R/$@-amp-2.v; cd $R; make $@-amp-2.pdf
	Cat3d $@-amp-1.H $@-amp-2.H axis=2 | Graph transp=y yreverse=y min2=-40000 max2=40000 $(lab3) >/dev/null out=$R/$@-amp-3.v; cd $R; make $@-amp-3.pdf
	Math file1=$@-amp-1.H file2=$@-amp-2.H exp=file2-file1     | Graph transp=y yreverse=y grid=1 min2=-15000 max2=15000 $(lab2)> /dev/null out=$R/$@-amp.v; cd $R; make $@-amp.pdf
	Window3d min2=$* n2=1 < dmult-flat-fig-2759-06-s.H | Stack3d > $@-warp-1.H
	Window3d min2=$* n2=1 < dmult-warp-fig-2759-08-s.H | Stack3d > $@-warp-2.H
	Cat3d $@-warp-1.H $@-warp-2.H axis=2 | Graph transp=y yreverse=y min2=-40000 max2=40000 $(lab2) >/dev/null out=$R/$@-warp-1.v; cd $R; make $@-warp-1.pdf
	Cat3d $@-warp-1.H $@-warp-2.H axis=2 | Graph transp=y yreverse=y min2=-20000 max2=20000 $(lab3) >/dev/null out=$R/$@-warp-2.v; cd $R; make $@-warp-2.pdf
	Cat3d $@-warp-1.H $@-warp-2.H axis=2 | Graph transp=y yreverse=y min2=-40000 max2=40000 $(lab3) >/dev/null out=$R/$@-warp-3.v; cd $R; make $@-warp-3.pdf
	Math file1=$@-warp-1.H file2=$@-warp-2.H exp=file2-file1   | Graph transp=y yreverse=y grid=1 min2=-15000 max2=15000 $(lab2)> /dev/null out=$R/$@-warp.v; cd $R; make $@-warp.pdf
	Window3d min2=$* n2=1 n3=1 min3=0 < dmult-warp-fig-2759-08-ts.H | Graph Graph grid=1 transp=y yreverse=y min2=-.1 max2=10. label2="shift(m)" $(lab2) >/dev/null out=$R/$@-ts.v; cd $R; make $@-ts.pdf
	#Window3d min2=$* n2=1 n3=1 min3=0 < dmult-warp-fig-2759-08-ts.H | Graph Graph grid=1 transp=y yreverse=y min2=-.1 max2=10 label2="shift(m)" title="cmp-$*(m)" crowd1=0.2 label1="depth(m)" >/dev/null out=$R/$@-ts.v; cd $R; make $@-ts.pdf
	#Cat3d $@-raw.H $@-dmult.H $@-amp.H $@-warp.H axis=3 | Graph transp=y yreverse=y min2=-35000 max2=35000 title="cmp-$*(m)" | Tube -geometry 200x800 stretchy=y &
	#Cat3d $@-raw.H $@-dmult.H $@-amp.H $@-warp.H axis=3 | Graph transp=y yreverse=y min2=-40000 max2=40000 title="cmp-$*(m)" | Tube -geometry 200x800 stretchy=y &



