From a9a129e3fe40c26a134846e98701a374cc3efd48 Mon Sep 17 00:00:00 2001
From: JanThorbecke <janth@xs4all.nl>
Date: Mon, 27 May 2019 11:28:08 -0500
Subject: [PATCH] WS15

---
 marchenko/demo/WS15/README.2           |  2 +-
 marchenko/demo/WS15/README.3           | 10 +++++-
 marchenko/demo/WS15/README.4           |  6 ++--
 marchenko/demo/twoD/epsPlane.scr       | 34 ++++++++++++++++++
 marchenko/demo/twoD/epsPrimaries.scr   | 38 ++++++++++++++++++++
 marchenko/demo/twoD/initialPlane.scr   | 50 ++++++++++++++++++++++++++
 marchenko/demo/twoD/marchenkoPlane.scr | 15 ++++++++
 marchenko/demo/twoD/primaries.scr      |  8 +++--
 marchenko/demo/twoD/referenceShot.scr  |  5 +--
 9 files changed, 159 insertions(+), 9 deletions(-)
 create mode 100755 marchenko/demo/twoD/epsPlane.scr
 create mode 100755 marchenko/demo/twoD/epsPrimaries.scr
 create mode 100755 marchenko/demo/twoD/initialPlane.scr
 create mode 100755 marchenko/demo/twoD/marchenkoPlane.scr

diff --git a/marchenko/demo/WS15/README.2 b/marchenko/demo/WS15/README.2
index aa9603a..cd50a79 100644
--- a/marchenko/demo/WS15/README.2
+++ b/marchenko/demo/WS15/README.2
@@ -23,7 +23,7 @@ run the marchenko program interactively (no need to submit job to queue);
 
 Compare the Green's function computed by marchenko with the reference (adapt job.pbs to run referenceShot.scr)
 
-The script eps.scr generate .eps files and .png files that can be copied back to your local laptop for display.
+The script eps.scr generates .eps and .png files that can be copied back to your local laptop for display.
 
 You can experiment with 
 -amplitude of R: scale with a constant ampltiude 
diff --git a/marchenko/demo/WS15/README.3 b/marchenko/demo/WS15/README.3
index 37f0f30..7cbb22a 100644
--- a/marchenko/demo/WS15/README.3
+++ b/marchenko/demo/WS15/README.3
@@ -1 +1,9 @@
-plane waves
+Plane waves
+
+Marchenko emthod worls as well with plane-waves, in stead of modeling a foccus point response for the initial operaror and plane wave is modeled. 
+
+Submit the initialPlane.scr to the queue to compute the intial operator. The marchenkoPlane.scr script computes the Macrehnko solution for the plane-wave response. 
+
+
+
+The script epsPlane.scr generates .eps and .png files that can be copied back to your local laptop for display.
diff --git a/marchenko/demo/WS15/README.4 b/marchenko/demo/WS15/README.4
index b6da83d..071e902 100644
--- a/marchenko/demo/WS15/README.4
+++ b/marchenko/demo/WS15/README.4
@@ -1,3 +1,5 @@
 
- 
-Primaries only
+To generate a shot record with Primaries reflections only submit the demo/twoD/primaries.scr to the queue. 
+
+The script epsPrimaries.scr generates .eps and .png files that can be copied back to your local laptop for display.
+
diff --git a/marchenko/demo/twoD/epsPlane.scr b/marchenko/demo/twoD/epsPlane.scr
new file mode 100755
index 0000000..e5abc5e
--- /dev/null
+++ b/marchenko/demo/twoD/epsPlane.scr
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+#intial plane operator
+file=iniPlane_z1100_rp.su
+file_base=${file%.su}
+sumax < $file mode=abs outpar=nep
+clipref=`cat nep | awk '{print $1/2}'`
+
+supsimage hbox=6 wbox=4 labelsize=10 linewidth=0.0 < $file \
+    label1="time (s)" label2="lateral distance (m)" \
+    n1tic=2 x1beg=0 x1end=2.0 d1num=0.4 \
+    f2=-3000 f2num=-3000 d2num=1000 clip=$clipref > ${file_base}.eps
+convert -quality 90 -antialias ${file_base}.eps ${file_base}.jpg
+
+supsimage hbox=6 wbox=4 labelsize=10 linewidth=0.0 < p0plus.su \
+    label1="time (s)" label2="lateral distance (m)" \
+    n1tic=2 x1beg=0 x1end=2.0 d1num=0.4 \
+    f2=-3000 f2num=-3000 d2num=1000 clip=$clipref > ${file_base}_muted.eps
+convert ${file_base}_muted.eps ${file_base}_muted.png
+
+
+#Marchencko computed Greens function
+file=f2Plane.su
+file_base=${file%.su}
+sumax < $file mode=abs outpar=nep
+clipref=`cat nep | awk '{print $1/4}'`
+
+supsimage hbox=6 wbox=4 labelsize=10 linewidth=0.0 < $file \
+    label1="time (s)" label2="lateral distance (m)" \
+    n1tic=2 x1beg=0 x1end=2.0 d1num=0.4 \
+    f2=-3000 f2num=-3000 d2num=1000 clip=$clipref > ${file_base}.eps
+convert ${file_base}.eps ${file_base}.png
+
+
diff --git a/marchenko/demo/twoD/epsPrimaries.scr b/marchenko/demo/twoD/epsPrimaries.scr
new file mode 100755
index 0000000..515814d
--- /dev/null
+++ b/marchenko/demo/twoD/epsPrimaries.scr
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+#original shot record 
+
+file=shotw.su
+file_base=${file%.su}
+sumax < $file mode=abs outpar=nep
+clipref=`cat nep | awk '{print $1/5}'`
+
+supsimage hbox=6 wbox=4 labelsize=10 linewidth=0.0 < $file \
+    label1="time (s)" label2="lateral distance (m)" \
+    n1tic=2 x1beg=0 x1end=2.0 d1num=0.4 \
+    f2=-3000 f2num=-3000 d2num=1000 clip=$clipref title="original shot" > ${file_base}.eps
+convert -quality 90 -antialias ${file_base}.eps ${file_base}.jpg
+
+
+#Marchencko computed primaries only 
+file=pred_rr.su
+file_base=${file%.su}
+
+supsimage hbox=6 wbox=4 labelsize=10 linewidth=0.0 < $file \
+    label1="time (s)" label2="lateral distance (m)" \
+    n1tic=2 x1beg=0 x1end=2.0 d1num=0.4 \
+    f2=-3000 f2num=-3000 d2num=1000 clip=$clipref title="primaries"> ${file_base}.eps
+convert ${file_base}.eps ${file_base}.png
+
+
+#difference : removed internal multiples
+sudiff pred_rr.su shotw.su > diff.su
+file=diff.su
+file_base=${file%.su}
+
+supsimage hbox=6 wbox=4 labelsize=10 linewidth=0.0 < $file \
+    label1="time (s)" label2="lateral distance (m)" \
+    n1tic=2 x1beg=0 x1end=2.0 d1num=0.4 \
+    f2=-3000 f2num=-3000 d2num=1000 clip=$clipref title="removed multiples"> ${file_base}.eps
+convert ${file_base}.eps ${file_base}.png
+
diff --git a/marchenko/demo/twoD/initialPlane.scr b/marchenko/demo/twoD/initialPlane.scr
new file mode 100755
index 0000000..fbdd55e
--- /dev/null
+++ b/marchenko/demo/twoD/initialPlane.scr
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+export PATH=$HOME/src/OpenSource/bin:$PATH:
+
+dx=2.5
+dt=0.0005
+
+makemod sizex=6000 sizez=2000 dx=$dx dz=$dx cp0=1900  ro0=1200 \
+        orig=-3000,0 file_base=synclDown.su verbose=2 \
+        intt=def x=-3000,500,3000 z=195,195,195 poly=1 cp=1950 ro=3700 \
+        intt=def x=-3000,3000 z=600,600 poly=0 cp=2050 ro=1750 \
+        intt=def x=-3000,3000 z=680,680 poly=0 cp=2150 ro=2220 \
+        intt=def x=-3000,3000 z=780,780 poly=0 cp=2230 ro=1700 \
+        intt=def x=-3000,-2200,-1500,0,1300,2100,3000 z=520,580,680,840,680,600,500 poly=2 cp=2400 ro=2800 \
+
+makewave fp=20 dt=$dt file_out=wave.su nt=4096 t0=0.1 scale=1
+
+dxshot=10
+ishot=300
+nshots=301
+
+export KMP_AFFINITY=disabled
+export OMP_NUM_THREADS=16
+
+file_rcv=iniPlane_z1100.su
+	
+fdelmodc \
+	file_cp=synclDown_cp.su ischeme=1 iorder=4 \
+   	file_den=synclDown_ro.su \
+   	file_src=wave.su \
+   	file_rcv=$file_rcv \
+   	src_type=1 \
+	src_orient=1 \
+	src_injectionrate=1 \
+   	rec_type_vz=0 \
+   	rec_type_p=1 \
+   	rec_int_vz=2 \
+	rec_delay=0.1 \
+   	dtrcv=0.004 \
+   	verbose=2 \
+   	tmod=2.100 \
+   	dxrcv=10.0 \
+   	xrcv1=-3000 xrcv2=3000 \
+   	zrcv1=0 zrcv2=0 \
+   	xsrc=0 zsrc=1100 plane_wave=1 nsrc=2401 \
+   	ntaper=200 \
+   	left=2 right=2 top=2 bottom=2
+
+
+
diff --git a/marchenko/demo/twoD/marchenkoPlane.scr b/marchenko/demo/twoD/marchenkoPlane.scr
new file mode 100755
index 0000000..3798374
--- /dev/null
+++ b/marchenko/demo/twoD/marchenkoPlane.scr
@@ -0,0 +1,15 @@
+#!/bin/bash -x
+
+export PATH=$HOME/src/OpenSource/bin:$PATH:
+
+export OMP_NUM_THREADS=40
+
+#mute all events below the first arrival to get the intial focusing field
+fmute file_shot=iniPlane_z1100_rp.su file_out=p0plus.su above=-1 shift=-10 verbose=1 check=1 hw=4
+
+#apply the Marchenko algorithm
+marchenko file_shot=shots/refl_rp.su file_tinv=p0plus.su nshots=601 verbose=1 \
+    tap=0 niter=15 hw=8 shift=7 smooth=3 \
+    file_green=pPlane.su \
+    file_f1plus=f1plusPlane.su file_f1min=f1minPlane.su file_f2=f2Plane.su
+
diff --git a/marchenko/demo/twoD/primaries.scr b/marchenko/demo/twoD/primaries.scr
index d001b74..4fa1a4f 100755
--- a/marchenko/demo/twoD/primaries.scr
+++ b/marchenko/demo/twoD/primaries.scr
@@ -20,21 +20,23 @@ marchenko_primaries file_shot=shots/refl_rp.su ishot=$select file_src=wave.su \
 	nshots=601 verbose=2 istart=40 iend=650 fmax=90 \
 	niter=22 niterskip=50 shift=20 file_rr=pred_rr.su T=0
 
+#for reference original shot record from Reflection matrix
+suwind key=fldr min=$select max=$select < shots/refl_rp.su > shotsx0.su
+fconv file_in1=shotsx0.su file_in2=wave.su file_out=shotw.su
+
 #alternative use shotw as input, must first be multiplied by -1 (see theory)
-#suwind key=fldr min=$select max=$select < shots/refl_rp.su > shotsx0.su
-#fconv file_in1=shotsx0.su file_in2=wave.su file_out=shotw.su
 #sugain scale=-1 < shotw.su > pplus.su
 #
 #marchenko_primaries file_shot=shots/refl_rp.su file_tinv=pplus.su \
 #	nshots=601 verbose=2 istart=40 iend=1024 fmax=90 \
 #	niter=22 niterskip=50 shift=20 file_rr=pred_rr.su T=0
 
-exit
 
 # for displaying results
 
 (suwind key=offset min=0 max=0 < pred_rr.su ; suwind key=offset min=0 max=0 < shotw.su) | suxgraph
 
+exit
 sudiff pred_rr.su shotw.su > diff.su
 suximage < shotw.su  x1end=2.5 clip=1 title="original shot"&
 suximage < pred_rr.su  x1end=2.5 clip=1 title="shot with multiples removed"&
diff --git a/marchenko/demo/twoD/referenceShot.scr b/marchenko/demo/twoD/referenceShot.scr
index abd00a1..56411aa 100755
--- a/marchenko/demo/twoD/referenceShot.scr
+++ b/marchenko/demo/twoD/referenceShot.scr
@@ -19,8 +19,9 @@ fdelmodc \
     src_type=1 \
     src_orient=1 \
     src_injectionrate=1 \
-    rec_type_ud=1 \
+    rec_type_ud=0 \
     rec_type_p=1 \
+    rec_type_vz=0 \
     rec_int_vz=2 \
     dtrcv=0.004 \
     rec_delay=0.1 \
@@ -30,7 +31,7 @@ fdelmodc \
     xrcv1=-3000 xrcv2=3000 \
     zrcv1=0 zrcv2=0 \
     xsrc=0 zsrc=1100 \
-    file_snap=backpropref.su tsnap1=0.1 dtsnap=0.010 tsnap2=2.100 \
+    file_snap=backpropref.su tsnap1=0.1 dtsnap=0.010 tsnap2=0.000 \
     dxsnap=10 dzsnap=10 zsnap1=0 zsnap2=2000 xsnap1=-2250 xsnap2=2250 sna_type_vz=0 \
     ntaper=200 \
     left=2 right=2 top=2 bottom=2
-- 
GitLab