include ${SEPINC}/SEP.top
RESULTSNR=
RESULTSER=data  
RESULTSCR=shot1200 allshots actshots vshot1200csum3500 vshot1200.3500 manysrc manysrcrand vshot1200.3500.rand vshot1200csum3500rand 

GR = Grey title=" " > /dev/null
GP = Graph title=" " transp=y yreverse=y plotfat=6 > /dev/null
RESDIR = ./Fig
R = ${RESDIR}
DIFDIR=/net/koko/guest/deyan/RawData/Diffr
SYNDIR=/net/koko/guest/deyan/RawData/2sync
dn= /dev/null
GRD=Grey label1='time(s)' label2='x(m)' geophysics=1 title=' ' crowd=.89 > $(dn)
GRZ=Grey label1='depth(m)' label2='x(m)' geophysics=1 title=' ' crowd=.89 > $(dn)
vp=vppen vpstyle=n <
vpn=vppen vpstyle=n 
TXTDIR=../Txt
T=$(TXTDIR)
vpa=vp_annotate batch=y 
figpdf:$(addprefix $R/, $(addsuffix .pdf, $(RESULTSCR))) $R/data.pdf
$R/tran1200difr.v:$(DIFDIR)/trans_difr2_1200.su
	cd $(DIFDIR); $(MAKE) 1200.h ; $(GRD) < 1200.h out=$@
$R/tran4000difr.v:$(DIFDIR)/trans_difr2_4000.su
	cd $(DIFDIR); $(MAKE) 1200.h ; $(GRD) < 1200.h out=$@
$R/tran1200.v:$(SYNDIR)/trans_2sync_1200.su
	cd $(SYNDIR); $(MAKE) 1200.h ; $(GRD) < 1200.h out=$@
$R/tran4000.v:$(SYNDIR)/trans_2sync_4000.su
	cd $(SYNDIR); $(MAKE) 1200.h ; $(GRD) < 1200.h out=$@
$R/vel2syn.v: vel2syn.H
	< $< Window3d | Transp |$(GRZ) newclip=1 out=$@
$R/data.v:#  $R/tran1200.v $R/tran4000.v $R/vel2syn.v
	cat $T/intext_a $T/lshot > aa
	$(vpa) < $R/tran1200.v text=aa |\
	  $(vpn)   xsize=2. ysize=3. yshift=0.1 > a.v 
	cat $T/intext_b $T/cshot > bb
	$(vpa) < $R/tran4000.v text=bb |\
	  $(vpn)  xsize=2. ysize=3. yshift=0.1 > b.v xshift=2.
	cat $T/intext_c $T/lshot $T/cshot > cc
	$(vpa) < $R/vel2syn.v  text=cc |\
	  $(vpn) xsize=2. ysize=3. yshift=0.1 > c.v xshift=4.
	vp_Overlay a.v b.v c.v > $@
	rm -f a.v b.v c.v d.v aa bb cc 
#$R/data.v:$R/tran1200difr.v  $R/tran1200.v  $R/tran4000difr.v  $R/tran4000.v
#	$(vp) $R/tran1200difr.v xsize=3. ysize=3. yshift=0.1 > a.v
#	$(vp) $R/tran4000.v     xsize=3. ysize=3. yshift=3.1 > b.v xshift=3.
#	$(vp) $R/tran4000difr.v xsize=3. ysize=3. yshift=0.1 > c.v xshift=3.
#	$(vp) $R/tran1200.v     xsize=3. ysize=3. yshift=3.1 > d.v 
#	vp_Overlay a.v b.v c.v d.v > $@
#	rm -f a.v b.v c.v d.v 

corr.%.H:$(SYNDIR)/trans_2sync_%.su
	cd $(SYNDIR) ; $(MAKE) $*.h 
	ln -s $(SYNDIR)/$*.h $*.h
	Pad n1out=2048 < $*.h > t$*.H
	$B/BigCorr.x traces=t$*.H gathers=tt$*.H minf=2. maxf=80. decon=n
	$B/FtOnesideP.x traces=tt$*.H decon=f time=corr.$*.H
	echo o3=1200 d3=20. o2=1200. d2=20.  >> corr.$*.H
	Rm t$*.H tt$*.H 
$R/vshot1200.3500.v:corr.1200.3500.shift.H
	Grey eout=1 < corr.1200.3500.shift.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=a.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	Grey eout=1 < corr.1200.3500.shift.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=1   frame3=1   out=b.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	$(vp) b.v xsize=3. ysize=3. yshift=0.12 > a2.v
	$(vp) a.v xsize=3. ysize=3. yshift=0.12 > b2.v xshift=3.
	vp_Overlay a2.v b2.v > a.v
	vp_annotate < a.v text=../Txt/hypercirc batch=y | ${vpn} > $@
	rm -f a.v b.v a2.v b2.v 
$R/vshot1200csum3500.v:corr.1200csum3500.H
	Grey eout=1 < corr.1200csum3500.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=a.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	Grey eout=1 < corr.1200csum3500.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=1   frame3=1   out=b.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	$(vpa) < b.v text=../Txt/cube_a | $(vpn) xsize=3. ysize=3. yshift=0.12 > a2.v
	$(vpa) < a.v text=../Txt/cube_b | $(vpn) xsize=3. ysize=3. yshift=0.12 > b2.v xshift=3.
	vp_Overlay a2.v b2.v > a.v
	vp_annotate < a.v text=../Txt/hypercirc batch=y | ${vpn} > $@
	rm -f a.v b.v a2.v b2.v 
$R/vshot1200.3500.rand.v:corr.1200.3500.rand.H
	Grey eout=1 < corr.1200.3500.rand.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=a.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	Grey eout=1 < corr.1200.3500.rand.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=1   frame3=1   out=b.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	$(vpa) < b.v text=../Txt/cube_a | $(vpn) xsize=3. ysize=3. yshift=0.12 > a2.v
	cat ../Txt/arrow ../Txt/cube_b > bb
	$(vpa) < a.v text=bb | $(vpn) xsize=3. ysize=3. yshift=0.12 > b2.v xshift=3.
	vp_Overlay a2.v b2.v > aa.v
	vp_annotate < aa.v text=../Txt/hypercirc batch=y | ${vpn} > $@
	rm -f a.v b.v a2.v b2.v aa.v bb aa 
$R/vshot1200csum3500rand.v:corr.1200csum3500rand.H
	Grey eout=1 < $< gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=a.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	Grey eout=1 < $< gainpanel=a | \
	  Cubeplot frame1=80 frame2=1   frame3=1   out=b.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	$(vpa) < b.v text=../Txt/cube_a | $(vpn) xsize=3. ysize=3. yshift=0.12 > a2.v
	cat ../Txt/arrow ../Txt/cube_b > bb
	$(vpa) < a.v text=bb | $(vpn) xsize=3. ysize=3. yshift=0.12 > b2.v xshift=3.
	vp_Overlay a2.v b2.v > $@
	rm -f a.v b.v a2.v b2.v aa.v bb 
$R/shot%.v:corr.%.H
	Grey eout=1 < corr.$*.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=a.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	Grey eout=1 < corr.$*.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=1   frame3=1   out=b.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	$(vpa) < a.v text=../Txt/cube_a | $(vpn) xsize=3. ysize=3. yshift=0.12 > a2.v xshift=3.
	$(vpa) < b.v text=../Txt/cube_b | $(vpn) xsize=3. ysize=3. yshift=0.12 > b2.v
	vp_Overlay a2.v b2.v > $@
	rm -f a.v b.v a2.v b2.v 
$R/manysrc.v:corr.small.H corr.smallsmall.H
	Grey eout=1 < corr.small.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=a.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	Grey eout=1 < corr.smallsmall.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=b.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	$(vpa) < a.v text=../Txt/cube_a | $(vpn) xsize=3. ysize=3. yshift=0.12 > a2.v 
	$(vpa) < b.v text=../Txt/cube_b | $(vpn) xsize=3. ysize=3. yshift=0.12 > b2.v xshift=3.
	vp_Overlay a2.v b2.v > $@
	rm -f a.v b.v a2.v b2.v 
$R/manysrcrand.v:corr.smallrand.H corr.smallsmallrand.H
	Grey eout=1 < corr.smallrand.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=a.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	Grey eout=1 < corr.smallsmallrand.H gainpanel=a | \
	  Cubeplot frame1=80 frame2=140 frame3=140 out=b.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	$(vpa) < a.v text=../Txt/cube_a | $(vpn) xsize=3. ysize=3. yshift=0.12 > a2.v 
	$(vpa) < b.v text=../Txt/cube_b | $(vpn) xsize=3. ysize=3. yshift=0.12 > b2.v xshift=3.
	vp_Overlay a2.v b2.v > $@
	rm -f a.v b.v a2.v b2.v 
$R/allshots.v: $(SYNDIR)/2syn.indcorrs.T
	< $< Cubeplot frame1=125 frame2=140 frame3=140 out=a.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	< $< Cubeplot frame1=125 frame2=1   frame3=1   out=b.v > $(dn) \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='virtual shot(m)'
	$(vpa) < a.v text=../Txt/cube_a | $(vpn) xsize=3. ysize=3. yshift=0.12 > a2.v xshift=3.
	$(vpa) < b.v text=../Txt/cube_b | $(vpn) xsize=3. ysize=3. yshift=0.12 > b2.v
	vp_Overlay a2.v b2.v > $@
	rm -f a.v b.v a2.v b2.v 
ACTDIR=/net/koko/guest/deyan/RawData/SurfData
$R/actshots.v: $(ACTDIR)/shots.pad.T
	< $< Cubeplot frame1=195 frame2=140 frame3=140 out=a.v > $(dn) g1num=1. o1num=0. \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='shot(m)'
	< $< Cubeplot frame1=195 frame2=1   frame3=1   out=b.v > $(dn) g1num=1. o1num=0. \
	  geophysics=1 title=' ' crowd=.89 wantcoordlabel=-1 label1='t(s)' label2='x(m)' label3='shot(m)'
	$(vpa) < b.v  text=../Txt/cube_a | $(vpn)xsize=3. ysize=3. yshift=0.12 > a2.v
	$(vpa) < a.v text=../Txt/cube_b | $(vpn) xsize=3. ysize=3. yshift=0.12 > b2.v xshift=3.
	vp_Overlay a2.v b2.v > $@
	rm -f a.v b.v a2.v b2.v 








include ${SEPINC}/SEP.bottom

