/* JRG, the Resource Geology Seismic Processing System for Java, and Viewmat for Java are Copyright 1998, 1999 by John N. Louie The software and methods here are the subject of academic research, not commercial products. I would like to know what use you make of my methods, and have your feedback on their success or failure. Also, by letting me know who you are, I can inform you if bugs or errors are discovered. Please send me an email message with: your name and email address; whether you are a student or faculty member, consultant or employee; the name of your university or company, and department; and a sentence or two describing what use you intend to make of these methods. Send your message to louie@seismo.unr.edu */ import java.util.*; import java.io.*; import java.lang.Math; class testcomplexplane { public static void main(String args[]) { int i; FltPlane fltplane = new FltPlane(210, 1000); fltplane.readBinaryFile("test.flt", 0); ComplexPlane cp = new ComplexPlane(fltplane, fltplane); cp.realtoFltPlane(fltplane); System.out.println("Real max=" + fltplane.max() + " rms=" + fltplane.rms() + " dot=" + fltplane.dot(fltplane)); cp.imtoFltPlane(fltplane); System.out.println("Imaginary max=" + fltplane.max() + " rms=" + fltplane.rms() + " dot=" + fltplane.dot(fltplane)); /* FltPlane fltplane = new FltPlane(210, 1000); fltplane.readBinaryFile("test.flt", 0); */ cp.powtoFltPlane(fltplane); float rms = fltplane.rms(); fltplane.viewinFrame("test.flt.pow", true, (0.001F*2000F/2F)/15.24F, RgCtab.rwb, false, 3F*rms); /* FltPlane fp = new FltPlane(100, 178); fp.readBinaryFile("dixie-migvels", 0); fp.addc(-(fp.min())); fp.viewinFrame("dixie-migvels", false, 1F, RgCtab.yglobe, true, -1F); */ } } public class ComplexPlane extends ComplexVec { public int ne; public int vecs; public String VecUnits; public float Vec0; public float DVec; public static void filt(ComplexPlane cdata, int ld, int lu, int hu, int hd, int spec) { int i; for (int i1=0; i1 0F) /* time forward */ sc = cp.getDUnitofDim(0); else /* time inverse */ sc = 1F/cp.getDUnitofDim(0)/2F/n2/2F; /* Loop over n1, number of rows */ for (i1=0; i1 m-1) { j = j - m; m = m/2; if (m < 1) break; } j = j + m; } lstep = 1; do { istep = 2*lstep; cw.re = 1F; cw.im = 0F; arg = (float)(sign2*Math.PI/lstep); cdel.re = (float)(Math.cos((double)(arg))); cdel.im = (float)(Math.sin((double)(arg))); for (m=0; m m-1) { j = j - m; m = m/2; if (m < 1) break; } j = j + m; } do { istep = 2*k; for (m=0; m= NDims) return(1); else return(0); } public String getUnitsofDim(int Dim) { if (Dim == 0) return(ElemUnits); else if (Dim == 1) return(VecUnits); return(""); } public void setUnitsofDim(int Dim, String Dimunits) { if (Dim == 0) ElemUnits = new String(Dimunits); else if (Dim == 1) VecUnits = new String(Dimunits); } public float getUnit0ofDim(int Dim) { if (Dim == 0) return Elem0; else if (Dim == 1) return Vec0; return 0F; } public void setUnit0ofDim(int Dim, float Unit0) { if (Dim == 0) Elem0 = Unit0; else if (Dim == 1) Vec0 = Unit0; } public float getDUnitofDim(int Dim) { if (Dim == 0) return DElem; else if (Dim == 1) return DVec; return 1F; } public void setDUnitofDim(int Dim, float DUnit) { if (Dim == 0) DElem = DUnit; else if (Dim == 1) DVec = DUnit; } }