G   = $(B)/greens.x
OW  = $(B)/oneway.x
HH  = $(B)/hessian.x
HH2 = $B/hessian_new.x
HH3 = $B/hessian_new_test.x
DD  = ../Oneway/
DD2 = ../../Multiple/Data
#shot depth
d1 = 0. 
d2 = 100. 
d3 = 200. 
d4 = 40. 
d5 = 240. 
d6 = 300. 
#shot start
s1 = -3000. 
s2 = -3500. 
s3 = -2600. 
s4 = -2900. 
s5 = -3200. 
s6 = -2500. 
#shot end
se1 = 3000. 
se2 = 2500. 
se3 = 3400. 
se4 = 3100. 
se5 = 2800. 
se6 = 3500.
msh = cd /home/goayeni/Research/Source/Solver; make default hybrid; cd

wk= $(HOME)/Research/Norne/work/
mt= $(HOME)/Research/Norne/matlab/

hess_nrn: 
	make $(HH2);
	#Transp max_memory=1000 plane=23 reshape=2,3,6 < /data/sep/goayeni/workspace/green-nrn-06-2759/green/gr201-210/w1-60/gr201-210--w1-60.H > junk.$@.H
	#Transp reshape=3,5,6 < junk.$@.H  > green.$@.H max_memory=1000
	$(HH2) greens=green.$@.H   hessian=$@.H 					\
	ngx=10      ogx=975 dgx=25 nsx=1  osx=975 dsx=25				\
	nx_offd=1  ox_offd=0  nz_offd=1 oz_offd=0 					\
	zmin_modl= 500 zmax_modl= 500							\
	nhx_offd=1  ohx_offd=0    nhx_modl=1 ohx_modl=0 				\
	report=$@.log nodes=7 jw=1 wavelet=/data/sep/goayeni/workspace/green-nrn-06-2759/wave/gr201-210/w1-60/wav-gr201-210--w1-60.H
hess_nrn2: 
	make $(HH2);
	Window3d n4=1 squeeze=n < /data/sep/goayeni/workspace/grn-norne-06-2759/wave/gr1-441/w10-10/wav-gr1-441--w10-10.H > wav-$@.H 
	$(HH2) greens=/data/sep/goayeni/workspace/grn-norne-06-2759/green/gr1-441/w10-10/gr1-441--w10-10.H  hessian=$@.H 					\
	ngx=261      ogx=-3250 dgx=25 nsx=110  osx=500 dsx=25				\
	nx_offd=1  ox_offd=0  nz_offd=1 oz_offd=0 					\
	zmin_modl= 500 zmax_modl= 500							\
	nhx_offd=1  ohx_offd=0    nhx_modl=1 ohx_modl=0 				\
	marine=y									\
	nodes=7 spike=y verb=3 								\
	report=$@.log jw=1 wavelet=wav-$@.H
hess_nrn3: 
	make $(HH2);
	Window3d n4=1 squeeze=n < /data/sep/goayeni/workspace/grn-norne-06-2759/wave/gr1-441/w20-20/wav-gr1-441--w20-20.H > wav-$@.H 
	$(HH2) greens=/data/sep/goayeni/workspace/grn-norne-06-2759/green/gr1-882/w20/gr1-882--w20.H hessian=$@.H 					\
	ngx=261    ogx=-3250 dgx=25 nsx=2  osx=2000 dsx=25 00				\
	ngx=1      ogx=0 dgx=25 nsx=520  osx=500 dsx=25 00			\
	nx_offd=1  ox_offd=0  nz_offd=1 oz_offd=0 					\
	zmin_modl= 1500 zmax_modl= 500							\
	nhx_offd=1  ohx_offd=0    nhx_modl=1 ohx_modl=0 				\
	marine=y  									\
	nodes=15 spike=y verb=2  								\
	report=$@.log jw=1 wavelet=wav-$@.H
hess_nrn4: 
	make $(HH2);
	Window3d n4=1 squeeze=n < /data/sep/goayeni/workspace/norne-06-2759/wav- > wav-$@.H 
	$(HH2) greens=/home/goayeni/Research/Source/Oneway/2D-green.H hessian=$@.H 					\
	ngx=261    ogx=-3250 dgx=25 nsx=2  osx=2000 dsx=25 00				\
	ngx=1      ogx=0 dgx=25 nsx=520  osx=500 dsx=25 00			\
	ngx=261    ogx=-3250 dgx=25 nsx=1  osx=500 dsx=25 00				\
	nx_offd=1  ox_offd=0  nz_offd=1 oz_offd=0 					\
	zmin_modl= 1500 zmax_modl= 500							\
	nhx_offd=1  ohx_offd=0    nhx_modl=1 ohx_modl=0 				\
	marine=y  									\
	nodes=15 spike=y verb=2  								\
	report=$@.log jw=1 wavelet=wav-$@.H
hess_nrn5: 
	make $(HH2);
	Window3d n4=1 squeeze=n < /data/sep/goayeni/workspace/grns-norne-06-2759/wave/gr1-882/w20/wav-gr1-882--w20.H > wav-$@.H 
	$(HH2) greens=/data/sep/goayeni/workspace/grn-norne-06-2759/green/gr1-882/w20/gr1-882--w20.H hessian=$@.H 					\
	ngx=261    ogx=-3250 dgx=25 nsx=2  osx=2000 dsx=25 00				\
	ngx=1      ogx=0     dgx=25 nsx=520  osx=500 dsx=25 00				\
	ngx=261    ogx=-3250 dgx=25 nsx=520  osx=500 dsx=25 00				\
	nx_offd=25  ox_offd=-300  nz_offd=61 oz_offd=-150				\
	nx_modl=1   ox_modl=5000 nz_modl=1  oz_modl=3000				\
	zmin_modl=3000 zmax_modl=3005							\
	nhx_offd=1  ohx_offd=0    nhx_modl=1 ohx_modl=0 				\
	marine=y  									\
	nodes=15 spike=n verb=2  							\
	report=$@.log jw=1 wavelet=wav-$@.H
hess_nrn6: 
	make $(HH3);
	Window3d n4=1 squeeze=n < /data/sep/goayeni/workspace/grns-norne-06-2759/wave/gr1-882/w20/wav-gr1-882--w20.H > wav-$@.H 
	$(HH3) greens=/data/sep/goayeni/workspace/grns-norne-06-2759/green/gr1-882/w20/gr1-882--w20.H hessian=$@.H \
	ngx=261    ogx=-3250 dgx=25 nsx=2  osx=2000 dsx=25 00				\
	ngx=1      ogx=0     dgx=25 nsx=520  osx=500 dsx=25 00				\
	ngx=261    ogx=-3250 dgx=25 nsx=520  osx=500 dsx=25 00				\
	nx_offd=1  ox_offd=0    nz_offd=1  oz_offd=0					\
	nx_modl= 1  ox_modl= 5000 nz_modl= 1  oz_modl= 3000				\
	zmin_modl= 3000 zmax_modl= 3005							\
	nhx_offd=1  ohx_offd=0    nhx_modl=1 ohx_modl=0 				\
	marine=y  									\
	nodes=15 spike=n verb=3  							\
	report=$@.log jw=1 wavelet=wav-$@.H
hess_nrn7: 
	make $(HH3);
	Window3d n4=1 squeeze=n < /data/sep/goayeni/workspace/grns-norne-06-2759/wave/gr1-882/w20/wav-gr1-882--w20.H > wav-$@.H 
	$(HH3) greens=/data/sep/goayeni/workspace/grns-norne-06-2759/green/gr1-882/w20/gr1-882--w20.H hessian=$@.H \
	ngx=261    ogx=-3250 dgx=25 nsx=2  osx=2000 dsx=25 00				\
	ngx=1      ogx=0     dgx=25 nsx=520  osx=500 dsx=25 00				\
	ngx=261    ogx=-3250 dgx=25 nsx=520  osx=500 dsx=25 00				\
	nx_offd=1  ox_offd=0    nz_offd=1  oz_offd=0					\
	nx_modl= 1  ox_modl= 5000 nz_modl= 1  oz_modl= 300				\
	zmin_modl= 3000 zmax_modl= 3000							\
	nhx_offd=1  ohx_offd=0    nhx_modl=1 ohx_modl=0 				\
	marine=y  									\
	nodes=15 spike=n verb=3  							\
	report=$@.log jw=1 wavelet=wav-$@.H \
	hole_sy1=0 hole_sy2=0 \
	hole_gy1=0 hole_gy2=0 \
	hole_sx1=4000 hole_sx2=4250 \
	hole=y

HJM  = $(B)/hessian_conv_joint_multiple.x

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

HJM  = $(B)/hessian_conv_joint_multiple.x

h= /data/sep/goayeni/workspace/hess-offd-norne-06-2759/hess/hs1-882.H
v= /data/sep/goayeni/workspace/norne-06-2759/vel-norne-06-2759.H
m= /data/sep/goayeni/workspace/norne-06-2759/modl/norne-06-2759.H
mm= /home/goayeni/Research/Norne/work/mig-me1.H
hh= /data/sep/goayeni/workspace/hesss-offd-norne-06-2759/hess/hs1-882.H
#hhh= /data/sep/goayeni/workspace/hessss-offd-norne-06-2759/hess/hs1-882.H

test_mod.H : 
	Window3d < $(v) min1=0 n1=560 min3=1500 n3=501 squeeze=n | Window3d | Transp > junk-norne-vel.H ; reflectivity.x vel=junk-norne-vel.H | Transp reshape=1,3 > norne-refl.H
	$(HJM)  hess1=$(h) modl1=norne-refl.H data1=norne-mod..H \
		adj=n inv=n  small=y nsurv=1 method=2 

test_inv.H : 
	Window3d < $(m) min2=0 n2=560 min1=1500 n1=501 squeeze=n | Transp reshape=1,3 > norne-modl.H ; echo d2=25 >> norne-modl.H 
	$(HJM)  hess1=$(h) modl1=norne-invl.H data1=norne-modl.H \
	  adj=n inv=y verb=y mode=9 jmov=1 precond=y noreg=y niter=150 nsurv=1

test_inv1.H : 
	make
	Window3d < $(m) min2=0 n2=560 min1=1500 n1=501 squeeze=n | Transp reshape=1,3 > norne-modl.H ; echo d2=25 >> norne-modl.H 
	$(HJM)  hess1=$(h) modl1=norne-$@ data1=norne-modl.H \
	  adj=n inv=y verb=y mode=9 jmov=1 precond=y noreg=y niter=150 nsurv=1 nodes=12 node=12

test_inv2.H : 
	make
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.006 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=norne-$@ data1=$@-modl.H \
	  adj=n inv=y verb=y mode=9 jmov=1 precond=y noreg=y niter=30 nsurv=1 nodes=12 node=12 \
	  method=2
test_inv3.H :
	make
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.0015 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=norne-$@ data1=$@-modl.H \
	  adj=n inv=y verb=y mode=17 jmov=1 precond=y noreg=y niter=80 nsurv=1 nodes=12 node=12 \
	  method=2
test_inv4.H :
	make
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.0015 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hhh) modl1=norne-$@ data1=$@-modl.H \
	  adj=n inv=y verb=y mode=17 jmov=1 precond=y noreg=y niter=30 nsurv=1 nodes=12 node=12 \
	  method=2
test_inv5.H :
	make
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.0015 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=norne-$@ data1=$@-modl.H \
	  adj=n inv=y verb=y mode=18 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=12 node=12 \
	  method=2
test_inv6.H :
	make
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.003 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=norne-$@ data1=$@-modl.H \
	  adj=n inv=y verb=y mode=18 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=12 node=12 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5
test_inv7.H :
	make
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.003 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=norne-$@ data1=$@-modl.H \
	  adj=n inv=y verb=y mode=18 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=12 node=12 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5
mmm= /home/goayeni/Research/Norne/work/norne-mig-27591.H
hhhh= /data/sep/goayeni/workspace/hessss-offd-norne-06-2759/hess/hs1-882.H

test_dip:
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(mmm) | Transp > $@-modl.H 
	#Window3d min1=0 n1=560 min3=1500 n3=501 < $(mmm)  > $@-modl.H 
	Grey < $@-modl.H titlesz=8 title='infile'      wantscalebar=y pclip=99.6 >/dev/null out=$@.v  
	Dip.x < $@-modl.H  method=sergey_s eps=0.001 eps2=0.001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 | Smooth rect1=2 rect2=2 > $@.H 
	Dip.x < $@-modl.H  method=sergey_s eps=0.001 eps2=0.001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=2 wind2=2 > $@.H
	Transp reshape=1,3 < $@.H > $@-t.H
	touch $@
test_inv8:test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.0001 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=18 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y 
test_inv9: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=10 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y 
test_inv10: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.005 | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=10 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y 
test_inv-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y 
test-inv-eps160-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160 
test-inv-eps240-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=240 
test-inv-eps320-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=320 

test-inv-qd075-qm050-eps160-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160 
test-inv-qd075-qm075-eps160-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160 
test-inv-qd040-qm050-eps160-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.4 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160 
test-inv-qd040-qm040-eps160-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.4 quant_m=0.4 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160 

mmmm= /home/goayeni/research.ln/Norne/work/norne-hole1-mig-06-27591.H
hhhh= /data/sep/goayeni/workspace/hesss-hole-offd-norne-06-2759/hess/hs1-882.H
test-inv-eps160-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160 
test-hole-inv-eps160-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n >$@-modl.H ; echo d2=25 >> $@-modl.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(hhhh) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160 
test2-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y eps1=160 
test3-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160 
test4-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=20 jmov=1 precond=n noreg=n niter=150 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=1 
test5-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=20 jmov=1 precond=n noreg=n niter=150 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=2 lmd2=1 
test6-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=20 jmov=1 precond=n noreg=n niter=150 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=4
test7-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=21 jmov=1 precond=n noreg=n niter=150 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=2 lmd2=.1 rho=.99 
test8-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=21 jmov=1 precond=n noreg=n niter=150 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=2 lmd2=.4 rho=.99 
test9-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=22 jmov=1 precond=n noreg=n niter=150 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=.5 lmd2=.1 rho=.99 
test10-inv-2759: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(mmm)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mmmm) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(hh)   modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(hhhh) modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=23 jmov=1 precond=n noreg=n niter=150 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=.5 lmd2=.1 rho=.99 
b2759  = /home/goayeni/research.ln/Norne/work/norne-mig-06-27591.H
bh2759 = /home/goayeni/research.ln/Norne/work/norne-hole1-mig-06-27591.H
m2759  = /home/goayeni/research.ln/Norne/work/norne-mig-08-27591.H
ms2759 = /home/goayeni/research.ln/Norne/work/norne-mig-08-27591-s.H
mh2759 = /home/goayeni/research.ln/Norne/work/norne-hole1-mig-08-27591.H
mhs2759= /home/goayeni/research.ln/Norne/work/norne-hole1-mig-08-27591-s.H

h2759 = /data/sep/goayeni/workspace/hesss-offd-norne-06-2759/hess/hs1-882.H
hh2759= /data/sep/goayeni/workspace/hesss-hole-offd-norne-06-2759/hess/hs1-882.H
#monitor
inv1-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(b$*)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(ms$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=21 jmov=1 precond=n noreg=n niter=30 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.5 quant_m=0.5 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=.5 lmd2=.01 rho=.99
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.8 bclip=-.8 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H
	Cat3d axis=2 $@-modl1.H $@-modl2.H $@-modl-dif.H | Transp reshape=2,3 > $@-modl.H 
	Scale < $@-modl.H | Grey color=i newclip=1 eclip=.8 bclip=-.8 >/dev/null out=$@-modl.v

inv2-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(b$*)  min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(ms$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H \
	  adj=n inv=y verb=y mode=21 jmov=1 precond=n noreg=n niter=30 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.8 quant_m=0.8 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=80 lmd1=10. lmd2=.01 rho=.99
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.8 bclip=-.8 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H

inv3-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d min3=0 min5=0 n3=1 n5=1 < $(h2759) | Transp plane=23 > $@-hes1.H  
	Window3d min3=0 min5=0 n3=1 n5=1 < $(hh2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	Window3d < $(b$*)   min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H hesp1=$@-hes.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=24 jmov=1 precond=y noreg=n niter=100 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=1 lmd1=1. lmd2=.2 rho=.99 gpow=0.
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H
	Cat3d axis=2 $@-modl1.H $@-modl2.H $@-modl-dif.H | Transp reshape=2,3 > $@-modl.H 
	Scale < $@-modl.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@-modl.v
inv4-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d min3=0 min5=0 n3=1 n5=1 < $(h2759) | Transp plane=23 > $@-hes1.H  
	Window3d min3=0 min5=0 n3=1 n5=1 < $(hh2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	Window3d < $(b$*)   min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H hesp1=$@-hes.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=24 jmov=1 precond=y noreg=n niter=100 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=10 lmd1=1. lmd2=.2 rho=.99 gpow=0.
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H
	Cat3d axis=2 $@-modl1.H $@-modl2.H $@-modl-dif.H | Transp reshape=2,3 > $@-modl.H 
	Scale < $@-modl.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@-modl.v
inv5-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d min3=0 min5=0 n3=1 n5=1 < $(h2759) | Transp plane=23 > $@-hes1.H  
	Window3d min3=0 min5=0 n3=1 n5=1 < $(hh2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	Window3d < $(b$*)   min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H hesp1=$@-hes.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=24 jmov=1 precond=y noreg=n niter=100 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=80 lmd1=1. lmd2=.2 rho=.99 gpow=0.
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H
	Cat3d axis=2 $@-modl1.H $@-modl2.H $@-modl-dif.H | Transp reshape=2,3 > $@-modl.H 
	Scale < $@-modl.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@-modl.v
inv6-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d min3=0 min5=0 n3=1 n5=1 < $(h2759) | Transp plane=23 > $@-hes1.H  
	Window3d min3=0 min5=0 n3=1 n5=1 < $(hh2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	Window3d < $(b$*)   min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H hesp1=$@-hes.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=24 jmov=1 precond=y noreg=n niter=100 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=160 lmd1=1. lmd2=.2 rho=.99 gpow=0.
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H
	Cat3d axis=2 $@-modl1.H $@-modl2.H $@-modl-dif.H | Transp reshape=2,3 > $@-modl.H 
	Scale < $@-modl.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@-modl.v
imp0-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d min3=0 min5=0 n3=1 n5=1 < $(h2759) | Transp plane=23 > $@-hes1.H  
	Window3d min3=0 min5=0 n3=1 n5=1 < $(hh2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	Window3d < $(b$*)   min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H hesp1=$@-hes.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=23 jmov=1 precond=y noreg=n niter=150 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.7 quant_m=0.7 ldip=y verb_dip=3 nang=90  eps_dip=0.15 destroy_nhlx=y eps1=20 lmd1=.5 lmd2=.1 rho=.99 gpow=0.
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H
	Cat3d axis=2 $@-modl1.H $@-modl2.H $@-modl-dif.H | Transp reshape=2,3 > $@-modl.H 
	Scale < $@-modl.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@-modl.v
imp1-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d min3=0 min5=0 n3=1 n5=1 < $(h2759) | Transp plane=23 > $@-hes1.H  
	Window3d min3=0 min5=0 n3=1 n5=1 < $(hh2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	Window3d < $(b$*)   min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H hesp1=$@-hes.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=23 jmov=1 precond=y noreg=n niter=100 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.7 quant_m=0.7 ldip=y verb_dip=3 nang=90  eps_dip=0.15 destroy_nhlx=y eps1=80 lmd1=.5 lmd2=.1 rho=.99 gpow=0.
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H
	Cat3d axis=2 $@-modl1.H $@-modl2.H $@-modl-dif.H | Transp reshape=2,3 > $@-modl.H 
	Scale < $@-modl.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@-modl.v
imp2-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d min3=0 min5=0 n3=1 n5=1 < $(h2759) | Transp plane=23 > $@-hes1.H  
	Window3d min3=0 min5=0 n3=1 n5=1 < $(hh2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	Window3d < $(b$*)   min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$(h2759)  modl1=$@-1.H  data1=$@-modl1.H dip1=$<.H hesp1=$@-hes.H \
		hess2=$(h2759)  modl2=$@-2.H  data2=$@-modl2.H dip2=$<.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=23 jmov=1 precond=y noreg=n niter=100 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.7 quant_m=0.7 ldip=y verb_dip=3 nang=90  eps_dip=0.15 destroy_nhlx=y eps1=160 lmd1=.5 lmd2=.1 rho=.99 gpow=0.
	Math file1=$@-1.H file2=$@-2.H exp=file2-file1 > $@-dif.H
	Cat3d axis=2 $@-1.H $@-2.H $@-dif.H | Transp reshape=2,3 > $@.H 
	Scale < $@.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@.v
	Math file1=$@-modl1.H file2=$@-modl2.H exp=file2-file1 > $@-modl-dif.H
	Cat3d axis=2 $@-modl1.H $@-modl2.H $@-modl-dif.H | Transp reshape=2,3 > $@-modl.H 
	Scale < $@-modl.H | Grey color=i newclip=1 eclip=.4 bclip=-.4 >/dev/null out=$@-modl.v




#Figures seminar jan 2011
lab = label1='z(m)' label2='distance(m)'
Figs:
	Window3d < inv6-2759-modl1.H   | Transp | 			              			Grey newclip=1 color=i  $(lab) titlesz=8 title='migration'  >/dev/null out=$R/$@-0.v
	Window3d < /home/goayeni/Research/Source/Hessian/norne-test_inv7.H  | Transp | 	             	Grey newclip=1 color=i  $(lab) titlesz=8 title='reflectivity '	       >/dev/null out=$R/$@-1.v
	Window3d < test-inv-qd040-qm040-eps160-004.H inv6-2759-1.H          | Transp |  		Grey newclip=1 titlesz=8 title='impedance inversion' color=i  $(lab) >/dev/null out=$R/$@-2.v
	Window3d < inv6-2759-modl1.H   					    | Transp | Tpow tpow=1. 1 | Leakinteg.x rho=.98 | Scale | Grey $(lab) titlesz=8 title='rel. imp. from migration' bclip=-.5 eclip=.5 newclip=1 color=a  >/dev/null out=$R/$@-3.v
	Window3d < test-inv-qd040-qm040-eps160-004.H inv6-2759-1.H          | Transp | Leakinteg.x rho=.98 | Scale | Grey $(lab) titlesz=8 title='rel. imp. from reflectivity' bclip=-.5 eclip=.5 newclip=1 color=a  >/dev/null out=$R/$@-4.v
	Window3d < imp0-2759-1.H       | Transp |                                       Scale | Grey $(lab) titlesz=8 title='rel. imp. from direct inversion' bclip=-.5 eclip=.5 newclip=1 color=a  >/dev/null out=$R/$@-5.v
	Window3d < imp0-2759-hes.H     | Transp | Grey $(lab) titlesz=8 title='illumination-ratio' color=j newclip=1 >/dev/null out=$R/$@-hesp.v 
	Window3d < imp0-2759-hes1.H    | Transp | Grey $(lab) titlesz=8 title='illumination (2006)' color=j newclip=1 >/dev/null out=$R/$@-hes1.v 
	Window3d < imp0-2759-hes2.H    | Transp | Grey $(lab) titlesz=8 title='illumination (2008)' color=j newclip=1 >/dev/null out=$R/$@-hes2.v 

jpg:
	make $R/Figs-1.jpg 
	make $R/Figs-2.jpg 
	make $R/Figs-3.jpg  
	make $R/Figs-4.jpg  
	make $R/Figs-5.jpg 
	make $R/Figs-hesp.jpg 
	make $R/Figs-hes1.jpg	
	make $R/Figs-hes2.jpg	
	
	#Window3d < imp1-2759-1.H       | Transp |                                       Scale | Grey $(lab) bclip=-.5 eclip=.5 newclip=1 color=a  >/dev/null out=$@-6.v
	#Window3d < test10-inv-2759-1.H | Transp |                                       Scale | Grey $(lab) bclip=-.5 eclip=.5 newclip=1 color=a  >/dev/null out=$@-7.v


m3225= /home/goayeni/research.ln/Norne/work/norne-mig-32251.H
h3225= /data/sep/goayeni/workspace/hesss-offd-norne-06-3225/hess/hs1-882.H
mm3225= /home/goayeni/research.ln/Norne/work/norne-mig-32251.H
hh3225= /data/sep/goayeni/workspace/hesss-offd-norne-06-3225/hess/hs1-882.H


test-3225-inv-eps160-%: test_dip
	make
	Transp reshape=1,3 < $<.H > $<-t.H
	Window3d < $(m3225) min2=0 n1=560 min1=0 n3=501 min3=1500 squeeze=n | Window3d | Transp | Bandpass flo=0.$* | Transp reshape=1,3 >$@-modl.H ; echo d2=25 >> $@-modl.H 
	$(HJM)  hess1=$(h3225) modl1=$@.H  data1=$@-modl.H dip1=$<.H \
	  adj=n inv=y verb=y mode=19 jmov=1 precond=n noreg=n niter=80 nsurv=1 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.4 quant_m=0.4 ldip=y verb_dip=3 nang=90  eps_dip=0.2 destroy_nhlx=y eps1=160

#try multiple regs
reg1-%: test_dip
	$(msh)
	make
	#Window3d min2=500 max2=4000 min1=1800 max1=3000 < $<.H > $<-t.H
	#Window3d min3=0 min5=0 n3=1 n5=1 min8=500 max8=4000 min10=1800 max10=3000 < $(h$*)  | Transp plane=23 > $@-hes1.H  
	#Window3d min3=0 min5=0 n3=1 n5=1 min8=500 max8=4000 min10=1800 max10=3000 < $(hh$*) | Transp plane=23 > $@-hes2.H
	#Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	#Window3d 			          min8=500 max8=4000 min10=1800 max10=3000 squeeze=n < $(h$*)  > $@-hes1.H  
	#Window3d 			          min8=500 max8=4000 min10=1800 max10=3000 squeeze=n < $(hh$*) > $@-hes2.H
	#Window3d < $(b$*)   min1=500 max1=4000 min3=1800 max3=3000 squeeze=n squezze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	#Window3d < $(mhs$*) min1=500 max1=4000 min3=1800 max3=3000 squeeze=n squezze=n | Window3d | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$@-hes1.H  modl1=$@-1.H  data1=$@-modl1.H dip1=$<-t.H hesp1=$@-hes.H \
		hess2=$@-hes2.H  modl2=$@-2.H  data2=$@-modl2.H dip2=$<-t.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=25 jmov=1 precond=y noreg=n niter=2 nsurv=2 nodes=1 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 quant_m1=.75 ldip=y verb_dip=3 nang=3  eps_dip=0.1 destroy_nhlx=y eps1=160 lmd1=1. lmd2=.2 rho=.99 gpow=0.

reg2-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(h$*)  | Transp plane=23 > $@-hes1.H  
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(hh$*) | Transp plane=23 > $@-hes2.H
	#Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	#Window3d 			n5=31     squeeze=n < $(h$*)  > $@-hes1.H  
	#Window3d 			n5=31     squeeze=n < $(hh$*) > $@-hes2.H
	Window3d < $(b$*)   min1=0 n1=560 min3=1500 n3=501  | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min1=0 n1=560 min3=1500 n3=501  | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	#Window3d min2=500 max2=4000 min1=1800 max1=3000 < $<.H > $<-t.H
	$(HJM)  \
		hess1=$@-hes1.H  modl1=$@-1.H  data1=$@-modl1.H dip1=$<-t.H hesp1=$@-hes.H \
		hess2=$@-hes2.H  modl2=$@-2.H  data2=$@-modl2.H dip2=$<-t.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=80 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.4 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=25 eps2=1 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y
reg3-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(h$*)  | Transp plane=23 > $@-hes1.H  
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(hh$*) | Transp plane=23 > $@-hes2.H
	#Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	#Window3d 			n5=31     squeeze=n < $(h$*)  > $@-hes1.H  
	#Window3d 			n5=31     squeeze=n < $(hh$*) > $@-hes2.H
	Window3d < $(b$*)   min1=0 n1=560 min3=1500 n3=501  | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min1=0 n1=560 min3=1500 n3=501  | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$@-hes1.H  modl1=$@-1.H  data1=$@-modl1.H dip1=$<-t.H hesp1=$@-hes.H \
		hess2=$@-hes2.H  modl2=$@-2.H  data2=$@-modl2.H dip2=$<-t.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=80 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.4 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=25 eps2=5 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y
#
reg4-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(h$*)  | Transp plane=23 > $@-hes1.H  
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(hh$*) | Transp plane=23 > $@-hes2.H
	#Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	#Window3d 			n5=31     squeeze=n < $(h$*)  > $@-hes1.H  
	#Window3d 			n5=31     squeeze=n < $(hh$*) > $@-hes2.H
	Window3d < $(b$*)   min1=0 n1=560 min3=1500 n3=501  | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	Window3d < $(mhs$*) min1=0 n1=560 min3=1500 n3=501  | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=$@-hes1.H  modl1=$@-1.H  data1=$@-modl1.H dip1=$<-t.H hesp1=$@-hes.H \
		hess2=$@-hes2.H  modl2=$@-2.H  data2=$@-modl2.H dip2=$<-t.H hesp2=$@-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.99 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=25 eps2=25 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
reg5-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.5 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=25 eps2=25 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
reg6-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.02 ldip=y verb_dip=3 nang=90  eps_dip=0.1 destroy_nhlx=y eps1=25 eps2=25 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
##
reg7-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y eps1=25 eps2=5 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
reg8-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y eps1=25 eps2=25 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
reg9-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y eps1=25 eps2=50 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
###
reg10-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y eps1=.1 eps2=25 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
reg11-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y eps1=1 eps2=25 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
reg12-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y eps1=10 eps2=25 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
reg13-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=26 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y eps1=100 eps2=25 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y \
	  report=$@.log
##
reg14-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=27 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=10 epA1=25 epB1=.1 \
	  lmd1=1. lmd2=.2 rho=.99 gpow=0. \
	  halfhess=y \
	  report=$@.log
reg15-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=27 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=10 epA1=25 epB1=1 \
	  lmd1=1. lmd2=.2 rho=.99 gpow=0. \
	  halfhess=y \
	  report=$@.log
reg16-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=27 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=10 epA1=25 epB1=10 \
	  lmd1=1. lmd2=.2 rho=.99 gpow=0. \
	  halfhess=y \
	  report=$@.log
reg17-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=test_dip-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=test_dip-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=27 jmov=1 precond=y noreg=n niter=60 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=10 epA1=25 epB1=100 \
	  lmd1=1. lmd2=.2 rho=.99 gpow=0. \
	  halfhess=y \
	  report=$@.log


##
reg20-%: test_dip2
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=$<-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=$<-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=27 jmov=1 precond=y noreg=n niter=150 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=5 epA1=25 epB1=2 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=0. \
	  halfhess=y \
	  report=$@.log
reg21-%: test_dip2
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=$<-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=$<-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=27 jmov=1 precond=y noreg=n niter=150 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=25 epB1=2 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=0. \
	  halfhess=y \
	  report=$@.log
reg22-%: test_dip2
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=$<-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=$<-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=27 jmov=1 precond=y noreg=n niter=150 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=25 epA1=25 epB1=2 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=0. \
	  halfhess=y \
	  report=$@.log
reg23-%: test_dip2
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg4-2759-modl1.H dip1=$<-t.H hesp1=reg4-2759-hes.H \
		hess2=reg4-2759-hes2.H  modl2=$@-2.H  data2=reg4-2759-modl2.H dip2=$<-t.H hesp2=reg4-2759-hes.H \
	  adj=n inv=y verb=y mode=27 jmov=1 precond=y noreg=n niter=150 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=50 epA1=25 epB1=2 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=0. \
	  halfhess=y \
	  report=$@.log

##
reg30-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(h$*) | Transp plane=23 > $@-hes1.H  
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(h$*) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	#Window3d < $(b$*)   min1=0 n1=560 min3=1500 n3=501  | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl1.H ; echo d2=25 >> $@-modl1.H 
	#Window3d < $(ms$*)  min1=0 n1=560 min3=1500 n3=501  | Transp | Bandpass flo=0.004 | Transp reshape=1,3 >$@-modl2.H ; echo d2=25 >> $@-modl2.H 
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=$@-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=$@-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=29 jmov=1 precond=y noreg=n niter=180 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=20 epB1=15 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
reg31-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=29 jmov=1 precond=y noreg=n niter=180 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=20 epB1=20 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
reg32-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=29 jmov=1 precond=y noreg=n niter=180 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=20 epB1=45 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.3 \
	  halfhess=y \
	  report=$@.log
reg33-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=29 jmov=1 precond=y noreg=n niter=180 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=15 epB1=90 \
	  lmd1=1. lmd2=.2 rho=.30 gpow=1.3 \
	  halfhess=y \
	  report=$@.log

#######
reg40-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=30 jmov=1 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.9 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=15 epB1=20 epC1=5 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
reg41-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=30 jmov=1 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.9 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=15 epB1=20 epC1=15 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
reg42-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=30 jmov=1 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.9 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=15 epB1=20 epC1=30 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.3 \
	  halfhess=y \
	  report=$@.log
reg43-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=30 jmov=1 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.9 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=15 epB1=20 epC1=50 \
	  lmd1=1. lmd2=.2 rho=.30 gpow=1.3 \
	  halfhess=y \
	  report=$@.log
#l2
reg01-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=29 jmov=1 precond=y noreg=n niter=82 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.75 quant_m2=.6 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=15 epB1=20 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
reg02-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=29 jmov=1 precond=y noreg=n niter=82 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.75 quant_m2=.6 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=50 epB1=20 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
reg03-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H \
	  adj=n inv=y verb=y mode=29 jmov=1 precond=y noreg=n niter=82 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.75 quant_m2=.6 ldip=y verb_dip=3 nang=90  eps_dip=0.05 destroy_nhlx=y \
	  eps1=12.5 epA1=150 epB1=20 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=1.4 \
	  halfhess=y \
	  report=$@.log




picks:
	Picks.x < test_dip2.H picks=reservoir-top.dat add=n | Scale  > resv-top.H
	Picks.x < test_dip2.H picks=reservoir-bot.dat add=n | Scale rscale=-1 | Scale > resv-bot.H
	Math file1=resv-top.H file2=resv-bot.H exp=file2+file1 | Leakinteg.x rho=1 | Median_me.x wind2=40 nodes=10 | Smooth rect1=10 rect2=10 rect2=3 | Scale rscale=-1 | Math file1=in exp='(file1+1)' | Transp reshape=1,3 > resv-$@.H 
picks2:
	Picks.x < test_dip2.H picks=4d-picks.dat add=n | Scale  | Scale rscale=-1 | Math file1=in exp='(file1+1)' | Transp reshape=1,3 > $@.H 
picks3:
	Picks.x < test_dip2.H picks=4d-picks2.dat add=n | Scale  | Scale rscale=-1 | Math file1=in exp='(file1+1)' | Transp reshape=1,3 > $@.H 

dif-%:
	Math file1=reg30-2759-modl1.H file2=reg30-2759-modl2.H exp=file2-file1 | Window3d min3=1800 n1=501 | Transp > 0.H ; 
	Math file1=reg$*0-2759-1.H file2=reg$*0-2759-2.H exp=file2-file1 | Window3d min3=1800 n1=501 | Transp > 1.H ; 
	Math file1=reg$*1-2759-1.H file2=reg$*1-2759-2.H exp=file2-file1 | Window3d min3=1800 n1=501 | Transp > 2.H ; 
	Math file1=reg$*2-2759-1.H file2=reg$*2-2759-2.H exp=file2-file1 | Window3d min3=1800 n1=501 | Transp > 3.H ; 
	Math file1=reg$*3-2759-1.H file2=reg$*3-2759-2.H exp=file2-file1 | Window3d min3=1800 n1=501 | Transp > 4.H
	Cat3d [0-4].H | Window3d min1= 1800 | Scale | Grey gainpanel=e newclip= pclip=99.99 color=G | Tube

#modeling test

mod1-%: test_dip
	$(msh)
	make
	#Window3d min2=500 max2=4000 min1=1800 max1=3000 < $<.H > $<-t.H
	#Spike n1=240 n2=140 nsp=3 k1=120,140,200 k2=40,80 | Transp reshape=1,3 > $@-ref1.H ; echo o1=500 d1=25 o2=0 d2=25 o3=1800 d3=5 >> $@-ref1.H
	#Spike n1=240 n2=140 nsp=3 k1=120,140,200 k2=40,80 | Transp reshape=1,3 > $@-ref2.H ; echo o1=500 d1=25 o2=0 d2=25 o3=1800 d3=5 >> $@-ref2.H
	#Window3d 			n5=61     min8=500 max8=4000 min10=1800 max10=3000 squeeze=n < $(h$*)  > $@-hes1.H  
	#Window3d 			n5=61     min8=500 max8=4000 min10=1800 max10=3000 squeeze=n < $(hh$*) > $@-hes2.H
	$(HJM)  \
		hess1=$@-hes1.H  modl1=$@-ref1.H  data1=$@-modl1.H dip1=$<-t.H hesp1=$@-hes.H \
		hess2=$@-hes2.H  modl2=$@-ref2.H  data2=$@-modl2.H dip2=$<-t.H hesp2=$@-hes.H \
	  adj=n inv=n verb=y mode=26 jmov=1 precond=y noreg=n niter=2 nsurv=2 nodes=15 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 quant_m1=.75 ldip=y verb_dip=3 nang=3  eps_dip=0.1 destroy_nhlx=y eps1=160 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=n

mod2-%: test_dip
	$(msh)
	make
	#Window3d min2=500 max2=4000 min1=1800 max1=3000 < $<.H > $<-t.H
	#Spike n1=240 n2=140 nsp=3 k1=120,140,200 k2=40,80 | Transp reshape=1,3 > $@-ref1.H ; echo o1=500 d1=25 o2=0 d2=25 o3=1800 d3=5 >> $@-ref1.H
	#Spike n1=240 n2=140 nsp=3 k1=120,140,200 k2=40,80 | Transp reshape=1,3 > $@-ref2.H ; echo o1=500 d1=25 o2=0 d2=25 o3=1800 d3=5 >> $@-ref2.H
	#Window3d 			n5=31     min8=500 max8=4000 min10=1800 max10=3000 squeeze=n < $(h$*)  > $@-hes1.H  
	#Window3d 			n5=31     min8=500 max8=4000 min10=1800 max10=3000 squeeze=n < $(hh$*) > $@-hes2.H
	$(HJM)  \
		hess1=$@-hes1.H  modl1=$@-ref1.H  data1=$@-modl1.H dip1=$<-t.H hesp1=$@-hes.H \
		hess2=$@-hes2.H  modl2=$@-ref2.H  data2=$@-modl2.H dip2=$<-t.H hesp2=$@-hes.H \
	  adj=n inv=n verb=y mode=26 jmov=1 precond=y noreg=n niter=2 nsurv=2 nodes=15 15  node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 quant_m1=.75 ldip=y verb_dip=3 nang=3  eps_dip=0.1 destroy_nhlx=y eps1=160 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y

test_dip1:
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(mmm) | Transp > $@-modl.H 
	Dip.x < $@-modl.H coh=1.H method=sergey_f eps=0.00010 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@1.H & 
	Dip.x < $@-modl.H coh=2.H method=sergey_f eps=0.00015 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@2.H &
	Dip.x < $@-modl.H coh=3.H method=sergey_f eps=0.00020 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@3.H &
	Dip.x < $@-modl.H coh=4.H method=sergey_f eps=0.00025 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@4.H
	touch $@
test_dip2:
	Window3d min1=0 n1=560 min3=1500 n3=501 < reg15-2759-1.H | Transp > $@-modl.H 
	Dip.x < $@-modl.H coh=3.H method=sergey_f eps=0.00030 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@.H &
	Dip.x < $@-modl.H coh=1.H method=sergey_f eps=0.00010 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@1.H & 
	Dip.x < $@-modl.H coh=2.H method=sergey_f eps=0.00020 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@2.H &
	Dip.x < $@-modl.H coh=3.H method=sergey_f eps=0.00030 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@3.H &
	Dip.x < $@-modl.H coh=4.H method=sergey_f eps=0.00040 eps2=0.00001 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=1 wind2=1 > $@4.H
	touch $@

#with var..
reg50-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=15   > 4d-var.H
	Window3d < picks3.H resv-picks.H | Transp | Smooth rect1=5 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=6 > 4d-var.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=y verb=y mode=32 jmov=1 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 ldip=y verb_dip=3 nang=15  eps_dip=0.02 destroy_nhlx=y \
	  nvar=8 lvdip=y \
	  norm_m=hybrid norm_m1=hybrid norm_m2=hybrid  norm_m3=hybrid norm_m4=hybrid \
	  quant_m=0.95  quant_m1=.75   quant_m2=.6     quant_m3=.6    quant_m4=.6 \
	  eps1=25       epA1=10        epB1=1         epC1=.01        epD1=.01 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=2.6 \
	  halfhess=y \
	  report=$@.log
reg51-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=15   > 4d-var.H
	Window3d < picks3.H resv-picks.H | Transp | Smooth rect1=5 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=6 > 4d-var.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=y verb=y mode=32 jmov=1 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 ldip=y verb_dip=3 nang=15  eps_dip=0.02 destroy_nhlx=y \
	  nvar=8 lvdip=y \
	  norm_m=hybrid norm_m1=hybrid norm_m2=hybrid  norm_m3=hybrid norm_m4=hybrid \
	  quant_m=0.95  quant_m1=.75   quant_m2=.6     quant_m3=.6    quant_m4=.6 \
	  eps1=25       epA1=10        epB1=10         epC1=.01        epD1=.01 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=2.6 \
	  halfhess=y \
	  report=$@.log
reg52-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=15   > 4d-var.H
	Window3d < picks3.H resv-picks.H | Transp | Smooth rect1=5 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=6 > 4d-var.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=y verb=y mode=32 jmov=1 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 ldip=y verb_dip=3 nang=15  eps_dip=0.02 destroy_nhlx=y \
	  nvar=8 lvdip=y \
	  norm_m=hybrid norm_m1=hybrid norm_m2=hybrid  norm_m3=hybrid norm_m4=hybrid \
	  quant_m=0.95  quant_m1=.75   quant_m2=.6     quant_m3=.6    quant_m4=.6 \
	  eps1=25       epA1=10        epB1=30         epC1=.01        epD1=.01 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=2.6 \
	  halfhess=y \
	  report=$@.log
reg53-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=15   > 4d-var.H
	Window3d < picks3.H resv-picks.H | Transp | Smooth rect1=5 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=6 > 4d-var.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=y verb=y mode=32 jmov=1 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 ldip=y verb_dip=3 nang=15  eps_dip=0.02 destroy_nhlx=y \
	  nvar=8 lvdip=y \
	  norm_m=hybrid norm_m1=hybrid norm_m2=hybrid  norm_m3=hybrid norm_m4=hybrid \
	  quant_m=0.95  quant_m1=.75   quant_m2=.6     quant_m3=.6    quant_m4=.6 \
	  eps1=25       epA1=10        epB1=60         epC1=.01        epD1=.01 \
	  lmd1=1. lmd2=.2 rho=.85 gpow=2.6 \
	  halfhess=y \
	  report=$@.log
reg54-%: test_dip
	$(msh)
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=y verb=y mode=31 jmov=1 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.55 ldip=y verb_dip=3 nang=30  eps_dip=0.02 destroy_nhlx=y \
	  nvar=5 lvdip=y \
	  eps1=12.5 epA1=15 epB1=20 epC1=5 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
reg55-%: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	$(HJM)  \
		hess1=reg4-2759-hes1.H  modl1=$@-1.H  data1=reg30-2759-modl1.H dip1=$<-t.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=reg4-2759-hes1.H  modl2=$@-2.H  data2=reg30-2759-modl2.H dip2=$<-t.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=y verb=y mode=31 jmov=1 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.55 ldip=y verb_dip=3 nang=30  eps_dip=0.02 destroy_nhlx=y \
	  nvar=5 lvdip=y \
	  eps1=12.5 epA1=15 epB1=20 epC1=30 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.4 \
	  halfhess=y \
	  report=$@.log




















# New hole new rad+ warp....etc 
base-2759   = /home/goayeni/research.ln/Norne/work/mig-norne-grad-flat-warp-2759-06.H
moni-2759   = /home/goayeni/research.ln/Norne/work/mig-norne-grad-flat-warp-2759-08.H
base-h-2759 = /home/goayeni/research.ln/Norne/work/mig-norne-hole-sxgx-grad-flat-warp-2759-06.H
moni-h-2759 = /home/goayeni/research.ln/Norne/work/mig-norne-hole-sxgx-grad-flat-warp-2759-08.H

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

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

 
hess-2759: 
	#Window3d < $(hess-2759)   n5=31 squeeze=n  max_memory=1000 > $@-06.H  ; echo d2=25 >> $@-06.H 
	#Window3d < $(hess-h-2759) n5=31 squeeze=n  max_memory=1000 > $@-08.H  ; echo d2=25 >> $@-08.H 
hessw4-2759: 
	#Window3d < $(hessw4-2759)   n5=31 squeeze=n  max_memory=1000 > $@-06.H  ; echo d2=25 >> $@-06.H 
	#Window3d < $(hessw4-h-2759) n5=31 squeeze=n  max_memory=1000 > $@-08.H  ; echo d2=25 >> $@-08.H 
hes-2759:
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(hess-2759)   | Transp plane=23 > $@-hes1.H  
	#Window3d min3=0 min5=0 n3=1 n5=1 < $(hess-h-2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp=file1/file2 > $@-hesp-rat0.H
	Math file1=$@-hesp-rat0.H exp="file1/`Attr param=1 < $@-hesp-rat0.H |Get parform=n minval`" > $@-hesp-rat.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp=file1-file2 > $@-hesp-dif.H 
migo-2759:
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(base-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.008 | Transp reshape=1,3 | Scale rscale=1 > $@-06.H  ; echo d2=25 >> $@-06.H 
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(moni-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.008 | Transp reshape=1,3 | Scale rscale=1 > $@-08.H  ; echo d2=25 >> $@-08.H 
migno-2759: #shifted normalized
	Window3d min1=0 n1=560 min3=1500 max3=2500 < $(base-2759)  squeeze=n  > junk1-$@.H 
	Window3d min1=0 n1=560 min3=1500 max3=2500 < $(monin-2759) squeeze=n  > junk2-$@.H 
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(base-2759)  squeeze=n  | Window3d | Transp | Bandpass flo=0.008 | Transp reshape=1,3 | Math file1=in exp="file1*`Attr param=1 < junk2-$@.H | Get rms parform=n `" > $@-06.H  ; echo d2=25 >> $@-06.H 
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(monin-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.008 | Transp reshape=1,3 | Math file1=in exp="file1*`Attr param=1 < junk1-$@.H | Get rms parform=n `" > $@-08.H  ; echo d2=25 >> $@-08.H

mig-2759:
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(base-h-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.008 | Transp reshape=1,3 | Scale rscale=1 > $@-06.H  ; echo d2=25 >> $@-06.H 
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(moni-h-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.008 | Transp reshape=1,3 | Scale rscale=1 > $@-08.H  ; echo d2=25 >> $@-08.H 
mign-2759: #shifted normalized
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(base-2759)    squeeze=n  > junk1-$@.H 
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(monin-h-2759) squeeze=n  > junk2-$@.H 
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(base-2759)    squeeze=n  | Window3d | Transp | Bandpass flo=0.008 | Transp reshape=1,3 | Math file1=in exp="file1*`Replace.x opt=3 value=0 cutoff=1.008 replace=hes-2759-hesp-rat.H < junk2-$@.H | Attr param=1 | Get rms parform=n `" > $@-06.H  ; echo d2=25 >> $@-06.H 
	Window3d min1=0 n1=560 min3=1500 n3=501 < $(monin-h-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.008 | Transp reshape=1,3 | Math file1=in exp="file1*`Replace.x opt=3 value=0 cutoff=1.008 replace=hes-2759-hesp-rat.H < junk1-$@.H | Attr param=1 | Get rms parform=n `" > $@-08.H  ; echo d2=25 >> $@-08.H
 
dip-2759:
	#Window3d min1=0 n1=560 min3=1500 n3=501 < $(base-h-2759) | Transp > $@-modl.H 
	Window3d min1=0 n1=560 min3=1500 n3=501 < mign-2759-06.H | Transp > $@-modl.H 
	Grey < $@-modl.H titlesz=8 title='infile'      wantscalebar=y pclip=99.6 >/dev/null out=$@.v  
	#Dip.x < $@-modl.H  method=sergey_s eps=0.002 eps2=0.002 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=2 wind2=2  | Smooth rect1=2 rect2=2 > $@.H
	/home/goayeni/Research/Source/Dips/Dip/Sdip rect1=2 rect2=2 < $@-modl.H  | Smooth rect1=2 rect2=2 > $@.H
	killwave.x infile=$@-modl.H verb=6 eps=0.01 verb1=4 nfilt=3 nang=45 dip=$@.H  destroy=y outfile=$@-modl-des.H rand_in=n  > $@ & 
	killwave.x infile=$@-modl.H verb=6 eps=0.25 verb1=4 nfilt=2 nang=45 dip=$@.H destroy=n outfile=$@-modl-smt.H rand_in=n > $@  
	Transp reshape=1,3 < $@.H > $@-t.H
	#touch $@
4dip-2759:
	Math file1=inv-6-1.H file2=inv-6-2.H exp=file2-file1 | Window3d | 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=2 rect2=2 < $@-modl.H  | Smooth rect1=2 rect2=2 > $@.H
	killwave.x infile=$@-modl.H verb=6 eps=0.1 verb1=4 nfilt=3 nang=45 dip=$@.H  destroy=n outfile=$@-modl-smt1.H rand_in=n  > $@ 
	Transp reshape=1,3 < $@.H > $@-t.H
	touch $@
mod-%: 
	$(msh)
	make
	Spike n1=501 n2=560 nsp=7 k1=20,60,120,200,250,300,350 k2= | Scale rscale=1 | Transp reshape=1,3 > $@-ref1.H ; echo o1=00 d1=25 o2=0 d2=25 o3=1500 d3=5 >> $@-ref1.H
	Spike n1=501 n2=560 nsp=7 k1=20,60,120,200,250,300,350 k2= | Scale rscale=1 | Transp reshape=1,3 > $@-ref2.H ; echo o1=00 d1=25 o2=0 d2=25 o3=1500 d3=5 >> $@-ref2.H
	$(HJM)  \
		hess1=hessw4-2759-08.H  modl1=$@-ref1.H  data1=mod-2759-06.H dip1=dip-2759.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=hessw4-2759-08.H  modl2=$@-ref2.H  data2=mod-2759-08.H dip2=dip-2759.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=n verb=y mode=26 jmov=1 precond=y noreg=n niter=2 nsurv=2 nodes=15 15  node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 quant_m1=.75 ldip=n verb_dip=3 nang=3  eps_dip=0.1 destroy_nhlx=y eps1=160 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y

inv-1: 
	$(msh) 
	make
	#Window3d min3=0 min5=0 n3=1 n5=1 < hess-2759-06.H | Transp plane=23 > $@-hes1.H
	#Window3d min3=0 min5=0 n3=1 n5=1 < hess-2759-06.H | Transp plane=23 > $@-hes2.H
	#Math file1=$@-hes1.H file2=$@-hes2.H exp='file1/file2' > $@-hes.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=mig-2759-06.H dip1=dip-2759.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=hess-2759-08.H  modl2=$@-2.H  data2=mig-2759-08.H dip2=dip-2759.H hesp2=resv-picks.H var2=4d-var.H \
	60mov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=35 jmov=5 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.5 quant_m1=.25 quant_m2=.6 quant_m3=.55 ldip=y verb_dip=3 nang=30  eps_dip=0.02 destroy_nhlx=y \
	  nvar=1 lvdip=y \
	  eps1=60 epA1=15 epB1=20 epC1=30 \
	  lmd1=1. lmd2=.2 rho=.9999 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
inv-2: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=mig-2759-06.H dip1=dip-2759.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=hess-2759-08.H  modl2=$@-2.H  data2=mig-2759-08.H dip2=dip-2759.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=y verb=y mode=36 jmov=5 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.55 ldip=y verb_dip=3 nang=30  eps_dip=0.02 destroy_nhlx=y \
	  nvar=1 lvdip=y \
	  eps1=25 epA1=45 epB1=20 epC1=30 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
inv-3: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=mig-2759-06.H dip1=dip-2759.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=hess-2759-08.H  modl2=$@-2.H  data2=mig-2759-08.H dip2=dip-2759.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=y verb=y mode=36 jmov=5 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.55 ldip=y verb_dip=3 nang=30  eps_dip=0.02 destroy_nhlx=y \
	  nvar=1 lvdip=y \
	  eps1=120 epA1=45 epB1=20 epC1=30 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.4 \
	  halfhess=y \
	  report=$@.log
inv-4: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	Gpow gpow=4  < hes-2759-hesp-rat.H > hesp-2759-rat.H 
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=mig-2759-06.H dip1=dip-2759.H hesp1=resv-picks.H var1=4d-var.H wg1=hesp-2759-rat.H \
		hess2=hess-2759-08.H  modl2=$@-2.H  data2=mig-2759-08.H dip2=dip-2759.H hesp2=resv-picks.H var2=4d-var.H wg2=hesp-2759-rat.H \
	  adj=n inv=y verb=y mode=37 jmov=5 precond=y noreg=n niter=40 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.25 quant_m2=.6 quant_m3=.55 ldip=y verb_dip=3 nang=30  eps_dip=0.02 destroy_nhlx=y \
	  nvar=3 lvdip=y \
	  eps1=120 epA1=45 epB1=20 epC1=.1 epD1=.1 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.4 \
	  halfhess=y \
	  weight=y \
	  report=$@.log
inv-5: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	Window3d < picks3.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks3.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 | Transp reshape=23 > resv.H
	Gpow gpow=8  < hes-2759-hesp-rat.H > hesp-2759-rat.H 
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=mig-2759-06.H dip1=dip-2759.H hesp1=resv.H var1=4d-var.H wg1=hesp-2759-rat.H \
		hess2=hess-2759-08.H  modl2=$@-2.H  data2=mig-2759-08.H dip2=dip-2759.H hesp2=resv.H var2=4d-var.H wg2=hesp-2759-rat.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=38 jmov=5 precond=y noreg=n niter=15 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.95 quant_m1=.95 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=15  eps_dip=0.05 destroy_nhlx=y \
	  nvar=6 lvdip=y \
	  eps1=45 epA1=45 epB1=50 epC1=50 epD1=25 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=2 \
	  halfhess=y \
	  weight=y \
	  report=$@.log
inv-6: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	Window3d < picks4.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks4.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 | Transp reshape=1,3 > resv.H
	Gpow gpow=8  < hes-2759--rat.H > hesp-2759-rat.H 
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=mign-2759-06.H dip1=dip-2759.H hesp1=resv.H var1=4d-var.H wg1=hesp-2759-rat.H \
		hess2=hess-2759-08.H  modl2=$@-2.H  data2=mign-2759-08.H dip2=dip-2759.H hesp2=resv.H var2=4d-var.H wg2=hesp-2759-rat.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=38 jmov=5 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.45 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=15  eps_dip=0.05 destroy_nhlx=y \
	  nvar=6 lvdip=y \
	  eps1=60 epA1=45 epB1=50 epC1=60 epD1=25 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=2 \
	  halfhess=y \
	  weight=y \
	  report=$@.log
invo-6: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	Math file1=hesp-2759-rat.H exp="file1*0+1" > hesp0-2759-rat.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	Window3d < picks4.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks4.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 | Transp reshape=1,3 > resv.H
	Gpow gpow=8  < hes-2759-hesp-rat.H > hesp-2759-rat.H 
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=migno-2759-06.H dip1=dip-2759.H hesp1=resv.H var1=4d-var.H wg1=hesp0-2759-rat.H \
		hess2=hess-2759-06.H  modl2=$@-2.H  data2=migno-2759-08.H dip2=dip-2759.H hesp2=resv.H var2=4d-var.H wg2=hesp0-2759-rat.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=38 jmov=5 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.45 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=15  eps_dip=0.05 destroy_nhlx=y \
	  nvar=6 lvdip=y \
	  eps1=60 epA1=45 epB1=50 epC1=60 epD1=25 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=2 \
	  halfhess=y \
	  weight=y \
	  report=$@.log
inv-7: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	#Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	Window3d < picks4.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks4.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 | Transp reshape=1,3 > resv.H
	Gpow gpow=1  < hes-2759-hesp-rat.H > hesp-2759-rat.H 
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=mign-2759-06.H dip1=dip-2759.H 4dip1=4dip-2759.H hesp1=resv.H var1=4d-var.H 4var1=4d-var.H wg1=hesp-2759-rat.H \
		hess2=hess-2759-08.H  modl2=$@-2.H  data2=mign-2759-08.H dip2=dip-2759.H 4dip2=4dip-2759.H hesp2=resv.H var2=4d-var.H 4var2=4d-var.H wg2=hesp-2759-rat.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=39 jmov=5 precond=y noreg=n niter=45 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.45 quant_m2=.975 quant_m3=.975 quant_m4=.975 ldip=y verb_dip=3 nang=30  eps_dip=0.05 destroy_nhlx=y \
	  nvar=6 lvdip=y \
	  eps1=60 epA1=35 epB1=45 epC1=45 epD1=15 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=2 wpow=9 \
	  halfhess=y \
	  weight=y \
	  report=$@.log
picks4:
	Picks.x < test_dip2.H picks=4d-picks3.dat add=n | Scale  | Scale rscale=-1 | Math file1=in exp='(file1+1)' | Transp reshape=1,3 > $@.H 

#=============================
#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:
raw-fig-%:
	#Window3d < /data/sep/goayeni/workspace/norne-me-hx-06-$*/modl/norne-me-hx-06-$*-ang.H | Stack3d > $@-06.H 
	#Window3d < /data/sep/goayeni/workspace/norne-me-hx-08-$*/modl/norne-me-hx-08-$*-ang.H | Stack3d > $@-08.H 
	Grey color=i pclip=96 $(lab) < $@-06.H >/dev/null out=$R/$@-full-g-06.v; $(ps) $R/$@-full-g-06.v $R/$@-full-g-06.ps $(ps1)
	Grey color=G pclip=96 $(lab) < $@-06.H >/dev/null out=$R/$@-full-06.v  ; $(ps) $R/$@-full-06.v   $R/$@-full-06.ps $(ps1)
	Window3d min1=1550 max1=4005 n2=545 < $@-06.H | Grey color=i $(lab) > /dev/null out=$R/$@-g-06.v; $(ps) $R/$@-g-06.v $R/$@-g-06.ps $(ps1)
	Window3d min1=1550 max1=4005 n2=545 < $@-06.H | Grey color=G $(lab) > /dev/null out=$R/$@-06.v  ; $(ps) $R/$@-06.v   $R/$@-06.ps $(ps1)
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Grey color=i pclip=99.9 $(lab) >/dev/null out=$R/$@-full-g-4d.v ; $(ps) $R/$@-full-g-4d.v $R/$@-full-g-4d.ps $(ps1)
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-full-4d.v   ; $(ps) $R/$@-full-4d.v   $R/$@-full-4d.ps $(ps1)
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=545 | Grey color=i pclip=99.9 $(lab) >/dev/null out=$R/$@-g-4d.v; $(ps) $R/$@-g-4d.v $R/$@-g-4d.ps $(ps1)
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=545 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v  ; $(ps) $R/$@-4d.v   $R/$@-4d.ps $(ps1)
	touch $@
shft-fig-%: raw-fig-%
	#Window3d < /data/sep/goayeni/workspace/norne-me-hx-08-$*/modl/norne-me-hx-08-$*-ang-s.H | Stack3d > $@-08.H 
	Math file1=raw-fig-$*-06.H file2=$@-08.H exp=file2-file1 | 				  	 Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-full-4d.v;  $(ps) $R/$@-full-4d.v $R/$@-full-4d.ps $(ps1)
	Math file1=raw-fig-$*-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=545 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v;	      $(ps) $R/$@-4d.v      $R/$@-4d.ps $(ps1)
	touch $@
mult-fig-%: shft-fig-%
	Math file1=$(wk)/norne-grad-negpos-$*-stk-afmult-06.H file2=$(wk)/norne-grad-negpos-$*-stk-afmult-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=545 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
warp-fig-%: mult-fig-%
	Math file1=$(wk)/norne-grad-flat-warp-$*-06.H file2=$(wk)/norne-grad-flat-warp-$*-08-s.H exp=file2-file1 | Stack3d | Transp | Window3d min1=1550 max1=4005 n2=545 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
rwarp-fig-%: warp-fig-%
	Math file1=$(wk)/mig-norne-grad-flat-warp-$*-06.H file2=$(wk)/mig-shift-norne-grad-flat-warp-$*-08-s.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
amp-fig-%: rwarp-fig-%
	Math file1=migno-$*-06.H file2=migno-$*-08.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
inv-fig-%: amp-fig-%
	Math file1=invo-6-1.H file2=invo-6-2.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@



#data
dg1 = sfgrey3 titlesz=8 title=  label1=time unit1=s label2=sx unit2=m label3=offset unit3=m frame1=211 frame2=235 frame3=7  point1=.75 point2=.8 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color= < 
dg2 = sfgrey3 titlesz=8 title=  label1=time unit1=s label2=sx unit2=m label3=offset unit3=m frame1=211 frame2=255 frame3=7  point1=.75 point2=.8 titlesz=8 title=  wantcoordlabel=-1 labelsz=5 wantaxes= color= < 
#raw
dat-fig-%:
	#Window3d min3=500 n3=520 max_memory=1000 max3=12000 j1=2 n1=616 < /data/sep/goayeni/norne-prestack/sail-line-08-2d-2759.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@.T
	Window3d min3=500 n3=520 max_memory=1000 max3=12000 j1=2 n1=616 < /data/sep/goayeni/norne-prestack/sail-line-06-2d-2759-half-rmo.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@-rmo0.T
	#Window3d min3=500 n3=520 max_memory=1000 max3=12000 j1=2 n1=616 < /data/sep/goayeni/norne-prestack/sail-line-08-2d-2759-half-rmo.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@-rmo.T
	#Window3d min3=500 n3=520 max_memory=1000 max3=12000 j1=2 n1=616 < /data/sep/goayeni/norne-prestack/sail-hole-line-08-2d-2759.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@-hole.T
	#Window3d min3=500 n3=520 max_memory=1000 max3=12000 j1=2 n1=616 < /data/sep/goayeni/norne-prestack/sail-hole-line-08-2d-2759-half-rmo.H | Transp plane=23 | Grey gainpanel=a eout=1 pclip=96 | Reverse which=4 > $@-hole-rmo.T
	$(dg1) $@.T 	     > $R/$@.v;  	 $(ps) $R/$@.v 	         $R/$@.ps $(ps1)
	$(dg1) $@-rmo0.T     > $R/$@-rmo0.v;     $(ps) $R/$@-rmo0.v      $R/$@-rmo0.ps $(ps1)
	$(dg1) $@-rmo.T      > $R/$@-rmo.v;      $(ps) $R/$@-rmo.v       $R/$@-rmo.ps $(ps1)
	$(dg1) $@-hole.T     > $R/$@-hole.v;     $(ps) $R/$@-hole.v      $R/$@-hole.ps $(ps1)
	$(dg1) $@-hole-rmo.T > $R/$@-hole-rmo.v; $(ps) $R/$@-hole-rmo.v  $R/$@-hole-rmo.ps $(ps1)
	$(dg2) $@-hole-rmo.T > $R/$@-hole-rmo2.v;$(ps) $R/$@-hole-rmo2.v $R/$@-hole-rmo2.ps $(ps1)


#Hessian
#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
#vel
vel-fig-%:
	Window3d min1=0 max1=13025 < $(wk)/vel-norne-hx-mig-08-2759.H | Transp | Grey color=j newclip=1 wantscalebar=y >/dev/null out=$R/$@.v; $(ps) $R/$@.v $R/$@.ps $(ps1)



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 < 
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< 
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< 
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< 
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< 
#shifts

hole-raw-fig-%:
	#Window3d < /data/sep/goayeni/workspace/norne-me-hx-06-$*/modl/norne-me-hx-06-$*-ang.H | Stack3d > $@-06.H 
	#Window3d < /data/sep/goayeni/workspace/norne-hole-sxgx-me-hx-08-$*/modl/norne-hole-sxgx-me-hx-08-$*-ang.H | Stack3d > $@-08.H 
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=545 | Grey color=i pclip=99.9 $(lab) >/dev/null out=$R/$@-g-4d.v; $(ps) $R/$@-g-4d.v $R/$@-g-4d.ps $(ps1) &
	Math file1=$@-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=545 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v  ; $(ps) $R/$@-4d.v   $R/$@-4d.ps $(ps1)
	touch $@

hole-shft-fig-%: hole-raw-fig-%
	Window3d min1=1550 max1=4005 min4= n4=545 < /data/sep/goayeni/workspace/norne-me-hx-06-$*/modl/norne-me-hx-06-$*-ang.H			    | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-06.T &  
	Window3d min1=1550 max1=4005 min4= n4=545 < /data/sep/goayeni/workspace/norne-hole-sxgx-me-hx-08-$*/modl/norne-hole-sxgx-me-hx-08-$*-ang.H   | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-08.T 
	Window3d min1=1550 max1=4005 min4= n4=545 < /data/sep/goayeni/workspace/norne-hole-sxgx-me-hx-08-$*/modl/norne-hole-sxgx-me-hx-08-$*-ang-s.H | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-08-s.T 
	$(ag1) $@-06.T > $R/$@-06.v; $(ps) $R/$@-06.v   $R/$@-06.ps $(ps1)
	$(ag1) $@-08.T > $R/$@-08.v; $(ps) $R/$@-08.v   $R/$@-08.ps $(ps1)
	$(ag1) $@-08-s.T > $R/$@-08-s.v; $(ps) $R/$@-08-s.v   $R/$@-08-s.ps $(ps1)
	#Window3d n4=1 min3=1550 max3=4005 min1=0 n1=545 < $(wk)/mod-hole-sxgx-2759-2-ts.H | Transp reshape=2,3,4 | Grey eout=1 gainpanel=a pclip=99.5 > $@-ts.T 
	Window3d n4=1 min3=1550 max3=4005 min1=0 n1=545 < $(wk)/mod-hole-sxgx-2759-2-ts.H | Stack3d | Math file1=in exp="file1/121" | Transp | Grey newclip=1 eclip=6 bclip=-6                gainpanel=a pclip=99.5 color=j>/dev/null out=$R/$@-ts-stk.v ; $(ps) $R/$@-ts-stk.v   $R/$@-ts-stk.ps  $(ps1)
	Window3d n4=1 min3=1550 max3=4005 min1=0 n1=545 < $(wk)/mod-hole-sxgx-2759-2-ts.H | Stack3d | Math file1=in exp="file1/121" | Transp | Grey newclip=1 eclip=6 bclip=-6 wantscalebar=y gainpanel=a pclip=99.5 color=j>/dev/null out=$R/$@-ts-stk2.v; $(ps) $R/$@-ts-stk2.v  $R/$@-ts-stk2.ps $(ps1)
	$(ag2) $@-ts.T > $R/$@-ts.v; $(ps) $R/$@-ts.v   $R/$@-ts.ps $(ps1)
	$(cg3) $@-ts.T > /dev/null out=$R/$@-ts2.v; $(ps) $R/$@-ts2.v   $R/$@-ts2.ps $(ps1)
	Window3d < /data/sep/goayeni/workspace/norne-hole-sxgx-me-hx-08-$*/modl/norne-hole-sxgx-me-hx-08-$*-ang-s.H | Stack3d > $@-08.H 
	Math file1=hole-raw-fig-$*-06.H file2=$@-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=545 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v;	      $(ps) $R/$@-4d.v      $R/$@-4d.ps $(ps1)
	touch $@
#mult
hole-mult-fig-%: hole-shft-fig-%
	Window3d max1=4005 < /data/sep/goayeni/workspace/multiples3/norne-two-pos-hole-sxgx-grad-2759/modl/qm0.5-qd0.998-eps1.25.modh-env-1.T > $@-1.T 
	$(ag4)  $@-1.T > $R/$@-06-modl1.v ; $(ps) $R/$@-06-modl1.v $R/$@-06-modl1.ps $(ps1) &
	$(ag5)  $@-1.T > $R/$@-06-modl2.v ; $(ps) $R/$@-06-modl2.v $R/$@-06-modl2.ps $(ps1) &
	Window3d min1=1550 max1=4005 n3=545 < $(wk)/norne-hole-sxgx-grad-negpos-$*-mult-06.H | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-06.T &
	Window3d min1=1550 max1=4005 n3=545 < $(wk)/norne-hole-sxgx-grad-negpos-$*-mult-08.H | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-08.T &
	Window3d min1=1550 max1=4005 n3=545 < $(wk)/norne-hole-sxgx-grad-negpos-$*-b4mult-06.H | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-b4mult-06.T &  
	Window3d min1=1550 max1=4005 n3=545 < $(wk)/norne-hole-sxgx-grad-negpos-$*-b4mult-08.H | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-b4mult-08.T &
	Window3d min1=1550 max1=4005 n3=545 < $(wk)/norne-hole-sxgx-grad-negpos-$*-afmult-06.H | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-afmult-06.T
	Window3d min1=1550 max1=4005 n3=545 < $(wk)/norne-hole-sxgx-grad-negpos-$*-afmult-08.H | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-afmult-08.T
	$(ag3) $@-06.T > $R/$@-06.v; $(ps) $R/$@-06.v   $R/$@-06.ps $(ps1) &
	$(ag3) $@-08.T > $R/$@-08.v; $(ps) $R/$@-08.v   $R/$@-08.ps $(ps1) &
	$(ag3) $@-b4mult-06.T > $R/$@-b4mult-06.v; $(ps) $R/$@-b4mult-06.v   $R/$@-b4mult-06.ps $(ps1) &
	$(ag3) $@-b4mult-08.T > $R/$@-b4mult-08.v; $(ps) $R/$@-b4mult-08.v   $R/$@-b4mult-08.ps $(ps1) &
	$(ag3) $@-afmult-06.T > $R/$@-afmult-06.v; $(ps) $R/$@-afmult-06.v   $R/$@-afmult-06.ps $(ps1) &
	$(ag3) $@-afmult-08.T > $R/$@-afmult-08.v; $(ps) $R/$@-afmult-08.v   $R/$@-afmult-08.ps $(ps1)
	Math file1=$(wk)/norne-hole-sxgx-grad-negpos-$*-stk-afmult-06.H file2=$(wk)/norne-hole-sxgx-grad-negpos-$*-stk-afmult-08.H exp=file2-file1 | Window3d min1=1550 max1=4005 n2=545 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
#flat
hole-flat-fig-%: hole-mult-fig-%
	#Window3d min1=1550 max1=4005 n3=545 < $(wk)/norne-hole-sxgx-grad-flat-negpos-06-2759-s.H | Transp plane=23 | Grey eout=1 gainpanel=a pclip=99 > $@-06.T 
	$(ag3) $@-06.T > $R/$@-06.v; $(ps) $R/$@-06.v   $R/$@-06.ps $(ps1) &
	#Window3d min1=1550 max1=4005 n3=545 < $(wk)/norne-hole-sxgx-grad-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; $(ps) $R/$@-06-ts.v   $R/$@-06-ts.ps $(ps1) &
	$(cg3) $@-06-ts.T >/dev/null out=$R/$@-06-ts2.v; $(ps) $R/$@-06-ts2.v  $R/$@-06-ts2.ps $(ps1) &
	touch $@
#warp
hole-warp-fig-%: #shft-fig-%
	#Window3d min3=1550 max3=4005 n1=545     < $(wk)/norne-hole-sxgx-grad-flat-warp-2759-08-s.H  | Transp reshape=2,3,4 | Grey eout=1 gainpanel=a pclip=99 > $@-08.T 
	$(ag3) $@-08.T > $R/$@-08.v; $(ps) $R/$@-08.v   $R/$@-08.ps $(ps1) &
	#Window3d min3=1550 max3=4005 n1=545 n4=1< $(wk)/norne-hole-sxgx-grad-flat-warp-2759-08-ts.H | Transp reshape=2,3,4 |  Grey eout=1 gainpanel=a pclip=99 > $@-08-ts.T 
	$(ag2) $@-08-ts.T > 		 $R/$@-08-ts.v; $(ps) $R/$@-08-ts.v    $R/$@-08-ts.ps $(ps1) &
	$(cg3) $@-08-ts.T >/dev/null out=$R/$@-08-ts2.v; $(ps) $R/$@-08-ts2.v  $R/$@-08-ts2.ps $(ps1) &
	Math file1=$(wk)/norne-hole-sxgx-grad-flat-warp-$*-06.H file2=$(wk)/norne-hole-sxgx-grad-flat-warp-$*-08-s.H exp=file2-file1 | Stack3d | Transp | Window3d min1=1550 max1=4005 n2=545 | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
#rwarp
hole-rwarp-fig-%:
	Window3d min3=1550 max3= 4005 min1=0 n1=545 n4=1 < $(wk)/mig-shift-norne-hole-sxgx-grad-flat-warp-$*-08-ts.H | Transp | Grey color=j newclip=1 eclip=12 bclip=-12 >/dev/null out=$R/$@-ts.v; $(ps) $R/$@-ts.v  $R/$@-ts.ps $(ps1) &
	Window3d min3=1550 max3= 4005 min1=0 n1=545 n4=1 < $(wk)/mig-shift-norne-hole-sxgx-grad-flat-warp-$*-08-ts.H | Transp | Grey color=j newclip=1 eclip=12 bclip=-12 wantscalebar=y >/dev/null out=$R/$@-ts2.v; $(ps) $R/$@-ts2.v  $R/$@-ts2.ps $(ps1) &
	Math file1=$(wk)/mig-norne-hole-sxgx-grad-flat-warp-2759-06.H file2=$(wk)/mig-shift-norne-hole-sxgx-grad-flat-warp-2759-08-s.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
#amp
hole-amp-fig-%: 
	Window3d < mign-2759-06.H min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=95. $(lab) >/dev/null out=$R/$@-06.v ; $(ps) $R/$@-06.v $R/$@-06.ps $(ps1)
	Window3d < mign-2759-08.H min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=95. $(lab) >/dev/null out=$R/$@-08.v ; $(ps) $R/$@-08.v $R/$@-08.ps $(ps1)
	Math file1=mign-2759-06.H file2=mign-2759-08.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
#inversion
hole-inv-fig-%: 
	Window3d < inv-6-1.H min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=95 $(lab) >/dev/null out=$R/$@-06.v ; $(ps) $R/$@-06.v $R/$@-06.ps $(ps1)
	Window3d < inv-6-2.H min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=95 $(lab) >/dev/null out=$R/$@-08.v ; $(ps) $R/$@-08.v $R/$@-08.ps $(ps1)
	Math file1=inv-6-1.H file2=inv-6-2.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; $(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@
hole-inv7-fig-%: 
	Window3d < inv-7-1.H min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=95 $(lab) >/dev/null out=$R/$@-06.v ;# $(ps) $R/$@-06.v $R/$@-06.ps $(ps1)
	Window3d < inv-7-2.H min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=95 $(lab) >/dev/null out=$R/$@-08.v ;# $(ps) $R/$@-08.v $R/$@-08.ps $(ps1)
	Math file1=inv-7-1.H file2=inv-7-2.H exp=file2-file1 | Window3d min3=1550 max3= 4005 n1=545 | Transp | Grey color=G pclip=99.9 $(lab) >/dev/null out=$R/$@-4d.v ; #$(ps) $R/$@-4d.v $R/$@-4d.ps $(ps1)
	touch $@





#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

 
hess-dmult-2759: 
	Window3d < $(hess-dmult-2759)   n5=31 min3=-150 n3=13 min8=0 n8=460 squeeze=n  max_memory=1000 > $@-06.H  ; echo d2=25 >> $@-06.H   
	Window3d < $(hess-h-dmult-2759) n5=31 min3=-150 n3=13 min8=0 n8=460 squeeze=n  max_memory=1000 > $@-08.H  ; echo d2=25 >> $@-08.H
	touch $@
hes-dmult-2759:
	Window3d min3=0 min5=0 n3=1 n5=1 min8=0 n8=460 < $(hess-dmult-2759)   | Transp plane=23 > $@-hes1.H  
	Window3d min3=0 min5=0 n3=1 n5=1 min8=0 n8=460 < $(hess-h-dmult-2759) | Transp plane=23 > $@-hes2.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp=file1/file2 > $@-hesp-rat0.H
	Math file1=$@-hesp-rat0.H exp="file1/`Attr param=1 < $@-hesp-rat0.H |Get parform=n minval`" > $@-hesp-rat.H
	Math file1=$@-hes1.H file2=$@-hes2.H exp=file1-file2 > $@-hesp-dif.H 
	touch $@
migo-dmult-2759:
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(base-dmult-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3,4 | Scale rscale=1 > $@-06.H  ; echo d2=25 >> $@-06.H 
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(moni-dmult-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3,4 | Scale rscale=1 > $@-08.H  ; echo d2=25 >> $@-08.H 
	touch $@
migno-dmult-2759: #shifted normalized
	Window3d min1=0 n1=460 min3=1500 max3=2000 < $(base-dmult-2759)  squeeze=n  > junk1-$@.H 
	Window3d min1=0 n1=460 min3=1500 max3=2000 < $(monin-dmult-2759) squeeze=n  > junk2-$@.H 
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(base-dmult-2759)  squeeze=n  | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3,4 | Math file1=in exp="file1*`Attr param=1 < junk2-$@.H | Get rms parform=n `" > $@-06.H  ; echo d2=25 >> $@-06.H 
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(monin-dmult-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3,4 | Math file1=in exp="file1*`Attr param=1 < junk1-$@.H | Get rms parform=n `" > $@-08.H  ; echo d2=25 >> $@-08.H
	touch $@

mig-dmult-2759:
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(base-h-dmult-2759)  squeeze=n  | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3,4 | Scale rscale=1 > $@-06.H  ; echo d2=25 >> $@-06.H 
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(monin-h-dmult-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3,4 | Scale rscale=1 > $@-08.H  ; echo d2=25 >> $@-08.H 
	touch $@
mign-dmult-2759: #shifted normalized
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(base-dmult-2759)    squeeze=n  > junk1-$@.H 
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(monin-h-dmult-2759) squeeze=n  > junk2-$@.H 
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(base-dmult-2759)    squeeze=n  | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3,4 | Math file1=in exp="file1*`Replace.x opt=3 value=0 cutoff=1.001 replace=hes-dmult-2759-hesp-rat.H < junk2-$@.H | Attr param=1 | Get rms parform=n `" > $@-06.H  ; echo d2=25 >> $@-06.H 
	Window3d min1=0 n1=460 min3=1500 n3=501 < $(monin-h-dmult-2759) squeeze=n  | Window3d | Transp | Bandpass flo=0.001 | Transp reshape=1,3,4 | Math file1=in exp="file1*`Replace.x opt=3 value=0 cutoff=1.001 replace=hes-dmult-2759-hesp-rat.H < junk1-$@.H | Attr param=1 | Get rms parform=n `" > $@-08.H  ; echo d2=25 >> $@-08.H
	touch $@
dip-dmult-2759:
	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  
	#Dip.x < $@-modl.H  method=sergey_s eps=0.002 eps2=0.002 verb=y niter=20 nl_iter=20 | Median_me.x nodes=8 node=8 wind1=2 wind2=2  | Smooth rect1=2 rect2=2 > $@.H
	/home/goayeni/Research/Source/Dips/Dip/Sdip rect1=3 rect2=2 < $@-modl.H  | Smooth rect1=2 rect2=2 > $@.H
	killwave.x infile=$@-modl.H verb=6 eps=0.01 verb1=4 nfilt=3 nang=45 dip=$@.H  destroy=y outfile=$@-modl-des.H rand_in=n  > $@ & 
	killwave.x infile=$@-modl.H verb=6 eps=0.25 verb1=4 nfilt=2 nang=45 dip=$@.H destroy=n outfile=$@-modl-smt.H rand_in=n > $@  
	Transp reshape=1,3,4 < $@.H > $@-t.H
	touch $@
4dip-dmult-2759:
	Math file1=inv-6-1.H file2=inv-6-2.H exp=file2-file1 | Window3d | 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=2 rect2=2 < $@-modl.H  | Smooth rect1=2 rect2=2 > $@.H
	killwave.x infile=$@-modl.H verb=6 eps=0.1 verb1=4 nfilt=3 nang=45 dip=$@.H  destroy=n outfile=$@-modl-smt1.H rand_in=n  > $@ 
	Transp reshape=1,3 < $@.H > $@-t.H
	touch $@
mod-%: 
	$(msh)
	make
	Spike n1=501 n2=460 nsp=7 k1=20,60,120,200,250,300,350 k2= | Scale rscale=1 | Transp reshape=1,3 > $@-ref1.H ; echo o1=00 d1=25 o2=0 d2=25 o3=1500 d3=5 >> $@-ref1.H
	Spike n1=501 n2=460 nsp=7 k1=20,60,120,200,250,300,350 k2= | Scale rscale=1 | Transp reshape=1,3 > $@-ref2.H ; echo o1=00 d1=25 o2=0 d2=25 o3=1500 d3=5 >> $@-ref2.H
	$(HJM)  \
		hess1=hess-dmult-2759-08.H  modl1=$@-ref1.H  data1=mod-dmult-2759-06.H dip1=dip-dmult-2759.H hesp1=resv-picks.H var1=4d-var.H \
		hess2=hess-dmult-2759-08.H  modl2=$@-ref2.H  data2=mod-dmult-2759-08.H dip2=dip-dmult-2759.H hesp2=resv-picks.H var2=4d-var.H \
	  adj=n inv=n verb=y mode=26 jmov=1 precond=y noreg=n niter=2 nsurv=2 nodes=15 15  node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.75 quant_m=0.75 quant_m1=.75 ldip=n verb_dip=3 nang=3  eps_dip=0.1 destroy_nhlx=y eps1=160 lmd1=1. lmd2=.2 rho=.99 gpow=0. halfhess=y

dinv-1: test_dip
	$(msh) 
	make
	Window3d < $<.H > $<-t.H
	Window3d < resv-picks.H | Transp | Smooth rect1=30 rect2=5 | Math file1=in exp=file1-1| Scale rscale=-1 | Math file1=in exp=file1+1 | Scale rscale=50   > 4d-var.H
	Window3d < picks4.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks4.H |  Transp | Smooth rect1=4 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 | Transp reshape=1,3 > resv.H
	Gpow gpow=8  < hes-2759-hesp-rat.H > hesp-2759-rat.H 
	$(HJM)  \
		hess1=hess-2759-06.H  modl1=$@-1.H  data1=mign-2759-06.H dip1=dip-2759.H hesp1=resv.H var1=4d-var.H wg1=hesp-2759-rat.H \
		hess2=hess-2759-08.H  modl2=$@-2.H  data2=mign-2759-08.H dip2=dip-2759.H hesp2=resv.H var2=4d-var.H wg2=hesp-2759-rat.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=38 jmov=5 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.45 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=15  eps_dip=0.05 destroy_nhlx=y \
	  nvar=6 lvdip=y \
	  eps1=60 epA1=45 epB1=50 epC1=60 epD1=25 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=2 \
	  halfhess=y \
	  weight=y \
	  report=$@.log
dinv-2: picks-dmult4	
	$(msh) 
	make
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=5 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=5 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=1 | Transp reshape=1,3,4 > resv.H
	Gpow gpow=1  < hes-dmult-2759-hesp-rat.H > hesp-dmult-2759-rat.H
	Math file1=dip-dmult-2759.H exp="0*file1-0" > dip-dmult-2759-t.H 
	$(HJM)  \
		hess1=hess-dmult-2759-06.H  modl1=$@-1.H  data1=mign-dmult-2759-06.H dip1=dip-dmult-2759.H hesp1=resv.H var1=4d-var.H wg1=hesp-dmult-2759-rat.H \
		hess2=hess-dmult-2759-08.H  modl2=$@-2.H  data2=mign-dmult-2759-08.H dip2=dip-dmult-2759.H hesp2=resv.H var2=4d-var.H wg2=hesp-dmult-2759-rat.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=38 jmov=5 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.99 quant_m=0.75 quant_m1=.25 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=25  eps_dip=0.05 destroy_nhlx=y \
	  nvar=6 lvdip=y \
	  eps1=25 epA1=6 epB1=20.0008  epC1=10.0000020 epD1=5 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.4 wpow=1 \
	  halfhess=y \
	  weight=y \
	  report=$@.log
#	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.99 quant_m=0.75 quant_m1=.75 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=25  eps_dip=0.05 destroy_nhlx=y \

dinv-3: picks-dmult4	
	$(msh) 
	make
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=5 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=5 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=.6 | Transp reshape=1,3,4 > resv.H
	Gpow gpow=1  < hes-dmult-2759-hesp-rat.H > hesp-dmult-2759-rat.H
	Math file1=dip-dmult-2759.H exp="0*file1-0" > dip-dmult-2759-t.H 
	$(HJM)  \
		hess1=hess-dmult-2759-06.H  modl1=$@-1.H  data1=mign-dmult-2759-06.H dip1=dip-dmult-2759.H hesp1=resv.H var1=4d-var.H wg1=hesp-dmult-2759-rat.H \
		hess2=hess-dmult-2759-08.H  modl2=$@-2.H  data2=mign-dmult-2759-08.H dip2=dip-dmult-2759.H hesp2=resv.H var2=4d-var.H wg2=hesp-dmult-2759-rat.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=38 jmov=5 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.99 quant_m=0.75 quant_m1=.25 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=25  eps_dip=0.05 destroy_nhlx=y \
	  nvar=6 lvdip=y \
	  eps1=25 epA1=6 epB1=20.0008  epC1=10.0000020 epD1=5 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=1.4 wpow=1 \
	  halfhess=y \
	  weight=y \
	  report=$@.log

dinvo-2:	
	$(msh) 
	make
	Math file1=hesp-dmult-2759-rat.H exp="file1*0+1" > hesp0-dmult-2759-rat.H
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=6 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=6 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 | Transp reshape=1,3,4 > resv.H
	Gpow gpow=8  < hes-dmult-2759-hesp-rat.H > hesp-dmult-2759-rat.H 
	$(HJM)  \
		hess1=hess-dmult-2759-06.H  modl1=$@-1.H  data1=migno-dmult-2759-06.H dip1=dip-dmult-2759.H hesp1=resv.H var1=4d-var.H wg1=hesp0-dmult-2759-rat.H \
		hess2=hess-dmult-2759-06.H  modl2=$@-2.H  data2=migno-dmult-2759-08.H dip2=dip-dmult-2759.H hesp2=resv.H var2=4d-var.H wg2=hesp0-dmult-2759-rat.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=38 jmov=5 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.45 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=15  eps_dip=0.05 destroy_nhlx=y \
	  nvar=6 lvdip=y \
	  eps1=6 epA1=3 epB1=1 epC1=10 epD1=5 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=2 \
	  halfhess=y \
	  weight=y \
	  report=$@.log




picks-dmult1:
	Picks.x < dip-dmult-2759.H picks=4d-dmult-picks.dat  add=n | Scale  | Scale rscale=-1 | Math file1=in exp='(file1+1)' | Transp reshape=1,3,4 > $@.H 
picks-dmult2:
	Picks.x < dip-dmult-2759.H picks=4d-dmult-picks2.dat add=n | Scale  | Scale rscale=-1 | Math file1=in exp='(file1+1)' | Transp reshape=1,3,4 > $@.H 
picks-dmult3:
	Picks.x < dip-dmult-2759.H picks=4d-dmult-picks3.dat add=n | Scale  | Scale rscale=-1 | Math file1=in exp='(file1+1)' | Transp reshape=1,3,4 > $@.H 
picks-dmult4:
	Picks.x < dip-dmult-2759.H picks=4d-dmult-picks4.dat add=n | Scale  | Scale rscale=-1 | Math file1=in exp='(file1+1)' | Transp reshape=1,3,4 > $@.H 



lab1 = label1='z(m)' label2='distance(m)' crowd2=0.4
c4d= newclip=1 bclip=-6000 eclip=6000 
#figures----
#raw
dmult-raw-fig-%:
	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  | Transp plane=23 > $@-06.T ; $(ag3) $@-06.T > $R/$@-06.v titlesz=8 title="Raw 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  | 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 
	Grey color=i pclip=96 $(lab) < $@-06-stk.H >/dev/null out=$R/$@-full-g-06.v; cd $R; make $@-full-g-06.pdf
	Grey color=G pclip=96 $(lab) < $@-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 $(lab) >/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 $(c4d) $(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 $(c4d) $(lab1) titlesz=8 title="4d image: raw" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf   
	touch $@
#dmult
dmult-dmult-fig-%: dmult-raw-fig-%
	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 $(c4d) $(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 $(c4d) $(lab1) titlesz=8 title="4d image: after radon demultiple" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf   
	touch $@
#amp
dmult-amp-fig-%: dmult-dmult-fig-% 
	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. $(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. $(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 $(c4d) $(lab1) titlesz=8 title="4d image: after amplitude balancing" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf 
	touch $@

#flat
dmult-flat-fig-%: dmult-amp-fig-%
	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  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  &
	touch $@
#warp
dmult-warp-fig-%: dmult-flat-fig-%
	#Window3d min3=1550 max3=4005 n1=445     < $(wk)/norne-dmult-flat-warp-2759-08.H  | Transp reshape=2,3,4 | 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,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-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 > $@-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-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 $(c4d) $(lab1) titlesz=8 title="After RMO + warping">/dev/null out=$R/$@-4d.v ;cd $R; make $@-4d.pdf 
	touch $@
#rwarp
dmult-rwarp-fig-%: dmult-warp-fig-%
	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                >/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 >/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 $(c4d) $(lab1) titlesz=8 title="After RMO + (Pre+Post stack) warping">/dev/null out=$R/$@-4d.v ;cd $R;  make $@-4d.pdf 
	touch $@
#inv
dmult-inv-fig-%: dmult-rwarp-fig-% 
	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=99.999 $(lab1) titlesz=8 title="After inversion" >/dev/null out=$R/$@-4d.v ; cd $R; make  $@-4d.pdf 
	touch $@

#Hessian
#diag and fft
hess-dmult-fig-%:
	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 wantscalebar=y color=j newclip=1 eclip=1 bclip=0.2 color= polarity=-1 >/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 wantscalebar=y color=j newclip=1 eclip=1 bclip=0.2 		       >/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 color=j newclip=1 >/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 color=j newclip=1 >/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 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 < $(hess-dmult-2759)    |  Transp  | Interp d2out=5  > $@-offd-06.H; 
	Window3d min8=2600 n8=1 min10=2600 n10=1 < $(hess-h-dmult-2759)  |  Transp  | Interp d2out=5  > $@-offd-08.H;
	Math file1=$@-offd-06.H file2=$@-offd-08.H exp=file2-file1 |  Grey title=' ' newclip=1 eclip=`Attr param=1 < $@-offd-08.H |Get parform=n maxval` bclip=-`Attr param=1 < $@-offd-08.H |Get parform=n maxval` >/dev/null out=$R/$@-offd-diff.v; cd $R; make  $@-offd-diff.pdf  
	Grey < $@-offd-06.H title=' ' newclip=1 eclip=`Attr param=1 < $@-offd-08.H |Get parform=n maxval` bclip=-`Attr param=1 < $@-offd-08.H |Get parform=n maxval` >/dev/null out=$R/$@-offd-06.v; cd $R; make  $@-offd-06.pdf  
	Grey < $@-offd-08.H title=' ' newclip=1 eclip=`Attr param=1 < $@-offd-08.H |Get parform=n maxval` bclip=-`Attr param=1 < $@-offd-08.H |Get parform=n maxval` >/dev/null out=$R/$@-offd-08.v; cd $R; make  $@-offd-08.pdf   
	Window3d min1=-0.02505 max1=0.0001 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-06.H   | Grey color=j newclip=1 wantscalebar=y eclip=800 bclip=0 >/dev/null out=$R/$@-fft-06.v; cd $R; make  $@-fft-06.pdf  
	Window3d min1=-0.02505 max1=0.0001 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-08.H   | Grey color=j newclip=1 wantscalebar=y eclip=800 bclip=0 >/dev/null out=$R/$@-fft-08.v; cd $R; make  $@-fft-08.pdf  
	Window3d min1=-0.02505 max1=0.0001 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-diff.H | Grey color=j newclip=1 wantscalebar=y eclip=800 bclip=0 >/dev/null out=$R/$@-fft-diff.v; cd $R; make $@-fft-diff.pdf  
	Window3d min1=-0.02505 max1=0.0001 min1=-0.026 max1=0.0261 < $(mt)/hess-dmult-fft-06.H   > junk$@-1.H 
	Window3d min1=-0.02505 max1=0.0001 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 wantscalebar=y color=j newclip=1 eclip=1 bclip=0.05  >/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 wantscalebar=y color=j newclip=1 eclip=1 bclip=0.05  >/dev/null out=$R/$@-fft-rat.v   ; cd $R;make  $@-fft-rat.pdf   

#
##
#Figures======holed
dmult-hole-raw-fig-%:
	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 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 pclip=98.2 $(lab1) titlesz=8 title="4d image: raw" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf   
	touch $@
#dmult
dmult-hole-dmult-fig-%: dmult-hole-raw-fi-%
	#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 $(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 $(lab1) titlesz=8 title="4d image: after radon demultiple" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf   
	touch $@
#amp
dmult-hole-amp-fig-%: dmult-hole-dmult-fig-% 
	#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 $(lab1) titlesz=8 title="4d image: after amplitude balancing" >/dev/null out=$R/$@-4d.v ; cd $R; make $@-4d.pdf 
	touch $@

#flat
dmult-hole-flat-fig-%: dmult-hole-amp-fig-%
	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  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  &
	touch $@
#warp
dmult-hole-warp-fig-%: dmult-hole-flat-fig-%
	#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 > $@-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 > $@-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 $(lab1) titlesz=8 title="After RMO + warping">/dev/null out=$R/$@-4d.v ;cd $R; make $@-4d.pdf 
	touch $@
#rwarp
dmult-hole-rwarp-fig-%: dmult-hole-warp-fig-%
	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 $(lab1) titlesz=8 title="After RMO + (Pre+Post-stack) warping">/dev/null out=$R/$@-4d.v ;cd $R;  make $@-4d.pdf 
	touch $@
#inv
dmult-hole-inv-fig-%: dmult-hole-rwarp-fig-% 
	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 
	Window3d < dinv-3-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-2.v; cd $R; make  $@-06-2.pdf 
	Window3d < dinv-3-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-2.v; cd $R; make  $@-08-2.pdf 
	Math file1=dinv-3-1.H file2=dinv-3-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-2.v ; cd $R; make  $@-4d-2.pdf 
	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= < 
dat-dmult-fig-%:
	#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; 
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-fig-%:
	#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; 



#3d
3d-hess:
	Window3d squeeze=n min8=1000 n10=50 n8=50 < hess-dmult-2759-06.H > $@1.H
	Pad end9=50 end4=24 extend=1 < $@1.H > $@.H
	echo o4=-300 >> $@.H 
	touch $@

#3d gauss
3d-gauss-hess:
	Spike n1=63 n2=13 n3=13 nsp=1 k1=31 k2=7 k3=7 | Transp reshape=1,3 |  Triangle.x wind1=4 wind2=4 wind3=4 | Scale | Scale rscale=3.0   > $@-0.H ;  
	Spike n1=63 n2=13 n3=13 nsp=1 k1=31 k2=7 k3=7 | Transp reshape=1,3 |  Triangle.x wind1=6 wind2=6 wind3=6 | Scale | Scale rscale=-1.0  > $@-1.H ;  
	Math file1=$@-0.H file2=$@-1.H exp=file1+file2 | Triangle.x wind1=2 wind2=2 wind3=2 > $@-2.H ;  
	Transp reshape=3,5,7 < $@-2.H | Window3d squeeze=n n5=31 > $@-3.H  	
	echo o1=00 o2=00 o3=-150 o4=-150 o5=-150 o6=00 o7=00 o8=1000 o9=00 o10=1500 >> $@-3.H
	echo d1=25 d2=25 d3=25   d4=25   d5=5    d6=25 d7=25 d8=25   d9=25 d10=5    >> $@-3.H
	Pad extend=1 end8=49 end9=49 end10=49 < $@-3.H > $@.H 
	touch $@

3d-test:
	$(msh)
	make
	Pad end2=50 extend=1 < migno-dmult-2759-06.H | Window3d n1=50 n3=50 min1=1000 > migno-3d.H
	Pad end3=50 extend=1 <      dip-dmult-2759.H | Window3d n1=50 n2=50 min2=1000 | Pad end4=1 > dip-dmult-2759-3d.H
	Pad end3=50 extend=1  < 4d-var.H                  | Window3d n1=50 n2=50 min2=1000  > 4d-var3d.H  
	Pad end2=50 extend=1  <  resv.H                   | Window3d n1=50 n3=50 min1=1000  >   resv3d.H  
	Pad end2=50 extend=1  < hesp0-dmult-2759-rat.H    | Window3d n1=50 n3=50 min1=1000  > hesp0-dmult-2759-rat3d.H  
	Pad end2=50 extend=1  <  resv.H                   | Window3d n1=50 n3=50 min1=1000  >   resv3d.H  
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=6 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=6 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 | Transp reshape=1,3,4 > resv.H
	$(HJM)  \
		hess1=3d-hess.H modl1=$@-1.H  data1=migno-3d.H dip1=dip-dmult-2759-3d.H hesp1=resv3d.H var1=4d-var3d.H wg1=hesp0-dmult-2759-rat3d.H \
		hess2=3d-hess.H modl2=$@-2.H  data2=migno-3d.H dip2=dip-dmult-2759-3d.H hesp2=resv3d.H var2=4d-var3d.H wg2=hesp0-dmult-2759-rat3d.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=y verb=y mode=38 jmov=5 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.45 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=5  eps_dip=0.05 destroy_nhlx=y \
	  nvar=2 lvdip=y \
	  eps1=2 epA1=3 epB1=1 epC1=10 epD1=5 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=2 \
	  halfhess=y \
	  weight=y \
	  report=$@.log
3d-testmod:
	$(msh)
	make
	#Pad end2=50 extend=1 < migno-dmult-2759-06.H | Window3d n1=50 n3=50 min1=1000 > migno-3d.H
	#Pad end3=50 extend=1 <      dip-dmult-2759.H | Window3d n1=50 n2=50 min2=1000 | Pad end4=1 > dip-dmult-2759-3d.H
	#Pad end3=50 extend=1  < 4d-var.H                  | Window3d n1=50 n2=50 min2=1000  > 4d-var3d.H  
	##Pad end2=50 extend=1  <  resv.H                   | Window3d n1=50 n3=50 min1=1000  >   resv3d.H  
	#Pad end2=50 extend=1  < hesp0-dmult-2759-rat.H    | Window3d n1=50 n3=50 min1=1000  > hesp0-dmult-2759-rat3d.H  
	#Pad end2=50 extend=1  <  resv.H                   | Window3d n1=50 n3=50 min1=1000  >   resv3d.H  
	Spike n1=50 n2=50 n3=50 nsp=4 k1=5,10,15,30  k2=20,35 k3=25,25,25 | Transp reshape=1,3 > $@-ref1.H ; echo o1=1000 d1=25 o2=0 d2=25 o3=1500 d3=5 >> $@-ref1.H
	Spike n1=50 n2=50 n3=50 nsp=4 k1=25,25,30,35 k2=30,45 k3=25,25,25 | Transp reshape=1,3 > $@-ref2.H ; echo o1=1000 d1=25 o2=0 d2=25 o3=1500 d3=5 >> $@-ref2.H
	Spike n1=50 n2=50 n3=50 nsp=2 k1=25,12  k2=25    k3=25,25 | Transp reshape=1,3 > $@-ref1.H ; echo o1=1000 d1=25 o2=0 d2=25 o3=1500 d3=5 >> $@-ref1.H
	Spike n1=50 n2=50 n3=50 nsp=2 k1=25,12  k2=25,25 k3=25    | Transp reshape=1,3 > $@-ref2.H ; echo o1=1000 d1=25 o2=0 d2=25 o3=1500 d3=5 >> $@-ref2.H
	#Window3d < picks-dmult4.H |  Transp | Smooth rect1=6 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 > 4d-var.H
	Window3d < picks-dmult4.H |  Transp | Smooth rect1=6 rect2=3 | Scale | Math file1=in exp=file1-1 | Math file1=in exp=file1+1 | Gpow gpow=30 | Math file1=in exp=file1+1 | Gpow gpow=4 | Transp reshape=1,3,4 > resv.H
	$(HJM)  \
		hess1=3d-gauss-hess.H modl1=$@-ref1.H  data1=$@1-3d.H dip1=dip-dmult-2759-3d.H hesp1=resv3d.H var1=4d-var3d.H wg1=hesp0-dmult-2759-rat3d.H \
		hess2=3d-gauss-hess.H modl2=$@-ref2.H  data2=$@2-3d.H dip2=dip-dmult-2759-3d.H hesp2=resv3d.H var2=4d-var3d.H wg2=hesp0-dmult-2759-rat3d.H \
	  mmov=$@-mmov.H rdov=$@-rdov.H \
	  adj=n inv=n verb=y mode=38 jmov=5 precond=y noreg=n niter=25 nsurv=2 nodes=12 node=15 \
	  method=2 norm_d=hybrid norm_m=hybrid quant_d=0.9 quant_m=0.75 quant_m1=.45 quant_m2=.99 quant_m3=.99 quant_m4=.99 ldip=y verb_dip=3 nang=5  eps_dip=0.05 destroy_nhlx=y \
	  nvar=2 lvdip=y \
	  eps1=2 epA1=3 epB1=1 epC1=10 epD1=5 \
	  lmd1=1. lmd2=.2 rho=.25 gpow=2 \
	  halfhess=y \
	  weight=y \
	  report=$@.log



#
