

0000elf_vrms.3590.H:
	Window3d < /data/elf_L7d/L7d-vel.H n3=1 min3=3950 | Vconvert inpar=2 outpar=1 invelopt=1 intype=1 \
	outtype=2 n1out=1500 d1out=0.004 o1out=0|Interp d2out=13.3333 type=2 > $@

0000elf_velor.3590.H:
	Window3d </data/elf_L7d/L7d-vel.H n3=1 min3=3950|Transp plane=12 reshape=1,3 |\
	Interp d1out=27 d3out=13.5 o1out=0 type=1| Pad extend=1 beg1=1000 end1=1000 > $@

0000elf_vedit.3590.H:
	Window3d </data/elf_L7d/L7d-vel.H n3=1 min3=3950|Transp plane=12 reshape=1,3|../Tese/bin/OW_editvel_mut.x vchg=1 v=3000 |\
	Interp  d1out=27 d3out=13.5 o1out=0 type=1| Pad extend=1 beg1=1000 end1=1000 > $@

0000elf_vedit.3590.to2600.H:
	< 0000elf_vedit.3590.H Clip chop=greater clip=2600 to=2600 | Gpow gpow=-1 > $@

0000elf_vedit.3590.to4000.H:
	< 0000elf_vedit.3590.H ../Tese/bin/OW_editvel_pik.x v=2700 hor1=hor.gt3070 > /dev/null
	< 0000elf_vedit.3590.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vmut=1 v=4000 > j.H
	Math file1=j.H exp="1/file1" | Pad extend=1 beg1=1000 end1=1000> $@

###############################################
#
# Definite rules to create 
# v0 improved in the top sediment part
# RmoPicked data (rho) where smoothed and filled in Matlab
0000elf_vedit.3590.rmo_sediment.H:
	< 0000elf_velor.3590.H Window3d squeeze=n n1=481 min1=0 n3=364 | ../Tese/bin/OW_vrms.x int2rms=1 > vrms.H
	< 0000elf_velor.3590.H Window3d squeeze=n n1=481 min1=0 n3=364 | Pad beg1=1000 end1=1000 extend=1 > 1.H
	Math file1=vrms.H file2=rmopicks.transp.H exp="file1*file2" | ../Tese/bin/OW_vrms.x int2rms=0 | Pad beg1=1000 end1=1000 extend=1 > vint.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vvel=1 vsub=1.H | Gpow gpow=-1 > $@

0000elf_vedit.3590.rmo_sediment.to4000smoothed.H:
	< 0000elf_velor.3590.H Window3d squeeze=n n1=481 min1=0 n3=364 | ../Tese/bin/OW_vrms.x int2rms=1 > vrms.H
	Math file1=vrms.H file2=rmopicks.transp.H exp="file1*file2" | ../Tese/bin/OW_vrms.x int2rms=0 | Pad beg1=1000 end1=1000 extend=1 > vint.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vmut=1 v=4000 > v1.H
	Window3d < v1.H | Transp| Smooth rect1=9 rect2=3 repeat=17 |Transp plane=13 > v1smooth.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vvel=1 vsub=v1smooth.H | Gpow gpow=-1 > $@

0000elf_vedit.3590.rmo_sediment.to2300smoothed.H:
	< 0000elf_velor.3590.H Window3d squeeze=n n1=481 min1=0 n3=364 | ../Tese/bin/OW_vrms.x int2rms=1 > vrms.H
	Math file1=vrms.H file2=rmopicks.transp.H exp="file1*file2" | ../Tese/bin/OW_vrms.x int2rms=0 | Pad beg1=1000 end1=1000 extend=1 > vint.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vmut=1 v=2300 > v1.H
	Window3d < v1.H | Transp| Smooth rect1=9 rect2=3 repeat=17 |Transp plane=13 > v1smooth.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vvel=1 vsub=v1smooth.H | Gpow gpow=-1 > $@

0000elf_vedit.3590.rmo_sediment.to2600smoothed.H:
	< 0000elf_velor.3590.H Window3d squeeze=n n1=481 min1=0 n3=364 | ../Tese/bin/OW_vrms.x int2rms=1 > vrms.H
	Math file1=vrms.H file2=rmopicks.transp.H exp="file1*file2" | ../Tese/bin/OW_vrms.x int2rms=0 | Pad beg1=1000 end1=1000 extend=1 > vint.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vmut=1 v=2600 > v1.H
	Window3d < v1.H | Transp| Smooth rect1=9 rect2=3 repeat=17 |Transp plane=13 > v1smooth.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vvel=1 vsub=v1smooth.H | Gpow gpow=-1 > $@

0000elf_vedit.3590.rmo_sediment.to3200smoothed.H:
	< 0000elf_velor.3590.H Window3d squeeze=n n1=481 min1=0 n3=364 | ../Tese/bin/OW_vrms.x int2rms=1 > vrms.H
	Math file1=vrms.H file2=rmopicks.transp.H exp="file1*file2" | ../Tese/bin/OW_vrms.x int2rms=0 | Pad beg1=1000 end1=1000 extend=1 > vint.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vmut=1 v=3200 > v1.H
	Window3d < v1.H | Transp| Smooth rect1=9 rect2=3 repeat=17 |Transp plane=13 > v1smooth.H
	< vint.H ../Tese/bin/OW_editvel_mut.x hor1=hor.gt3070 vvel=1 vsub=v1smooth.H | Gpow gpow=-1 > $@
#
#
#
#########################


0100elf_data_recip.H:
#	Create3d < ../2Wpar/8002marm_shot_fd.H keyname1=offset keyname2=sx verb=1 > junk.H
#	Headermath key1=cmp eqn1="sx+0.5*offset" < junk.H > junk1.H
#	Sort3d < junk1.H nkeys=2 key2=cmp ng2=1000 og2=0 dg2=12 key1=offset ng1=67 og1=0 dg1=48 max_size=1000 > junk2.H
#	<junk2.H Infill3d >junk3.H
####	<junk3.H Stack >junk30.H
	< data3950.h26.H ../Tese/bin/OW_trcedit.x hor1=editraces > data3950.h26.ed.H
	Window3d < 0000elf_vrms.3590.H n2=1000 > 1.H;
	Stretch < data3950.h26.ed.H rule=nmo velfile=1.H|Interp d2out=13.3333 o2out=0 maxsize=1000|\
	Stretch conj=1 rule=nmo velfile=1.H >junk31.H
	Reverse < junk31.H opt=no which=2 | Window3d max2=-0.002 > junk4.H
	Merge axis=2 space=n junk4.H junk31.H > junk5.H
	Create3d < junk5.H keyname1=offset keyname2=cmp verb=1 > junk6.H
	Headermath key1=sx eqn1="cmp-0.5*offset" < junk6.H > junk7.H
	Sort3d < junk7.H nkeys=2 key2=sx ng2=501 og2=0 dg2=26.6666 key1=offset ng1=267 og1=-3453.3247 dg1=26.6666 max_size=1000> junk8.H
	<junk8.H Infill3d > junk9.H
	<junk9.H Stack3d > $@

0100elf.crec.H:
	< 0100elf_data_recip.H Interp d2out=27 o2out=-3456 n2out=257 >j0.H
	<j0.H Interp o3out=0 d3out=27 n3out=494 maxsize=1800 >j1.H;
	<j1.H Window3d n1=1001|Scale scale_to=1|Transf shotmig=y is2d=y wei=y f_min=0 f_min1=6 f_max1=40 f_max=46 maxsize=1000>j2.H
	< j2.H Pad beg1=200 end1=200 > $@

0200elf_bkim:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 0100elf.csou.H
	< 0000elf_vedit.3590.H Gpow gpow=-1 > 1.H
	../Tese/bin/OWmig2d_areal.x sou=0100.elf.csou.H rec=0100elf.crec.H \
	vel=1.H bkgimg=0200elf.bkim.H \
	zmin=0 zmax=4900 nh=31 oh=-399.9990 migration=1 areal=0 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

0200elf_bkim2600:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 0100elf.csou.H
	../Tese/bin/OWmig2d_areal.x sou=0100elf.csou.H rec=0100elf.crec.H \
	vel=0000elf_vedit.3590.to2600.H bkgimg=0200elf.bkim.2600.H \
	zmin=0 zmax=4900 nh=61 oh=-799.9980 migration=1 areal=0 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

0200elf_bkim4000:
	echo o6=0 >> 0100elf.crec.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 0100elf.csou.H
	../Tese/bin/OWmig2d_areal.x sou=0100elf.csou.H rec=0100elf.crec.H \
	vel=0000elf_vedit.3590.to4000.H bkgimg=0200elf.bkim.4000.H \
	zmin=0 zmax=4900 nh=61 oh=-810 migration=1 areal=0 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

############################################
0100elf.crec.plane.H:
	Window3d < 0100elf.crec.H |Transp > shots.1.H; echo d1=1.5692242050 >> shots.1.H
	/homes/sep/claudio/research.ln/Others/planewave/bin/shottoplane.x opx=-0.0005 npx=100 dpx=0.00001 opy=0 npy=1 dpy=0.1 Shot=shots.1.H Plane=$@ dx=27.

#	Window3d < 0000elf_velor.3590.H |Transp > vel.1.H
#	Window3d < 0100elf.csou.H f3=2 > wave.1.H; echo d1=1.5692242050 >> wave.1.H

0200tiltmig%:
	Window3d squeeze=n n4=1 f4=$* f3=2 < 0100elf.crec.plane.H >plane$*.H
	/homes/sep/claudio/research.ln/Others/planewave/bin/isotiltplanemig.x Data=plane$*.H Velocity=vel.1.H Wavelet=wave.1.H mig_nz=375 mig_dz=13.5 ohx=-405 nhx=31 dhx=27 image_min_x=0 image_max_x=15000 \
	Image_hx=0200elf.bkim.plane.or.$*.H operator=2 > a.txt

0200elf.bkim.plane.ang.%.H:
	Pad beg2=150 end2=150 < 0200elf.bkim.plane.or.$*.H | OFF2ANG amax=60 verb=y maxmem=1000 eps=10 > $@

0200elf.bkim.plane.or.H:
	Math file1=0200elf.bkim.plane.or.0.H file2=0200elf.bkim.plane.or.10.H file3=0200elf.bkim.plane.or.20.H file4=0200elf.bkim.plane.or.30.H file5=0200elf.bkim.plane.or.40.H exp="file1+file2+file3+file4+file5" > 1.H
	Math file1=0200elf.bkim.plane.or.50.H file2=0200elf.bkim.plane.or.60.H file3=0200elf.bkim.plane.or.70.H file4=0200elf.bkim.plane.or.80.H file5=0200elf.bkim.plane.or.90.H exp="file1+file2+file3+file4+file5" > 2.H 
	Math file1=1.H file2=2.H exp=file1+file2 > $@

0200elf.bkim.plane.ang.H:
	Math file1=0200elf.bkim.plane.ang.0.H file2=0200elf.bkim.plane.ang.1.H file3=0200elf.bkim.plane.ang.2.H\
	     file4=0200elf.bkim.plane.ang.3.H file5=0200elf.bkim.plane.ang.4.H file6=0200elf.bkim.plane.ang.5.H\
	     file7=0200elf.bkim.plane.ang.6.H file8=0200elf.bkim.plane.ang.7.H file9=0200elf.bkim.plane.ang.8.H\
	    file10=0200elf.bkim.plane.ang.9.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 1.H 
	Math file1=0200elf.bkim.plane.ang.10.H file2=0200elf.bkim.plane.ang.11.H file3=0200elf.bkim.plane.ang.12.H\
	     file4=0200elf.bkim.plane.ang.13.H file5=0200elf.bkim.plane.ang.14.H file6=0200elf.bkim.plane.ang.15.H\
	     file7=0200elf.bkim.plane.ang.16.H file8=0200elf.bkim.plane.ang.17.H file9=0200elf.bkim.plane.ang.18.H\
	    file10=0200elf.bkim.plane.ang.19.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 2.H 
	Math file1=0200elf.bkim.plane.ang.20.H file2=0200elf.bkim.plane.ang.21.H file3=0200elf.bkim.plane.ang.22.H\
	     file4=0200elf.bkim.plane.ang.23.H file5=0200elf.bkim.plane.ang.24.H file6=0200elf.bkim.plane.ang.25.H\
	     file7=0200elf.bkim.plane.ang.26.H file8=0200elf.bkim.plane.ang.27.H file9=0200elf.bkim.plane.ang.28.H\
	    file10=0200elf.bkim.plane.ang.29.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 3.H 
	Math file1=0200elf.bkim.plane.ang.30.H file2=0200elf.bkim.plane.ang.31.H file3=0200elf.bkim.plane.ang.32.H\
	     file4=0200elf.bkim.plane.ang.33.H file5=0200elf.bkim.plane.ang.34.H file6=0200elf.bkim.plane.ang.35.H\
	     file7=0200elf.bkim.plane.ang.36.H file8=0200elf.bkim.plane.ang.37.H file9=0200elf.bkim.plane.ang.38.H\
	    file10=0200elf.bkim.plane.ang.39.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 4.H 
	Math file1=0200elf.bkim.plane.ang.40.H file2=0200elf.bkim.plane.ang.41.H file3=0200elf.bkim.plane.ang.42.H\
	     file4=0200elf.bkim.plane.ang.43.H file5=0200elf.bkim.plane.ang.44.H file6=0200elf.bkim.plane.ang.45.H\
	     file7=0200elf.bkim.plane.ang.46.H file8=0200elf.bkim.plane.ang.47.H file9=0200elf.bkim.plane.ang.48.H\
	    file10=0200elf.bkim.plane.ang.49.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 5.H 
	Math file1=0200elf.bkim.plane.ang.50.H file2=0200elf.bkim.plane.ang.51.H file3=0200elf.bkim.plane.ang.52.H\
	     file4=0200elf.bkim.plane.ang.53.H file5=0200elf.bkim.plane.ang.54.H file6=0200elf.bkim.plane.ang.55.H\
	     file7=0200elf.bkim.plane.ang.56.H file8=0200elf.bkim.plane.ang.57.H file9=0200elf.bkim.plane.ang.58.H\
	    file10=0200elf.bkim.plane.ang.59.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 6.H 
	Math file1=0200elf.bkim.plane.ang.60.H file2=0200elf.bkim.plane.ang.61.H file3=0200elf.bkim.plane.ang.62.H\
	     file4=0200elf.bkim.plane.ang.63.H file5=0200elf.bkim.plane.ang.64.H file6=0200elf.bkim.plane.ang.65.H\
	     file7=0200elf.bkim.plane.ang.66.H file8=0200elf.bkim.plane.ang.67.H file9=0200elf.bkim.plane.ang.68.H\
	    file10=0200elf.bkim.plane.ang.69.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 7.H 
	Math file1=0200elf.bkim.plane.ang.70.H file2=0200elf.bkim.plane.ang.71.H file3=0200elf.bkim.plane.ang.72.H\
	     file4=0200elf.bkim.plane.ang.73.H file5=0200elf.bkim.plane.ang.74.H file6=0200elf.bkim.plane.ang.75.H\
	     file7=0200elf.bkim.plane.ang.76.H file8=0200elf.bkim.plane.ang.77.H file9=0200elf.bkim.plane.ang.78.H\
	    file10=0200elf.bkim.plane.ang.79.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 8.H 
	Math file1=0200elf.bkim.plane.ang.80.H file2=0200elf.bkim.plane.ang.81.H file3=0200elf.bkim.plane.ang.82.H\
	     file4=0200elf.bkim.plane.ang.83.H file5=0200elf.bkim.plane.ang.84.H file6=0200elf.bkim.plane.ang.85.H\
	     file7=0200elf.bkim.plane.ang.86.H file8=0200elf.bkim.plane.ang.87.H file9=0200elf.bkim.plane.ang.88.H\
	    file10=0200elf.bkim.plane.ang.89.H exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > 9.H 
	Math file1=0200elf.bkim.plane.ang.90.H file2=0200elf.bkim.plane.ang.91.H file3=0200elf.bkim.plane.ang.92.H\
	     file4=0200elf.bkim.plane.ang.93.H file5=0200elf.bkim.plane.ang.94.H file6=0200elf.bkim.plane.ang.95.H\
	     file7=0200elf.bkim.plane.ang.96.H file8=0200elf.bkim.plane.ang.97.H file9=0200elf.bkim.plane.ang.98.H\
	    file10=0200elf.bkim.plane.ang.99.H \
	exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10+file11" > 10.H 
	Math file1=1.H file2=2.H file3=3.H file4=4.H file5=5.H file6=6.H file7=7.H file8=8.H file9=9.H file10=10.H \
	exp="file1+file2+file3+file4+file5+file6+file7+file8+file9+file10" > $@

#############################################
#
# Velocity optimization using plane waves
0220elfplane:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 0100elf.csou.H
	../Tese/bin/OWplane_areal.x sou=0100elf.csou.H rec=0100elf.crec.H v0=1473 \
	rec_pl=0220elf.crec.plane.H sou_pl=0220elf.csou.plane.H ango=-40 angd=1. node=16 > /dev/null

2230elfmigplane:
	echo o6=0 >> 2220elf.crec.plane.H
	Gpow gpow=-1 < 0000elf_velor.3590.H > 0000elf_sloor.3590.H
	../Tese/bin/OWmig2d_areal.x sou=2220elf.csou.plane.H rec=2220elf.crec.plane.H  \
	vel=0000elf_sloor.3590.H bkgimg=2200elf.bkim.velor.plane.H \
	zmin=0 zmax=4995 nh=31 oh=-405 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2231elfmigplane:
	echo o6=0 >> 2220elf.crec.plane.H
	< 0000elf_vedit.3590.rmo_sediment.H Pad extend=1 n3out=371 > 1.H
	../Tese/bin/OWmig2d_areal.x sou=2220elf.csou.plane.H rec=2220elf.crec.plane.H  \
	vel=1.H bkgimg=2200elf.bkim.vel_rmo_sedim.plane.H \
	zmin=0 zmax=4995 nh=31 oh=-405 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

0221elfpl.H:
	susynlv ref="1:-9000,500;90000.,500" nt=501 dt=0.004 dxs=25 nxs=501 fpeak=15 fxs=0 dxo=25 nxo=601 fxo=-7500 v00=4000 > junk1.su;< junk1.su Su2sep > junk1.H
	< junk1.H Infill3d > j2.H; echo n2=601 o2=-7500 d2=25 n3=501 o3=0 d3=25 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=30 f_max=36 wei=y is2d=y > j1.H
	< j1.H Transp plane=23 reshape=2,4,5 > $@
	Wavelet n1=501 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=1. domain=time > j2.H;echo o1=-1. >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=30 f_max=36 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 0100elf.csou.H
	../Tese/bin/OWplane_areal.x sou=0100elf.csou.H rec=$@ v0=4000 \
	rec_pl=0221elf.crec.plane.H sou_pl=0221elf.csou.plane.H ango=-40 angd=1. node=16 > /dev/null

0230elfmigplane:
	echo o6=0 >> 0220elf.crec.plane.H
	../Tese/bin/OWmig2d_areal.x sou=0220elf.csou.plane.H rec=0220elf.crec.plane.H  \
	vel=0000elf_vedit.3590.to4000.H bkgimg=0200elf.bkim.4000.plane.H \
	zmin=0 zmax=2000 nh=61 oh=-810 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

0231elfmigplane:
	Gpow gpow=-1 < 0000elf_velor.3590.H > v1.H
	echo o6=0 >> 0221elf.crec.plane.H
	../Tese/bin/OWmig2d_areal.x sou=0220elf.csou.plane.H rec=0220elf.crec.plane.H \
	vel=v1.H bkgimg=0231elf.bkim.plane.H \
	zmin=0 zmax=2000 nh=61 oh=-810 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

0232elfmigplane:
	< 0000elf_velor.3590.H Window3d squeeze=n n1=481 min1=0 n3=364 | ../Tese/bin/OW_vrms.x int2rms=1 > vrms.H
	Math file1=vrms.H file2=rmopicks.transp.H exp="file1*file2" | ../Tese/bin/OW_vrms.x int2rms=0 > vint.H
	Gpow gpow=-1 < vint.H | Pad beg1=1000 end1=1000 extend=1 > v1.H;
	echo o6=0 >> 0221elf.crec.plane.H
	../Tese/bin/OWmig2d_areal.x sou=0220elf.csou.plane.H rec=0220elf.crec.plane.H \
	vel=v1.H bkgimg=0232elf.bkim.plane.vrmo.H \
	zmin=0 zmax=2000 nh=61 oh=-810 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

0233elfmigplane:
	echo o6=0 >> 0221elf.crec.plane.H
	../Tese/bin/OWmig2d_areal.x sou=0220elf.csou.plane.H rec=0220elf.crec.plane.H \
	vel=0000elf_vedit.3590.rmo_sediment.to4000smoothed.H bkgimg=0233elf.bkim.plane.vrmo.H \
	zmin=0 zmax=4000 nh=61 oh=-810 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

0240elfplane:
	Math file1=0220elf.crec.plane.H exp="file1/1000000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > r1.H
	Math file1=0220elf.csou.plane.H exp="file1/1000000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > s1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=s1.H 0220elf.csou.plane.H rec=r1.H 0220elf.crec.plane.H \
	vel=0000elf_vedit.3590.to4000.H grad=0240elf.inv_grad.plane.H \
	Dimage=0240elf.inv_dso.plane.H bkgimg=0240elf.inv_bkim.plane.H Velout=0240elf.inv_vout.plane.H \
	zmin=0 zmax=3000 nh=31 oh=-405 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=15 xv_min=6400 xv_max=12555 \
	dxk=1080 nxk=7 oxk=6372 dzk=27 nzk=112 \
	horv0=hor.gt3070.plane.x8000 log=log_bfgs_elf0240.plane list=listagem_bfgs_elf0240.plane \
	padtraces=35 traces_in_taper=25 node=14 bounds=1 vmin=3000 vmax=5000 extrapolator=ffd

02400elfplane:
	Math file1=0220elf.crec.plane.H exp="file1/100000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > r1.H
	Math file1=0220elf.csou.plane.H exp="file1/100000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > s1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=s1.H 0220elf.csou.plane.H rec=r1.H 0220elf.crec.plane.H \
	vel=0000elf_vedit.3590.to4000.H grad=02400elf.inv_grad.plane.H \
	Dimage=02400elf.inv_dso.plane.H bkgimg=02400elf.inv_bkim.plane.H Velout=02400elf.inv_vout.plane.H \
	zmin=0 zmax=3000 nh=31 oh=-405 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=15 xv_min=6400 xv_max=12555 \
	dxk=2160 nxk=4 oxk=6372 dzk=27 nzk=112 sufx=02400\
	horv0=hor.gt3070.plane.x8000 log=log_bfgs_elf02400.plane list=listagem_bfgs_elf02400.plane \
	padtraces=35 traces_in_taper=25 node=14 bounds=1 vmin=1000 vmax=5000 extrapolator=ffd

0241elfplane:
	Math file1=0220elf.crec.plane.H exp="file1/1000000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > r1.H
	Math file1=0220elf.csou.plane.H exp="file1/1000000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > s1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=s1.H 0220elf.csou.plane.H rec=r1.H 0220elf.crec.plane.H \
	vel=0000elf_vedit.3590.to4000.H grad=0241elf.inv_grad.plane.H \
	Dimage=0241elf.inv_dso.plane.H bkgimg=0241elf.inv_bkim.plane.H Velout=0241elf.inv_vout.plane.H \
	zmin=0 zmax=3000 nh=31 oh=-405 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=15 xv_min=8046 6400 xv_max=10962 12555 \
	dxk= 135 nxk= 23 33 oxk= 7992 dzk= 27 nzk= 112 \
	horv0=hor.gt3070.plane.x8000.nopad log=log_bfgs_elf0241.plane list=listagem_bfgs_elf0241.plane \
	padtraces=0 35 traces_in_taper=0 25 node=14 bounds=1 vmin=1000 vmax=5000 extrapolator=ffd

#	dxk=1333.33 nxk=11 oxk=2600.034 dzk=26.6666 nzk=184 \
#	dxk=533.332 nxk=26 oxk=2600.034 dzk=26.6666 nzk=184 \
#	dxk=266.666 nxk=50 oxk=2600.034 dzk=26.6666 nzk=184 \
#	dxk=133.333 nxk=99 oxk=2600.034 dzk=26.6666 nzk=184 \

0243elfplane:
	Math file1=0220elf.crec.plane.H exp="file1/10000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > r1.H
	Math file1=0220elf.csou.plane.H exp="file1/10000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > s1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=s1.H 0220elf.csou.plane.H rec=r1.H 0220elf.crec.plane.H \
	vel=0000elf_vedit.3590.rmo_sediment.to4000smoothed.H grad=0243elf.inv_grad.plane.H \
	Dimage=0243elf.inv_dso.plane.H bkgimg=0243elf.inv_bkim.plane.H Velout=0243elf.inv_vout.plane.H \
	zmin=0 zmax=4000 nh=31 oh=-405 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=15 xv_min=8046 6400 xv_max=10962 12555 \
	dxk= 135 nxk= 23 33 oxk= 7992 dzk= 27 nzk= 112 \
	horv0=hor.2ndlobe.x8000.nopad log=log_bfgs_elf0243.plane list=listagem_bfgs_elf0243.plane \
	padtraces=0 35 traces_in_taper=0 25 node=14 bounds=1 cbounds=0 p_lo=30 p_up=30 extrapolator=ffd

0243elfplaneall:
	Math file1=0220elf.crec.plane.H exp="file1/10000" |Window3d squeeze=n min1=0 max1=13500 > r1.H
	Math file1=0220elf.csou.plane.H exp="file1/10000" |Window3d squeeze=n min1=0 max1=13500 > s1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=s1.H rec=r1.H \
	vel=0000elf_vedit.3590.rmo_sediment.to4000smoothed.H grad=0243elf.inv_grad.plane.all.H \
	Dimage=0243elf.inv_dso.plane.all.H bkgimg=0243elf.inv_bkim.plane.all.H Velout=0243elf.inv_vout.plane.all.H \
	horv0=hor.2ndlobe.x0 log=log_bfgs_elf0243.plane.all list=listagem_bfgs_elf0243.plane.all \
	zmin=0 zmax=4000 nh=31 oh=-405 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=15 xv_min=27 xv_max=13473 \
	dxk=135 nxk=101 oxk=0 dzk=27 nzk=152 \
	padtraces=0 traces_in_taper=0 node=14 bounds=1 cbounds=0 p_lo=20 p_up=30 extrapolator=ffd

0244elfplane:
	Math file1=0220elf.crec.plane.H exp="file1/10000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > r1.H
	Math file1=0220elf.csou.plane.H exp="file1/10000" |Window3d squeeze=n min1=8000 max1=11000 n4= 1 f4= 0 > s1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=s1.H 0220elf.csou.plane.H rec=r1.H 0220elf.crec.plane.H \
	vel=0000elf_vedit.3590.rmo_sediment.to4000smoothed.H grad=0244elf.inv_grad.plane.H \
	Dimage=0244elf.inv_dso.plane.H bkgimg=0244elf.inv_bkim.plane.H Velout=0244elf.inv_vout.plane.H \
	zmin=0 zmax=4000 nh=31 oh=-405 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=5 xv_min=8046 6400 xv_max=10962 12555 \
	dxk=135 nxk=23 33 oxk=7992 dzk=27 nzk=152 \
	horv0=hor.2ndlobe.x8000.nopad log=log_bfgs_elf0244.plane list=listagem_bfgs_elf0244.plane \
	padtraces=0 35 traces_in_taper=0 25 node=14 bounds=1 cbounds=0 p_lo=30 p_up=30 extrapolator=ffd

0244elfplaneall:
	Math file1=0220elf.crec.plane.H exp="file1/10" |Window3d squeeze=n min1=8000 max1=11000 > r2.H
	Math file1=0220elf.csou.plane.H exp="file1/1" |Window3d squeeze=n min1=8000 max1=11000 > s2.H
	../Tese/bin/OW_lbfgsc_areal.x sou=s2.H rec=r2.H \
	vel=0000elf_vedit.3590.rmo_sediment.to4000smoothed.H grad=0244elf.inv_grad.plane.all.H \
	Dimage=0244elf.inv_dso.plane.all.H bkgimg=0244elf.inv_bkim.plane.all.H Velout=0244elf.inv_vout.plane.all.H \
	horv0=hor.2ndlobe.x8000.nopad log=log_bfgs_elf0244.plane.all list=listagem_bfgs_elf0244.plane.all \
	zmin=0 zmax=3500 nh=15 31 oh=-216 405 jh=1 niter=5 dso=1 inversion=1 areal=1 mmax=5 xv_min=8046 xv_max=10962 \
	dxk=108 nxk=27 oxk=7992 dzk=27 nzk=152 \
	padtraces=0 traces_in_taper=0 node=14 bounds=1 cbounds=0 p_lo=20 p_up=30 extrapolator=ffd

2244elfplaneall:
	Math file1=2220elf.crec.plane.H exp="file1/1" |Window3d squeeze=n min1=8000 0 max1=11000 13500 > r2.H
	Math file1=2220elf.csou.plane.H exp="file1*100" |Window3d squeeze=n min1=8000 0 max1=11000 13500 > s2.H
	Window3d < 2244elf.inv_vout.plane.all.H n4=1 f4=1 squeeze=n | Gpow gpow=-1 > v1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=s2.H rec=r2.H \
	vel=v1.H 0000elf_vedit.3590.rmo_sediment.to2600smoothed.H grad=2244elf.inv_grad.plane.all.H \
	Dimage=2244elf.inv_dso.plane.all.H bkgimg=2244elf.inv_bkim.plane.all.H Velout=2244elf.inv_vout.plane.all.H \
	horv0=hor.gt3070.plane.x8000.nopad.prn hor.2ndlobe.x0 log=log_bfgs_elf2244.plane.all list=listagem_bfgs_elf2244.plane.all \
	zmin=0 zmax=3996 nh=31 oh=-405 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=1 10 xv_min=8046 xv_max=10962 13473 \
	dxk=81 135 nxk=38 23 101 oxk=7992 0 dzk=27 nzk=152 \
	padtraces=0 traces_in_taper=0 node=14 bounds=1 cbounds=0 p_lo=1 p_up=100 extrapolator=ffd

2264elfplaneall:
	Math file1=2220elf.crec.plane.H exp="file1/100"  |Window3d squeeze=n min1=8000 0 max1=11000 13500 > r2.H
	Math file1=2220elf.csou.plane.H exp="file1*1"|Window3d squeeze=n min1=8000 0 max1=11000 13500 > s2.H
	../Tese/bin/OW_lnsrch.x sou=s2.H rec=r2.H \
	vel=0000elf_vedit.3590.rmo_sediment.to3200smoothed.H grad=2264elf.inv_grad.plane.all.H \
	Dimage=2264elf.inv_dso.plane.all.H bkgimg=2264elf.inv_bkim.plane.all.H Velout=2264elf.inv_vout.plane.all.H \
	horv0=hor.gt3070.plane.x8000.nopad.prn log=log_lnsrch_elf2264.plane.all list=listagem_lnsrch_elf2264.plane.all listwolfe=listwolfe_elf2264.plane.all \
	zmin=0 zmax=3996 nh=31 oh=-405 jh=1 niter=5 dso=1 inversion=1 areal=1 mmax=1 10 xv_min=8046 xv_max=10962 13473 \
	dxk=270 405 nxk=12 28 oxk=7992 5292 dzk=54 108 nzk=77 39 \
	padtraces=0 25 traces_in_taper=0 25 node=14 bounds=1 cbounds=0 p_lo=1 p_up=100 extrapolator=ffd

2284elfplaneall:
	Math file1=2220elf.crec.plane.H exp="file1/100"  |Window3d squeeze=n min1=6000 max1=13500 > r3.H
	Math file1=2220elf.csou.plane.H exp="file1*1"|Window3d squeeze=n min1=6000 max1=13500 > s3.H
	../Tese/bin/OW_lnsrch.x sou=s3.H rec=r3.H \
	vel=0000elf_vedit.3590.rmo_sediment.to3200smoothed.H grad=2284elf.inv_grad.plane.all.H \
	Dimage=2284elf.inv_dso.plane.all.H bkgimg=2284elf.inv_bkim.plane.all.H Velout=2284elf.inv_vout.plane.all.H \
	horv0=hor.gt3070.x6000.pad50.prn log=log_lnsrch_elf2284.plane.all list=listagem_lnsrch_elf2284.plane.all listwolfe=listwolfe_elf2284.plane.all \
	zmin=0 zmax=3996 nh=31 oh=-405 jh=1 niter=5 dso=1 inversion=1 areal=1 mmax=1 10 xv_min=4671 xv_max=14823 \
	dxk=405 nxk=27 oxk=4644 dzk=54 nzk=77 \
	padtraces=25 traces_in_taper=25 node=14 bounds=1 cbounds=0 p_lo=1 p_up=100 extrapolator=ffd

2294elfplaneall:
	../Tese/bin/OW_lnsrch.x sou=s3.H rec=r3.H \
	vel=0000elf_vedit.3590.rmo_sediment.to3200smoothed.H grad=2294elf.inv_grad.plane.all.H \
	Dimage=2294elf.inv_dso.plane.all.H bkgimg=2294elf.inv_bkim.plane.all.H Velout=2294elf.inv_vout.plane.all.H \
	horv0=hor.gt3070.x6000.pad50.prn log=log_lnsrch_elf2294.plane.all list=listagem_lnsrch_elf2294.plane.all listwolfe=listwolfe_elf2294.plane.all \
	zmin=0 zmax=3996 nh=31 oh=-405 jh=1 niter=5 dso=1 inversion=1 areal=1 mmax=1 10 xv_min=4671 xv_max=14823 \
	dxk=3240 nxk=4 oxk=4644 dzk=54 nzk=77 \
	padtraces=25 traces_in_taper=25 node=14 bounds=1 cbounds=0 p_lo=1 p_up=100 extrapolator=ffd

2295elfplaneall:
	../Tese/bin/OW_lnsrch.x sou=s3.H rec=r3.H \
	vel=0000elf_vedit.3590.rmo_sediment.to3200smoothed.H grad=2295elf.inv_grad.plane.all.H \
	Dimage=2295elf.inv_dso.plane.all.H bkgimg=2295elf.inv_bkim.plane.all.H Velout=2295elf.inv_vout.plane.all.H \
	horv0=hor.gt3070.x6000.pad50.prn log=log_lnsrch_elf2295.plane.all list=listagem_lnsrch_elf2295.plane.all listwolfe=listwolfe_elf2295.plane.all \
	zmin=0 zmax=3996 nh=31 oh=-405 jh=1 niter=5 dso=1 inversion=1 areal=1 mmax=1 10 xv_min=4671 xv_max=14823 \
	dxk=3240 nxk=4 oxk=4644 dzk=54 nzk=77 expdso=2 \
	padtraces=25 traces_in_taper=25 node=14 bounds=1 cbounds=0 p_lo=1 p_up=100 extrapolator=ffd

2296elfplaneall:
	../Tese/bin/OW_lnsrch.x sou=s3.H rec=r3.H \
	vel=0000elf_vedit.3590.rmo_sediment.to3200smoothed.H grad=2296elf.inv_grad.plane.all.H \
	Dimage=2296elf.inv_dso.plane.all.H bkgimg=2296elf.inv_bkim.plane.all.H Velout=2296elf.inv_vout.plane.all.H \
	horv0=hor.gt3070.x6000.pad50.prn log=log_lnsrch_elf2296.plane.all list=listagem_lnsrch_elf2296.plane.all listwolfe=listwolfe_elf2296.plane.all \
	zmin=0 zmax=3996 nh=31 oh=-405 jh=1 niter=5 dso=1 inversion=1 areal=1 mmax=1 10 xv_min=4671 xv_max=14823 \
	dxk=3240 nxk=4 oxk=4644 dzk=54 nzk=77 expdso=4 \
	padtraces=25 traces_in_taper=25 node=14 bounds=1 cbounds=0 p_lo=1 p_up=100 extrapolator=ffd

2297elfplaneall:
	Math file1=2220elf.crec.plane.H exp="file1/100"  |Window3d squeeze=n min1=6000 max1=13500 > r3.H
	Math file1=2220elf.csou.plane.H exp="file1*1"|Window3d squeeze=n min1=6000 max1=13500  > s3.H
	../Tese/bin/OW_lnsrch.x sou=s3.H rec=r3.H \
	vel=0000elf_vedit.3590.rmo_sediment.to3200smoothed.H grad=2297elf.inv_grad.plane.all.H \
	Dimage=2297elf.inv_dso.plane.all.H bkgimg=2297elf.inv_bkim.plane.all.H Velout=2297elf.inv_vout.plane.all.H \
	horv0=hor.gt3070.x6000.pad50.prn log=log_lnsrch_elf2297.plane.all list=listagem_lnsrch_elf2297.plane.all listwolfe=listwolfe_elf2297.plane.all \
	zmin=0 zmax=3996 nh=31 oh=-405 jh=1 niter=20 dso=1 inversion=1 areal=1 mmax=1 10 xv_min=4671 xv_max=14823 \
	dxk=540 3240 nxk=52 4 oxk=4644 dzk=54 nzk=77 expdso=2 maxvchg=0.1 \
	padtraces=25 traces_in_taper=25 node=14 bounds=1 cbounds=0 p_lo=1 p_up=100 extrapolator=ffd

2298elfplaneall:
	Math file1=2220elf.crec.plane.H exp="file1/100"  |Window3d squeeze=n min1=6000 max1=13500 n4=1 f4=41 > r3.H
	Math file1=2220elf.csou.plane.H exp="file1*1"|Window3d squeeze=n min1=6000 max1=13500 n4=1 f4=41 > s3.H
	Window3d < 2297elf.inv_vout.plane.all.H squeeze=n n4=1 f4=2 | Gpow gpow=-1 > 2297elf.inv_sout.plane.all.3rd.H
	../Tese/bin/OW_lnsrch.x sou=s3.H rec=r3.H \
	vel=2297elf.inv_sout.plane.all.3rd.H grad=2298elf.inv_grad.plane.all.H \
	Dimage=2298elf.inv_dso.plane.all.H bkgimg=2298elf.inv_bkim.plane.all.H Velout=2298elf.inv_vout.plane.all.H \
	horv0=hor.gt3070.x6000.pad50.prn log=log_lnsrch_elf2298.plane.all list=listagem_lnsrch_elf2298.plane.all \
	listwolfe=listwolfe_elf2298.plane.all \
	zmin=0 zmax=3996 nh=31 oh=-405 jh=1 niter=2 20 dso=1 inversion=1 areal=1 mmax=1 10 xv_min=4671 xv_max=14823 \
	dxk=270 540 3240 nxk=104 52 4 oxk=4644 dzk=54 nzk=77 expdso=2 maxvchg=0.1 envelope=1 tc1=31 tc2=101\
	padtraces=25 traces_in_taper=25 node=14 bounds=1 cbounds=0 p_lo=1 p_up=100 extrapolator=ffd \
	smooth=0 serg_epsh=0.01 serg_niter=30 serg_eps1=0.002 serg_eps2=0.002 dip_niter=100 dip_eps=130.
#	dip3=dip3.H

###############################################################################
0250elf.rho.H:
	Window3d min1=0 max1=13000 < 0200elf.bkim.4000.plane.H|Transp plane=13|Transp plane=23 reshape=2,4,5|\
	Interp d2out=3.375 Pad beg1=100 end1=100 beg2=250 end2=250|OFF2ANG amax=60 eps=10 verb=y maxmem=1000 > x1.H
	Window3d < x1.H min1=0 max1=4000 min2=-40 max2=40 j4=10 | Agc window=50 | ../Tese/bin/OW_rhopanel.x method=gcg \
	exponent=.5 eps=1 niter=50 orho=0.8 drho=0.02 nrho=201 > m.H

0251elf.scan.rho.H:
	Window3d < 0200elf.bkim.4000.plane.H min1=0 n1=481 > x1.H
	../Tese/bin/OW_resmig.x nrho=201 orho=0.8 drho=0.002 bkgimg=x1.H Dimage=$@ scan=1 node=14

0260pick.optim.H:
#	Window3d < rmopicks.H n2=10 max1=2000 > rmo.H
#	Math file1=0251elf.scan.rho.H exp="file1/1000000"|Window3d n1=10 f1=100 |Transp plane=13 > 0251elf.scan.rho.tr1.H
	../Tese/bin/OW_simann_rmo.x rho0=rmo.H scan=0251elf.scan.rho.tr1.H maxevl=300000 iseed2=1371 rt=.85 ns=1 nt=5 t=95.  cbound=0 optrho=$@
#	Window3d < rmopicks.H max1=2000 > rmo.H
#	Math file1=0251elf.scan.rho.H exp="file1/1000000000000"|Transp plane=13 > 0251elf.scan.rho.tr.H

0261pick.brute.H:
#	Window3d < rmopicks.H n2=100 max1=2000 > rmo.H
#	Math file1=0251elf.scan.rho.H exp="file1/1000000"|Window3d min2=-270 max2=297 n1=100 max3=2000|Transp plane=13 > 0251elf.scan.rho.tr1.H
#	Window3d min3=2000 max3=5000 min2=-270 max2=297< 0251elf.scan.rho.tr1.H > 0251elf.scan.rho.tr2.H
	../Tese/bin/OW_brute_rmo.x scan=0251elf.scan.rho.tr1.H node=14 jx=23 jz=13 eps2=0 400 eps1= 0 40 optrho=$@ corridor=1 rho0=rmo.H perc1=5 perc2=10 nfunc=2

############################################
0300elf.window.H:
	< 0200elf.bkim.H Window3d min1=0 max1=13000 > 1.H
	< 1.H ../Tese/bin/OW_windowing.x nhorz=7 hor1=elf_h1 hor2=elf_h2 hor3=elf_h3 hor4=elf_h4 \
	hor5=elf_h5 hor6=elf_h6 hor7=elf_h7 wavz=21 > $@

0400elf_rotsd:
	Window3d <0300elf.window.H n1=180 f1=0 n4=1 f4=0  |Transp plane=13|\
	../Tese/bin/OW_3dslant.x nax=21 nah=31 oax=-20 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg3=0 end3=308 > h1.sou.sd.H
	Window3d <0300elf.window.H n1=180 f1=0 n4=1 f4=0  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=21 nah=31 oax=-20 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg3=0 end3=308 > h1.rec.sd.H
##
	Window3d <0300elf.window.H n1=200 f1=240 n4=1 f4=1  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg3=240 end3=48 > h2.sou.sd.H
	Window3d <0300elf.window.H n1=200 f1=240 n4=1 f4=1  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg3=240 end3=48 > h2.rec.sd.H
##
	Window3d <0300elf.window.H n1=90 f1=390 n4=1 f4=2  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg3=390 end3=8 > h3.sou.sd.H
	Window3d <0300elf.window.H n1=90 f1=390 n4=1 f4=2  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg3=390 end3=8 > h3.rec.sd.H
##
	Window3d <0300elf.window.H n1=150 f1=320 n4=1 f4=3  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg3=320 end3=18 > h4.sou.sd.H
	Window3d <0300elf.window.H n1=150 f1=320 n4=1 f4=3  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg3=320 end3=18 > h4.rec.sd.H
##
	Window3d <0300elf.window.H n1=180 f1=0 n4=1 f4=4 |Transp plane=13|\
	../Tese/bin/OW_3dslant.x nax=21 nah=31 oax=-20 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg3=0 end3=308 > h5.sou.sd.H
	Window3d <0300elf.window.H n1=180 f1=0 n4=1 f4=4 |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=21 nah=31 oax=-20 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg3=0 end3=308 > h5.rec.sd.H
##
	Window3d <0300elf.window.H n1=70 f1=350 n4=1 f4=5  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg3=350 end3=68 > h6.sou.sd.H
	Window3d <0300elf.window.H n1=70 f1=350 n4=1 f4=5  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg3=350 end3=68 > h6.rec.sd.H
##
	Window3d <0300elf.window.H n1=180 f1=0 n4=1 f4=6  |Transp plane=13|\
	../Tese/bin/OW_3dslant.x nax=21 nah=31 oax=-20 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg3=0 end3=308 > h7.sou.sd.H
	Window3d <0300elf.window.H n1=180 f1=0 n4=1 f4=6  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=21 nah=31 oax=-20 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg3=0 end3=308 > h7.rec.sd.H
##
	Cat h1.sou.sd.H h2.sou.sd.H h3.sou.sd.H h4.sou.sd.H h5.sou.sd.H h6.sou.sd.H h7.sou.sd.H axis=4 >0400elf.rot.sou.sd.H
	Cat h1.rec.sd.H h2.rec.sd.H h3.rec.sd.H h4.rec.sd.H h5.rec.sd.H h6.rec.sd.H h7.rec.sd.H axis=4 >0400elf.rot.rec.sd.H
	Rm h*.rec.sd.H h*.sou.sd.H 1.H

0500elf_perm%:
	Window3d < 0400elf.rot.sou.sd.H min3=5000 |Transp plane=13 > s1.H
	Window3d < 0400elf.rot.rec.sd.H min3=5000 |Transp plane=13 > r1.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=30 f_max=36 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13|Window3d squeeze=n f3=1 > 0100elf.csou.H
	<0000elf_vedit.3590.H Window3d | Transp > 1.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=0100elf.csou.H vel=1.H \
	rec_out=0500elf.crec$*.perm.H sou_out=0500elf.csou$*.perm.H nrefvel=4 vsal=7000 \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=1 ngap=$* zmin=0 zmax= 3000 node=14 \
	> /dev/null 

0502elf_perm%:
	Window3d < 0400elf.rot.sou.sd.H min3=5000 |Transp plane=13 > s1.H
	Window3d < 0400elf.rot.rec.sd.H min3=5000 |Transp plane=13 > r1.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=30 f_max=36 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13|Window3d squeeze=n f3=1 > 0100elf.csou.H
	<0000elf_vedit.3590.H Window3d | Transp > 1.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=0100elf.csou.H vel=1.H \
	rec_out=0500elf.crec$*.perm.H sou_out=0500elf.csou$*.perm.H nrefvel=4 vsal=7000 \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=2 ngap=$* zmin=0 zmax= 3000 node=14 \
	> /dev/null 

0600elfperm%:
	<0500elf.crec$*.perm.H Transp plane=13|Window3d squeeze=n min1=6000 >0500elf.crec$*.perm.pad.H
	<0500elf.csou$*.perm.H Transp plane=13|Window3d squeeze=n min1=6000 >0500elf.csou$*.perm.pad.H
	<0000elf_vedit.3590.H Gpow gpow=-1 > 1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=0500elf.csou$*.perm.pad.H rec=0500elf.crec$*.perm.pad.H \
	vel=1.H grad=0600elf.inv_grad$*.perm.H \
	Dimage=0600elf.inv_dso$*.perm.H bkgimg=0600elf.inv_bkim$*.perm.H Velout=0600elf.inv_vout$*.perm.H \
	zmin=0 zmax=4900 nh=31 oh=-399.999 jh=1 niter=25 dso=1 inversion=1 areal=1 nxfilt= 100 mmax=5 xv_min=6500 xv_max=12500 \
	dxk=266.666 nxk=51 oxk=4386.6940 dzk=26.6666 nzk=184 \
	horv0=elf_v0.6000 log=log_bfgs_elf0.perm$* list=listagem_bfgs_elf0.perm$* \
	padtraces=35 traces_in_taper=25 node=14 bounds=1 vmin=3000 vmax=6000 vsal=7000 nrefvel=4 sufx=$* > /dev/null &

###################################
#
# Right portion
#
# Transp plane=13 < 2200elf.bkim.vel_rmo_sedim.plane.H | Window3d min3=6000 max3=13000 min2=-189 n2=15 | Grey eout=1 pclip=99 gainpanel=a > x.T
#
#
############################################
1000elf.window.H:
	< 2200elf.bkim.vel_rmo_sedim.plane.H Window3d min1=6000 max1=13000 min2=-189 n2=15 > 1.H
	< 1.H ../Tese/bin/OW_windowing.x nhorz=4 hor1=elf_right1 hor2=elf_right2 hor3=elf_right3 hor4=elf_right4 wavz=13 > $@
#3 hor4=elf_right4 hor5=elf_right5 wavz=13 > $@

1100elf_rotsd:
	Window3d <1000elf.window.H n4=1 f4=0 |Transp plane=13|\
	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 > h1.sou.sd.H
	Window3d <1000elf.window.H n4=1 f4=0 |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 > h1.rec.sd.H
#
	Window3d <1000elf.window.H n4=1 f4=1  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 > h2.sou.sd.H
	Window3d <1000elf.window.H n4=1 f4=1  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 > h2.rec.sd.H
#
	Window3d <1000elf.window.H n4=1 f4=2  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 > h3.sou.sd.H
	Window3d <1000elf.window.H n4=1 f4=2  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 > h3.rec.sd.H
#
	Window3d <1000elf.window.H n4=1 f4=3  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1  > h4.sou.sd.H
	Window3d <1000elf.window.H n4=1 f4=3  |Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 > h4.rec.sd.H
###
##	Window3d <1000elf.window.H n1=260 f1=50 n4=1 f4=4 |Transp plane=13|\
##	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
##	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg3=50 end3=9 > h5.sou.sd.H
##	Window3d <1000elf.window.H n1=260 f1=50 n4=1 f4=4 |Transp plane=13 | \
##	../Tese/bin/OW_3dslant.x nax=41 nah=41 oax=-40 oah=-40 dax=2 dah=2 \
##	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg3=50 end3=9 > h5.rec.sd.H
##
#	Cat h1.sou.sd.H h2.sou.sd.H h3.sou.sd.H h4.sou.sd.H h5.sou.sd.H axis=4 >1100elf.rot.sou.sd.H
#	Cat h1.rec.sd.H h2.rec.sd.H h3.rec.sd.H h4.rec.sd.H h5.rec.sd.H axis=4 >1100elf.rot.rec.sd.H
	Cat h1.sou.sd.H h2.sou.sd.H h3.sou.sd.H h4.sou.sd.H axis=4 >1100elf.rot.sou.sd.H
	Cat h1.rec.sd.H h2.rec.sd.H h3.rec.sd.H h4.rec.sd.H axis=4 >1100elf.rot.rec.sd.H
#	Rm h*.rec.sd.H h*.sou.sd.H 1.H

1200elf_perm%:
	Window3d < 1100elf.rot.sou.sd.H |Transp plane=13 > s1.H
	Window3d < 1100elf.rot.rec.sd.H |Transp plane=13 > r1.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=30 f_max=36 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 0100elf.csou.H
	< 0000elf_vedit.3590.rmo_sediment.H Pad extend=1 n3out=371|Gpow gpow=-1 > 1.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=0100elf.csou.H vel=1.H \
	rec_out=1200elf.crec$*.perm.H sou_out=1200elf.csou$*.perm.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=1 ngap=$* zmin=0 zmax= 3000 node=14 \
	> /dev/null 

1300elfperm%:
	Math file1=1200elf.crec$*.perm.H exp="file1/10000" | Window3d squeeze=n n3= 5 f3= 25 > 0500elf.crec$*.perm.H
	Math file1=1200elf.csou$*.perm.H exp="file1/10000" | Window3d squeeze=n n3= 5 f3= 25 > 0500elf.csou$*.perm.H
	< 0000elf_vedit.3590.rmo_sediment.H Pad extend=1 n3out=371 > 1.H
	../Tese/bin/OW_lbfgsc_areal.x sou=0500elf.csou$*.perm.H rec=0500elf.crec$*.perm.H \
	vel=1.H grad=1300elf.inv_grad$*.perm.H Dimage=1300elf.inv_dso$*.perm.H bkgimg=1300elf.inv_bkim$*.perm.H Velout=1300elf.inv_vout$*.perm.H \
	zmin=0 zmax=4990 nh=15 oh=-189 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=15 xv_min=6500 xv_max=12500 \
	dxk=270 nxk=41 oxk=4185 dzk=27 nzk=186 \
	horv0=hor.gt3070a.csv log=log_bfgs_elf1300.perm$* list=listagem_bfgs_elf1300.perm$* \
	padtraces=35 traces_in_taper=25 node=14 bounds=1 cbounds=0 p_lo=20 p_up=20 extrapolator=ffd

1201elf_perm%:
	Window3d < 1100elf.rot.sou.sd.H min3=5000 n4=1 f4=2|Transp plane=13 > s1.H
	Window3d < 1100elf.rot.rec.sd.H min3=5000 n4=1 f4=2|Transp plane=13 > r1.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=30 f_max=36 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 0100elf.csou.H
	<0000elf_vedit.3590.to2600.H Gpow gpow=-1 > 1.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=0100elf.csou.H vel=1.H \
	rec_out=1200elf.crec$*.perm.h3.H sou_out=1200elf.csou$*.perm.h3.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=0 random=1 injection=1 nreal=1 ngap=$* zmin=0 zmax= 3000 node=14 \
	> /dev/null 

1301elfperm%:
	Math file1=1200elf.crec$*.perm.h3.H exp="file1/10" |Window3d squeeze=n min1= 6000 >0500elf.crec$*.perm.pad.h3.H
	Math file1=1200elf.csou$*.perm.h3.H exp="file1/10" |Window3d squeeze=n min1= 6000 >0500elf.csou$*.perm.pad.h3.H
	../Tese/bin/OW_lbfgsc_areal.x sou=0500elf.csou$*.perm.pad.h3.H rec=0500elf.crec$*.perm.pad.h3.H \
	vel=0000elf_vedit.3590.to2600.H grad=1301elf.inv_grad$*.perm.H \
	Dimage=1301elf.inv_dso$*.perm.H bkgimg=1301elf.inv_bkim$*.perm.H Velout=1301elf.inv_vout$*.perm.H \
	zmin=0 zmax=3500 nh=15 oh=-186.662 jh=1 niter=25 dso=1 inversion=1 areal=1 mmax=15 xv_min=5500 xv_max=13000 \
	dxk=1333.33 nxk=11 oxk=4386.6940 dzk=26.6666 nzk=184 \
	horv0=hor2600.5000.txt log=log_bfgs_elf1301.perm$* list=listagem_bfgs_elf1301.perm$* \
	padtraces=35 traces_in_taper=25 node=14 bounds=1 vmin=2500 vmax=5000 extrapolator=ffd

#	dxk=1333.33 nxk=11 oxk=2600.034 dzk=26.6666 nzk=184 \
#	dxk=533.332 nxk=26 oxk=2600.034 dzk=26.6666 nzk=184 \
#	dxk=266.666 nxk=50 oxk=2600.034 dzk=26.6666 nzk=184 \
#	dxk=133.333 nxk=99 oxk=2600.034 dzk=26.6666 nzk=184 \

##############################
##############################
##############################
##############################
####  AMOed data 25m #########
##############################
##############################
##############################
##############################
#
# On pompei
# Window3d < /scr1/bob/claudio.HH | Transp plane=23 | Interp d3out=25 maxsize=1000 > iline4000.H
# echo d2=50 >> iline4000.H ; < iline4000.H Interp d2out=25 maxsize=1000 > iline4000_h25.H
# Window3d < ../Elf3d/xxx.H | Interp d1out=0.004 |Interp d2out=25|Interp d3out=25 maxsize=1000 | Window3d n1=1001 > iline2500_25m.H


2000elf_data_recip.H:
	< iline2500_25m.H Transp plane=23 > j1.H;<j1.H Reverse opt=no which=2 | Window3d max2=-0.002 > junk4.H
	Merge axis=2 space=n junk4.H j1.H > junk5.H
	Create3d < junk5.H keyname1=offset keyname2=cmp verb=1 > junk6.H
	Headermath key1=sx eqn1="cmp-0.5*offset" < junk6.H > junk7.H
	Sort3d < junk7.H nkeys=2 key2=sx ng2=501 og2=0 dg2=25 key1=offset ng1=287 og1=-3575 dg1=25 max_size=1000 > junk8.H
	<junk8.H Infill3d > $@

2101elf.crec.H:
	< 2000elf_data_recip.H Scale scale_to=1|Transf shotmig=y is2d=y wei=y f_min=0 f_min1=6 f_max1=28 40 f_max=32 46 maxsize=1000>j2.H
	< j2.H Pad beg1=200 end1=200 > $@

2220elfplane:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=28 40 f_max=32 46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 2100elf.csou.H
	../Tese/bin/OWplane_areal.x sou=2100elf.csou.H rec=2101elf.crec.H v0=1473 \
	rec_pl=2220elf.crec.plane.H sou_pl=2220elf.csou.plane.H ango=-40 angd=1. node=14 > /dev/null

3101elf.crec.H:
	< 2000elf_data_recip.H Scale scale_to=1|Transf shotmig=y is2d=y wei=y f_min=0 f_min1=6 f_max1=40 f_max=46 maxsize=1000>j2.H
	< j2.H Pad beg1=200 end1=200 > $@

3220elfplane:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=25 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 3100elf.csou.H
	../Tese/bin/OWplane_areal.x sou=3100elf.csou.H rec=3101elf.crec.H v0=1473 \
	rec_pl=3220elf.crec.plane.H sou_pl=3220elf.csou.plane.H ango=-40 angd=1. node=14 > /dev/null

4000elf_data_recip.H:
#	Transf < ../Elf3d/cmp_gathers2500.H >j1.H;<j1.H Window3d | Transp plane=23 | Interp d3out=25 maxsize=1000 > j0.H
#	echo d2=50 >> j0.H ; < j0.H Interp d2out=25 maxsize=1000 >iline2500_25m.H;echo label2=offset label3=cmp >>iline2500_25m.H
#	< iline2500_25m.H Transp plane=13|Window3d >j1.H;<j1.H Reverse opt=no which=2|Window3d max2=-0.002 > junk4.H
	Merge axis=2 space=n junk4.H j1.H | Transp plane=13 > junk5.H
	Create3d < junk5.H keyname1=offset keyname2=cmp verb=1 > junk6.H
	Headermath key1=sx eqn1="cmp-0.5*offset" < junk6.H > junk7.H
	Sort3d < junk7.H nkeys=2 key2=sx ng2=501 og2=0 dg2=25 key1=offset ng1=287 og1=-3575 dg1=25 max_size=1000 > junk8.H
	<junk8.H Infill3d > $@

4101elf.crec.H:
	< 4000elf_data_recip.H Transp plane=35|Transf shotmig=y is2d=y wei=y f_min=0 f_min1=6 f_max1=54 f_max=60 maxsize=1000>j2.H
	< j2.H Pad beg1=200 end1=200 > $@

4220elfplane:
	Spike n1=1024 d1=0.00585936 o1=0 n2=1 d2=1 o2=0 nsp=1 k1=513 >j2.H;echo o1=-2.99999232>>j2.H;<j2.H Bandpass flo=0 fhi=60|\
	Transf f_min=0 f_min1=6 f_max1=50 f_max=60 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 4100elf.csou.H
	Transp plane=54 < 4101elf.crec.H > j1.H;echo d3=0.166667 >> j1.H
	../Tese/bin/OWplane_areal.x sou=4100elf.csou.H rec=j1.H v0=1473 \
	rec_pl=4220elf.crec.plane.H sou_pl=4220elf.csou.plane.H ango=-40 angd=1. node=14 > /dev/null

5000elf_data_recip.H:
	Transf < ../Elf3d/cmp_gathers2500.H >j1.H;<j1.H Window3d > iline2500_20m.H;echo label2=offset label3=cmp >>iline2500_20m.H
	< iline2500_20m.H Transp plane=23 | Interp d2out=20 maxsize=1000 |Window3d >j1.H;<j1.H Reverse opt=no which=2|Window3d max2=-0.002 > junk4.H
	Merge axis=2 space=n junk4.H j1.H > junk5.H
	Create3d < junk5.H keyname1=offset keyname2=cmp verb=1 > junk6.H
	Headermath key1=sx eqn1="cmp-0.5*offset" < junk6.H > junk7.H
	Sort3d < junk7.H nkeys=2 key2=sx ng2=672 og2=0 dg2=20 key1=offset ng1=360 og1=-3575 dg1=20 max_size=1000 > junk8.H
	<junk8.H Infill3d > $@

5101elf.crec.H:
	< 5000elf_data_recip.H Transp plane=35|Transf shotmig=y is2d=y wei=y f_min=0 f_min1=6 f_max1=54 f_max=60 maxsize=1000>j2.H
	< j2.H Pad beg1=250 end1=250 > $@

5220elfplane:
	Spike n1=1024 d1=0.00585936 o1=0 n2=1 d2=1 o2=0 nsp=1 k1=513 >j2.H;echo o1=-2.99999232>>j2.H;<j2.H Bandpass flo=0 fhi=60|\
	Transf f_min=0 f_min1=6 f_max1=50 f_max=60 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 5100elf.csou.H
	Transp plane=54 < 5101elf.crec.H > j1.H;echo d3=0.166667 >> j1.H
	../Tese/bin/OWplane_areal.x sou=5100elf.csou.H rec=j1.H v0=1473 \
	rec_pl=5220elf.crec.plane.H sou_pl=5220elf.csou.plane.H ango=-40 angd=1. node=14 > /dev/null


0000elf_velor.2500.25m.H:
	Window3d </data/elf_L7d/L7d-vel.H n3=1 min3=2500|Transp plane=12 reshape=1,3 |\
	Interp d1out=25 d3out=12.5 o1out=0 type=1| Pad extend=1 beg1=1000 end1=1000 > $@

0000elf_veled.2500.25m.H:
	Window3d </data/elf_L7d/L7d-vel.H n3=1 min3=2500|Transp plane=12 reshape=1,3 |\
	Interp d1out=25 d3out=12.5 o1out=0 type=1| Pad extend=1 beg1=1000 end1=1000 > $@

2200elf_bkim.plane:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=6000 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=6000 max1=13000 > 3.H
	< 0000elf_velor.2500.25m.H Gpow gpow=-1 > 1.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=1.H bkgimg=2200elf.bkim.velor.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkim.plane.pspi:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=6000 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=6000 max1=13000 > 3.H
	< 0000elf_velor.2500.25m.H Gpow gpow=-1 > 1.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=1.H bkgimg=2200elf.bkim.velor.plane.pspi.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=pspi vsal=7000 nrefvel=4

2200elf_bkim:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=25 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 2100elf.csou.H
	< 0000elf_velor.3590.25m.H Gpow gpow=-1 > 1.H
	< 2101elf.crec.H Window3d squeeze=n min4=6000 > 2.H
	../Tese/bin/OWmig2d_areal.x sou=2100elf.csou.H rec=2.H 2101elf.crec.H \
	vel=1.H bkgimg=2200elf.bkim.velor.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=0 \
	padtraces=0 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkimor:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 0100elf.csou.H
	< 0000elf_velor.3590.H Gpow gpow=-1 > 1.H
	../Tese/bin/OWmig2d_areal.x sou=0100elf.csou.H rec=0100elf.crec.H \
	vel=1.H bkgimg=0200elf.bkim.or.H \
	zmin=0 zmax=4900 nh=31 oh=-399.9990 migration=1 areal=0 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2000elf_vedit.2500.H:
	< 0000elf_velor.2500.25m.H Window3d min1=0 max1=13000 squeeze=n | Gpow gpow=-1|Smooth rect1=51 rect3=51 | Scale dscale=1.1 |Gpow gpow=-1|../Tese/bin/OW_editvel_mut.x hor1=topchalk_2500_ind02.csv \
	vthr=1 v=2500 > k.H
	< 0000elf_velor.2500.25m.H Window3d min1=0 max1=13000 squeeze=n | ../Tese/bin/OW_editvel_mut.x hor1=topchalk_2500_ind02.csv hor2500.gt2700 vvel=1 vsub=k.H | Gpow gpow=-1 |\
	Pad extend=1 beg1=1000 end1=1000 > $@

2200elf_bkim.plane.vedit2500:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2000elf_vedit.2500.H bkgimg=2200elf.bkim.veledit.2500.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkimed:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=28 40 f_max=32 46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 2100elf.csou.H
	../Tese/bin/OWmig2d_areal.x sou=2100elf.csou.H rec=2101elf.crec.H \
	vel=2000elf_vedit.2500.H bkgimg=0200elf.bkim.ed.H \
	zmin=0 zmax=4900 nh=33 oh=-400 migration=1 areal=0 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2300elf.window.LS01.H:
	< 0200elf.bkim.ed.H Window3d min1=0 max1=13000 min2=-375 n2=31 | Transp plane=13| Transp plane=23 | Fx2d lambda=10.| Transp plane=23 |Transp plane=13 > 1.H
	< 1.H ../Tese/bin/OW_windowing.x nhorz=1 hor1=basechalk_prstk_375_sht_1 wavz=7 | Transp plane=13 |../Tese/bin/OW_scale.x|Transp plane=13 > $@

2300elf.window.LS01_1.H:
	< 0200elf.bkim.ed.H Window3d min1=0 max1=13000 min2=-375 n2=31 | Transp plane=13| Transp plane=23 | Fx2d lambda=10.| Transp plane=23 |Transp plane=13 > 1.H
	< 1.H ../Tese/bin/OW_windowing.x nhorz=1 hor1=basechalk_prstk_375_sht_1 wavz=7|Transp plane=13|../Tese/bin/OW_scale1.x|Transp plane=13 > $@

2301elf_rotsd:
	< 2300elf.window.LS01.H Window3d max3=4000 | Transp plane=13 | ../Tese/bin/OW_3dslant.x nax=41 nah=31 oax=-40 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 > 2301elf.sou.LS01.H
	< 2300elf.window.LS01.H Window3d max3=4000 |Transp plane=13 | ../Tese/bin/OW_3dslant.x nax=41 nah=31 oax=-40 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 > 2301elf.rec.LS01.H

2301elf_rotsd_1:
	< 2300elf.window.LS01_1.H Window3d max3=4000 | Transp plane=13 | ../Tese/bin/OW_3dslant.x nax=41 nah=31 oax=-40 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 > 2301elf.sou.LS01_1.H
	< 2300elf.window.LS01_1.H Window3d max3=4000 |Transp plane=13 | ../Tese/bin/OW_3dslant.x nax=41 nah=31 oax=-40 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 > 2301elf.rec.LS01_1.H

2302elf.LS01.perm%:
	< 2301elf.rec.LS01.H Transp plane=13 > r1.H
	< 2301elf.sou.LS01.H Transp plane=13 > s1.H
	Math file1=2000elf_vedit.2500.H exp="file1*2" > 2000elf_vedit.2500.v2.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=20 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=4 f_max1=30 f_max=36 wei=y is2d=y shotmig=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 11111.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=11111.H vel=2000elf_vedit.2500.v2.H \
	rec_out=2302elf.LS01.crec$*.perm.H sou_out=2302elf.LS01.csou$*.perm.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=10 ngap=$* zmin=0 zmax=2987.5 node=14

2302elf.LS01_1.perm%:
	< 2301elf.rec.LS01_1.H Transp plane=13 > r1.H
	< 2301elf.sou.LS01_1.H Transp plane=13 > s1.H
	Math file1=2000elf_vedit.2500.H exp="file1*2" > 2000elf_vedit.2500.v2.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=20 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=4 f_max1=30 f_max=36 wei=y is2d=y shotmig=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 11111.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=11111.H vel=2000elf_vedit.2500.v2.H \
	rec_out=2302elf.LS01_1.crec$*.perm.H sou_out=2302elf.LS01_1.csou$*.perm.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=10 ngap=$* zmin=0 zmax=2987.5 node=14

2303elf.LS01.%:
	Math file1=2302elf.LS01.crec$*.perm.H exp="file1/100" |Window3d n4=1 squeeze=n > 2302elf.LS01.crec.perm.H
	Math file1=2302elf.LS01.csou$*.perm.H exp="file1/100" |Window3d n4=1 squeeze=n > 2302elf.LS01.csou.perm.H
	Math file1=2000elf_vedit.2500.H exp="file1*2" | Window3d min1=1000 max1=12000 squeeze=n | Pad beg1=1000 end1=1000 extend=1 > 2000elf_vedit.2500.v2.H
#	Window3d < 2303elf.LS01.inv_vout$*.perm.H n4=1 f4=2 squeeze=n | Gpow gpow=-1 | Pad beg1=1000 end1=1000 end3=200 extend=1> v.H 
	../Tese/bin/OW_lbfgsc_areal.x sou=2302elf.LS01.csou.perm.H rec=2302elf.LS01.crec.perm.H \
	vel=2000elf_vedit.2500.v2.H grad=2303elf.LS01.inv_grad$*.perm.H \
	Dimage=2303elf.LS01.inv_dso$*.perm.H bkgimg=2303elf.LS01.inv_bkim$*.perm.H \
	Velout=2303elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=17 oh=-200 jh=1 niter=15 dso=1 mmax=1 3 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=1000 nxk=19 oxk=-2700 dzk=16 nzk=241 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 cbounds=0 vmin=1000 vmax=2600 p_lo=40 p_up=40 \
	log=log_bfgs_elf.LS01.perm.$* list=listagem_bfgs_elf.LS01.perm.$* 

2304elf.LS01.%:
	Math file1=2302elf.LS01.crec$*.perm.H exp="file1/100" |Window3d n4= j4=2 squeeze=n > 2302elf.LS01.crec.perm.H
	Math file1=2302elf.LS01.csou$*.perm.H exp="file1/100" |Window3d n4= j4=2 squeeze=n > 2302elf.LS01.csou.perm.H
	Math file1=2000elf_vedit.2500.H exp="file1*2" | Window3d min1=1000 max1=12000 squeeze=n |\
	Pad beg1=1000 end1=1000 extend=1 > 2000elf_vedit.2500.v2.H
	../Tese/bin/steepest_ls.x sou=2302elf.LS01.csou.perm.H rec=2302elf.LS01.crec.perm.H \
	vel=2000elf_vedit.2500.v2.H grad=2304elf.LS01.inv_grad$*.perm.H \
	Dimage=2304elf.LS01.inv_dso$*.perm.H bkgimg=2304elf.LS01.inv_bkim$*.perm.H \
	Velout=2304elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=31 oh=-375 jh=1 niter=15 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=2000 nxk=10 oxk=-2875 dzk=16 nzk=241 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 cbounds=0 vmin=1000 vmax=2600 p_lo=40 p_up=40 

2200elf_bkim.plane.voptimLS01_20:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	< 2304elf.LS01.inv_vout20.perm.H Window3d n4=1 f4=6 squeeze=n |Scale dscale=2.|\
	Gpow gpow=-1|Pad beg1=1000 end1=1000 end3=200 extend=1 > v.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=v.H bkgimg=2200elf.bkim.veloptim.LS01_20.plane.H \
	zmin=0 zmax=3000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2000elf_LS01_vedit.2500.H:
	< 2304elf.LS01.inv_vout20.perm.H Window3d min1=0 max1=13000 n4=1 f4=6 squeeze=n n3=171 |Scale dscale=2.|Gpow gpow=-1|\
	Pad end3=200 extend=1 > v.H
	< 2000elf_vedit.2500.H Window3d min1=0 max1=13000 squeeze=n > w.H
	< v.H ../Tese/bin/OW_editvel_mut.x hor1=basechalk_LS01_stk.csv vvel=1 vsub=w.H |Pad extend=1 beg1=1000 end1=1000 end3=100 > $@

2200elf_bkim.plane.veditLS01_20:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2000elf_LS01_vedit.2500.H bkgimg=2200elf.bkim.veledit.LS01.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2300elf.window.LS02.H:
#	< 2200elf.bkim.veledit.LS01.plane.H Window3d min1=0 max1=13000 min2=-375 n2=31 | Transp plane=13|Fx2d lambda=10.|\
#	Transp plane=23 | Fx2d lambda=10.| Transp plane=23 |Transp plane=13 > 1.H
	< 1.H ../Tese/bin/OW_windowing.x nhorz=3 dip=1 hor1=elf_hor_LS0201_1 hor2=elf_hor_LS0201_2 hor3=elf_hor_LS0201_3\
	wavz=7 | Transp plane=13|../Tese/bin/OW_scale.x|Transp plane=13 > $@

2302elf_rotsd:
#	< 2300elf.window.LS02.H Window3d max3=4000 n4=1 f4=0 n1=150 f1=30 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=11 nah=31 oax=-10 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1|Pad beg3=30 end3=340 > h1.sou.LS02.H
#	< 2300elf.window.LS02.H Window3d max3=4000 n4=1 f4=0 n1=150 f1=30 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=11 nah=31 oax=-10 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1|Pad #beg3=30 end3=340 > h1.rec.LS02.H
##
	< 2300elf.window.LS02.H Window3d max3=4000 n4=1 f4=1 n1=100 f1=320 | Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1|Pad beg3=320 end3=100 > h2.sou.LS02.H
	< 2300elf.window.LS02.H Window3d max3=4000 n4=1 f4=1 n1=100 f1=320 | Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1|Pad beg3=320 end3=100 > h2.rec.LS02.H
##
#	< 2300elf.window.LS02.H Window3d max3=4000 n4=1 f4=2 n1=50 f1=430 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1|Pad beg3=430 end3=40 > h3.sou.LS02.H
#	< 2300elf.window.LS02.H Window3d max3=4000 n4=1 f4=2 n1=50 f1=430 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=31 nah=31 oax=-30 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1|Pad beg3=430 end3=40 > h3.rec.LS02.H
##
#	< 2300elf.window.LS02.H Window3d max3=4500 n4=1 f4=3 f1=290 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1|Pad beg3=290 > h4.sou.LS02.H
#	< 2300elf.window.LS02.H Window3d max3=4500 n4=1 f4=3 f1=290 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1|Pad beg3=290 > h4.rec.LS02.H
##
#	< 2300elf.window.LS02.H Window3d max3=4500 n4=1 f4=4 f1=290 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1|Pad beg3=290 > h5.sou.LS02.H
#	< 2300elf.window.LS02.H Window3d max3=4500 n4=1 f4=4 f1=290 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1|Pad beg3=290 > h5.rec.LS02.H
##
#	< 2300elf.window.LS02.H Window3d max3=4500 n4=1 f4=5 f1=290 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1|Pad beg3=290 > h6.sou.LS02.H
#	< 2300elf.window.LS02.H Window3d max3=4500 n4=1 f4=5 f1=290 | Transp plane=13 | \
#	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1|Pad beg3=290 > h6.rec.LS02.H
##
	Cat h1.sou.LS02.H h2.sou.LS02.H h3.sou.LS02.H axis=4 > 2302elf_rot.sou.LS02.H
	Cat h1.rec.LS02.H h2.rec.LS02.H h3.rec.LS02.H axis=4 > 2302elf_rot.rec.LS02.H
#	Rm h*rec*LS02* h*sou*LS02*

2302elf.LS02.perm%:
	< 2302elf_rot.rec.LS02.H Window3d n4= 1 f4= 1 squeeze=n min3= 1000 max3= 5000 | Transp plane=13 > r1.H
	< 2302elf_rot.sou.LS02.H Window3d n4= 1 f4= 1 squeeze=n min3= 1000 max3= 5000 | Transp plane=13 > s1.H
	Math file1=2000elf_LS01_vedit.2500.H exp="file1*2" > 2000elf_LS01_vedit.2500.v2.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=20 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=4 f_max1=30 f_max=36 wei=y is2d=y shotmig=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 11111.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=11111.H vel=2000elf_LS01_vedit.2500.H \
	rec_out=2302elf.LS02.crec$*.perm.H sou_out=2302elf.LS02.csou$*.perm.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=1 ngap=$* zmin=0 zmax=3975. node=14

2200elf_bkim.perm%:
	../Tese/bin/OWmig2d_areal.x sou=2302elf.LS02.csou$*.perm.H rec=2302elf.LS02.crec$*.perm.H \
	vel=2000elf_LS01_vedit.2500.H bkgimg=2200elf.bkim.veledit.LS01.perm.H \
	zmin=0 zmax=4000 nh=17 oh=-200 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

4200elf_bkim.plane:
	../Tese/bin/OWmig2d_areal.x sou=4220elf.csou.plane.H rec=4220elf.crec.plane.H \
	vel=2000elf_vedit.2500.H bkgimg=4200elf.bkim.vedit.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

5200elf_bkim.plane:
	< 2000elf_vedit.2500.H Interp d1out=20 > 2000elf_vedit.2500_20m.H
	../Tese/bin/OWmig2d_areal.x sou=5220elf.csou.plane.H rec=5220elf.crec.plane.H \
	vel=2000elf_vedit.2500_20m.H bkgimg=5200elf.bkim.vedit.plane.H \
	zmin=0 zmax=5000 nh=41 oh=-400 migration=1 areal=1 \
	padtraces=60 traces_in_taper=30 node=14 extrapolator=ffd

2304elf.LS02.%:
	Math file1=2302elf.LS02.crec$*.perm.H exp="file1/100" |Window3d n4= 1 j4=2 squeeze=n > 2302elf.LS02.crec.perm.H
	Math file1=2302elf.LS02.csou$*.perm.H exp="file1/100" |Window3d n4= 1 j4=2 squeeze=n > 2302elf.LS02.csou.perm.H
	Math file1=2000elf_LS01_vedit.2500.H exp="file1*2" | Window3d min1=1000 max1=12000 squeeze=n |\
	Pad beg1=1000 end1=1000 extend=1 > 2000elf_LS01_vedit.2500.v2.H
	../Tese/bin/steepest_ls.x sou=2302elf.LS02.csou.perm.H rec=2302elf.LS02.crec.perm.H \
	vel=2000elf_LS01_vedit.2500.H grad=2304elf.LS02.inv_grad$*.perm.H \
	Dimage=2304elf.LS02.inv_dso$*.perm.H bkgimg=2304elf.LS02.inv_bkim$*.perm.H \
	Velout=2304elf.LS02.inv_vout$*.perm.H \
	zmin=0 zmax=4000 nh=31 oh=-375 jh=1 niter=15 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=4000 nxk=6 10 oxk=-2875 dzk=25 nzk=179 horv0=basechalk_LS01_stk_coord.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 cbounds=0 p_lo=40 p_up=40 

2000elf_LS02_vedit.saltflow.2500.H:
	< 2304elf.LS02.inv_vout30.perm.H Window3d min1=5050 n1=156 n4=1 f4=10 squeeze=n |Gpow gpow=-1|\
	Pad end3=80 extend=1|../Tese/bin/OW_editvel_mut.x hor1=toposalt01_index.csv vmut=1 v=0.0002222|Window3d|Transp > v1.H
	< 2304elf.LS02.inv_vout30.perm.H Window3d max1=5050 n4=1 f4=10 |Gpow gpow=-1|\
	Pad end2=80 extend=1 |Transp > v0.H
	< 2304elf.LS02.inv_vout30.perm.H Window3d min1=8925 n4=1 f4=10 |Gpow gpow=-1|\
	Pad end2=80 extend=1 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 > $@

2000elf_LS02_vedit.sedimflow.2500.H:
	< 2304elf.LS02.inv_vout30.perm.H Window3d min1=5075 n1=156 n4=1 f4=10 squeeze=n |Gpow gpow=-1|\
	Pad end3=80 extend=1 > v00.H
	< 2000elf_LS02_vedit.saltflow.2500.H Window3d min1=5075 n1=156 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=basesalt01_index.csv vvel=1 vsub=v00.H |Window3d|Transp > v1.H
	< 2304elf.LS02.inv_vout30.perm.H Window3d max1=5075 n4=1 f4=10 |Gpow gpow=-1|\
	Pad end2=80 extend=1 |Transp > v0.H
	< 2000elf_LS02_vedit.saltflow.2500.H Window3d min1=8975 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 > $@

2200elf_bkim.plane.LS02:
	< 2304elf.LS02.inv_vout30.perm.H Window3d min1=0 max1=13000 n4=1 f4=10 squeeze=n |Gpow gpow=-1|\
	Pad end3=100 extend=1 beg1=1000 end1=1000 > 2304elf.LS02.inv_vout30_10.perm.H
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2304elf.LS02.inv_vout30_10.perm.H bkgimg=2200elf.bkim.veloptim.LS02.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkim.plane.saltflow.LS02:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2000elf_LS02_vedit.saltflow.2500.H bkgimg=2200elf.bkim.vedit.saltflow.LS02.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkim.plane.sedimflow.LS02:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2000elf_LS02_vedit.sedimflow.2500.H bkgimg=2200elf.bkim.vedit.sedimflow.LS02.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkim.hfi.plane.velor2500:
	< 0000elf_velor.2500.25m.H Gpow gpow=-1 > 1.H
	< 3220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 3220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=1.H bkgimg=3200elf.bkim.hfi.velor.2500.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkim.hfi.plane.vedit2500:
	< 3220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 3220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2000elf_vedit.2500.H bkgimg=3200elf.bkim.hfi.veledit.2500.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkim.hfi.plane.sedimflow.LS02:
	< 3220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 3220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=3000elf_LS02_vedit.basesalt.2500.H bkgimg=3200elf.bkim.hfi.vedit.sedimflow.LS02.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkim.hfi.plane.sedimflow02.LS02:
	< 3220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 3220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=3000elf_LS02_vedit.basesalt.2500.H bkgimg=3200elf.bkim.hfi.vedit.sedimflow02.LS02.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2200elf_bkim.hfi.plane.sedimflow02.LS02.pspi:
	< 3220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 3220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=3000elf_LS02_vedit.basesalt.2500.H bkgimg=3200elf.bkim.hfi.vedit.sedimflow02.LS02.plane.pspi.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=pspi lloyd=1 nrefvel=8

2200elf_bkim.ang.velor:
	< 3200elf.bkim.hfi.velor.2500.plane.H Window3d min1=1000 max1=10500 max3=4500 | Transp plane=13 | Transp plane=34 |\
	Pad beg2=50 end2=50 | OFF2ANG maxmem=1000 amax=40 eps=10 verb=y > x.H
	< x.H Window3d > 2200elf_ang.velor.2500.H
	< 2200elf_ang.velor.2500.H Grey eout=1 pclip=95 gainpanel=a > 2200elf_ang.velor.2500.T

2200elf_bkim.ang.vedit:
	< 3200elf.bkim.hfi.veledit.2500.plane.H Window3d min1=1000 max1=10500 max3=4500 | Transp plane=13 | Transp plane=34 |\
	Pad beg2=50 end2=50 | OFF2ANG maxmem=1000 amax=40 eps=10 verb=y > x.H
	< x.H Window3d > 2200elf_ang.vedit.2500.H
	< 2200elf_ang.vedit.2500.H Grey eout=1 pclip=95 gainpanel=a > 2200elf_ang.vedit.2500.T

2200elf_bkim.ang.sedimflow.LS02:
	< 3200elf.bkim.hfi.vedit.sedimflow.LS02.plane.H Window3d min1=1000 max1=10500 max3=4500 | Transp plane=13 | Transp plane=34 |\
	Pad beg2=50 end2=50 | OFF2ANG maxmem=1000 amax=40 eps=10 verb=y > x.H
	< x.H Window3d > 2200elf_ang.sedimflow.LS02.H
	< 2200elf_ang.sedimflow.LS02.H Grey eout=1 pclip=95 gainpanel=a > 2200elf_ang.sedimflow.LS02.T

0200elf_bkimor.plane:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	< 0000elf_velor.2500.25m.H Gpow gpow=-1 > 1.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=1.H bkgimg=2200elf.bkim.velor.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2300elf.window.LS03.H:
	< 2200elf.bkim.vedit.sedimflow.LS02.plane.H Window3d min1=0 max1=13000 min2=-375 n2=31 | Transp plane=13|Fx2d \
	lambda=10.|Transp plane=23 | Fx2d lambda=10.| Transp plane=23 |Transp plane=13 > 1.H
	< 1.H ../Tese/bin/OW_windowing.x nhorz=2 dip=1 hor1=prechalk_LS02_1 hor2=prechalk_LS02_2 \
	wavz=7 | Transp plane=13|../Tese/bin/OW_scale.x|Transp plane=13 > $@

2302elf_rotsd_LS03:
	< 2300elf.window.LS03.H Window3d max3=4000 n4=1 f4=1 n1=70 f1=360 | Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1|Pad beg3=360 end3=90 > h1.sou.LS03.H
	< 2300elf.window.LS03.H Window3d max3=4000 n4=1 f4=1 n1=70 f1=360 | Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1|Pad beg3=360 end3=90 > h1.rec.LS03.H
##
	< 2300elf.window.LS03.H Window3d max3=4000 n4=1 f4=0 n1=60 f1=420 | Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1|Pad beg3=420 end3=40 > h2.sou.LS03.H
	< 2300elf.window.LS03.H Window3d max3=4000 n4=1 f4=0 n1=60 f1=420 | Transp plane=13 | \
	../Tese/bin/OW_3dslant.x nax=36 nah=31 oax=-35 oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1|Pad beg3=420 end3=40 > h2.rec.LS03.H
##
	Cat h1.sou.LS03.H h2.sou.LS03.H axis=4 > 2302elf_rot.sou.LS03.H
	Cat h1.rec.LS03.H h2.rec.LS03.H axis=4 > 2302elf_rot.rec.LS03.H
#	Rm h*rec*LS02* h*sou*LS02*

2302elf.LS03.perm%:
	< 2302elf_rot.rec.LS03.H Window3d n4= 1 f4= 1 squeeze=n min3=8000 | Transp plane=13 > r1.H
	< 2302elf_rot.sou.LS03.H Window3d n4= 1 f4= 1 squeeze=n min3=8000 | Transp plane=13 > s1.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=20 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=4 f_max1=30 f_max=36 wei=y is2d=y shotmig=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 11111.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=11111.H vel=2000elf_LS02_vedit.sedimflow.2500.H \
	rec_out=2302elf.LS03.crec$*.perm.H sou_out=2302elf.LS03.csou$*.perm.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=1 ngap=$* zmin=0 zmax=3975. node=14

2304elf.LS03.%:
	< 2304elf.LS02.inv_vout30.perm.H Window3d n4=1 f4=10 squeeze=n |Gpow gpow=-1|\
	Pad end3=80 beg1=1000 end1=1000 extend=1 > v0.H
	Math file1=2302elf.LS03.crec$*.perm.H exp="file1/10000" |Window3d n4= 1 j4= 4 squeeze=n > 2302elf.LS03.crec.perm.H
	Math file1=2302elf.LS03.csou$*.perm.H exp="file1/10000" |Window3d n4= 1 j4= 4 squeeze=n > 2302elf.LS03.csou.perm.H
	../Tese/bin/steepest_ls.x sou=2302elf.LS03.csou.perm.H rec=2302elf.LS03.crec.perm.H \
	vel=v0.H grad=2304elf.LS03.inv_grad$*.perm.H \
	Dimage=2304elf.LS03.inv_dso$*.perm.H bkgimg=2304elf.LS03.inv_bkim$*.perm.H \
	Velout=2304elf.LS03.inv_vout$*.perm.H \
	zmin=0 zmax=4000 nh=31 oh=-375 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=6000 xv_max=12000 \
	dxk=8000 nxk=2 oxk=5125 dzk=25 nzk=160 horv0=prechalk_LS02_stk01.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 cbounds=0 p_lo=40 p_up=40 


3304elf.LS02.%:
	Math file1=2302elf.LS02.crec$*.perm.H exp="file1/100" |Window3d n4= 1 j4= 4 squeeze=n > 2302elf.LS02.crec.perm.H
	Math file1=2302elf.LS02.csou$*.perm.H exp="file1/100" |Window3d n4= 1 j4= 4 squeeze=n > 2302elf.LS02.csou.perm.H
	../Tese/bin/steepest_ls.x sou=2302elf.LS02.csou.perm.H rec=2302elf.LS02.crec.perm.H \
	vel=2000elf_LS01_vedit.2500.H grad=3304elf.LS02.inv_grad$*.perm.H \
	Dimage=3304elf.LS02.inv_dso$*.perm.H bkgimg=3304elf.LS02.inv_bkim$*.perm.H \
	Velout=3304elf.LS02.inv_vout$*.perm.H \
	zmin=0 zmax=4000 nh=31 oh=-375 jh=1 niter=15 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=4000 nxk=6 10 oxk=-2875 dzk=25 nzk=179 horv0=basechalk_LS01_stk_coord.csv line_search=3 \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 cbounds=0 p_lo=40 p_up=40 

####
#
# Test w/multiple realizations
2604elf.LS01_1.%:
	Math file1=2302elf.LS01_1.crec$*.perm.H exp="file1/100" |Window3d n4= j4=2 n3= 70 squeeze=n > 2302elf.LS01.crec.perm.H
	Math file1=2302elf.LS01_1.csou$*.perm.H exp="file1/100" |Window3d n4= j4=2 n3= 70 squeeze=n > 2302elf.LS01.csou.perm.H
	Math file1=2000elf_vedit.2500.H exp="file1*2" | Window3d min1=1000 max1=12000 squeeze=n |\
	Pad beg1=1000 end1=1000 extend=1 > 2000elf_vedit.2500.v2.H
	../Tese/bin/steepest_ls1.x sou=2302elf.LS01.csou.perm.H rec=2302elf.LS01.crec.perm.H \
	vel=2000elf_vedit.2500.v2.H grad=2604elf.LS01.inv_grad$*.perm.H \
	Dimage=2604elf.LS01.inv_dso$*.perm.H bkgimg=2604elf.LS01.inv_bkim$*.perm.H \
	Velout=2604elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=17 oh=-200 jh=1 niter=15 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=1500 nxk=16 21 oxk=-2875 dzk=16 nzk=241 dxkmin=1500 horv0=topchalk_2500.csv rect1=11 rect3=3 \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 cbounds=0 p_lo=20 p_up=20 

2605elf_bkim.plane.voptimLS01_20:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	< 2604elf.LS01.inv_vout30.perm.H Window3d min1=0 max1=13000 n4=1 f4=2 squeeze=n |Scale dscale=0.5|\
	Pad beg1=1000 end1=1000 end3=300 extend=1 > v.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=v.H bkgimg=2605elf.bkim.veloptim.LS01_30.plane.H \
	zmin=0 zmax=4000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2605elf_bkim.plane.veditLS01_20:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2000elf_LS01_vedit.2500.H bkgimg=2200elf.bkim.veledit.LS01.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

2605elf_LS01_veledit.2500.H:
	< 2604elf.LS01.inv_vout30.perm.H Window3d min1=0 max1=13000 n4=1 f4=3 squeeze=n |Scale dscale=.5|\
	../Tese/bin/OW_editvel_mut.x vup=1 hor1=topchalk_2500_ind02.csv |Smooth rect1=11 rect3=11 rect2=1 > v.H
	< 2000elf_vedit.2500.H Window3d min1=0 max1=13000 squeeze=n > w.H
	< w.H ../Tese/bin/OW_editvel_mut.x hor1=topchalk_2500_ind02.csv vvel=1 vsub=v.H > y.H 
	< y.H ../Tese/bin/OW_editvel_mut.x hor1=basechalk_LS01_stk_2604_index.csv vvel=1 vsub=w.H |Pad extend=1 beg1=1000 end1=1000 end3=100 > $@

2605elf_bkim.plane.veledit:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2605elf_LS01_veledit.2500.H bkgimg=2605elf.bkim.veledit.LS01.plane.H \
	zmin=0 zmax=5000 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

#
#
# 
# Figures Biondo |
#                V

3000elf_vedit.2500.H:
	< 0000elf_velor.2500.25m.H Window3d min1=0 max1=13000 squeeze=n | Gpow gpow=-1|Smooth rect1=101 rect3=101 | Scale dscale=1.2 |Gpow gpow=-1|../Tese/bin/OW_editvel_mut.x hor1=topchalk_2500_ind02.csv \
	vthr=1 v=2500 > k.H
	< 0000elf_velor.2500.25m.H Window3d min1=0 max1=13000 squeeze=n | ../Tese/bin/OW_editvel_mut.x hor1=topchalk_2500_ind02.csv vvel=1 vsub=k.H | Gpow gpow=-1 |\
	Pad extend=1 beg1=1000 end1=1000 > $@

3200elf_bkim.plane.vedit2500:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=3000elf_vedit.2500.H bkgimg=3200elf.bkim.veledit.2500.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

3300elf.prepwindow.LS01:
	< 3200elf.bkim.veledit.2500.plane.H Window3d min1=0 max1=13000 min2=-375 n2=31 | Transp plane=13 | Fx2d lambda=10. | Transp plane=23 | Fx2d lambda=10. | Transp plane=23 > 00.H
	< 3200elf.bkim.veledit.2500.plane.H Window3d min1=0 max1=13000 min2=-375 n2=31 | Transp plane=13 | Envelope tc1=3 tc2=3 > 0env.H
	< 3200elf.bkim.veledit.2500.plane.H Window3d min1=0 max1=13000 min2=-375 n2=31 | Transp plane=13 | Fx2d lambda=10. | Transp plane=23 | Fx2d lambda=10. | Transp plane=23 | Envelope tc1=3 tc2=3 > 1env.H
	Math file1=00.H file2=0env.H file3=1env.H exp="file1/file3*file2" > $@.H
	< $@.H Grey eout=1 pclip=92 gainpanel=a > $@.T
	
3300elf.window.LS01.H:
	< 3200elf.bkim.veledit.2500.plane.H Window3d min1=0 max1=13000 min2=-375 n2=31 > 00.H
	< 00.H ../Tese/bin/OW_windowing.x nhorz=2 hor1=basechalk_LS01_prstk_v30001 hor2=basechalk_LS01_prstk_v30002 wavz=9 dip=1 > $@
#	| Transp plane=13 | ../Tese/bin/OW_scale.x | Transp plane=23 | Fx2d lambda=10. | Transp plane=23 | Transp plane=13 > $@

3301elf_rotsd:
	< 3300elf.window.LS01.H Window3d min3=1000 max3=2500 | Transp plane=13 | ../Tese/bin/OW_3dslant.x nax=41 nah=31 oax=-40 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 | Pad beg1=80 > 3301elf.sou.LS01.H
	< 3300elf.window.LS01.H Window3d min3=1000 max3=2500 |Transp plane=13 | ../Tese/bin/OW_3dslant.x nax=41 nah=31 oax=-40 oah=-30 dax=2 dah=2 \
	nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 | Pad beg1=80 > 3301elf.rec.LS01.H

3302elf.LS01.perm%:
#	< 3301elf.rec.LS01.H Transp plane=13| ../Tese/bin/OW_scale.x  > r1.H
#	< 3301elf.sou.LS01.H Transp plane=13| ../Tese/bin/OW_scale.x  > s1.H
#	< 3300elf.window.LS01.H ../Tese/bin/OW_scale.x  > r1.H
#	< 3300elf.window.LS01.H ../Tese/bin/OW_scale.x  > s1.H
	Transp < y.H plane=12 reshape=3,4 > r1.H
	Transp < y.H plane=12 reshape=3,4 > s1.H
	Math file1=3000elf_vedit.2500.H exp="file1*2" > 3000elf_vedit.2500.v2.H
	Wavelet n1=1001 d1=0.006 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=4 f_max1=22 f_max=28 wei=y is2d=y shotmig=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 11111.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=11111.H vel=3000elf_vedit.2500.v2.H \
	rec_out=3302elf.LS01.crec$*.perm.H sou_out=3302elf.LS01.csou$*.perm.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=1 ngap=$* zmin=0 zmax=2475 node=14

3303elf.LS01.%:
	Math file1=3302elf.LS01.crec$*.perm.H exp="file1/100" |Window3d min2=-200 n2=17 n4=1 squeeze=n > 3302elf.LS01.crec.perm.H
	Math file1=3302elf.LS01.csou$*.perm.H exp="file1/100" |Window3d min2=-200 n2=17 n4=1 squeeze=n > 3302elf.LS01.csou.perm.H
	Math file1=3000elf_vedit.2500.H exp="file1*2" | Window3d min1=1000 max1=12000 squeeze=n | Pad beg1=1000 end1=1000 extend=1 > 3000elf_vedit.2500.v2.H
	../Tese/bin/OW_lbfgsc_areal.x sou=2302elf.LS01.csou.perm.H rec=2302elf.LS01.crec.perm.H \
	vel=2000elf_vedit.2500.H grad=2303elf.LS01.inv_grad$*.perm.H \
	Dimage=2303elf.LS01.inv_dso$*.perm.H bkgimg=2303elf.LS01.inv_bkim$*.perm.H \
	Velout=2303elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=17 oh=-200 jh=1 niter=15 dso=1 mmax=1 3 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=1000 nxk=19 oxk=-2700 dzk=16 nzk=241 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 cbounds=0 vmin=1000 vmax=2600 p_lo=40 p_up=40 \
	log=log_bfgs_elf.LS01.perm.$* list=listagem_bfgs_elf.LS01.perm.$* 

3304elf.LS01.%:
	Math file1=3302elf.LS01.crec$*.perm.H exp="file1/100" |Window3d n4= 1 j4=2 squeeze=n > 3302elf.LS01.crec.perm.H
	Math file1=3302elf.LS01.csou$*.perm.H exp="file1/100" |Window3d n4= 1 j4=2 squeeze=n > 3302elf.LS01.csou.perm.H
	Math file1=3000elf_vedit.2500.H exp="file1*2" | Window3d min1=1000 max1=12000 squeeze=n |\
	Pad beg1=1000 end1=1000 extend=1 > 3000elf_vedit.2500.v2.H
	../Tese/bin/steepest_ls.x sou=3302elf.LS01.csou.perm.H rec=3302elf.LS01.crec.perm.H \
	vel=3000elf_vedit.2500.v2.H grad=3304elf.LS01.inv_grad$*.perm.H \
	Dimage=3304elf.LS01.inv_dso$*.perm.H bkgimg=3304elf.LS01.inv_bkim$*.perm.H Velout=3304elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=17 oh=-200 jh=1 max_iters=25 dso=1 inversion=1 areal=1 xv_min=3000 xv_max=11000 gamma=-1 \
	dxk=2000 nxk=13 oxk=-2875 dzk=25 nzk=121 dxkmin=2000 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 p_lo=60 p_up=60 

3305elf.LS01.%:
	Math file1=2302elf.LS01.crec$*.perm.H exp="file1/100" |Window3d n4= 1 j4=4 squeeze=n > 3302elf.LS01.crec.perm.H
	Math file1=2302elf.LS01.csou$*.perm.H exp="file1/100" |Window3d n4= 1 j4=4 squeeze=n > 3302elf.LS01.csou.perm.H
	Math file1=2000elf_vedit.2500.H exp="file1*2" | Window3d min1=3000 max1=11000 squeeze=n |\
	Pad beg1=1000 end1=1000 extend=1 > 3000elf_vedit.2500.v2.H
	../Tese/bin/steepest_ls1.x sou=3302elf.LS01.csou.perm.H rec=3302elf.LS01.crec.perm.H \
	vel=3000elf_vedit.2500.v2.H grad=3305elf.LS01.inv_grad$*.perm.H \
	Dimage=3305elf.LS01.inv_dso$*.perm.H bkgimg=3305elf.LS01.inv_bkim$*.perm.H Velout=3305elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=17 oh=-200 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=3000 xv_max=11000 \
	dxk=2000 nxk=13 oxk=-2875 dzk=25 nzk=121 dxkmin=2000 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 p_lo=40 p_up=40 

3306elf.LS01.%:
	Math file1=3302elf.LS01.crec$*.perm.H exp="file1/100" |Window3d n4= 1 j4= 2 squeeze=n > 3302elf.LS01.crec.perm.H
	Math file1=3302elf.LS01.csou$*.perm.H exp="file1/100" |Window3d n4= 1 j4= 2 squeeze=n > 3302elf.LS01.csou.perm.H
	Math file1=3000elf_vedit.2500.H exp="file1*2" | Window3d min1=3000 max1=11000 squeeze=n |\
	Pad beg1=1000 end1=1000 extend=1 > 3000elf_vedit.2500.v2.H
	../Tese/bin/steepest_ls1.x sou=3302elf.LS01.csou.perm.H rec=3302elf.LS01.crec.perm.H \
	vel=3000elf_vedit.2500.v2.H grad=3306elf.LS01.inv_grad$*.perm.H \
	Dimage=3306elf.LS01.inv_dso$*.perm.H bkgimg=3306elf.LS01.inv_bkim$*.perm.H Velout=3306elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=17 oh=-200 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=500 xv_max=12500 \
	dxk=2000 nxk=13 oxk=-2875 dzk=25 nzk=121 dxkmin=2000 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 p_lo=60 p_up=60 

3200elf_bkim.plane.voptimLS01_20:
	< 3220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 3220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	< 3306elf.LS01.inv_vout20.perm.H Window3d n4=1 f4=4 squeeze=n |Scale dscale=0.5|\
	Pad beg1=1000 end1=1000 end3=200 extend=1 > v.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=v.H bkgimg=3200elf.bkim.veloptim.LS01_20.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

3000elf_LS01_vedit.2500.H:
	< 3305elf.LS01.inv_vout20.perm.H Window3d min1=0 max1=13000 n4=1 f4=1 squeeze=n n3=169 |Scale dscale=.5|\
	Pad end3=200 extend=1 > v.H
	< 2000elf_vedit.2500.H Window3d min1=0 max1=13000 squeeze=n > w.H
	< v.H ../Tese/bin/OW_editvel_mut.x hor1=50_basechalk_LS01_index.csv vvel=1 vsub=w.H |Pad extend=1 beg1=1000 end1=1000 end3=100 > $@

3200elf_bkim.plane.veleditLS02_20:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=3000elf_LS01_vedit.2500.H bkgimg=3200elf.bkim.veledit.LS02.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

3300elf.window.LS02.H:
	< 3200elf.bkim.veloptim.LS01_20.plane.H Window3d min1=0 max1=13000 min2=-375 n2=31 > 00.H
	< 00.H ../Tese/bin/OW_windowing.x nhorz=2 hor1=50_prechalk_vupdt_1 hor2=50_prechalk_vupdt_2 wavz=11 dip=0 > $@
#	| Transp plane=13 | ../Tese/bin/OW_scale.x | Transp plane=23 | Fx2d lambda=10. | Transp plane=23 | Transp plane=13 > $@

3301elf_rotsd_LS02:
#	< 3300elf.window.LS02.H Window3d f1=40 n1=100 min3=3000 max3=4500 n4=1 f4=0 | Transp plane=13 |\
#	../Tese/bin/OW_3dslant.x nax=11 nah=31 oax=-10 \
#	oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 > x.H
#	< x.H Pad beg3=40 end3=380 beg1=240 > h1.sou.LS02.H
#	< 3300elf.window.LS02.H Window3d f1=40 n1=100 min3=3000 max3=4500 n4=1 f4=0 | Transp plane=13 |\
#	../Tese/bin/OW_3dslant.x nax=11 nah=31 oax=-10 \
#	oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 > x.H
#	< x.H  Pad beg3=40 end3=380 beg1=240 > h1rec.LS02.H
##
#	< 3300elf.window.LS02.H Window3d f1=300 n1=180 min3=3000 max3=4500 n4=1 f4=1 | Transp plane=13 |\
#	../Tese/bin/OW_3dslant.x nax=11 nah=31 oax=-10 \
#	oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 nodes=14 nxchunk=1 > x.H
#	< x.H  Pad beg3=300 end3=40 beg1=240 > h2.sou.LS02.H
#	< 3300elf.window.LS02.H Window3d f1=300 n1=180 min3=3000 max3=4500 n4=1 f4=1 | Transp plane=13 |\
#	../Tese/bin/OW_3dslant.x nax=21 nah=31 oax=-20 \
#	oah=-30 dax=2 dah=2 nxw=31 rot=1 upshft=0 rec=1 nodes=14 nxchunk=1 > x.H
#	< x.H  Pad beg3=300 end3=40 beg1=240 > h2.rec.LS02.H
#
	Cat h1.sou.LS02.H h2.sou.LS02.H axis=4 > 3301elf_rot.sou.LS02.H
	Cat h1rec.LS02.H h2.rec.LS02.H axis=4 > 3301elf_rot.rec.LS02.H

3302elf.LS02.perm%:
	< 3301elf_rot.rec.LS02.H Transp plane=13 > r1.H
	< 3301elf_rot.sou.LS02.H Transp plane=13 > s1.H
	< 3305elf.LS01.inv_vout20.perm.H Window3d n4=1 f4=1 squeeze=n |Scale dscale=0.5| Pad beg1=1000 end1=1000 end3=200 extend=1 > v.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=15 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=4 f_max1=20 f_max=26 wei=y is2d=y shotmig=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 11111.H
	../Tese/bin/OW_arealsht.x rec_cig=r1.H sou_cig=s1.H sou=11111.H vel=3000elf_LS01_vedit.2500.H v.H \
	rec_out=3302elf.LS02.crec$*.perm.H sou_out=3302elf.LS02.csou$*.perm.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=1 random=1 injection=1 nreal=1 ngap=$* zmin=0 zmax=4475 node=14

3305elf.LS02.%:
	Math file1=3302elf.LS02.crec$*.perm.H exp="file1/100" |Window3d n4= 1 j4=4 squeeze=n > 3302elf.LS02.crec.perm.H
	Math file1=3302elf.LS02.csou$*.perm.H exp="file1/100" |Window3d n4= 1 j4=4 squeeze=n > 3302elf.LS02.csou.perm.H
	< 3000elf_LS01_vedit.2500.H Scale dscale=2. > v.H
	../Tese/bin/steepest_ls1.x sou=3302elf.LS02.csou.perm.H rec=3302elf.LS02.crec.perm.H \
	vel=v.H grad=3305elf.LS02.inv_grad$*.perm.H \
	Dimage=3305elf.LS02.inv_dso$*.perm.H bkgimg=3305elf.LS02.inv_bkim$*.perm.H Velout=3305elf.LS02.inv_vout$*.perm.H \
	zmin=0 zmax=4475 nh=17 oh=-200 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=3000 xv_max=11000 \
	dxk=4500 nxk=7 13 oxk=-2875 dzk=25 nzk=179 dxkmin=4000 horv0=50_prechalk_vfix02.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 p_lo=10 p_up=10 

3200elf_bkim.plane.voptimLS02_20:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	< 3305elf.LS02.inv_vout20.perm.H Window3d n4=1 f4=3 squeeze=n |Scale dscale=0.5|\
	Pad beg1=1000 end1=1000 end3=200 extend=1 > v.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=v.H bkgimg=3200elf.bkim.veloptim.LS02_20.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

3000elf_LS02_vedit.saltflow.2500.H:
	< 3305elf.LS02.inv_vout20.perm.H Window3d n4=1 f4=3 min1=5200 n1=123 squeeze=n |\
	Pad end3=80 extend=1|../Tese/bin/OW_editvel_mut.x hor1=50_topsalt_index.csv vmut=1 v=0.0004444|Window3d|Transp > v1.H
	< 3305elf.LS02.inv_vout20.perm.H Window3d max1=5200 n4=1 f4=3 |\
	Pad end2=80 extend=1 |Transp > v0.H
	< 3305elf.LS02.inv_vout20.perm.H Window3d min1=8225 n4=1 f4=3 |\
	Pad end2=80 extend=1 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 |Scale dscale=0.5 > $@

3200elf_bkim.plane.saltflowLS02_20:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=3000elf_LS02_vedit.saltflow.2500.H bkgimg=3200elf.bkim.saltflow.LS02.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

3000elf_LS02_vedit.basesalt.2500.H:
	< 3305elf.LS02.inv_vout20.perm.H Pad end3=80 extend=1| Window3d n4=1 f4=3 min1=5200 n1=124 squeeze=n |Scale dscale=.5 > v00.H
	< 3000elf_LS02_vedit.saltflow.2500.H Window3d min1=5200 n1=124 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=50_basesalt_index.csv vvel=1 vsub=v00.H |Window3d|Transp > v1.H
	< 3305elf.LS02.inv_vout20.perm.H Pad end3=80 extend=1 | Window3d max1=5200 n4=1 f4=3 |Scale dscale=.5  |Transp > v0.H
	< 3000elf_LS02_vedit.saltflow.2500.H Window3d min1=8300 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 > $@

3000elf_LS02_vedit.basesalt02.2500.H:
	< 3305elf.LS02.inv_vout20.perm.H Pad end3=80 extend=1| Window3d n4=1 f4=3 min1=5200 n1=124 squeeze=n |Scale dscale=.5 > v00.H
	< 3000elf_LS02_vedit.saltflow.2500.H Window3d min1=5200 n1=124 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=50_basesalt02_index.csv vvel=1 vsub=v00.H |Window3d|Transp > v1.H
	< 3305elf.LS02.inv_vout20.perm.H Pad end3=80 extend=1 | Window3d max1=5200 n4=1 f4=3 |Scale dscale=.5  |Transp > v0.H
	< 3000elf_LS02_vedit.saltflow.2500.H Window3d min1=8300 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3,4 > $@

3200elf_bkim.plane.sedimfloodLS02_20:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=0 max1=13000 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=0 max1=13000 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=3000elf_LS02_vedit.basesalt02.2500.H bkgimg=3200elf.bkim.basesalt02.LS02.plane.H \
	zmin=0 zmax=4900 nh=31 oh=-375 migration=1 areal=1 \
	padtraces=50 traces_in_taper=25 node=14 extrapolator=ffd

######################################
#
# Mohammad
#
#
model2-vel-saltmodel.H:
	< /net/koko/homes/sep/mohammad/Research/subsalt_2dm/model2-vel.H Transp plane=12 reshape=1,3|\
	Window3d squeeze=n min1=6.612 n1=411 |../Tese/bin/OW_editvel_mut.x hor1=~/picks_moh01.csv \
	vmut=1 v=4500|Window3d|Transp > v1.H
	< /net/koko/homes/sep/mohammad/Research/subsalt_2dm/model2-vel.H Window3d max2=6.612 > v0.H
	< /net/koko/homes/sep/mohammad/Research/subsalt_2dm/model2-vel.H Window3d min2=11.544 > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d > model2-vel-saltflood.H
#
#
	< /net/koko/homes/sep/mohammad/Research/subsalt_2dm/model2-vel.H Window3d min2=6.612 n2=411 | Transp plane=12 reshape=1,3 > v00.H
	< model2-vel-saltflood.H Window3d min2=6.612 n2=411| Transp plane=12 reshape=1,3 |\
	../Tese/bin/OW_editvel_mut.x hor1=~/picks_moh.csv vvel=1 vsub=v00.H |Window3d|Transp > v1.H
	< /net/koko/homes/sep/mohammad/Research/subsalt_2dm/model2-vel.H Window3d max2=6.612 > v0.H
	< model2-vel-saltflood.H Window3d min2=11.544 > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d > $@

##############
#
# Bspline
# 	../Tese/bin/steepest_ls1.x sou=3302elf.LS02.csou.perm.H rec=3302elf.LS02.crec.perm.H

3306elf.LS02.%:
	Math file1=3302elf.LS02.crec$*.perm.H exp="file1/100"|Window3d n3= 50 f1=250 j4=2 n4= 1 squeeze=n|Pad beg1=250> 3302elf.LS02.crec.perm.H
	Math file1=3302elf.LS02.csou$*.perm.H exp="file1/100"|Window3d n3= 50 f1=250 j4=2 n4= 1 squeeze=n|Pad beg1=250> 3302elf.LS02.csou.perm.H
	< 3000elf_LS01_vedit.2500.H Scale dscale=2. > v.H
	../Tese/bin/conjgdir.x sou=3302elf.LS02.csou.perm.H rec=3302elf.LS02.crec.perm.H \
	vel=3000elf_LS01_vedit.2500.H grad=3306elf.LS02.inv_grad$*.perm.H \
	Dimage=3306elf.LS02.inv_dso$*.perm.H bkgimg=3306elf.LS02.inv_bkim$*.perm.H Velout=3306elf.LS02.inv_vout$*.perm.H \
	zmin=0 zmax=4475 nh=31 oh=-375 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	rect1=5 rect3=5 dxk=500 4500 nxk=64 7 oxk=-2875 dzk=25 nzk=179 dxkmin=2000 4000 horv0=50_prechalk_vfix02.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 p_lo=10 p_up=10 

3315elf.LS01.%:
	Math file1=3302elf.LS01.crec$*.perm.H exp="file1/100" |Window3d n4= 1 j4= 4 squeeze=n > 3302elf.LS01.crec.perm.H
	Math file1=3302elf.LS01.csou$*.perm.H exp="file1/100" |Window3d n4= 1 j4= 4 squeeze=n > 3302elf.LS01.csou.perm.H
	Math file1=2000elf_vedit.2500.H exp="file1*2" | Window3d min1=1000 max1=12000 squeeze=n |\
	Pad beg1=1000 end1=1000 extend=1 > 3000elf_vedit.2500.v2.H
	../Tese/bin/conjgdir.x sou=3302elf.LS01.csou.perm.H rec=3302elf.LS01.crec.perm.H \
	vel=3000elf_vedit.2500.v2.H grad=3315elf.LS01.inv_grad$*.perm.H \
	Dimage=3315elf.LS01.inv_dso$*.perm.H bkgimg=3315elf.LS01.inv_bkim$*.perm.H Velout=3315elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=31 oh=-375 jh=1 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	rect1=7 rect3=7 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=14 bounds=1 p_lo=40 p_up=40 

##############################
#
# Plane wave input to wemva
#
4000elf.crec.H:
	< 2000elf_data_recip.H Agc window=600| Scale scale_to=1|Transf shotmig=y is2d=y wei=y f_min=0 f_min1=6 f_max1=40 f_max=46 maxsize=1000>j2.H
	< j2.H Pad beg1=200 end1=200 > $@

4000elfplane:
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=25 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-2 >> j2.H
	<j2.H Transf f_min=0 f_min1=6 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Cmplx j2.H j1.H|Transp plane=13 > 3100elf.csou.H
	../Tese/bin/OWplane_areal.x sou=3100elf.csou.H rec=4000elf.crec.H v0=1473 \
	rec_pl=4220elf.crec.plane.H sou_pl=4220elf.csou.plane.H ango=-40 angd=1. node=14 > /dev/null

4001elf.LS01:
	Window3d < 2220elf.csou.plane.H squeeze=n min1=-375 n1=550 > s.H
	Window3d < 2220elf.crec.plane.H squeeze=n min1=-375 n1=550 > r.H
	../Tese/bin/steepest_ls1.x sou=s.H rec=r.H \
	vel=2000elf_vedit.2500.H grad=4001elf.LS01.inv_grad.plane.H \
	Dimage=4001elf.LS01.inv_dso.plane.H bkgimg=4001elf.LS01.inv_bkim.plane.H Velout=4001elf.LS01.inv_vout.plane.H \
	zmin=0 zmax=4000 nh=17 oh=-200 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=2000 nxk=10 oxk=-2875 dzk=25 nzk=161 dxkmin=4000 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=12 bounds=1 cbounds=0 p_lo=40 p_up=40 

4002elf.LS01:
	Math file1=4220elf.crec.plane.H exp="file1/1000000" | Window3d squeeze=n min1=-375 n1=550 > r.H
	Window3d < 4220elf.csou.plane.H squeeze=n min1=-375 n1=550 > s.H
	../Tese/bin/steepest_ls1.x sou=s.H rec=r.H \
	vel=2000elf_vedit.2500.H grad=4002elf.LS01.inv_grad.plane.H \
	Dimage=4002elf.LS01.inv_dso.plane.H bkgimg=4002elf.LS01.inv_bkim.plane.H Velout=4002elf.LS01.inv_vout.plane.H \
	zmin=0 zmax=4000 nh=33 oh=-400 jh=1 max_iters=10 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk= 500 nxk= 40 oxk= -2875 dzk= 25 nzk= 161 dxkmin= 500 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=12 bounds=1 cbounds=0 p_lo=40 p_up=40 

4003elf.LS01:
	Math file1=4220elf.crec.plane.H exp="file1/1000000" | Window3d squeeze=n min1=-375 n1=550 > r.H
	Window3d < 4220elf.csou.plane.H squeeze=n min1=-375 n1=550 > s.H
	../Tese/bin/steepest_ls1.x sou=s.H rec=r.H \
	vel=2000elf_vedit.2500.H grad=4003elf.LS01.inv_grad.plane.H \
	Dimage=4003elf.LS01.inv_dso.plane.H bkgimg=4003elf.LS01.inv_bkim.plane.H Velout=4003elf.LS01.inv_vout.plane.H \
	zmin=0 zmax=4000 nh=33 oh=-400 jh=1 max_iters=10 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=250 nxk=80 oxk=-2875 dzk=25 nzk=161 dxkmin=250 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 node=12 bounds=1 cbounds=0 p_lo=40 p_up=40 

4004elf.LS01:
	Window3d < 2220elf.csou.plane.H squeeze=n min1=-375 n1=550 > s.H
	Math file1=2220elf.crec.plane.H exp="file1/1000000" | Window3d squeeze=n min1=-375 n1=550 > r.H
	../Tese/bin/steepest_ls1.x sou=s.H rec=r.H \
	vel=2000elf_vedit.2500.H grad=4004elf.LS01.inv_grad.plane.H \
	Dimage=4004elf.LS01.inv_dso.plane.H bkgimg=4004elf.LS01.inv_bkim.plane.H Velout=4004elf.LS01.inv_vout.plane.H \
	zmin=0 zmax=4000 nh=33 oh=-400 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=500 nxk=40 oxk=-2875 dzk=25 nzk=161 dxkmin=500 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 geomspread=0 node=12 bounds=1 cbounds=0 p_lo=40 p_up=40 

4005elf.LS01:
	Window3d < 2220elf.csou.plane.H squeeze=n min1=-375 n1=550 n3= 10 f3= 60 > s.H
	Math file1=2220elf.crec.plane.H exp="file1/1000000" | Window3d squeeze=n min1=-375 n1=550 n3= 10 f3= 60  > r.H
	../Tese/bin/steepest_ls1.x sou=s.H rec=r.H \
	vel=2000elf_vedit.2500.H grad=4005elf.LS01.inv_grad.plane.H \
	Dimage=4005elf.LS01.inv_dso.plane.H bkgimg=4005elf.LS01.inv_bkim.plane.H Velout=4005elf.LS01.inv_vout.plane.H \
	zmin=0 zmax=4000 nh=33 oh=-400 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=2000 nxk=11 oxk=-2875 dzk=25 nzk=161 dxkmin=500 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 geomspread=1 node=12 bounds=1 cbounds=0 p_lo=40 p_up=40 > /dev/null

4000elf_LS01_vedit.PW.2500.H:
	< 4005elf.LS01.inv_vout.plane.H Window3d min1=-2875 max1=15850 n4=1 f4=4 squeeze=n >v.H
	< 2000elf_vedit.2500.H Window3d min1=-2875 max1=15850 squeeze=n > w.H
	< v.H ../Tese/bin/OW_editvel_mut.x hor1=basechalk_LS01_stk.PW.index.csv vvel=1 vsub=w.H |Pad extend=1 beg1=1000 end1=1000 end3=100 > $@

4006elf.LS01:
	Window3d < 2220elf.csou.plane.H squeeze=n min1=-375 n1=550 n3= 10 f3= 60 > s.H
	Math file1=2220elf.crec.plane.H exp="file1/1000000" | Window3d squeeze=n min1=-375 n1=550 n3= 10 f3= 60 > r.H
	../Tese/bin/steepest_ls1.x sou=s.H rec=r.H \
	vel=4000elf_LS01_vedit.PW.2500.H grad=4006elf.LS01.inv_grad.plane.H \
	Dimage=4006elf.LS01.inv_dso.plane.H bkgimg=4006elf.LS01.inv_bkim.plane.H Velout=4006elf.LS01.inv_vout.plane.H \
	zmin=0 zmax=5000 nh=33 oh=-400 jh=1 max_iters=5 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=2000 nxk=11 oxk=-2875 dzk=25 nzk=201 dxkmin=500 horv0=basechalk_LS01_stk.PW.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 geomspread=1 node=12 bounds=1 cbounds=0 p_lo=20 p_up=20 > /dev/null

4005mig:
	< 2220elf.csou.plane.H Window3d squeeze=n min1=-375 n1=550 > 2.H
	< 2220elf.crec.plane.H Window3d squeeze=n min1=-375 n1=550 > 3.H
	../Tese/bin/OWmig2d_areal.x sou=2.H rec=3.H \
	vel=2000elf_vedit.2500.H bkgimg=4005elf.bkim.vinit.plane.H \
	zmin=0 zmax=5000 nh=33 oh=-400 migration=1 areal=1 \
	padtraces=50 traces_in_taper=50 node=14 extrapolator=ffd
###################################
#
#
#
5001elf.LS01.%:
	Math file1=3302elf.LS01.crec$*.perm.H exp="file1/100000" > 3302elf.LS01.crec.perm.H
	Math file1=3302elf.LS01.csou$*.perm.H exp="file1/100000" > 3302elf.LS01.csou.perm.H
	Math file1=3000elf_vedit.2500.H exp="file1*2" > 3000elf_vedit.2500.v2.H
	../Tese/bin/steepest_ls1.x sou=3302elf.LS01.csou.perm.H rec=3302elf.LS01.crec.perm.H vel=3000elf_vedit.2500.v2.H \
	grad=5001elf.LS01.inv_grad$*.perm.H Dimage=5001elf.LS01.inv_dso$*.perm.H bkgimg=5001elf.LS01.inv_bkim$*.perm.H \
	Velout=5001elf.LS01.inv_vout$*.perm.H \
	zmin=0 zmax=3000 nh=31 oh=-375 jh=1 niter=5 dso=1 inversion=1 areal=1 xv_min=1000 xv_max=12000 \
	dxk=1000 nxk=21 oxk=-2875 dzk=25 nzk=201 dxkmin=500 horv0=topchalk_2500.csv \
	extrapolator=ffd padtraces=50 traces_in_taper=50 geomspread=0 1 node=12 bounds=1 cbounds=0 p_lo=20 p_up=60 > /dev/null

##################################
3delf_perm%:
	Window3d < ../opteron/elf.3D.000to356.flt.int30.window21.H min3=2500 n3=1 > s1.H
	Wavelet n1=1501 d1=0.002 wavelet=ricker2 phase=0 fund=10 order=8 tdelay=1.5 domain=time > j0.H;echo o1=-1.5 >> j0.H
	<j0.H Scale dclip=-1 | Transf f_min=0 f_min1=1 f_max1=20 f_max=24 wei=y is2d=y | Window3d | Cabs > j1.H
	Math file1=j1.H exp="file1*0" > j2.H ; Cmplx j1.H j2.H | Transp plane=13 > sou.H
	Window3d < ../opteron/elf.L7f.vinit.grid30.H min2=2500 n2=1 squeeze=n > v.H
	../Tese/bin/OW_arealsht.x rec_cig=s1.H sou_cig=s1.H sou=sou.H vel=v.H \
	rec_out=3delf.crec$*.perm.H sou_out=3delf.csou$*.perm.H extrapolator=ffd \
	padtraces=101 encode=1 encz=1 eps=0 random=1 injection=1 nreal=1 ngap=$* zmin=0 zmax= 3000 node=14 \
	> /dev/null 

###################################
#
# Synth
#
elf.layer_vel.synth.H:
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+1" > a1.H ; < a1.H Tpow tpow=1 | Scale dscale=0.8 > a2.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+1" > a1.H ; < a1.H Tpow tpow=1 | Scale dscale=0.5 > a3.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+3500" > a4.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+1" > a1.H ; < a1.H Tpow tpow=1 | Scale dscale=0.01 > a5.H
	Math file1=a2.H exp="file1+1500" > a2v.H ; < a2v.H Mute tfile=refl2.H vmute=0 > amu2.H
	Math file1=a3.H exp="file1+3600" > a3v.H ; < a3v.H Mute tfile=refl3.H vmute=0 > amu3.H
	< a4.H Mute tfile=refl4.H vmute=0 > amu4.H
	Math file1=a5.H exp="file1+4800" > a5v.H ; < a5v.H Mute tfile=refl5.H vmute=0 > amu5.H
	Math file1=a3v.H file2=amu3.H exp=file1-file2 | Mute tfile=refl2.H vmute=0 > aq3.H
	Math file1=a4.H file2=amu4.H exp=file1-file2 | Mute tfile=refl3.H vmute=0 > aq4.H
	Math file1=a5v.H file2=amu5.H exp=file1-file2 | Mute tfile=refl4.H vmute=0 > aq5.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+5000" | Mute tfile=refl5.H vmute=0 > aq6.H
	Math file1=a2v.H file2=amu2.H file3=aq3.H file4=aq4.H file5=aq5.H file6=aq6.H exp=file1-file2+file3+file4+file5+file6 > $@

elf.layer_vrefl.synth.H:
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1>a0.H;Math file1=a0.H exp="file1*0+0.9">a1.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1>a0.H;Math file1=a0.H exp="file1*0+1" > a2.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1>a0.H;Math file1=a0.H exp="file1*0+1.1">a3.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1>a0.H;Math file1=a0.H exp="file1*0+1.2">a4.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1>a0.H;Math file1=a0.H exp="file1*0+1.3">a5.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1>a0.H;Math file1=a0.H exp="file1*0+1.4">a6.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1>a0.H;Math file1=a0.H exp="file1*0+1.45"| Mute tfile=refl6.H vmute=0 > aq7.H
	< a1.H Mute tfile=refl1.H vmute=0 > amu1.H
	< a2.H Mute tfile=refl2.H vmute=0 > amu2.H
	< a3.H Mute tfile=refl3.H vmute=0 > amu3.H
	< a4.H Mute tfile=refl4.H vmute=0 > amu4.H
	< a5.H Mute tfile=refl5.H vmute=0 > amu5.H
	< a6.H Mute tfile=refl6.H vmute=0 > amu6.H
	Math file1=a1.H file2=amu1.H exp=file1-file2 > aq1.H
	Math file1=a2.H file2=amu2.H exp=file1-file2 | Mute tfile=refl1.H vmute=0 > aq2.H
	Math file1=a3.H file2=amu3.H exp=file1-file2 | Mute tfile=refl2.H vmute=0 > aq3.H
	Math file1=a4.H file2=amu4.H exp=file1-file2 | Mute tfile=refl3.H vmute=0 > aq4.H
	Math file1=a5.H file2=amu5.H exp=file1-file2 | Mute tfile=refl4.H vmute=0 > aq5.H
	Math file1=a6.H file2=amu6.H exp=file1-file2 | Mute tfile=refl5.H vmute=0 > aq6.H
	Math file1=aq1.H file2=aq2.H file3=aq3.H file4=aq4.H file5=aq5.H file6=aq6.H file7=aq7.H exp=file1+file2+file3+file4+file5+file6+file7 > $@

elf.layer_vel.synth.top.H: elf.layer_vel.synth.H
	< elf.layer_vel.synth.H Transp plane=13 | Window3d min1=5150 n1=56 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=topsalt2model_02.prn vmut=1 v=4500|Window3d|Transp > v1.H
	< elf.layer_vel.synth.H Transp plane=13 | Window3d max1=5150 |Transp > v0.H
	< elf.layer_vel.synth.H Transp plane=13 | Window3d min1=6550 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 > $@

elf.layer_vel.synth.topbase.H: elf.layer_vel.synth.top.H
	< elf.layer_vel.synth.H Transp plane=13 | Window3d min1=5150 n1=56 squeeze=n > v00.H
	< elf.layer_vel.synth.top.H Window3d min1=5150 n1=56 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=basesalt2model_02.prn vvel=1 vsub=v00.H |Window3d|Transp > v1.H
	< elf.layer_vel.synth.H Transp plane=13 | Window3d max1=5150 |Transp > v0.H
	< elf.layer_vel.synth.top.H Window3d min1=6550 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 > $@

elf.layer_vrefl.synth.top.H: elf.layer_vrefl.synth.H
	< elf.layer_vrefl.synth.H Transp plane=13 | Window3d min1=5150 n1=56 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=topsalt2model_02.prn vmut=1 v=1.35 |Window3d|Transp > v1.H
	< elf.layer_vrefl.synth.H Transp plane=13 | Window3d max1=5150 |Transp > v0.H
	< elf.layer_vrefl.synth.H Transp plane=13 | Window3d min1=6550 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 > $@

elf.layer_vrefl.synth.topbase.H: elf.layer_vrefl.synth.top.H
	< elf.layer_vrefl.synth.H Transp plane=13 | Window3d min1=5150 n1=56 squeeze=n > v00.H
	< elf.layer_vrefl.synth.top.H Window3d min1=5150 n1=56 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=basesalt2model_02.prn vvel=1 vsub=v00.H |Window3d|Transp > v1.H
	< elf.layer_vrefl.synth.H Transp plane=13 | Window3d max1=5150 |Transp > v0.H
	< elf.layer_vrefl.synth.top.H Window3d min1=6550 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=23 > $@

elf.layer_slow.synth.topbase.H:
	< elf.layer_vel.synth.topbase.H Gpow gpow=-1 > $@

elf.layer_bvel.synth.H:
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+1" > a1.H ; < a1.H Tpow tpow=1 | Scale dscale=0.8 > a2.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+1" > a1.H ; < a1.H Tpow tpow=1 | Scale dscale=0.5 > a3.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+3500" > a4.H
	< a4.H Mute tfile=refl4.H vmute=0 > amu4.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+3500" > a5.H
	Math file1=a2.H exp="file1+1500" > a2v.H ; < a2v.H Mute tfile=refl2.H vmute=0 > amu2.H
	Math file1=a3.H exp="file1+3600" > a3v.H ; < a3v.H Mute tfile=refl3.H vmute=0 > amu3.H
	< a5.H Mute tfile=refl5.H vmute=0 > amu5.H
	Math file1=a3v.H file2=amu3.H exp=file1-file2 | Mute tfile=refl2.H vmute=0 > aq3.H
	Math file1=a4.H file2=amu4.H exp=file1-file2 | Mute tfile=refl3.H vmute=0 > aq4.H
	Math file1=a5.H file2=amu5.H exp=file1-file2 | Mute tfile=refl4.H vmute=0 > aq5.H
	Spike n1=401 o1=0 d1=12.5 n2=1 d2=1 o2=0 n3=479 d3=25 o3=0 nsp=1 k1=1 k2=1 k3=1 > a0.H ; Math file1=a0.H exp="file1*0+3500" | Mute tfile=refl5.H vmute=0 > aq6.H
	Math file1=a2v.H file2=amu2.H file3=aq3.H file4=aq4.H file5=aq5.H file6=aq6.H exp=file1-file2+file3+file4+file5+file6 > $@

elf.layer_bvel.synth.top.H: elf.layer_bvel.synth.H
	< elf.layer_bvel.synth.H Transp plane=13 | Window3d min1=5150 n1=56 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=topsalt2model_02.prn vmut=1 v=4500|Window3d|Transp > v1.H
	< elf.layer_bvel.synth.H Transp plane=13 | Window3d max1=5150 |Transp > v0.H
	< elf.layer_bvel.synth.H Transp plane=13 | Window3d min1=6550 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 > $@

elf.layer_bvel.synth.topbase.H: elf.layer_bvel.synth.top.H
	< elf.layer_bvel.synth.H Transp plane=13 | Window3d min1=5150 n1=56 squeeze=n > v00.H
	< elf.layer_bvel.synth.top.H Window3d min1=5150 n1=56 squeeze=n |\
	../Tese/bin/OW_editvel_mut.x hor1=basesalt2model_02.prn vvel=1 vsub=v00.H |Window3d|Transp > v1.H
	< elf.layer_bvel.synth.H Transp plane=13 | Window3d max1=5150 |Transp > v0.H
	< elf.layer_bvel.synth.top.H Window3d min1=6550 |Transp > v2.H
	Cat v0.H v1.H v2.H axis=2 | Window3d | Pad beg2=1000 end2=1000 extend=1|Transp plane=12 reshape=1,3 > $@

elf.layer_bslow.synth.topbase.H: elf.layer_bvel.synth.topbase.H
	< elf.layer_bvel.synth.topbase.H Gpow gpow=-1 > $@

elf.synth:
	< elf.layer_vel.synth.topbase.H Window3d | Transp > elf.layer_vel.synth.topbase.tr.H
	Wavelet n1=1001 d1=0.004 wavelet=ricker2 phase=0 fund=20 order=0.2 tdelay=2 domain=time > j2.H;echo o1=-.2 >> j2.H
	<j2.H Transf f_min=0 f_min1=4 f_max1=40 f_max=46 wei=y is2d=y > j1.H; <j1.H Window3d | Cabs > j2.H
	Math file1=j2.H exp="file1*0">j1.H;Math file1=j2.H exp="file1*-1">j3.H;Cmplx j3.H j1.H| Transp plane=13 > elf.synth.csou.H
	Lloyd_vel < elf.layer_vel.synth.topbase.H nref=4 min_region_pct=2 niter_lloyd=120 min_slow_dev=.01 > elf.layer_vref.synth.H
	../ShtPSPI/bin/OWmod2d_par.x sou=elf.synth.csou.H vel=elf.layer_vel.synth.topbase.tr.H vref=elf.layer_vref.synth.H lloyd=1 \
	vreflect=elf.layer_vrefl.synth.topbase.H refout=elf.layer_refout.synth.H shots=elf.synth.H extrapolator=pspi \
	traces_in_taper=100 padtraces=25 xmin=-15000 xmax=25000 light=1 illum=elf.synth.illum.H \
	nrec=601 orec=-7500 drec=25 nsht=481 osht=0 dsht=25 zmin=0 zmax=4900 node=14 > /dev/null

elf.timg:
#	Window3d < elf.synth.H min4=6000 n4=1 squeeze=n > rr.H
	../Tese/src/areal/wemvaop/OWmig2d_areal.x sou=elf.synth.csou.H rec=elf.synth.H vel=elf.layer_slow.synth.topbase.H \
	bkgimg=elf.timg.synth.H zmin=0 zmax=5000 nh=33 oh=-400 jh=1 migration=1 areal=0 extrapolator=pspi nrefvel=4 lloyd=1 \
	padtraces=150 traces_in_taper=50 node=14

elf.bimg:
	../Tese/src/areal/wemvaop/OWmig2d_areal.x sou=elf.synth.csou.H rec=elf.synth.H vel=elf.layer_bslow.synth.topbase.H \
	bkgimg=elf.bimg.synth.H zmin=0 zmax=5000 nh=33 oh=-400 jh=1 migration=1 areal=0 extrapolator=pspi nrefvel=4 lloyd=1 \
	padtraces=150 traces_in_taper=50 node=14


#	 ../Tese/bin/OW_hormut.x hor1=mute_lasthor.csv|Window3d n1=1290|Smooth rect1=11|Pad beg1=0 end1=1 extend=1>mute_lasthor.H
#	Transp plane=13 < elf.bimg.synth.H | Mute tfile=mute_lasthor.H vmute=0 | Window3d min3=0 max3=12500 | Transp plane=13 > 
