Newer
Older
#!/bin/bash -x
export PATH=$HOME/src/OpenSource/bin:$PATH:
export OMP_NUM_THREADS=1
#mute all events below the first arrival to get the intial focusing field
fmute file_shot=iniFocus_rp.su file_out=p0plus.su above=-1 shift=-8 verbose=1 check=0 hw=8
#apply the Marchenko algorithm
marchenko file_shot=shotsdx5_rp.su file_tinv=p0plus.su nshots=901 verbose=2 \
file_green=pgreen.su file_gplus=Gplus0.su file_gmin=Gmin0.su \
file_f1plus=f1plus0.su file_f1min=f1min0.su file_f2=f2.su
#compare Green's funtions on Marhcenko and reference result
suwind key=gx min=0 max=0 itmax=511 < pgreen.su | sumax mode=abs outpar=nepmg
suwind key=gx min=0 max=0 itmax=511 < referenceP_rp.su | sumax mode=abs outpar=neprf
mg=`cat nepmg | awk '{print $1}'`
rf=`cat neprf | awk '{print $1}'`
value=${value/[eE][+][0]/*10^}
mg=${mg/[eE][+][0]/*10^}
rf=${rf/[eE][+][0]/*10^}
rm nep*
scale=$(echo "scale=3; ($rf)/($mg)" | bc -l)
echo $scale
(suwind key=gx min=0 max=0 itmax=511 < pgreen.su | sugain scale=$scale; \
suwind key=gx min=0 max=0 < referenceP_rp.su) | suxgraph
#suwind itmax=511 < pgreen.su > pgreen512.su
#suop2 pgreen512.su referenceP_rp.su op=diff w2=1 w1=$scale > diffref.su
# plot for convergence rate, the values in conv.txt are collected from the output of the marhenko program with verbose=2
# marchenko: - iSyn 0: Ni at iteration 0 has energy 6.234892e+02; relative to N0 1.000000e+00
#a2b < conv.txt | \
#psgraph n=16 style=normal hbox=2 wbox=6 labelsize=10 \
#label2='convergence rate' label1='iteration number' > convergence.eps
# If guplot is installed: the same plot can also be produced by gnuplot this figure is used in the paper
#gnuplot conv.gnp