
##########################################################
#
#  Reflector at 1000m
#
flat/Vel1000.H:
	Vel n1=601 n2=2001 d1=10 d2=10 o1=0 o2=-10000 n3=1 d3=1 o3=1 vc=4000 z1=1000 vr1=3500 const1=1 > $@

flat/Velmig1000.H:
	Transp reshape=1,3 plane=12 <flat/Vel1000.H > $@

flat/Shot1000.H:
	Fdmod intag=flat/Vel1000.H no_stdout=1 oxs=-5000 dxs=10 nxs=10 tmax=2. bx=500 ex=500 hsfile=temp.H
	Bandpass flo=5 fhi=42 < temp.H | Mute vmute=4000 tmute=0.44 tramp=0.1 > temp1.H
	Bandpass flo=5 fhi=42 < temp.H | Mute vmute=4000 tmute=0.60 tramp=0.0 > temp2.H
	Math file1=temp1.H file2=temp2.H exp="file1-file2" > $@
	echo o1=0 o3=0 >> $@

flat/Shot100A.H:
	Fdmod intag=flat/Vel1000.H no_stdout=1 oxs=-5000 dxs=10 nxs=1 tmax=2. bx=500 ex=500 hsfile=temp.H
	Bandpass flo=5 fhi=42 < temp.H | Mute vmute=4000 tmute=0.44 tramp=0.1 > temp1.H
	Bandpass flo=5 fhi=42 < temp.H | Mute vmute=4000 tmute=0.60 tramp=0.0 > temp2.H
	Math file1=temp1.H file2=temp2.H exp="file1-file2" > $@
	echo o1=0 o3=0 >> $@

flat/source1001.H:
	Window3d < flat/Shot100A.H n3=1 n2=1 min1=.44 f2=500 > temp.H
	echo o1=-0.066 >> temp.H
	Pad end1=352 < temp.H > temp1.H
#	< temp1.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=6 f_max1=32 f_max=38 maxsize=1000 > temp2.H 
#	< temp2.H Transp reshape=1,3,5 plane=23 > $@

flat/Shot1000_cmp.H:
	< flat/Shot1000.H ./Bin/Drop_cmp.x > $@

flat/prep1000.H:
#	< flat/Shot1000.H Pad end1=3 | Window3d squeeze=n j3=2 j2=2 > j1.H; 
	<j1.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=6 f_max1=32 f_max=38 maxsize=1000 > temp.H 
	< temp.H Transp reshape=1,3,5 plane=23 | Pad beg1=100 end1=100 >$@

flat/prep1001.H:
	<flat/Shot1000.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=6 f_max1=32 f_max=38 maxsize=1000 > temp.H 
	< temp.H Transp reshape=1,3,5 plane=23 | Pad beg1=100 end1=100 >$@

flat/prep1000_gap.H:
	< flat/prep1000.H ./Bin/Drop.x amin=360. amax=1160. > $@

flat/prep1000_cmp.H:
	< flat/prep1000.H ./Bin/Drop_cmp.x > $@

flat/x1000.H:
	< flat/Shot1000.H Pad end1=3 |Window3d squeeze=n n3=1 f3=200 > j1.H; <j1.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=6 f_max1=32 f_max=38 maxsize=1000 > temp.H 
	< temp.H Transp reshape=1,3,5 plane=23 | Pad beg1=100 end1=100 >$@

flat/Mig01_1000.H:
	@date
	nohup Parallel command=./ShotMigNew files="flat/prep1000.H,flat/source.H,flat/v1000.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=200 axis=4,4,4,6 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_200 \
	nx_shots=200 ox_shots=0 \
	par=go_sis.P  taper=y  taper_pcent=2 marine=y minx=-5000 maxx=10000 & #restart=y

flat/Mig01_1001.H:
	@date
	Window3d squeeze=n n3=301 <flat/Velmig1000.H >flat/Velmig1000_301.H
	nohup Parallel command=./ShotMigNew files="flat/prep1001.H,flat/source1001.H,flat/Velmig1000_301.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=400 axis=4,4,4,6 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_200 \
	nx_shots=400 ox_shots=0 \
	par=flat/go_sis.P  taper=y  taper_pcent=2 marine=y minx=-5000 maxx=10000 & #restart=y

flat/Mig01_1001dec.H:
	@date
	nohup Parallel command=./ShotMigNew files="flat/prep1001.H,flat/source1001.H,flat/Velmig1000_301pad.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=400 axis=4,4,4,6 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_200 \
	nx_shots=400 ox_shots=0 \
	par=flat/go_sis.P decon=y eps=0 smooth=y rectx=20 taper=y taper_pcent=2 marine=y minx=-5000 maxx=10000 & #restart=y

flat/Mig01_1001dec1.H:
	@date
	nohup Parallel command=~claudio/ShotMig/bin/LINUX/ShotMig.x files="flat/prep1001.H,flat/source1001.H,flat/Velmig1000_301pad.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=400 axis=4,4,4,6 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_200 \
	nx_shots=400 ox_shots=0 \
	par=flat/go_sis.P decon=y eps=0. taper=y taper_pcent=2 marine=y minx=-5000 maxx=10000 & #restart=y

flat/Mig01_1001dec_eps1.H:
	@date
	nohup Parallel command=./ShotMigNew files="flat/prep1001.H,flat/source1001.H,flat/Velmig1000_301pad.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=400 axis=4,4,4,6 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_200 \
	nx_shots=400 ox_shots=0 \
	par=flat/go_sis.P decon=y eps=1 smooth=y rectx=4 taper=y taper_pcent=2 marine=y minx=-5000 maxx=10000 & #restart=y

flat/Mig01_1001dectst.H:
	@date
	Window3d squeeze=n n4=1 min4=2000. <flat/prep1001.H > flat/x.H
	~claudio/ShotMig/bin/LINUX/ShotMigNew D=flat/x.H D_d=flat/source1001.H V=flat/Velmig1000_301pad.H R=$@ \
	pverb=2 nx_shots=1 ox_shots=2000 \
	par=flat/go_sis.P decon=y eps=0.0 smooth=y taper=y taper_pcent=2 marine=y minx=-4000 maxx=8000 & #restart=y

flat/Mig01_1000_gap.H:
	@date
	nohup Parallel command=./ShotMigNew files="flat/prep1000_gap.H,flat/source.H,flat/v1000.H,$@"  \
	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=200 axis=4,4,4,6 pverb=2  \
	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_200 \
	nx_shots=200 ox_shots=0 \
	par=go_sis.P  taper=y  taper_pcent=2 marine=y minx=-5000 maxx=10000 & #restart=y

#flat/Mig01_1000_cmp.H:
#	@date
#	nohup Parallel command=./ShotMigNew files="flat/prep1000_cmp.H,flat/source.H,flat/v1000.H,$@"  \
#	tags="D,D_d,V,R" usage="INPUT,INPUT,INPUT,OUTPUT" nblock=200 axis=4,4,4,6 pverb=2  \
#	file_type="DISTRIBUTE,COPY,COPY,COPY" mach_mfile=machinefile_200 \
#	nx_shots=200 ox_shots=0 \
#	par=go_sis.P  taper=y  taper_pcent=2 marine=y minx=-5000 maxx=10000 & #restart=y

flat/Mig01_1000_cmp.H:
	@date
	./ShotMigNew D=flat/prep1000_cmp.H D_d=flat/source.H V=flat/v1000.H R=$@  \
	nx_shots=200 ox_shots=0 \
	par=go_sis.P  taper=y  taper_pcent=2 marine=y minx=-5000 maxx=10000 & #restart=y

flat/ADCIG1000_FT.H:
	<flat/Mig01_1000.H Transp reshape=2,4,5 plane=13 >flat/ODCIG1000.H
	<flat/ODCIG1000.H Window n4=1 min4=2000 | Pad beg2=69 end2=69 | /net/koko/bob/SEP_BOB/bin/OFF2ANG verb=y amax=80 eps=10 maxmem=1000 >$@

flat/ADCIG1000_Tr.H:
	<flat/Mig01_1000.H Transp reshape=2,4,5 plane=13 |Transp plane=34 >flat/ODCIG1000.H
	<flat/ODCIG1000.H  Window n3=1 min3=2000 | Pad end1=40 | ~claudio/Research/Off2ang/Yaxun/Bin/LINUX/off2ang_sd.x amin=-80 amax=80 dax=1 mode=0 style=1 | Window max1=2000 >$@

flat/ADCIG1000_Inv.H:
	<flat/ODCIG1000.H  Window n3=1 min3=2000 | Pad end1=40 | ~claudio/Research/Off2ang/Yaxun/Bin/LINUX/off2ang_sd.x amin=-80 amax=80 dax=1 mode=2 style=1 eps=3. niter=135 | Window max1=2000 >$@

flat/ADCIG1001_FT.H:
	<flat/Mig01_1001.H Transp reshape=2,4,5 plane=13 >flat/ODCIG1001.H
	<flat/ODCIG1001.H Window3d squeeze=n n4=1 min4=2000 | Pad beg2=69 end2=69 | /net/koko/bob/SEP_BOB/bin/OFF2ANG verb=y amax=80 eps=10 maxmem=1000 >$@

flat/ADCIG1001_Tr.H:
	<flat/Mig01_1001.H Transp reshape=2,4,5 plane=13 |Transp plane=34 >flat/ODCIG1001.H
	<flat/ODCIG1001_zh.H  Window n3=1 min3=2000 | Pad end1=40 | ~claudio/Research/Off2ang/Yaxun/Bin/LINUX/off2ang_sd.x amin=-80 amax=80 dax=1 mode=0 style=1 | Window max1=2000 >$@

flat/ADCIG1001_Trcos.H:
	<flat/Mig01_1001.H Transp reshape=2,4,5 plane=13 |Transp plane=34 >flat/ODCIG1001_zh.H
	<flat/ODCIG1001_zh.H  Window n3=1 min3=2000 | Pad end1=40 | ~claudio/Research/Off2ang/Yaxun/Bin/LINUX/off2ang_sd.x amin=-80 amax=80 dax=1 mode=0 | Window max1=2000 >$@

flat/ADCIG1001_Inv.H:
	<flat/ODCIG1001_zh.H  Window n3=1 min3=2000 | Pad end1=40 | ~claudio/Research/Off2ang/Yaxun/Bin/LINUX/off2ang_sd.x amin=-80 amax=80 dax=1 mode=2 eps=5. niter=50 | Window max1=2000 >$@

flat/ADCIG1001_FTd.H:
#	<flat/Mig01_1001dec1.H Transp reshape=2,4,5 plane=13 >flat/ODCIG1001d1.H
	<flat/ODCIG1001d1.H Window3d squeeze=n n4=1 min4=2000 | Pad beg2=69 end2=69 | /net/koko/bob/SEP_BOB/bin/OFF2ANG verb=y amax=80 eps=10 maxmem=1000 >$@

flat/ADCIG1001_Trcosd.H:
#	<flat/Mig01_1001dec1.H Transp reshape=2,4,5 plane=13 |Transp plane=34 >flat/ODCIG1001_zhd1.H
	<flat/ODCIG1001_zhd.H  Window n3=1 min3=2000 | Pad end1=40 | ~claudio/Research/Off2ang/Yaxun/Bin/LINUX/off2ang_sd.x amin=-80 amax=80 dax=1 mode=0 | Window max1=2000 >$@

flat/ADCIG1001_Invd.H:
	<flat/ODCIG1001_zhd.H  Window n3=1 min3=2000 | Pad end1=40 | ~claudio/Research/Off2ang/Yaxun/Bin/LINUX/off2ang_sd.x amin=-80 amax=80 dax=1 mode=2 eps=5. niter=50 | Window max1=2000 >$@

#!!!!!!!!!!
#!
#! Computing Green's fct to invert ODCIGs in gomorrah
#!
#!	/net/koko/homes/sep/alejandro/research/SPWEI_SERIAL/bin/LINUX/ShotMig.x \

flat/GREEN.H:
	/homes/sep/alejandro/research/SPWEI_SERIAL/bin/LINUX86_64/ShotMig.x \
	D_d=flat/source1001_Wpad1.H V=flat/Velmig1000_301pad.H W_d=$@ \
	nx=440 ox=-200. dx=10. \
	nref=1 taper=y taper_pcent=2 marine=n \
	nx_W=101 ox_W=1500. dx_W=10.
	date

##########################################################
#
#  Reflector at 500m
#
flat/Vel500.H:
	Vel n1=601 n2=1201 d1=10 d2=10 o1=0 o2=-6000 n3=1 d3=1 o3=1 vc=4000 z1=500 vr1=3800 const1=1 > $@

flat/Velmig500.H:
	Transp reshape=1,3 plane=12 <flat/Vel500.H > $@

flat/Shot500.H:
	Fdmod intag=flat/Vel500.H no_stdout=1 oxs=-5000 dxs=10 nxs=1 tmax=2. bx=500 ex=500 hsfile=temp.H
	Bandpass flo=5 < temp.H | Mute vmute=4000 tmute=0.12 > $@
	echo o1=0 o3=0 >> $@

flat/Shot501.H:
	Bandpass flo=8 fhi=30 < flat/Shot500.H > $@ 

flat/source.H:
	Window < flat/Shot501.H n2=1 min2=2500 min1=.4 max1=1. > temp.H
	echo o1=-0.06625 >> temp.H
	Pad end1=752 < temp.H > temp1.H
	< temp1.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=8 f_max1=32 f_max=38 maxsize=1000 > temp2.H 
	< temp2.H Transp reshape=1,3,5 plane=23 > $@

flat/prep501.H:
	< flat/Shot501.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=8 f_max1=32 f_max=38 maxsize=1000 > temp.H 
	< temp.H Transp reshape=1,3,5 plane=23 | Pad beg1=100 end1=100 >$@

flat/prep500.H:
	< flat/Shot500.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=6 f_max1=32 f_max=38 maxsize=1000 > temp.H 
	< temp.H Transp reshape=1,3,5 plane=23 | Pad beg1=100 end1=100 >$@

flat/Mig01_500.H: flat/prep500.H flat/source.H flat/Velmig500.H flat/go_sis.P
	./ShotMigNew D=flat/prep500.H D_d=flat/source.H V=flat/Velmig500.H R=$@  \
	nx_shots=1 ox_shots=0 par=flat/go_sis.P \
	nref=2 taper=y taper_pcent=2 marine=y #restart=y

flat/Mig01_501.H: flat/prep501.H flat/source501.H flat/Velmig500.H flat/go_sis.P
	./ShotMigNew D=flat/prep500.H D_d=flat/source.H V=flat/Velmig500.H R=$@  \
	nx_shots=1 ox_shots=0 par=flat/go_sis.P \
	nref=2 taper=y taper_pcent=2 marine=y #restart=y
flat/ADCIG500.H:
	<flat/Mig01_500.H Transp reshape=2,4,5 plane=13 >flat/ODCIG500.H
	<flat/ODCIG500.H Pad beg2=43 end2=44 | /net/koko/bob/SEP_BOB/bin/OFF2ANG verb=y eps=1 maxmem=1000 >$@
###########################################################
#
#  Reflector at 2000m
#
flat/Vel.H:
	Vel n1=601 n2=1201 d1=10 d2=10 o1=0 o2=-6000 n3=1 d3=1 o3=1 vc=4000 z1=2000 vr1=300 const1=1 > $@

flat/Velmig.H:
	Transp reshape=1,3 plane=12 <flat/Vel.H > $@

flat/Shot.H:
	Fdmod intag=flat/Vel.H no_stdout=1 oxs=-5000 dxs=10 nxs=1 tmax=2. bx=500 ex=500 hsfile=temp.H
	Bandpass flo=3 < temp.H | Mute vmute=4000 tmute=0.8 > temp1.H
	Bandpass flo=3 < temp.H | Mute vmute=4000 tmute=1.2 > temp2.H
	Math file1=temp1.H file2=temp2.H exp="file1-file2" > $@
	echo o1=0 o3=0 >> $@

flat/prep.H:
	< flat/Shot.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=6 f_max1=32 f_max=38 maxsize=1000 > temp.H 
	< temp.H Transp reshape=1,3,5 plane=23 | Pad beg1=100 end1=100 >$@

flat/prep_pos.H:
	< flat/Shot.H Window min2=0 | /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=6 f_max1=32 f_max=38 maxsize=1000 > temp.H 
	< temp.H Transp reshape=1,3,5 plane=23 | Pad beg1=100 end1=100 >$@

flat/source.H:
	Window < flat/Shot.H n2=1 min1=.94 f2=500 > temp.H
	echo o1=-0.06625 >> temp.H
	Pad end1=752 < temp.H > temp1.H
	< temp1.H /net/koko/bob/SEP_BOB/bin/Transf shotmig=y is2d=y wei=y f_min=3 f_min1=6 f_max1=32 f_max=38 maxsize=1000 > temp2.H 
	< temp2.H Transp reshape=1,3,5 plane=23 > $@

flat/Mig01.H: flat/prep.H flat/source.H flat/Velmig.H flat/go_sis.P
	./ShotMigNew D=flat/prep.H D_d=flat/source.H V=flat/Velmig.H R=$@  \
	nx_shots=1 ox_shots=0 par=flat/go_sis.P \
	nref=2 taper=y taper_pcent=2 marine=y #restart=y

flat/Mig01_pos.H: flat/prep_pos.H flat/source.H flat/Velmig.H flat/go_sis.P
	./ShotMigNew D=flat/prep_pos.H D_d=flat/source.H V=flat/Velmig.H R=$@  \
	nx_shots=1 ox_shots=0 par=flat/go_sis.P \
	nref=2 taper=y taper_pcent=2 marine=y #restart=y

flat/Mig01_1rec.H: flat/prep_pos.H flat/source.H flat/Velmig.H flat/go_sis.P
	Window <flat/prep_pos.H 
	./ShotMigNew D=flat/prep_pos.H D_d=flat/source.H V=flat/Velmig.H R=$@  \
	nx_shots=1 ox_shots=0 par=flat/go_sis.P \
	nref=2 taper=y taper_pcent=2 marine=y #restart=y

flat/ADCIG.H:
	<flat/Mig01.H Transp reshape=2,4,5 plane=13 >flat/ODCIG.H
	<flat/ODCIG.H Pad beg2=43 end2=44 | /net/koko/bob/SEP_BOB/bin/OFF2ANG verb=y eps=1 maxmem=1000 >$@

flat/ADCIG_pos.H:
	<flat/Mig01_pos.H Transp reshape=2,4,5 plane=13 >flat/ODCIG_pos.H
	<flat/ODCIG_pos.H Pad beg2=43 end2=44 | /net/koko/bob/SEP_BOB/bin/OFF2ANG verb=y eps=1 maxmem=1000 >$@
