From f04550da28b25b6adb1b6aa4203bbc5a5982f5e1 Mon Sep 17 00:00:00 2001
From: JanThorbecke <janth@xs4all.nl>
Date: Thu, 9 Jul 2020 14:10:29 +0200
Subject: [PATCH] plane-wave correction

---
 marchenko/Makefile    |  2 +-
 marchenko/marchenko.c | 21 +++------------------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/marchenko/Makefile b/marchenko/Makefile
index 03f9a5b..f60dc90 100644
--- a/marchenko/Makefile
+++ b/marchenko/Makefile
@@ -61,7 +61,7 @@ fmute:	$(OBJJ)
 OBJH	= $(SRCH:%.c=%.o)
 
 marchenko:	$(OBJH) 
-	$(CC) $(LDFLAGS) $(OPTC) $(CFLAGS) -o marchenko1 $(OBJH) $(LIBS)
+	$(CC) $(LDFLAGS) $(OPTC) $(CFLAGS) -o marchenko $(OBJH) $(LIBS)
 
 OBJP	= $(SRCP:%.c=%.o)
 
diff --git a/marchenko/marchenko.c b/marchenko/marchenko.c
index ca54d5a..18f36d2 100644
--- a/marchenko/marchenko.c
+++ b/marchenko/marchenko.c
@@ -581,24 +581,9 @@ int main (int argc, char **argv)
         }
         /* Apply mute with window for Gmin */
 		if ( plane_wave==1 ) {
-            /* for plane wave with angle shift itmin downward */
-			int *tsynSW;
-    		tsynSW = (int *)malloc(Nfoc*nxs*sizeof(int));
-			itmin = NINT(tshift/dt);
-            for (i = 0; i < nxs; i++) tsynSW[i] = tsynW[i] + itmin;
-            //timeShift(Gmin, nts, npos, dt, tshift, fmin, fmax);
-
-            /* applyMute_tshift(Gmin, muteW, smooth, 4, Nfoc, nxs, nts, ixpos, npos, shift, 0, tsynSW);
-            for (l = 0; l < Nfoc; l++) {
-                for (i = 0; i < npos; i++) {
-                    memcpy(&trace[0],&Gmin[l*nxs*nts+i*nts],nts*sizeof(float));
-                    for (j = 0; j < nts; j++) {
-                        Gmin[l*nxs*nts+i*nts+j] = trace[j];
-                    }
-                }
-            } */
-            /* for plane wave with angle shift itmin downward */
-            //timeShift(Gmin, nts, npos, dt, tshift, fmin, fmax);
+            applyMute_tshift(Gmin, muteW, smooth, 4, Nfoc, nxs, nts, ixpos, npos, shift, 0, tsynW);
+            /* for plane wave with angle tshift downward */
+            timeShift(Gmin, nts, npos, dt, tshift, fmin, fmax);
 		}
 		else {
             applyMute(Gmin, muteW, smooth, 4, Nfoc, nxs, nts, ixpos, npos, shift, tsynW);
-- 
GitLab