/* wmig.java Migration in the (z, x, omega)-domain. Adapted from Jon Claerbout's Imaging the Earth's Interior (1985), p. 111, by John N. Louie, 29 November 1998. */ /* Include the usual classes */ import java.util.*; import java.io.*; import java.lang.Math; /* Declare a class to contain wmig as a main method, referring to the class fttestc.colmft() static method, and re-defining the extrap.ctris() static method. */ /* When you change the code in this file, make a copy to a new file with a new name like "ex8wmig.java", and be sure to make the same change to the class name below - e.g. "class ex8wmig" */ class wmig { /* The main() method compiles into a file named "wmig.class" that you run in the Java virtual machine as a stand-alone application with a command such as "java wmig"; or whatever you have renamed the class and file. */ public static void main(String args[]) /* No runtime arguments needed */ { System.out.println("Starting wmig..."); /* Declare variables */ int ix, nx, iz, nz, iw, nw, it, nt; float pi2, alpha, dt, dtau, dw, s, cang, w, v, dx; Complex aa = new Complex(); Complex a = new Complex(); Complex b = new Complex(); Complex c = new Complex(); Complex cshift = new Complex(); Complex num = new Complex(); Complex den = new Complex(); Complex num2 = new Complex(); Complex bl = new Complex(); Complex br = new Complex(); Complex qm1 = new Complex(); Complex qnx = new Complex(); /* Initialize constants */ nt = 64; nz = nt; nx = 48; pi2 = (float)(2.0*Math.PI); dt = 1F; dtau = 1F; dw = pi2/(dt*nt); nw = nt/2; v = 1F; dx = 1F; /* alpha = 0.25; */ alpha = v*v*dtau/(4F*dx*dx); /* Declare and initialize planes to zero values */ FltPlane q = new FltPlane(nt, nx); ComplexPlane cq = new ComplexPlane(nt, nx); /* Note that wmig operates in rows of x, for the convenience of the ctrisr() method. */ ComplexVec cd = new ComplexVec(nx); ComplexVec ce = new ComplexVec(nx); ComplexVec cf = new ComplexVec(nx); /* Broadened impulse source */ for (it=nt/3; it=0; i--) { num.mul(e.vec[i],q.vec[w0+i+1]); num.add(num,f.vec[i]); q.vec[w0+i].re = num.re; q.vec[w0+i].im = num.im; } /* End of ctrisr static method of class wmig */ } /* End of methods in class wmig */ }