include ${SEPINC}/SEP.top
LATOPTS = option=web 'style=jfc,makeidx,html,amsmath'
#LATOPTS = 'style=amsmath'
BINDIR = ./Bin/${MTYPE}
OBJDIR = ./Obj/${MTYPE}
SRCDIR = ./Src/main
RESDIR = ./Fig
PARDIR = ./Par
TXTDIR = ./Txt
LIBDIR = ./Lib/${MTYPE}
INCDIR = ./Inc
MYDEV  = ./
PYTDIR = ./Pyth
SIGDIR = /mnt/sepdata/1a/sigsbee_multiple
#COLOR=yes

#RESULTSNR = eigenvalues_const eigenvalues_bill
RESULTSER = compare compare_mig1
RESULTSCR = 
OLEVEL=2
#UF90FLAGS =-mp -check bounds
UF90FLAGS =-parallel -openmp -openmp_report2  -O3 -axW -vec_report3
MAINLIBS=-lsep2df90 -lsep3df90 -lsep3d -lsepf90 -lsep -L${LIBDIR}  -lsepgeef90
UF90LIBS=${MPILIBS} ${MAINLIBS} -lsepparf90 -lseppar_mpi -lsepgeef90 -lsep2df90 -static-libcxa -lguide#-Bstatic 
UF77LIBS = ${BEILIB}



###########################
#       My stuffs         #
###########################
Prog=/net/koko/brad/bin/LINUX/ShotMig

source01.H:$SIGSMULT_DATA/nfs-splitspread
	< $SIGSMULT_DATA/nfs-splitspread-shots.H Window3d min1=4.88 max1=5.12 f3=5 n3=1 f2=673 n2=1 | \
	Pad end1=2070 > j1.H ; echo o1=-0.112 n4=1 o4=1 d4=1 n5=1 o5=1 d5=1 >> j1.H; \
	<j1.H Transf f_min=1 f_min1=6 f_max1=42 f_max=50 is2d=y shotmig=y > $@

prep_pos.H: $SIGDIR/nfs-splitspread-shots.H
	<$SIGDIR/nfs-splitspread-shots.H Window3d min2=0. | Pad end1=300 beg2=100 end2=100 | \
	Transf f_min=1 f_min1=6 f_max1=42 f_max=50 is2d=y shotmig=y > $@

prep_neg.H: $SIGDIR/nfs-splitspread-shots.H
	<$SIGDIR/nfs-splitspread-shots.H Window3d max2=0. | Pad end1=300 beg2=100 end2=100 | \
	Transf f_min=1 f_min1=6 f_max1=42 f_max=50 is2d=y shotmig=y > $@

sigsbee_migvel.H:$SIGDIR/sigsbee2b_migration_velocity.H
	Cp $SIGDIR/sigsbee2b_migration_velocity.H > $@

Mig_pos1:prep_pos.H
	<prep_pos.H source01.H sigsbee_migvel.H
	@date
	nohup Parallel command=$Prog  files="prep_pos.H,source01.H,sigsbee_migvel.H,$@.H"  \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=20 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE" mach_mfile=machinefile_all \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=y watercolumn=5400. firstzW=191 minx=-2. maxx=2. taper=y  taper_pcent=2 #restart=y #print_all=1


#----------------------------------------------------------------
#bill's shot
#----------------------------------------------------------------
DDIR=/net/koko/alejandro/DATA/Gaussian
NFREQ=96
NP_bill=20

data.H: 
	< gather-all.H Pad beg1=1663 maxsize=1000 beg2=100 end2=100> t_$@
	echo o1=0. >> t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max=25.>$@
	echo o4=-2 o1=-3  d1=0.01 d4=.01>>$@
	Rm t_$@ t0_$@ t1$@

data_mod_bill_mute.H:
	< data_mod_bill_time_mute.H  Pad   maxsize=1000 beg2=100 end2=100 > t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max=25.>$@

data_mod_bill_ang_mute.H: data_mod_bill_ang_time_mute.H
	<  data_mod_bill_ang_time_mute.H Pad   maxsize=1000 beg2=100 end2=100 > t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max=25.>$@

compare_data:
	< gather-all.H Window3d f3=69 n3=1 n2=400 > pp.H
	Math file1=pp.H exp="-1.*file1" | Pad beg1=1663 maxsize=1000 > t2_$@.H
	echo o1=0. >> t2_$@.H
	< data_mod_bill_time_mute.H Window3d f3=69 n3=1 > t1_$@.H
	< t2_$@.H Grey pclip=100 out=t2_$@.v >/dev/null
	< t1_$@.H Grey pclip=100 out=t1_$@.v >/dev/null

source.H:
	Spike k1=1 mag=1 d1=.002 o1=-0. n1=2864 > t_$@
	echo o1=0. >> t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max=25.>$@
	Rm t_$@ t0_$@ t1$@

spslowd.H:  
	< ../Hessian_bill_SP/velocity_xdr.H Window j2=2 j1=2 n1=210 | Pad beg2=325 end2=325 extend=1| Add scale=.001 >t$@
	< t$@ Vconvert invelopt=1 outvelopt=2 intype=1 outtype=1 inpar=2 outpar=2 > t1$@
	< t1$@ Transp > t$@
	<t$@ Transp plane=23 >$@
	echo o1=-7. d1=0.01 d3=0.01 o3=0.0 d2=0.01 label1=ix_ label2=iy_ label3=z_>> $@
	Rm	t$@ t1$@

spslowd_5.H:  
	< ../Hessian_bill_SP/velocity_xdr.H Window j1=2 n1=210 | Add scale=.001 >t$@
	< t$@ Vconvert invelopt=1 outvelopt=2 intype=1 outtype=1 inpar=2 outpar=2 > t1$@
	< t1$@ Transp > t$@
	<t$@ Transp plane=23 >$@
	echo o1=-3.750. d1=0.005 d3=0.01 o3=0.0 d2=0.01 label1=ix_ label2=iy_ label3=z_>> $@
	Rm	t$@ t1$@

data_1shot.H: 
	< gather-all.H Window3d n3=1 | Pad beg1=1663 maxsize=1000 beg2=100 end2=100> t_$@
	echo o1=0. >> t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max=25.>$@
	echo o4=-2 o1=-3  d1=0.01 d4=.01>>$@
	Rm t_$@ t0_$@ t1$@

data_interp_2shot.H: 
	< gather-all.H Window3d n3=2 | Interp d2out=5| Pad beg1=1663 maxsize=1000 beg2=200 end2=200> t_$@
	echo o1=0. >> t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max=25.>$@
	echo o4=-2 o1=-3  d1=0.005 d4=.01>>$@
	Rm t_$@ t0_$@ t1$@

source_extr.H:
	< gather-all.H Window3d min1=4. max1=4.4 n3=1 n2=1 min2=-2 | Pad n1=2864> t_$@
	echo o1=-.18 >> t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max=25.>$@
	echo o4=-2 o1=-3  d1=0.01 d4=.01>>$@
#	Rm t_$@ t0_$@ t1$@

source_extr_new.H:
	< gather-all.H Window3d min1=4. max1=4.4 n3=1 n2=1 min2=-2 | Pad n1=2864> t_$@
	echo o1=-0.186 >> t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max=25.>$@
	echo o4=-2 o1=-3  d1=0.01 d4=.01>>$@

source_extr_new_t.H:
	< gather-all.H Window3d min1=4. max1=4.4 n3=1 n2=1 min2=-2 > $@
	echo o1=-0.186 >> $@
Pef:
#	< gather-all.H Window3d n3=1 n2=1 min2=-2| Pef a=200  > pef.H
	Spike n1=200 k1=1 o1=0 d1=0.002> sp.H
	< sp.H Helicon div=1 a0=1 filt=pef.H > invw.H 
	< pef.H Graph | Tube &
	< invw.H Graph | Tube &
	< invw.H Spectra | Graph max1=25 | Tube & 
	
source_mod.H:
	Wavelet d1=.002 o1=0. n1=2864 wavelet=ricker2 fund=13 fhigh=20 order=50 phase=45 tdelay=.1> t_$@
	echo o1=-.1 >>t_$@ 
	Transf < t_$@ shotmig=y is2d=y wei=y f_max1=14 f_max=25. f_min1=4>$@
	echo o4=-2 o1=-3  d1=0.01 d4=.01>>$@
	< $@ Cabs| Window3d| Graph out=source_mod.v fmax1=25>/dev/null

source_t0.14.H:
	Wavelet d1=.002 o1=0. n1=2864 wavelet=ricker2 fund=6 fhigh=12 order=50 tdelay=.14> t_$@
	Transf < t_$@ shotmig=y is2d=y wei=y f_max1=10 f_max=12 >$@
	echo o4=-2 o1=-3  d1=0.01 d4=.01>>$@
	< $@ Cabs| Window3d| Graph out=source_mod.v fmax1=25>/dev/null


#--------------------------------------------------------------------------------------------------------------------
mig_bill_off: data.H source_extr_new.H spslowd.H
	@date
	nohup Parallel command=/net/koko/brad/bin/LINUX/ShotMig  files="data.H,source_extr_new.H,spslowd.H,$@.H"  \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=36 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_all \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 rollalong=n  firstzW=191 minx=-2. maxx=2. taper=y  taper_pcent=2 #restart=y #print_all=1

mig_bill_off_xs: data.H source_extr_new.H spslowd.H
	@date
	nohup Parallel command=/net/koko/brad/bin/LINUX/ShotMig  files="data.H,source_extr_new.H,spslowd.H,$@.H"  \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=20 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE" mach_mfile=machinefile_all \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=n  firstzW=191 minx=-2. maxx=2. taper=y  taper_pcent=2 #restart=y #print_all=1

green_bill_test_serial: source_t0.14.H spslowd.H
	@date
	/net/koko/brad/bin/LINUX/ShotMig  D_d=source_t0.14.H S=spslowd.H W_d=$@.H  \
	taper=y  taper_pcent=2 rollalong=n nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01\
	nx=1201 ny=1 ox=-6. oy=0. dx=0.01 dy=1 nsx=1 nsy=1 osx=-1.5 osy=1 
	< green_bill_test_serial.H Window3d min1=-3. n1=600 n4=210| Pad n2out=256 | Ft3d sign2=-1 | Real | Transp reshape=2,3| Interp d3out=0.02 maxsize=500| Grey eout=1 pclip=99.9 gainpanel=a > green_bill_test_serial.T

green_bill_test_fdmod:
	Cp ../Hessian_bill_SP/velocity_xdr.H vel.H
	< vel.H Window3d min2=-3000 n2=1201>velw.H
	< velw.H Create3d > vel3d.H
	< vel3d.H Sep2su > vel.su
	< vel.su sustrip > vel.bin
	< vel.bin sufdmod2 nx=1201 dx=5 fx=-3000 nz=771 dz=5 xs=-1300 zs=0  tmax=5.9 verbose=1 mt=10> /scr2/alejandro/green_bill_test_fdmod.su
	Su2sep < /scr2/alejandro/green_bill_test_fdmod.su > green_bill_test_fdmod.3d.H	
	< green_bill_test_fdmod.3d.H Infill3d > $@.H
	echo n2=1201 n3=272 d3=.02173910 d1=5 o2=-3000 d2=5>> $@.H
	Window3d j1=2 j2=2 max1=2100 n2=600 <$@.H  | Interp d3out=.02 maxsize=500| Window3d n3=286 | Grey gainpanel=a pclip=99.5 eout=1 > green_bill_test_fdmod.T

mig_mod_bill_off: data_mod_bill_t.H source_extr.H spslowd.H
	@date
	nohup Parallel command=../SPWEI_SERIAL/bin/LINUX/ShotMig  files="data_mod_bill_t.H,source_extr.H,spslowd.H,$@.H" \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=22 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_half \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=n  firstzW=191 minx=-2. maxx=2. taper=y  taper_pcent=2 #restart=y #print_all=1

mig_mod_bill_off_xs: data_mod_bill_t.H source_extr.H spslowd.H
	@date
	Parallel command=/net/koko/brad/bin/LINUX/ShotMig  files="data_mod_bill_t.H,source_extr.H,spslowd.H,$@.H" \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=20 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE" mach_mfile=machinefile_all \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=n  firstzW=191 minx=-2. maxx=2. taper=y  taper_pcent=2 #restart=y #print_all=1

mig_mod_bill_mute_off: data_mod_bill_t.H source_extr.H spslowd.H
	@date
	nohup Parallel command=../SPWEI_SERIAL/bin/LINUX/ShotMig  files="data_mod_bill_mute.H,source_extr.H,spslowd.H,$@.H" \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=22 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_half \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=n  minx=-2. maxx=2. taper=y  taper_pcent=2


mig_mod_bill_mute_off_xs: 
	@date
	Parallel command=../SPWEI_SERIAL/bin/LINUX/ShotMig  files="data_mod_bill_mute.H,source_extr.H,spslowd.H,$@.H" \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=20 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE" mach_mfile=machinefile_half \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=n minx=-2. maxx=2. taper=y  taper_pcent=2 #restart=y #print_all=1

mig_mod_bill_ang_mute_off.H:
	< mig_mod_bill_ang_mute_off_xs.H Transp reshape=1,2,4,5,7 plane=25 | Stack3d > $@

mig_mod_bill_ang_mute_off_xs: 
	@date
	Parallel command=../SPWEI_SERIAL/bin/LINUX/ShotMig  files="data_mod_bill_ang_mute.H,source_extr.H,spslowd.H,$@.H" \
	tags="D,D_d,S,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=20 axis=4,4,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE" mach_mfile=machinefile_half \
	nref=8 nfk=20 niter_lloyd=100 min_slow_dev=.01 nhx=32 marine=n minx=-2. maxx=2. taper=y  taper_pcent=2 #restart=y #print_all=1

green_bill: data.H source.H spslowd.H
	@date
	nohup Parallel command=../SPWEI_SERIAL/bin/LINUX/ShotMig.x  files="data.H,source.H,spslowd.H,green_bill.H,mig_bill.H"  \
	tags="D,D_d,S,W_d,R" usage="INPUT,INPUT,INPUT,OUTPUT,OUTPUT" nblock=24 axis=4,4,5,5,5 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,DISTRIBUTE,COPY" mach_mfile=machinefile_alejandro \
	par=sp.P  marine=n firstzW=191 minx=-2. maxx=2. taper=y  taper_pcent=2 #restart=y #print_all=1 

green_1shot.H:
	../SPWEI_SERIAL/bin/LINUX/ShotMig.x D=data_1shot.H D_d=source.H S=spslowd.H W_d=green_1shot.H R=mig_bill_2shot.H par=sp.P marine=n taper=y  taper_pcent=2 nref=8

green_bill_1shot_time.H:
	Window3d <  green_1shot.H n5=1  squeeze=n| Transp plane=35 > green_bill_1shot.H 
	< green_bill_1shot.H Transf wei=y  >$@	

green:
	Window3d < green_bill_1shot.H j4=5 | Transp plane=23 | Cabs | Grey gainpanel=a pclip=100 eout=1 | Ricksep &
	Window3d < green_bill_1shot.H j4=5 | Pad n1=1024 | Ft3d sign1=1 center1=1 | Transp plane=23 | Cabs | Grey gainpanel=a pclip=100 eout=1 | Ricksep &
 
green_bill_w_t.H: 
	Window3d < green_bill.H min1=-2 max1=2 squeeze=n | Transp reshape=2,3,6 plane=23 > $@


data_mod_bill.H: 
	< green_bill_w_t.H ../Hessian_winter/Bin/LINUX/green_mod_freq_general.x  wave=source_extr.H  > $@ 

data_mod_bill_ang.H: 
	< green_bill_w_t.H ../Hessian_winter/Bin/LINUX/green_mod_freq_angle.x  wave=source_extr.H  > $@

data_mod_bill_t.H: data_mod_bill.H
	 Transp < data_mod_bill.H  plane=24 |Pad beg1=100 end1=101  > $@	
	 
data_mod_bill_ang_time.H: data_mod_bill_ang.H
	< data_mod_bill_ang.H  Transp reshape=2,3,5,6 plane=23 maxsize=500 |Pad n5=4000 maxsize=500> tt_$@
	< tt_$@ Transf wei=y f_max=25 > $@

data_mod_bill_time.H:
	< data_mod_bill.H  Transp reshape=2,3,5,6 plane=23 maxsize=500 |Pad n5=4000 maxsize=500> tt_$@
	< tt_$@ Transf wei=y f_max=25 > $@

data_mod_bill_time_mute.H:
	< data_mod_bill_time.H Window3d min1=3.5 > t$@
	< t$@ Pad beg1=2504 > t1$@
	< t1$@ Interp d1out=0.002 > $@
	echo o1=0.0 >> $@

data_mod_bill_ang_time_mute.H: data_mod_bill_ang_time.H
	< data_mod_bill_ang_time.H Window3d min1=3.5 j1=2> t$@
	< t$@ Pad beg1=2504 > t1$@
	< t1$@ Interp d1out=0.002 > $@
	echo o1=0.0 >> $@

mig_bill_ang.H:
	< mig_bill_off.H Window3d squeeze=n | Transp plane=15 > ppp.H
	< ppp.H OFF2ANG verb=y amax=65  >$@

mig_bill_ang_xs.H:
	< mig_bill_off_xs.H Window3d squeeze=n | Transp plane=15 > ppp.H
	< ppp.H OFF2ANG verb=y amax=55 eps=10 >$@

mig_bill_ang_biondo.H:
	< mig_bill_off.H Pad n5=256 n1=512 n3=64> pp.H
	< pp.H Transp reshape=2,4,5,6 plane=23 | Rtoc > pp1.H
	< pp1.H Ft3d sign1=1 sign3=1 > pp2.H
	< pp2.H Transp reshape=2,3,5,6 plane=13 > pp3.H
	< pp3.H /net/koko/homes/sep/alejandro/research/Ang_BB/Off2Ang3D_v5.x \
	par=Coplanar_azim_ang.P apply_jac_gamma=n apply_jac_azim_1=n  \
    comaz_data=y \
    n_gamma=32 gamma_0=-45 d_gamma=2.8125 \
    space_domain=n Coplanar_ang=pp4.H datapath=/scr1/alejandro/  > $@.head
	< pp4.H Ft3d sign2=-1 sign3=-1 maxsize=100| Real > $@

mig_mod_bill_ang_biondo.H:
	< mig_mod_bill_off.H Pad n5=256 n1=512 n3=64> pp.H
	< pp.H Transp reshape=2,4,5,6 plane=23 | Rtoc > pp1.H
	< pp1.H Ft3d sign1=1 sign3=1 > pp2.H
	< pp2.H Transp reshape=2,3,5,6 plane=13 > pp3.H
	< pp3.H /net/koko/homes/sep/alejandro/research/Ang_BB/Off2Ang3D_v5.x \
	par=Coplanar_azim_ang.P apply_jac_gamma=n apply_jac_azim_1=n  \
    comaz_data=y \
    n_gamma=32 gamma_0=-45 d_gamma=2.8125 \
    space_domain=n Coplanar_ang=pp4.H datapath=/scr1/alejandro/  > $@.head
	< pp4.H Ft3d sign2=-1 sign3=-1 maxsize=100| Real > $@

mig_mod_bill_mute_ang_biondo.H:
	< mig_mod_bill_mute_off.H Pad n5=256 n1=512 n3=64> pp.H
	< pp.H Transp reshape=2,4,5,6 plane=23 | Rtoc > pp1.H
	< pp1.H Ft3d sign1=1 sign3=1 > pp2.H
	< pp2.H Transp reshape=2,3,5,6 plane=13 > pp3.H
	< pp3.H /net/koko/homes/sep/alejandro/research/Ang_BB/Off2Ang3D_v5.x \
	par=Coplanar_azim_ang.P apply_jac_gamma=y apply_jac_azim_1=n  \
    comaz_data=y \
    n_gamma=32 gamma_0=-45 d_gamma=2.8125 \
    space_domain=n Coplanar_ang=pp4.H datapath=/scr1/alejandro/  > $@.head
	< pp4.H Ft3d sign2=-1 sign3=-1 maxsize=100| Real > $@

mig_mod_bill_mute_ang.H:
	< mig_mod_bill_mute_off.H Transp plane=15 > ppp.H
	< ppp.H OFF2ANG verb=y amax=65 >$@

mig_mod_bill_ang_mute_ang.H:
	< mig_mod_bill_ang_mute_off.H Transp plane=15 > ppp.H
	< ppp.H OFF2ANG verb=y amax=65 >$@

mig_mod_bill_ang.H:
	< mig_mod_bill_off.H Transp plane=15 > ppp.H
	< ppp.H OFF2ANG verb=y amax=55 >$@

mig_mod_bill_ang_xs.H:
	< mig_mod_bill_off_xs.H Transp plane=15 > ppp.H
	< ppp.H OFF2ANG verb=y amax=55 eps=10>$@

mig_mod_bill_mute_ang_xs.H:
	< mig_mod_bill_mute_off_xs.H Transp plane=15 > ppp.H
	< ppp.H OFF2ANG verb=y amax=55 eps=10>$@

mig_mod_bill_ang_mute_ang_xs.H:
	< mig_mod_bill_ang_mute_off_xs.H Transp plane=15 > ppp.H
	< ppp.H OFF2ANG verb=y amax=55 eps=10>$@


mig_line_ang.H:
	< mig_line.H Transp plane=13 |Transp plane=45 > ppp.H
	< ppp.H OFF2ANG verb=y amax=65 >$@
 


Greycompare=  Grey grid=y d1num=.5 d2num=.5 max1=5.726 pclip=100 label1="time (s)" label2="offset (km)" title=" "
 
${RESDIR}/compare.v:
	Window3d j3=300 min1=3. < data_mod_bill_time.H > pp.H
	Window3d j3=300 max1=1. < data_mod_bill_time.H > ppb.H
	Cat3d pp.H ppb.H axis=1 > ppp.H
	< ppp.H Window3d n3=1 | ${Greycompare} out=$@1  polarity=1 >/dev/null	
	< ppp.H Window3d f3=1 | ${Greycompare} out=$@2  polarity=1>/dev/null	
	\cp gather-all.H gather-all_cp.H
	echo o3=-2 o2=-2  d2=0.01 d3=.01 >> gather-all_cp.H
	Window3d j3=300 n2=400 < gather-all_cp.H | Pad beg1=1663 > pp.H
	echo o1=0.  >> pp.H
	< pp.H Window3d min1=3.  n3=1 | ${Greycompare} out=$@3  polarity=-1>/dev/null
	< pp.H Window3d min1=3.  f3=1 | ${Greycompare} out=$@4  polarity=-1 >/dev/null
	< $@1 vp_annotate batch=y text=${TXTDIR}/text_a  | vppen vpstyle=n   > $@11
	< $@2 vp_annotate batch=y text=${TXTDIR}/text_c  | vppen vpstyle=n   > $@22
	< $@3 vp_annotate batch=y text=${TXTDIR}/text_b  | vppen vpstyle=n   > $@33
	< $@4 vp_annotate batch=y text=${TXTDIR}/text_d  | vppen vpstyle=n   > $@44 
	vp_SideBySideAniso $@11 $@33| vppen vpstyle=n txscale=1.8 tyscale=1.8 > top.v
	vp_SideBySideAniso $@22 $@44| vppen vpstyle=n txscale=1.8 tyscale=1.8 > bot.v
	vp_OverUnderAniso top.v bot.v > $@

fragreyo1=eout=1  gainpanel=a  label1="z (km)" label2="x (km)" label3="h (km)" title=" " labelfat=4 pclip=100 
frames1=  frame1=10 frame2=75 frame3=16 title=" " point2=.75

${RESDIR}/compare_mig1.v:
	Window3d < mig_bill_off.H min5=1.9 n5=20 min1=0 n1=200 | Transp reshape=2,3,4,5,6 > ppppp.H
	Math file1=ppppp.H exp="-1.*file1"| Grey ${fragreyo1} |Cubeplot ${frames1}  out=$@1 > /dev/null 
	Window3d < mig_mod_bill_off.H min5=1.9 min1=0 n1=200 | Transp reshape=2,3,4,5,6 | Grey ${fragreyo1} |Cubeplot ${frames1}  out=$@2 > /dev/null
	Window3d < mig_line.H n3=20 | Transp reshape=1,3 |  Grey ${fragreyo1} |Cubeplot ${frames1}  out=$@3 > /dev/null
	< $@1 vp_annotate batch=y text=${TXTDIR}/text_a  | vppen vpstyle=n > $@11
	< $@2 vp_annotate batch=y text=${TXTDIR}/text_b  | vppen vpstyle=n > $@22
	< $@3 vp_annotate batch=y text=${TXTDIR}/text_c  | vppen vpstyle=n > $@33
	vp_OverUnderAniso $@11 $@22 $@33| vppen vpstyle=n txscale=1.8 tyscale=1.8 > $@

compare_mig:
	Window3d < mig_line.H n3=20 | Transp reshape=1,3 | Grey eout=1 gainpanel=a pclip=100> mig_line.T
	Window3d < mig_bill_off.H min5=1.9 n5=20 min1=0 n1=200 | Transp reshape=2,3,4,5,6 > ppppp.H
	Math file1=ppppp.H exp="-1.*file1"| Grey eout=1 gainpanel=a pclip=100> mig_bill_off.T
	Window3d < mig_mod_bill_off.H min5=1.9 min1=0 n1=200 | Transp reshape=2,3,4,5,6 | Grey eout=1 gainpanel=a pclip=100> mig_mod_bill_off.T
	Window3d < mig_mod_bill_mute_off.H min5=1.9 min1=0 n1=200 | Transp reshape=2,3,4,5,6 | Grey eout=1 gainpanel=a pclip=100> mig_mod_bill_mute_off.T
	Rickmulti mig_bill_off.T  mig_mod_bill_mute_off.T mig_line.T

compare_mig_ang:
	Math file1=mig_bill_ang.H exp="-1.*file1" | Window3d min1=1.5 | Transp plane=23 |Grey eout=1 gainpanel=a pclip=100 > mig_bill_ang.T
	Window3d < mig_mod_bill_mute_ang.H min1=1.5| Transp plane=23 |Grey eout=1 gainpanel=a pclip=100 > mig_mod_bill_mute_ang.T
	< mig_line_ang.H Pad beg1=40 | Window3d n1=60| Transp plane=23 > pp.H
	< pp.H Reverse which=2 > pp1.H
	Cat3d pp1.H pp.H axis=2|Pad beg2=1 |Grey eout=1 gainpanel=a pclip=100 > mig_line_ang_resize.T
	Rickmulti mig_bill_ang.T  mig_mod_bill_mute_ang.T  mig_line_ang_resize.T


data_mod_bill_1shot_time.H:
	< data_mod_bill_1shot.H Pad n3=6000 | Transp reshape=2,3,5,6 plane=23 > tt_$@
	< tt_$@ Transf wei=y f_max=25 > $@
	Rm tt_$@

data_mod_bill_serial_t.H:
	< data_mod_bill_serial.H Transp plane=24 | Pad beg1=100 end1=100 >  $@

pp: 
	<green_bill_w_t.H  Transp reshape=2,3,5,6 plane=24 maxsize=500 >pp1.H
	<pp1.H Pad n3out=128 >  pp2.H
	<pp2.H Ft3d sign3=1 > pp3.H
	<pp3.H Pad n3out=256 >pp4.H
	<pp4.H Ft3d sign3=-1 > pp5.H
	<pp5.H Transp reshape=2,3,5,6 plane=24 maxsize=500 > green_bill_w_t_res.H

Ang:
	Transp plane=14 reshape=2,3,4,5,6 < mig_bill1_s_32.H | OFF2ANG verb=1 eps=0.000001 amax=90 > pp.H

LtL_bill_az15_ax15_off33:   
	date
	nohup Parallel command=../Hessian_winter/Bin/LINUX/Lt_L_reorder_3D_off_wave.x  files="green_bill_w_t.H,source_extr.H,$@.H" \
	tags="stdin,wave,outtag" file_type="DISTRIBUTE,DISTRIBUTE,COPY" usage="INPUT,INPUT,OUTPUT" axis=6,3,11 nblock=174 \
	nax=15 naz=15 nay=1  mach_mfile=machinefile_all marine=n  pverb=2  minix=-2 nx=400  \
	nry=1 nrx=400 nsy=1 nsx=400 noffx=32 #restart=y
	date

LtL_bill_az15_ax15_off64:   
	date
	< green_bill_w_t.H Window3d n6=1 f6=20 squeeze=n max_memory=500> pp.H
	< source_extr.H    Window3d n3=1 f3=20 squeeze=n > pp_wave.H
	< pp.H ../Hessian_winter/Bin/LINUX/Lt_L_reorder_3D_off_wave.x  wave=pp_wave.H outtag=$@.H \
	nax=1 naz=1 nay=1   marine=n  pverb=2  minix=-2 nx=400  \
	nry=1 nrx=400 nsy=1 nsx=400 noffx=64 #restart=y
	date 


LtL_bill_az15_ax15_off33_t.H:
	< LtL_bill_az15_ax15_off33.H Transp reshape=2,3,5,10 plane=13 max_memory=600> pp.H
	< pp.H Transp reshape=7,9,10 plane=23 max_memory=600> $@

LtL_bill_az15_ax15_off16_t.H:
	< LtL_bill_az15_ax15_off16.H Transp reshape=2,3,5,10 plane=13 > pp.H
	< pp.H Transp reshape=7,9,10 plane=23 > $@

spike_line.H:
	Spike n1=33 n2=1 n3=21 n4=400 k1=17 k2=1 k3=11 > $@

mig_spike.H: 
	< LtL_bill_az15_ax15_off32_1_t.H Window3d min9=0 squeeze=n> LtL_pp.H
	< spike.H  Window3d min4=0 squeeze=n>  spike_pp.H
	< LtL_pp.H ../NoStaDecon/Bin/LINUX86_64/convolve_Mxv_inv_off.x m=spike_pp.H >$@

mig_line.H: 
	< LtL_bill_az15_ax15_off33_t.H Window3d min9=0 squeeze=n> LtL_pp.H
	< spike_line.H  Window3d min4=0 squeeze=n>  spike_line_pp.H
	< LtL_pp.H ../NoStaDecon/Bin/LINUX86_64/convolve_Mxv_inv_off.x m=spike_line_pp.H >$@ 
#	< LtL_bill_az15_ax15_off33_t.H ../NoStaDecon/Bin/LINUX86_64/convolve_Mxv_inv_off.x m=spike_line.H >$@ 
	
LtL_bill_az5_ax5_off5_wave.H: 
	date
	Window3d < source_extr.H n3=1 f3=10 j3=30 squeeze=n >pp_wave.H
	Window3d < green_bill_w_t.H n6=1 f6=10 j6=30 squeeze=n|../Hessian_winter/Bin/LINUX/Lt_L_reorder_3D_off_wave.x   outtag=$@ wave=pp_wave.H\
	nax=5 naz=5 nay=1   marine=n minix=-2 nx=400  jsx=1 jsy=1 jrx=1 jry=1 noffx=4 \
	nry=1 nrx=400 nsy=1 nsx=400   
	date

LtL_bill_az15_ax15_off1_wave_1.H: 
	date
	Window3d < source_extr.H n3=1 f3=50 j3=30 squeeze=n >pp_wave.H
	Window3d < green_bill_w_t.H n6=1 f6=50 j6=30 squeeze=n|../Src_Hessian/Bin/LINUX/Lt_L_reuse_3D_off_wave_2.x   outtag=$@ wave=pp_wave.H\
	nax=1 naz=1 nay=1   marine=y    noffx=5  \
	nry=1 nrx=100 orx=-.5 nsy=1 nsx=201 osx=-1. minix=-1.5 nx=300


LtL_bill_az15_ax15_off1_wave_old.H: 
	date
	Window3d < source_extr.H n3=1 f3=50 j3=30 squeeze=n >pp_wave.H
	Window3d < green_bill_w_t.H n6=1 f6=50 j6=30 squeeze=n|../Src_Hessian/Bin/LINUX/Lt_L_old_3D_off_wave_2.x   outtag=$@ wave=pp_wave.H\
	nax=1 naz=1 nay=1   marine=y    noffx=1  \
	nry=1 nrx=100 orx=-.5 nsy=1 nsx=3 osx=-0.1 dsx=.1 minix=-1.5 nx=300


LtL_bill_az15_ax15_off1_wave.H: 
	date
	Window3d < source_extr.H n3=1 f3=50 j3=30 squeeze=n >pp_wave.H
	Window3d < green_bill_w_t.H n6=1 f6=50 j6=30 squeeze=n|../Src_Hessian/Bin/LINUX/Lt_L_reuse_3D_off_wave_2.x   outtag=$@ wave=pp_wave.H\
	nax=1 naz=1 nay=1   marine=y   noffx=1  \
	nry=1 nrx=100 nsy=1 osx=-1. nsx=20 dsx=.1 orx=0. nx=400 minix=-2
	date
 

LtL_bill_az15_ax15_off32_wave_old.H: 
	date
	Window3d < source_extr.H n3=1 f3=50 j3=30 squeeze=n >pp_wave.H
	Window3d < green_bill_w_t.H n6=1 f6=50 j6=30 squeeze=n|../Src_Hessian/Bin/LINUX/Lt_L_old_3D_off_wave_1.x   outtag=$@ wave=pp_wave.H\
	nax=15 naz=15 nay=1   marine=y   jsx=1 jsy=1 jrx=1 jry=1 noffx=3 \
	nry=1 nrx=400 nsy=1 nsx=400  minix=-.5 nx=100
	date

illu_stack.H:
	< green_bill_w_t.H Window3d | 	../Hessian_winter/Bin/LINUX/stack_3d_complex.x > $@


LtL_bill_az15_ax15_ang16.H:
#	echo n6=134400 n7=1 n8=1 n9=1 n10=1 o4=-0.04 d4=0.005  o6=-0.04 d6=0.005>> LtL_bill_az15_ax15_off16.H
#	< LtL_bill_az15_ax15_off16.H Transp maxsize=500 reshape=2,5,6  > t$@
	<t$@ OFF2ANG verb=y amax=55 > t1$@
	echo n6=16 n7=1 n8=400 n9=1 n10=21 >> t1$@
	< t1$@ Transp maxsize=500 reshape=5,10 > t2$@
	echo n6=3600 n7=1 n8=1 n9=1 n10=1 >> t2$@
	< t2$@ Transp maxsize=500 reshape=4,5,10 > t3$@
	<t3$@ OFF2ANG verb=y amax=55> $@
	echo n6=15 n7=16 n8=1 n9=15 n10=1 >> $@
	Rm t*$@

LtL_bill_az15_ax15_ang48.H:
#	echo n6=134400 n7=1 n8=1 n9=1 n10=1 o4=-0.04 d4=0.005  o6=-0.04 d6=0.005>> LtL_bill_az15_ax15_off16.H
#	< LtL_bill_az15_ax15_off16.H Transp maxsize=500 reshape=2,5,6  > t$@
#	< t$@ Pad beg2=16 end2=16 >tt$@
#	<tt$@ OFF2ANG verb=y amax=55 > t1$@
#	echo n6=16 n7=1 n8=400 n9=1 n10=21 >> t1$@
#	< t1$@ Transp maxsize=500 reshape=5,10 > t2$@
#	echo n6=10800 n7=1 n8=1 n9=1 n10=1 >> t2$@
#	< t2$@ Transp maxsize=500 reshape=4,5,10 > t3$@
#	< t3$@ Pad beg2=16 end2=16 >tt3$@
	<tt3$@ OFF2ANG verb=y amax=55> $@
	echo n6=15 n7=48 n8=1 n9=15 n10=1 >> $@
	Rm t*$@

LtL_bill_az15_ax15_ang80.H:
#	echo n6=134400 n7=1 n8=1 n9=1 n10=1 o4=-0.04 d4=0.005  o6=-0.04 d6=0.005>> LtL_bill_az15_ax15_off16.H  
#	< LtL_bill_az15_ax15_off16.H Transp maxsize=500 reshape=2,5,6  > t$@    
#	< t$@ Pad beg2=32 end2=32 maxsize=500 >tt$@
#	<tt$@ OFF2ANG verb=y amax=55 maxmem=500> t1$@    
#	echo n6=16 n7=1 n8=400 n9=1 n10=21 >> t1$@
#	< t1$@ Transp maxsize=500 reshape=5,10 > t2$@
#	echo n6=18000 n7=1 n8=1 n9=1 n10=1 >> t2$@
#	< t2$@ Transp maxsize=500 reshape=4,5,10 > t3$@
	nohup < t3$@ Pad beg2=32 end2=32 maxsize=500 >tt3$@
	nohup <tt3$@ OFF2ANG verb=y amax=55 maxmem=500> $@
	echo n6=15 n7=80 n8=1 n9=15 n10=1 >> $@
	Rm t*$@

LtL_ang80_4d.T:
	< LtL_bill_az15_ax15_ang80.H Window3d min6=2 n6=1 min7=0 n7=1 max_memory=500 > pppp.H
	< pppp.H Transp plane=23 maxsize=500 > t$@	
	< t$@ Grey eout=1 pclip=100 gainpanel=a >  $@

LtL_ang48_4d.T:
	< LtL_bill_az15_ax15_ang48.H Transp reshape=5,10 max_memory=800> pppp1.H
	< pppp1.H Window3d min6=2 n6=1 min7=0 n7=1 max_memory=500 > pppp.H
	<pppp.H  Transp maxsize=500 plane=23> t$@	
	< t$@ Grey eout=1 pclip=100 gainpanel=a >  $@

LtL_ang16_4d.T:
	< LtL_bill_az15_ax15_ang16.H Transp reshape=5,10 max_memory=500> pppp1.H
	< pppp1.H Window3d min6=2 n6=1 min7=0 n7=1 max_memory=500 > pppp.H
	<pppp.H  Transp maxsize=500 plane=23> t$@	
	< t$@ Grey eout=1 pclip=100 gainpanel=a >  $@
	

#######################################################
#
# Important: the inversion does not work, I have to lokk into the size of the integers
#           look at the reguylarization
#
inv_az15ax15_off33_%.H: 
#	Window3d < mig_mod_bill_off.H min1=0 j1=4 n1=50 min5=1.9 squeeze=n| Transp reshape=2,5,6| Scale scale_to=1.> pp.H
#	Window3d < LtL_bill_az15_ax15_off33_t.H min9=0 j9=4 n9=50 n8=20 squeeze=n max_memory=500> pp1.H
	< pp1.H  ../NoStaDecon/Bin/LINUX86_64/Sparse_Mxv_inv_off.x mig=pp.H  niter=$* eps=10 reg_off=0 alpha=.001 na=1  remov=rmov.H mmov=mmov.H wmov=wmov.H>$@

inv_az15ax15_lsqr_off16_%.H: 
	Window3d < mig_bill_w_t.H min4=-1. n4=100 j4=2 min1=0 n1=1 squeeze=n | Scale scale_to=1.> pp.H
	Window3d < LtL_bill_az15_ax15_off16_t.H min10=-1. n10=100 j10=2 min1=0 n1=1 min6=0 n6=1 squeeze=n max_memory=500> pp1.H
	< pp1.H ../NoStaDecon/Bin/LINUX/Sparse_Mxv_inv_lsqr_off.x mig=pp.H  niter=$* eps=0 reg_off=0 alpha=.001 na=1  remov=rmov.H mmov=mmov.H wmov=wmov.H>$@

Comp:
	Window3d < pp.H | Transp reshape=1,3 | Grey eout=1 gainpanel=e pclip=100 > pp.T
	Window3d < inv_az15ax15_off16_10_eps0.H | Transp reshape=1,3 | Grey eout=1 gainpanel=e pclip=100 > inv_az15ax15_off16_10_eps0.T
	Window3d < inv_az15ax15_off16_10_eps1.H | Transp reshape=1,3 | Grey eout=1 gainpanel=e pclip=100 > inv_az15ax15_off16_10_eps1.T
	Window3d < inv_az15ax15_off16_30_eps1.H | Transp reshape=1,3 | Grey eout=1 gainpanel=e pclip=100 > inv_az15ax15_off16_30_eps1.T


DATDIR2=/net/koko/marie/symes

grados= nG=60 dG=-3

${RESDIR}/rays.v:     
	<spslowd.H Window3d |Transp| Smooth rect1=5 rect2=5 > junk.H
#	Hwt2d xsou=-2   ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays1.H
#	Hwt2d xsou=-1.75 ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays2.H
#	Hwt2d xsou=-1.5   ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays3.H
#	Hwt2d xsou=-1.25 ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays4.H
	Hwt2d xsou=1    ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays5.H
#	Hwt2d xsou=-0.75  ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays6.H
#	Hwt2d xsou=-0.5    ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays7.H
#	Hwt2d xsou=-0.25  ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays8.H
#	Hwt2d xsou=0    ${grados} zsou=0 oG=90 oT=0 nT=2951 dT=0.002< junk.H > rays9.H
	< spslowd.H Window3d | Transp| Grey min2=-3 max2=3 min1=0.0 max1=2.25 allpos=y title=" " label1="z (km)" label2="x (km)" allpos=y bias=.8 pclip=99.5 out=vel.v > /dev/null
#	Cat3d rays1.H rays2.H rays3.H rays4.H rays5.H axis=3 > rays.H
#	Cat3d rays1.H rays2.H rays3.H rays4.H rays5.H rays6.H rays7.H rays8.H rays9.H axis=3 > rays.H
	Cat3d rays5.H axis=3 > rays.H
	Graph yreverse=y min2=0.0 max2=2.50 min1=-3 max1=3 plotcol=1 title=" " wantaxis=n < rays.H out=b.v > /dev/null
	vp_Overlay vel.v b.v > $@ 
${RESDIR}/bill_slow.v:
	< spslowd.H Window3d | Transp| Grey min2=-3 max2=3 min1=0.0 max1=2.25 allpos=y title=" " label1="Depth (km)" label2="x (km)" allpos=y bias=.8 pclip=99.5 out=$@ labelfat=4> /dev/null

fragreyo=eout=1  gainpanel=a  label1="z (km)" label2="x (km)" label3="h (km)" title=" " labelfat=4 pclip=100
fragreya=eout=1  gainpanel=a  label1="z (km)" label2="x (km)" label3="angle " title=" " labelfat=4 pclip=100
frames=frame1=399 frame2=25 frame3=32 flat=1 point1=0.667331 point2=0.701786  title=" "

${RESDIR}/mig_off.v:
	Window3d < mig_bill_brad_off65.H min4=0 | Transp plane=23 |Grey ${fragreyo} |Cubeplot ${frames}  out=$@ > /dev/null

${RESDIR}/mig_ang.v:
	Window3d < mig_bill_brad_ang65.H min4=0 | Transp plane=23 |Grey ${fragreya} |Cubeplot ${frames}  out=$@ > /dev/null

framesi1=frame1=10 frame2=72 frame3=8 flat=1 point1=0.669492 point2=0.920489 polarity=-1 title=" "
${RESDIR}/illu_off16.v:
	Window3d < illu_off16.H min2=0 | Grey ${fragreyo} allpos=y pclip=100  |Cubeplot ${framesi1}  out=$@ > /dev/null

framesi= frame1=10 frame2=72 frame3=24 flat=1 point1=0.667331 point2=0.701786 polarity=-1 title=" " #frame1=5 frame2=72 frame3=8 flat=1 point1=0.669492 point2=0.920489
${RESDIR}/illu_ang48.v:
	Window3d < illu_ang48.H min3=0|Transp plane=23 | Grey ${fragreya} allpos=y pclip=100  |Cubeplot ${framesi}  out=$@ > /dev/null
framesii= frame1=10 frame2=72 frame3=8 flat=1 point1=0.667331 point2=0.701786 polarity=-1 title="  "
${RESDIR}/illu_ang16.v:
	Window3d < illu_ang16.H min3=0|Transp plane=23 | Grey ${fragreya} allpos=y  |Cubeplot ${framesii} out=$@ > /dev/null

${RESDIR}/illu_off16_mass.v:
	Window3d < illu_off_maslump.H min2=0 min3=1.95 max3=2.05| Transp plane=13 | Grey ${fragreyo}  |Cubeplot ${framesi}  out=$@ > /dev/null

fragreyfo=eout=1  gainpanel=a  label1="az (km)" label2="ax (km)" label3="h (km)" title=" " labelfat=4   g1num=0.07 g2num=0.07  clip=0.65 
framesof=frame1=7 frame2=7 frame3=8 flat=1 point1=0.483034 point2=0.483034	title=" " polarity=-1  
${RESDIR}/filt_off16.v:
	Window3d < LtL_bill_az15_ax15_off16.H min6=0 n6=1 min8=0.0 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo} |Cubeplot ${framesof} out=$@1 > /dev/null
	Window3d < LtL_bill_az15_ax15_off16.H min6=0 n6=1 min8=.25 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo} |Cubeplot ${framesof} out=$@2 > /dev/null
	Window3d < LtL_bill_az15_ax15_off16.H min6=0 n6=1 min8=.72 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo} |Cubeplot ${framesof} out=$@3 > /dev/null
	Window3d < LtL_bill_az15_ax15_off16.H min6=0 n6=1 min8=1.5 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo} |Cubeplot ${framesof} out=$@4 > /dev/null
	< $@1 vp_annotate batch=y text=${TXTDIR}/text_a  | vppen vpstyle=n yscale=2  > $@11
	< $@2 vp_annotate batch=y text=${TXTDIR}/text_b  | vppen vpstyle=n yscale=2  > $@22
	< $@3 vp_annotate batch=y text=${TXTDIR}/text_c  | vppen vpstyle=n yscale=2  > $@33
	< $@4 vp_annotate batch=y text=${TXTDIR}/text_d  | vppen vpstyle=n yscale=2  > $@44 
#	< $@1 vppen vpstyle=n yscale=2 >$@11
#	< $@2 vppen vpstyle=n yscale=2 >$@22
#	< $@3 vppen vpstyle=n yscale=2 >$@33
#	< $@4 vppen vpstyle=n yscale=2 >$@44
	vp_SideBySideIso $@11 $@22  > t.v 
	vp_SideBySideIso $@33 $@44  > b.v
	vp_OverUnderAniso t.v b.v | vppen vpstyle=n txscale=3 tyscale=3 > $@

fragreyfo2=eout=1  gainpanel=a  label1="az (km)" label2="ax (km)" label3="h (km)" title=" " labelfat=4   g1num=0.07 g2num=0.07  color=j 
framesof2=frame1=7 frame2=7 frame3=16 flat=1 point1=0.483034 point2=0.483034	title=" " polarity=-1 color=j

${RESDIR}/filt_off32_1.v:
	Window3d < LtL_bill_az15_ax15_off32_1.H min6=0 n6=1 min8=0.0 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@1 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_1.H min6=0 n6=1 min8=.25 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@2 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_1.H min6=0 n6=1 min8=.72 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@3 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_1.H min6=0 n6=1 min8=1.5 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@4 > /dev/null
	< $@1 vp_annotate batch=y text=${TXTDIR}/text_a  | vppen vpstyle=n yscale=2  > $@11
	< $@2 vp_annotate batch=y text=${TXTDIR}/text_b  | vppen vpstyle=n yscale=2  > $@22
	< $@3 vp_annotate batch=y text=${TXTDIR}/text_c  | vppen vpstyle=n yscale=2  > $@33
	< $@4 vp_annotate batch=y text=${TXTDIR}/text_d  | vppen vpstyle=n yscale=2  > $@44 
#	< $@1 vppen vpstyle=n yscale=2 >$@11
#	< $@2 vppen vpstyle=n yscale=2 >$@22
#	< $@3 vppen vpstyle=n yscale=2 >$@33
#	< $@4 vppen vpstyle=n yscale=2 >$@44
	vp_SideBySideIso $@11 $@22  > t.v 
	vp_SideBySideIso $@33 $@44  > b.v
	vp_OverUnderAniso t.v b.v | vppen vpstyle=n txscale=3 tyscale=3 > $@

${RESDIR}/filt_off32_1_far.v:
	Window3d < LtL_bill_az15_ax15_off32_1.H min6=-.08 n6=1 min8=0.0 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@1 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_1.H min6=-.08 n6=1 min8=.25 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@2 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_1.H min6=-.08 n6=1 min8=.72 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@3 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_1.H min6=-.08 n6=1 min8=1.5 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@4 > /dev/null
	< $@1 vp_annotate batch=y text=${TXTDIR}/text_a  | vppen vpstyle=n yscale=2  > $@11
	< $@2 vp_annotate batch=y text=${TXTDIR}/text_b  | vppen vpstyle=n yscale=2  > $@22
	< $@3 vp_annotate batch=y text=${TXTDIR}/text_c  | vppen vpstyle=n yscale=2  > $@33
	< $@4 vp_annotate batch=y text=${TXTDIR}/text_d  | vppen vpstyle=n yscale=2  > $@44 
#	< $@1 vppen vpstyle=n yscale=2 >$@11
#	< $@2 vppen vpstyle=n yscale=2 >$@22
#	< $@3 vppen vpstyle=n yscale=2 >$@33
#	< $@4 vppen vpstyle=n yscale=2 >$@44
	vp_SideBySideIso $@11 $@22  > t.v 
	vp_SideBySideIso $@33 $@44  > b.v
	vp_OverUnderAniso t.v b.v | vppen vpstyle=n txscale=3 tyscale=3 > $@

${RESDIR}/filt_off32.v:
	Window3d < LtL_bill_az15_ax15_off32_2.H min6=0 n6=1 min8=0.0 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@1 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_2.H min6=0 n6=1 min8=.25 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@2 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_2.H min6=0 n6=1 min8=.72 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@3 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_2.H min6=0 n6=1 min8=1.5 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@4 > /dev/null
	< $@1 vp_annotate batch=y text=${TXTDIR}/text_a  | vppen vpstyle=n yscale=2  > $@11
	< $@2 vp_annotate batch=y text=${TXTDIR}/text_b  | vppen vpstyle=n yscale=2  > $@22
	< $@3 vp_annotate batch=y text=${TXTDIR}/text_c  | vppen vpstyle=n yscale=2  > $@33
	< $@4 vp_annotate batch=y text=${TXTDIR}/text_d  | vppen vpstyle=n yscale=2  > $@44 
#	< $@1 vppen vpstyle=n yscale=2 >$@11
#	< $@2 vppen vpstyle=n yscale=2 >$@22
#	< $@3 vppen vpstyle=n yscale=2 >$@33
#	< $@4 vppen vpstyle=n yscale=2 >$@44
	vp_SideBySideIso $@11 $@22  > t.v 
	vp_SideBySideIso $@33 $@44  > b.v
	vp_OverUnderAniso t.v b.v | vppen vpstyle=n txscale=3 tyscale=3 > $@

${RESDIR}/filt_off32_far.v:
	Window3d < LtL_bill_az15_ax15_off32_2.H min6=-.08 n6=1 min8=0.0 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@1 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_2.H min6=-.08 n6=1 min8=.25 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@2 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_2.H min6=-.08 n6=1 min8=.72 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@3 > /dev/null
	Window3d < LtL_bill_az15_ax15_off32_2.H min6=-.08 n6=1 min8=1.5 n8=1 min10=2. n10=1 | Transp plane=12 | Grey ${fragreyfo2} |Cubeplot ${framesof2} out=$@4 > /dev/null
	< $@1 vp_annotate batch=y text=${TXTDIR}/text_a  | vppen vpstyle=n yscale=2  > $@11
	< $@2 vp_annotate batch=y text=${TXTDIR}/text_b  | vppen vpstyle=n yscale=2  > $@22
	< $@3 vp_annotate batch=y text=${TXTDIR}/text_c  | vppen vpstyle=n yscale=2  > $@33
	< $@4 vp_annotate batch=y text=${TXTDIR}/text_d  | vppen vpstyle=n yscale=2  > $@44 
#	< $@1 vppen vpstyle=n yscale=2 >$@11
#	< $@2 vppen vpstyle=n yscale=2 >$@22
#	< $@3 vppen vpstyle=n yscale=2 >$@33
#	< $@4 vppen vpstyle=n yscale=2 >$@44
	vp_SideBySideIso $@11 $@22  > t.v 
	vp_SideBySideIso $@33 $@44  > b.v
	vp_OverUnderAniso t.v b.v | vppen vpstyle=n txscale=3 tyscale=3 > $@


fragreyfa=eout=1  gainpanel=a  label1="az (km)" label2="ax (km)" label3="angle" title=" " labelfat=4  g1num=0.07 g2num=0.07 clip=1.25  
framesaf=frame1=7 frame2=7 frame3=24 flat=1 title=" " point1=0.234 point2=0.234   polarity=-1 #point1=0.667331 point2=0.701786 polarity=-1
#point1=0.237525 point2=0.237525 # 
${RESDIR}/filt_ang48.v:
	Window3d < LtL_bill_az15_ax15_ang48.H min2=0 n2=1 n4=1 min4=.00 min1=2. n1=1 | Transp plane=23| Grey ${fragreyfa}   |Cubeplot ${framesaf}   out=$@1 > /dev/null
	Window3d < LtL_bill_az15_ax15_ang48.H min2=0 n2=1 n4=1 min4=.25 min1=2. n1=1 | Transp plane=23| Grey ${fragreyfa}   |Cubeplot ${framesaf}   out=$@2 > /dev/null
	Window3d < LtL_bill_az15_ax15_ang48.H min2=0 n2=1 n4=1 min4=.72 min1=2. n1=1 | Transp plane=23| Grey ${fragreyfa}   |Cubeplot ${framesaf}   out=$@3 > /dev/null
	Window3d < LtL_bill_az15_ax15_ang48.H min2=0 n2=1 n4=1 min4=1.5 min1=2. n1=1 | Transp plane=23| Grey ${fragreyfa}   |Cubeplot ${framesaf}   out=$@4 > /dev/null
	< $@1 vp_annotate batch=y text=${TXTDIR}/text_a  | vppen vpstyle=n yscale=2  > $@11
	< $@2 vp_annotate batch=y text=${TXTDIR}/text_b  | vppen vpstyle=n yscale=2  > $@22
	< $@3 vp_annotate batch=y text=${TXTDIR}/text_c  | vppen vpstyle=n yscale=2  > $@33
	< $@4 vp_annotate batch=y text=${TXTDIR}/text_d  | vppen vpstyle=n yscale=2  > $@44  
	vp_SideBySideIso $@11 $@22  > t.v 
	vp_SideBySideIso $@33 $@44  > b.v
	vp_OverUnderAniso t.v b.v | vppen vpstyle=n txscale=3 tyscale=3 > $@

${RESDIR}/filt_ang16.v:
	Window3d < LtL_bill_az15_ax15_ang16.H min7=0 n7=1  | Transp plane=12 reshape=1,3| Grey ${fragreyfa}   |Cubeplot ${framesaf}  out=$@1 > /dev/null
	Window3d < LtL_bill_az15_ax15_ang16.H min7=0 n7=1  | Transp plane=12 reshape=1,3| Grey ${fragreyfa}   |Cubeplot ${framesaf}  out=$@2 > /dev/null
	Window3d < LtL_bill_az15_ax15_ang16.H min7=0 n7=1  | Transp plane=12 reshape=1,3| Grey ${fragreyfa}   |Cubeplot ${framesaf}  out=$@3 > /dev/null
	Window3d < LtL_bill_az15_ax15_ang16.H min7=0 n7=1  | Transp plane=12 reshape=1,3| Grey ${fragreyfa}   |Cubeplot ${framesaf}  out=$@4 > /dev/null
	< $@1 vppen vpstyle=n yscale=2 >$@11
	< $@2 vppen vpstyle=n yscale=2 >$@22
	< $@3 vppen vpstyle=n yscale=2 >$@33
	< $@4 vppen vpstyle=n yscale=2 >$@44
	vp_SideBySideIso $@11 $@22  > t.v
	vp_SideBySideIso $@33 $@44  > b.v
	vp_OverUnderAniso t.v b.v > $@

clean: jclean
	rm -f ./*.stb ./*fix*
	rm -f ./Obj/LINUX/*.o ./Obj/SGI64/*.o
	rm -f ./Bin/LINUX/*.x ./Bin/SGI64/*.x
	rm -f ./Lib/LINUX/* ./Lib/SGI64/*
	rm -f ./Src/*.o ./Src/*.stb ./Src/*.mod ./Src/*fix*

include ${SEPINC}/SEP.bottom
