Top Banner
by Andreas Tzanis Department of Geophysics University of Athens Athens, December 2005
140

Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Jul 28, 2018

Download

Documents

hakhanh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

by

Andreas Tzanis

Department of Geophysics University of Athens

Athens, December 2005

Page 2: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

LICENSE Copyright © 2005, Andreas Tzanis. Dr Andreas Tzanis Department of Geophysics, University of Athens Panepistimiopoli, Zografou 15784 Greece Tel: +30-210-727-4785 E-mail: [email protected] Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Founda-tion; with the Invariant Sections being “CHAPTER 1. OVERVIEW 1.1. Introduction 1.2. Why MATLAB and Which MATLAB? 1.3 Downloading and Installation 1.4. Legal Issues and Disclaimer 1.5. Acknowledgements GNU Free Documentation License” with the Front-Cover Texts being “MATGPR Release 1 Manual and Technical Reference by Andreas Tzanis Department of Geophysics University of Athens Athens, December 2005“ and with the Back-Cover Texts being no back cover text.. A copy of the license is included in the section entitled “GNU Free Documentation License”.

2

Page 3: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

CONTENTS LICENSE..................................................................................................................................2 CONTENTS..............................................................................................................................3 CHAPTER 1. OVERVIEW........................................................................................................6

1.1. Introduction ................................................................................................................... 6 1.2. Why MATLAB and Which MATLAB?........................................................................ 7 1.3. Downloading and Installation ..................................................................................... 8 1.4. Legal Issues and Disclaimer ...................................................................................... 9 1.5. Acknowledgements ................................................................................................... 10

CHAPTER 2. THE TOP LAYER.............................................................................................11 2.1. Program Logic and the MATGPR GUI. .................................................................. 11 2.2. Organization and Directory Structure ..................................................................... 14 2.3. Program Features and Utilities ................................................................................ 16

2.3.1. Runtime variables............................................................................................... 16 2.3.2. Object Manipulation: The FigureTools, ImageColours and Windows

features................................................................................................................. 18 2.3.3. The SEG-Y and Seismic Unix Standards....................................................... 20

2.4. Programming tips: How to write a MATGPR module........................................... 28 2.4.1 Setting up the uimenu. ........................................................................................ 28 2.4.2. Setting up the Callback function ...................................................................... 31 2.4.3. Reserved variable names and object tags ..................................................... 33

CHAPTER 3. THE BOTTOM LAYER.....................................................................................35 3.1. I/O and Flow Control: The 'Data' Menu .................................................................. 35

Import Raw Data. ............................................................................................................. 35 View Header Information................................................................................................. 35 Load Data from MAT-file................................................................................................ 37 Concatenate Sections........................................................................................................ 37 Hold Processed Data / Discard Processed Data. .............................................................. 38 Save Data to MAT-file..................................................................................................... 38 Save Depth Migrated Data. .............................................................................................. 39 Export. .............................................................................................................................. 39 Settings ............................................................................................................................. 39

3.2. Data Visualization: The "View" menu ..................................................................... 40 View Data / View Processed Data. .................................................................................. 40 Show Markers .................................................................................................................. 42 View Traces / View Spectra............................................................................................. 42 View Processed Traces / View Processed Spectra........................................................... 42

3

Page 4: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Attenuation Characteristics. ............................................................................................. 43 Instantaneous Attributes................................................................................................... 43

3.3. Basic Processing: The "Basic Handling" menu..................................................... 44 Adjust Signal Position...................................................................................................... 44 Trim Time Window.......................................................................................................... 45 Edit Scan Axis.................................................................................................................. 45 Remove Bad Traces ......................................................................................................... 46 Remove DC. ..................................................................................................................... 47 Dewow. ............................................................................................................................ 47 Equalize traces.................................................................................................................. 47 Remove DZT header gain. ............................................................................................... 47 Standard AGC. ................................................................................................................. 48 Gaussian-tapered AGC..................................................................................................... 48 Apply g(t)=scale * t^power.............................................................................................. 49 Resample Time Axis / Resample Scan Axis.................................................................... 49 Edit Markers..................................................................................................................... 50 Interpolate to Equal Spacing. ........................................................................................... 51 Make X Y Z...................................................................................................................... 51

3.4. Advanced Processing: The "Filtering" menu ......................................................... 52 Mean Filter / Median Filter. ............................................................................................. 52 Remove Global Background. ........................................................................................... 53 Suppress Horizontal Features........................................................................................... 53 Suppress Dipping Features............................................................................................... 53 Karhunen - Loeve Filter. .................................................................................................. 53 FIR Frequency Filter ........................................................................................................ 54 FIR Wavenumber Filter. .................................................................................................. 55 F - K Filter........................................................................................................................ 56 Predictive Deconvolution................................................................................................. 59

3.5. Interpretation: The "Imaging" menu ........................................................................ 60 Fit Diffraction Hyperbola................................................................................................. 60 Static Correction............................................................................................................... 61 Get 1-D velocity model. ................................................................................................... 61 1-D F-K Migration. .......................................................................................................... 62 1-D Phase-shift migration. ............................................................................................... 62 Time-to-Depth Conversion. ............................................................................................. 62 Get 2-D velocity model. ................................................................................................... 63 2-D Split-step Fourier Migration. .................................................................................... 64 2-D Phase-shift + Interpolation Migration. ...................................................................... 64 Simple Velocity Calculator. ............................................................................................. 65

4

Page 5: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

3.6. Interpretation: The "Modelling" menu ..................................................................... 66 Build 2-D Model. ............................................................................................................. 66 Split-step 2-D Modelling.................................................................................................. 75

CHAPTER 4. REFERENCES.................................................................................................77 CHAPTER 5. FUNCTION DOCUMENTATION......................................................................78

5.1. MATGPR GUI Complementary and Data Handling Utilities ............................... 78 5.2. I/O functions............................................................................................................... 82 5.3. Display and Data Inspection Utilities ...................................................................... 88 5.4. Data Editing and Basic Processing Utilities........................................................... 93 5.5. Gain manipulation functions..................................................................................... 99 5.6. Marker interpolation functions................................................................................ 101 5.7. Smoothing and Filtering Utilities ............................................................................ 104 5.8. Velocity Analysis and Imaging Utilities ................................................................. 110 5.9. Modelling Utilities ..................................................................................................... 121 5.10. Complementary Analysis and Support Utilities................................................. 125

GNU Free Documentation License ......................................................................................136

5

Page 6: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

CHAPTER 1. OVERVIEW

1.1. Introduction The Ground Probing Radar (GPR) has become an invaluable and almost indispensable means of exploring shallow structures for geoscientific, engineering environmental and archaeological work. At the same time, GPR analysis software is mostly proprietary and usually available from GPR manufacturers or a handful of other vendors. There are only two exceptions. A good but quite limited freeware package provided by the USGS (Lucius and Powers, 2002), which will not work in non-Microsoft platforms and due to the particularities of its graphics drivers has even problems working in Windows XP. The second free- ware package is the Radar Unix by Grandjean and Durand (1999), which is limited to Unix and Linux platforms; it does not work in Windows, OS(2) or Mackintosh systems unless they're augmented with the CygWin Linux emulator, and then under severe restrictions. Furthermore, RU draws processing power from the Seismic Unix (SU) analysis system, but as it is based on an outdated version of SU, it requires extensive overhaul. Both freeware packages are written in C, while RU's graphical interface (Xforms) is written in C++. This renders both of them rather unwieldy to modification or augmentation by the average practitioner. The most recent arrival on the scene is the openGPR project of Matthias Schuh, Tuebingen, Germany. This can be found in the URL http://opengpr.sourceforge.net/?openGPR and is a rather impressive piece or work. Unfortunately, it works only in Linux OS; moreover, it too is heavily dependent on SU and a host of other support programs. It can be used by people who know their way about with computing.

With the references above aside, the academic free software community has been slow to react on this issue and the limited freely distributed software is usually focused on very particular problems (mainly data input / output), generally unorganized and so diversely programmed, that if collected, it cannot form a consistent basis for the reliable manipulation of GPR data. Release 1 of MATGPR marks the beginning of an attempt to create a GPR analysis and interpretation package that can be truly cross-platform, as well as expandable and customizable to the needs of a particular user, with little programming effort. This is an ambiguous project, albeit feasible because MATLAB provides an all-inclusive high level programming environment, which facilitates the development of advanced software. This makes it much easier and faster than building programs from scratch with conventional high level languages such as C, C++ or FORTRAN.

MATLAB is a vast computing system, with many add-on application-specific toolboxes, priced and licensed separately. Some of those, (e.g. Signal Analysis, Image Processing etc.), include algorithms and analysis techniques that may be very useful to MATGPR. However, it is conceivable that many users do not enjoy access to the full range of MATLAB products. Accordingly, special provision was made for MATGPR to offer in-house solutions for those algorithms and analysis techniques that are necessary, but not supplied with the basic MATLAB system. Thus, MATGPR can be used by all those in possession of a MATLAB license, even if they do not have access to any other toolbox.

A basic (core) version of MATGPR, without GUI support may also be easily prepared, with rudimentary dialog and messaging services exclusively through the MATLAB command window. Its functions have to be executed manually, but would be truly platform independent and moreover, operational with other computing engines that emulate the MATLAB language (e.g. OCTAVE), or provide in-house translators

6

Page 7: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 1: Overview

from the MATLAB language (e.g. SCILAB). This is an endeavour planned for the near future, but only if it proves to be worthwhile.

At the present stage of development MATGPR provides a relatively broad and functional range of tools for the analysis of zero and single-offset GPR data. Nevertheless, one can think a multitude of analysis tools that can be included in future releases. Moreover, I consider it useful to point out that at this stage, MATGPR does not aspire to be a substitute for commercial analysis programs, which have been developed, debugged and perfected for long. However, it does offer a decent and in several aspects advanced means of treating GPR data. I hope that it has the potential to become competitive, if maintained, developed and expanded over time with contributions from other authors, along the spirit of the GNU project.

1.2. Why MATLAB and Which MATLAB?

In Section 1.1 above, I have made a brief statement about why MATLAB was chosen for the development of this GPR analysis software. However, there’s more to that.

MATLAB was not available until the latter part of the 1980’s, and prior to that, FORTRAN was the lan-guage of choice for serious numerical computation. C was making its first steps towards establishing a foothold in the world of scientific computation, but it didn’t offer built-in facilities for doing complex arithmetic and this was a serious drawback. Conversely, FORTRAN lacked some of C’s advantages such as structures, pointers, and dynamic memory allocation.

The appearance of MATLAB and its imitators made a big impact in the scientific community. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EIS-PACK projects, familiar to FORTRAN programmers for being robust collections of tools for linear alge-bra. To do this, MATLAB also introduced a new vector-oriented programming language, an interactive environment, and built-in graphics. These features offered many advantages and boosted productivity in comparison to more traditional application development environments. Since then, MATLAB has evolved to embed a large collection of state-of-the-art numerical tools, high quality graphics, object-oriented extensions, a built-in interactive debugger, web services and a host of other facilities.

Of course, C and FORTRAN have also evolved to C++ and FORTRAN90 / 95 respectively, with some editions also acquiring high-level (visual) application development environments. However, neither one offers as many goodies as MATLAB does, graphics for instance being a major issue.

Finally, MATLAB offers a fully vectorized language which leads to more concise and transparent code than most other languages. For the novice, it is actually easier to learn the vector approach since the op-erations in MATLAB are designed to be as natural as possible and resemble writing mathematical text on paper. For someone nourished with the programming practices of the traditional languages, like myself, getting rid of the habit to write code with long and explicit loops may be a little more difficult, but is well worth the effort.

In a final comment, it is worth noting that M-code (MATLAB’s language), on account of being inter-preted and not compiled, is much slower than C and FORTRAN when it comes to computationally inten-sive tasks. This is quite true, as would be appreciated by anyone who tired of waiting, went for a cup of coffee and found that the program was not even halfway through when he returned. However, MATLAB offers a solution in that it can integrate fast, compiled C or FORTRAN code with M-code by means of the MEX-file system. MATGPR makes use of this approach when a large amount of number crunching is re-quired. Another solution is to use M-code to drive customized, stand-alone C or FORTRAN programs

7

Page 8: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 1: Overview

and import their results for further processing. MATGPR also makes use of this approach when it needs to employ compiled third-party software. At any rate, many problems can be solved with more efficient programming: for many applications, vectorized and well-written M-code is as fast as compiled FOR-TRAN code, to the point of being competitive. This I have realized in several occasions while program-ming MATGPR, and is partly because much of MATLAB’s number crunching takes place in compiled C-language libraries. Let me also point out that when it comes to effectiveness, what really matters is the efficiency of the entire process of realizing a new scientific idea, or creating an analysis and interpretation procedure. Arguably, MATLAB is overall much more efficient in this respect: with built-in graphics, in-teractive environment, large tool set, and strict runtime error checking it facilitates the very rapid proto-typing of new algorithms or applications.

For all the above reasons, MATLAB is a rapidly evolving beast that has gone through many changes and is continuously acquiring new features. MATGPR is programmed in such a way, as to be as much backward compatible with earlier MATLAB editions, as possible. For instance, GUIs are programmed in a very old-style: GUIDE the GUI Layout Editor provided since MATLAB v.5 has not been employed, since it too has evolved and changed considerably. Moreover, provision has been for MATGPR to detect the MATLAB version and, when necessary, it does not invoke from an earlier version, functions and procedures added in later versions; in such a case it offers alternative, in-house solutions.

There is a point of no return however, and it has to do with the introduction to MATLAB, of data constructs like structures and cell arrays, as well as function handle callbacks. MATGPR uses such constructs, for they allow compact programming and efficient data handling. Consequently,

MATGPR will not work with any version of MATLAB that does not support structures and cell arrays!

MATGPR will not work with any version of MATLAB that does not support function handle callbacks!

This means that MATLAB v.4 is altogether out of the picture. I do not know how MATGPR will behave with MATLAB v5.x as it has not been tested on this platform. MATGPR will cooperate seamlessly with MATLAB v6.x and v7.x (less the bugs I may have overlooked).

A major issue is the MAT-file format (the MATLAB native binary file format) in which MATGPR exports or imports working data sets. On start up, MATGPR specifies that the MAT-file format will be the default for the version under which it is running. However, while the MAT-file format of MATLAB version 6.x is perfectly readable by version 7.x, the converse is not true! MATLAB Version 7, by default compresses the data it saves to MAT-files. It also uses Unicode character encoding when saving character data. Earlier MATLAB versions cannot read this file format. If you use v7.x and want your MAT-files to be readable by v6.x, you can disable these features. To see how, please refer to § 2.3.1. Note also that it is possible to override the compression and Unicode setting for all MATLAB v7.x sessions, by using the Preferences dialog box. See General Preferences for MATLAB in the Desktop Tools and Development Environment documentation for more information. Saving in MATLAB v4.x format is not possible. Version 4 does not support data constructs like structures, cell arrays, multidimensional arrays, or objects.

1.3. Downloading and Installation

MATGPR is distributed as single zip-file compressed with WinZip v8 or v9 or gzip. Matgpr.zip can be downloaded from URL http://users.uoa.gr/~atzanis/matgpr/matgpr.html. Copy it to your work directory and unzip. This will unfold the MATGPR home and subdirectory structure. The program is now ready to use. Start MATGPR by executing the function MATGPR/matgpr.m from the MATLAB command window. Please use this manual and the on-line help to navigate through the program and the test data provided in the directory MATGPR/work to familiarize with it.

8

Page 9: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 1: Overview

Users with MS Windows OS should have no problems using all features of MATGPR right away. The users of Linux and Unix OS please check the postscript notes in the links below, and adjust as necessary, in order to achieve full functionality. Mean and Median Filtering1-D Phase-shift migration (Gazdag)2-D Phase-shift + Interpolation MigrationSplit-step 2-D Modelling

1.4. Legal Issues and Disclaimer It will not take long to discover that the entire MATGPR package, including MATLAB and FORTRAN source codes, as well as their documentation, all have legal strings attached to them. MATGPR is pro-tected by the GNU General Public License, a copy of which is supplied herewith. Please take time to read it at least once. In accordance with the GNU GPL you should note the following: Whereas “this program” refers exclusively and in whole to the MATGPR software package as described in this here book and to its accompanying documentation (this here book), except for the limited material (free software) Copyrighted by third individuals and included in the MATGPR package,

This program is Copyright ©of Andreas Tzanis, 2005. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Gen-eral Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-out even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR-POSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

The following addenda to the Warranty Disclaimer apply:

1. No guarantees, or warranties, either expressed or implied, are provided by the Author, or Member of his Affiliated Organization, or by any Contributor to this program, regarding the ACCURACY, SAFETY, or ANY OTHER QUALITY or CHARACTERISTIC of this program, or ANY DERIVA-TIVE SOFTWARE.

2. MATLAB is a trademark of The MathWorks Inc. and is owned by them. Inasmuch as this program is based on the MATLAB platform, The MathWorks Inc. BEARS NO RESPONSIBILITY IN ANY FORM WHATSOEVER, for any adverse effect that may result from using this program.

This program is free, but is not public domain software. It is available under the following terms: 1. The Author (Copyright Holder) reserves the right to distribute this program and its documentation for

a profit and at his discretion. If such a decision is taken, the author guarantees that the copyright of third party free software included in this program will not be infringed and that no money will be charged for it.

9

Page 10: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 1: Overview

2. The simple repackaging and selling of this program as is, beyond the provisions of the GNU General Public License, as a commercial software product, is expressly forbidden without the prior written permission of the Author.

The following requests are not subject to any legal terms: 1. In publications, please refer to this program using one or all of the following:

a. Tzanis, A. and Kafetsis, G., 2004. A freeware package for the analysis and interpretation of common-offset Ground Probing Radar data, based on general purpose computing engines, Bul-letin Geol. Soc. Greece, XXXVI / 3, 1347-1354.

b. Tzanis, A., 2006. MATGPR: A freeware MATLAB package for the analysis of common-offset GPR data, Geophysical Research Abstracts, Vol. 8, 09488, 2006.

2. Please notify the Author for any corrections, bug fixes, improvements or additions / expansion you might make to this program, so that they may be can included in the next MATGPR release. Your name and affiliation will be dully credited.

1.5. Acknowledgements

1. The author acknowledges limited support by the “Kapodistrias Programme” of the Special Account for Research Grants, National and Kapodistrian University of Athens.

2. Support was also provided through the programme PYTHAGORAS II, “Support for Research Groups in Universities”, project “Development of Integrated Geophysical Technologies for Monitor-ing Changes in the State and Quality of Freshwater Aquifers”, conducted in the context of the Opera-tional Programme for Education and Initial Vocational Training, Ministry of Education of the Hel-lenic Republic.

10

Page 11: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

CHAPTER 2. THE TOP LAYER MATGPR is a two-layered software system, in which the bottom layer comprises a suite of functions to handle, display and process the data, while the top layer organizes these functions, automating data management and streamlining the flow of work by means of a GU Interface.

2.1. Program Logic and the MATGPR GUI. The MATGPR GUI (top layer) is produced by a long script (matgpr.m), which organizes the bottom layer functions and automates data management according to the flowchart of Figure 2.1. Figure 2.2 shows the physical appearance of the GU Interface; this is the start up MATGPR window, which appears when the matgpr.m script is executed and prior to importing any data.

The design philosophy is quite simple: work flows in a continuous cycle between the Current Input Data, i.e. that data before some processing operation (step) and the Output Data, i.e. the data resulting from this operation. You, the user, import, display and inspect the current input data with the appropriate choices under the Data and View menus. Then you decide and apply a processing step and inspect the result. If satisfied, you will 'hold' the result, replacing the current input data with the output data and will cycle through the same procedure with a new processing step. If not, you will ignore or discard the result and cycle with another processing step. While in Decision Node 1 (DN1), you may save or export the current input data. Soft and hard copies of the current input and output data (and other figures produced during a session), can be made at any time using the FigureTools menu of the figure windows. Data management decisions are realized with the appropriate choices under the Data menu (Figure 2.2), while the 'next processing step' is taken by one of the tasks under the Basic Handling, Filtering, Imaging and Modelling menus (also see Figure 2.2). Finally the Windows menu offers a fast navigation and window-switching facility exclusive to the MATGPR.

Figure 2.1. The flowchart of a data analysis session with MATGPR

11

Page 12: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

The Current Input Data is held in a structure named IPD (for Input Data) and the Output Data in an identical structure named OPD for (Output Data). Henceforth, the Current Input Data will be referred to at the “IPD structure” or simply the “IPD”. Likewise, the Output Data will be referred to as the “OPD structure” or simply the “OPD”. The IPD and OPD structures rotate during a typical data processing cycle as follows: • The IPD is copied onto the OPD. • OPD is modified by application of some processing step. • If the result is acceptable, the OPD is copied onto the IPD. • If the result is not acceptable you may discard the OPD, otherwise it will be automatically erased on

application of the next processing step. The IPD and OPD data structures comprise of the following fields (DATA stands for either the IPD or the OPD):

DATA.origin Header, specifying the type of system that collected the original data set (manufacturer and monostatic of bistatic).

DATA.pname String, path of the data file DATA.fname String, name of the data file DATA.d 2-D array of size [DATA.ns, DATA.ntr], data matrix DATA.ns Scalar, Number of samples per trace (scan) in DATA.d DATA.dt Scalar, temporal sampling rate of the traces in DATA.d DATA.tt2w Vector of size [1 x DATA.ns], 2-way traveltime DATA.sigpos Scalar, signal position (time-zero determined during data acquisition)

DATA.dz Scalar, spatial (depth) sampling rate of the columns (traces) of DATA.d – applies to depth migrated data

DATA.z Vector, depth DATA.zlab String, label of the vertical axis, used for display DATA.ntr Scalar, Number of traces (samples per row) in DATA.d DATA.dx Scalar, trace spacing

DATA.x Vector of size [1 x DATA.ntr], horizontal coordinates of the rows (traces) of DATA.d (scan axis). Can be either number of traces for un-equally spaced data, or distances from the start of the scan line.

DATA.xlab String, label of the horizontal axis, used for display.

DATA.markertr Vector, ID numbers and coordinates of marker traces. The coordinates are assumed fixed with respect to a local system of reference.

DATA.xyz.Tx Array of size [DATA.ntr x 3], with the X, Y and Z coordinates of the source antenna in a local frame of reference. For monostatic GPR systems (zero-offset data) DATA.xyz.Tx = DATA.xyz.Rx (see below)

DATA.xyz.Rx Array of size [DATA.ntr x 3], with the X, Y and Z coordinates of the receiver antenna in a local frame of reference. For monostatic GPR systems (zero-offset data) DATA.xyz.Rx = DATA.xyz.Tx (see above)

DATA.TxRx Scalar, antenna offset (Tx - Rx separation) DATA.Antenna String, antenna name / designation

DATA.DZThdgain Vector, variable gain settings used for data acquisition with GSSI systems (DZT)

DATA.TimesSaved Scalar, the number of times that a "save data"operation has been done dur-ing the current session.

DATA.comments On input, contains the file header, or header file comments of original data set. May be updated by the user.

DATA.history Cell array of strings, containing the which processing history of the current data set

DATA.matgprversion The current version of MATGPR.

12

Page 13: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

• NOTE: The IPD and OPD structures are accessible through MATLAB's base workspace and can used or manipulated independently of the MATGPR GUI. For example, their fields can be input / output to yours, or a third party's processing functions, while the results will still be available to MATGPR for further manipulation

When a data set is loaded, the MATGPR GUI displays essential information about the current input data (IPD) in the Data Info area (Figure 2.3). This information is updated after each and every processing step. If a field has not yet been assigned a value, the Not Available (NA) message is projected.

Figure 2.2. The start up window of the MATPR GUI.

Figure 2.3. The MATGPR GUI displays essential information about the IPD

13

Page 14: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

2.2. Organization and Directory Structure

MATGPR is a modular program. Each module performs a self-contained operation which is driven by the Callback function of the corresponding menu choice (uimenu item). The modules are organized and linked into an effective set by matgpr.m and a small complement of other functions.

• The MATGPR GUI is programmed in matgpr.m, which is the backbone of the top level and resides in the highest level directory MATGPR. When executed, matgpr.m adds the following directories to the MATLAB search path:

• The directory toplevel, with the complement of data management and control functions, which together with matgpr.m, comprise the backbone of the top level.

The subdirectory toplevel/callbacks contains the executive branch of the top level, namely functions that are executed as Callbacks to the menu items (the MATGPR modules). The names of the Callback functions have the form do_xxxxxx.m where xxxxxx can be the name of an analysis function or a task, or anything you’d like it to be when you’re developing it (see § 2.3 below). The Callback functions, in turn execute data handling and analysis functions residing in the io and analysis directories.

It may appear redundant to have a Callback function execute an analysis function, because (as one might rightfully suggest) the menu Callback could invoke the analysis function directly. However, this scheme facilitates using the I/O and analysis functions independently (e.g. from the MATLAB Command Window), or without the restrictions imposed by the MATGPR data structures (e.g. with different data or in an altogether different program).

• The directory io contains input / output and data display functions.

• The directory analysis contains data processing functions. Furthermore, analysis is parent to the folders mex_src and alternative.

mex_src contains the sources of the FORTRAN’90 MEX-files used by MATGPR. Details are given in the descriptions of the pertinent analysis functions (Chapters 3.4 – 3.6).

alternative contains alternative implementations of some analysis functions that rely of external programs for faster execution. For instance, phase-shift migration requires a good deal of number crunching and the heavier numerical work is carried out in FORTRAN 90 MEX-file (the source code is gazdag.f90 in the mex_src folder). There’s also backup M-code attached to the main routine, so that if the MEX-file is not available or corrupt, it will take over but will perform slowly. If you do not have a MEX-compliant compiler and somehow lose or cannot create the MEX function, you might wish to consider using the alternative phase-shift migration routine gazdagmig.m in subfolder alternative/gazdagmig+migrate.f90, together with the program migrate.f90; this is a stand alone version of gazdag.f90 and takes only a FORTRAN 90 compiler to make it work. In this way, you may retain the advantage of speed afforded by compiled programs. The existence of alternative implementations of analysis programs is pointed out in the detailed descriptions of the pertinent analysis modules (Chapter 3.4 – 3.6).

• The directory work is a workspace and may contain whatever you like it to contain. In the MATGPR distribution bundle it includes example data sets and model files. It is important to note that MATGPR does not create any particular (project) workspace for a new data set. Rather, it uses the parent directory of a raw data set, as the home directory of the data analysis project, to which it

14

Page 15: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

directs all i/o operations performed on the derivative (processed) data sets. You may override this default, but in the end it is really up to you to decide how to organize your project. In this respect, the directory MATGPR/work may be a convenient temporary workspace See also the items Import Raw Data and Save Data to Mat-File in Section 3.1, for additional information.

• The subdirectory doc contains the documentation of MATGPR; the “Manual and Technical Reference” (this book) in folder doc/PDF and the on-line help in folder doc/www (HTML). For all MATLAB releases featuring an in-house web browser, the on-line help is displayed automatically and seamlessly. Otherwise, you will have to bookmark the html help files (matgpr_help_1.html, matgpr_help_2.html and matgpr_help_3.html) in your preferred web browser.

MATGPR

TOPLEVEL

IO

ANALYSIS

DOC

WORK

MEX_SRC

ALTERNATIVE

CALLBACKS

Figure 2.4. The directory structure of MATGPR

15

Page 16: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

2.3. Program Features and Utilities

2.3.1. Runtime variables MATGPR features a collection of runtime variables to control certain aspects of program execution and can be changed according to your requirements. These are organized in a global structure named ENVAR, with fields:

Group Variable

1 ENVAR.matlabrelease ENVAR.matfileformat

2 ENVAR.computer_system ENVAR.endian

3 SEG-Y Data Sample Format

4

ENVAR.DisplayOption ENVAR.wigglescale ENVAR.maxwigs ENVAR.colormap

5 ENVAR.Design_Filter

1. The variables ENVAR.matlabrelease and ENVAR.matfileformat control the format of the MAT-file (the MATLAB native binary file) to which MATGPR exports, or from which it imports working data sets. On start up, MATGPR specifies that the MAT-file format will be the default for the version under which it is running, i.e. it always sets ENVAR.matfileformat = '-mat'. However, while the MAT-file formats of MATLAB versions 5.x and 6.x are perfectly readable by version 7.x, the converse is not true! MATLAB Version 7, by default compresses the data it saves to MAT-files. It also uses Unicode character encoding when saving character data. Earlier MATLAB versions cannot read this file format. If you use MATLAB v7.x and want your MAT-files to be readable by earlier versions, you can disable these features through the Data Settings MAT-file Save Format V.6 menu choice, which specifies the “-v6" option for the saving operation (ENVAR.matfileformat = '-v6'). Note that you should do this before any saving operation. You can switch back to the default by selecting the Data Settings MAT-file Save Format

V.7 (Default) submenu option. If you are using a MATLAB version earlier than 7.0, (ENVAR.matlabrelease < 14) this submenu is not available because it is not needed. Also see item Save Data to MAT-file

2. The variable ENVAR.computer_system is useful for invoking certain host OS commands and shell scripts, while ENVAR.endian can be used for exchanging data between little and big endian machines (in particular those in SU and SEG-Y formats). On start up, both variables are automatically adjusted to the parameters of the OS in use. ENVAR.endian can be changed at any time before exporting by specifying the Data Settings Byte Ordering menu choice.

16

Page 17: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

3. MATGPR can use the SEG-Y Revision 0 and 1 standards to import data and only Revision 1 standard to export data. In fact, this is the preferred method of exporting data for long-term storage or for exchange between different computer systems. The SEG-Y standard offers a choice of different storage formats; those supported by MATGPR can be specified with the ENVAR.SEGY_DataSampleFormat variable, which can take one of the values:

Value DataSampleFormat 1 : 4-Byte IBM Floating Point

2 : 4-Byte two’s complement Integer

3 : 2-Byte two’s complement Integer

5 : 4-Byte IEEE Floating Point

8 : 1-Byte two’s complement Integer

• ENVAR.SEGY_DataSampleFormat can be changed through the Data Settings SEGY Data Sample Format group of menu choices.

• The default value is ENVAR.SEGY_DataSampleFormat = 5. For details please refer to § 2.3.3.

4. The variables in this group determine the mode of data display. This may be: • ‘image’ (the default) , • ‘wiggle’ for simple wiggle-trace presentation, • ‘vararea’ for wiggle-trace variable-area presentation. • ‘wig&img’ for combined wiggle-trace / image presentation (image under wiggles). • ‘var&img’ for combined variable-area / image presentation (image under wiggles).

When ENVAR.DisplayOption = ‘image’, the colour scheme for the image display is determined by the ENVAR.colormap field. This can be either a string or a [n x 3] double array of RGB colours, where n is the number of colours (=64 in this version of MATGPR). Several standard colour schemes are available, plus two custom maps. ENVAR.colormap can be changed through the ImageColours menu. The colour scheme changes are global and persistent. The default colour scheme is ENVAR.colormap = 'jet'.

When ENVAR.DisplayOption is ‘wiggle’, or ‘vararea’, or ‘wig&img’, or ‘var&img’, then ENVAR.wigglescale determines the amplitude scale of the wiggles and ENVAR.maxwigs the number of wiggles to be shown or printed. Both variables can be changed dynamically by means of the slider-rule interfaces attached to the data display figures (see View Data). The default values are ENVAR.wigglescale = 1 and ENVAR.maxwigs = 100. • ENVAR.DisplayOption can be changed through the Data Settings Display Mode group of menu

choices.

5. The variable ENVAR.Design_Filter determines the method of designing frequency or wavenumber filters (see FIR Frequency Filter and FIR Wavenumber Filter for additional information). There are three options: • ENVAR.Design_Filter = ‘TESTTR’ : The filter will be designed on the basis of the spectrum of

a particular test trace selected by the user. This is the default. • ENVAR.Design_Filter = ‘MEANTR’ : The filter will be designed on the basis of the spectrum of

the average (mean) trace and • ENVAR.Design_Filter = ‘TYPEIN’ : The filter parameters will be given directly through an appropriate

dialog box. The field ENVAR.Design_Filter can be changed through the Data Settings Design F or K Filters

group of menu choices.

17

Page 18: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

2.3.2. Object Manipulation: The FigureTools, ImageColours and

Windows features

MATGPR provides a set of utilities for managing figures, colour schemes (colormaps) and fast switching between MATGPR windows. These are not part of the MATGPR GUI since they apply to individual windows and figures, but they are, nevertheless, part of the top level. A brief description of these utilities is given below:

FigureTools: The MATLAB Figure Menu contains a large collection of utilities, some of which may be useful in rare circumstances, and some of which may actually not apply in the context of MATGPR (for instance curve-fitting while displaying images, lighting a 2-D image or saving the work-space from a GUI dialog). The FigureTools menu provides a concise collection of the tools and utilities that everybody would like to have handy, while doing away with the full (and sometimes cumbersome) complement of the MATLAB Figure Menu. However, if one must access some feature of the Figure Menu (for instance advanced annotation utilities), it is always possible to toggle it on / off. FigureTools provides for: 1. Colour scheme editing, specific to the current figure as opposed to the global colour scheme manipu-

lation utilities provided by the ImageColors menu. 2. Zooming, panning and data inspection. 3. Exporting the current figure as a MATLAB *.fig file or as an image in various graphics formats sup-

ported my MATLAB. 4. Setting up the printer and printing the current figure. 5. Editing the current figure, the current axes and their children graphics objects. 6. Toggling the MATLAB Figure Menu on and off. Read documentation of relevant function.

ImageColours: Menu to change and manipulate the Image Display colour scheme, i.e. set the EN-VAR.colormap runtime variable). The default colormap is jet (rainbow). The menu choices allow switch-ing the colormap to: MATLAB colormaps: • grey : Linear greyscale. • bone : Greyscale with a higher value for the blue component. • jet : Rainbow, ranges from blue to red and passes through cyan, yellow and orange. It is a varia-

tion of the hsv colormap. • hsv : Variation of the hue component of the hue-saturation-value colour model. The colours change

from red, yellow, green, cyan, blue, magenta and back to red. • hot : Reel varying smoothly from black through shades of red, orange, and yellow, to white. • cool : Reel varying smoothly from cyan to magenta. • copper : Reel varying smoothly from black to bright copper. MATGPR additional colormaps • Blue-Red : Reel varying smoothly from navy blue to white and from white to brick

red. Useful for emphasizing the higher amplitude reflections while masking low amplitude noise. This colormap is produced by the function twocolors.m.

• Blue–Red Scaled : A navy blue – white – brick red colour reel whose blue and red ends are scaled exactly with respect to minimum and maximum values of the displayed data. Pure white al-ways corresponds to zero. This colormap is produced by the function twocolorsc.m.

18

Page 19: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

The colormap changes effected by the grey, bone, jet, hsv, hot, cool, copper and Blue-Red choices are global and persistent. The Blue-Red Scaled choice affects only the particular figure at which it was in-voked set. Colormap manipulation features include: • brighten : Increases the brightness. • darken : Decreases the brightness. • flipud : Reverses colour order. • permute : Interchanges colour indices These changes apply to the current global colormap and persist until they are reset or the colormap changes.

Read documentation of relevant function.

Windows: The MATGPR fast window switching / window navigation service. This service generates a custom Windows menu, which that facilitates switching between open MATGPR figures. The service is will manipulate window names exclusive to MATGPR and, moreover, only those registered with it. These would normally be figures with information deserving to be left on the screen (and consume memory) for future reference, but not trivial stuff as for instance i/o GUI dialogues. To register a new window open the function matgprwindows.m, go to the bottom of the ‘setup’ block, where you see the instruction: %%% %%% IF YOU WANT TO REGISTER A NEW WINDOW WITH THE SERVICE, %%% INSERT AFTER THIS POINT AND BEFORE return! %%%

and do just what it says by typing the following lines:

if ~isempty(findobj('tag','YOUR_WINDOW’s_TAG')), winarray = [winarray; findobj('Tag','YOUR_WINDOW’s_TAG')]; uimenu(wmenu,'Label','YOUR WINDOW’s_FIGURE_LABEL’,... 'Callback','figure(findobj(''tag'','' YOUR_WINDOW’s_TAG ''));'); end

• You must have given your window (figure) a tag, because MATGPR recognizes and identifies all ob-jects by their ‘tag’ property.

Note that the function matgprwindows.m, encoding the Windows service, cannot be placed just any-where in a function of script and will normally not be used from the command line. Although it is not obligatory, it should rather be invoked by the CreateFcn and DeleteFcn Figure properties (call-backs), upon creation or destruction of a window. For example:

figure('name','My Figure','Tag','MyNewFigure', ... 'menubar','none', ... 'CreateFcn',['figuretools; imagecolors; ' ... 'matgprwindows(''setup''); ' ... 'matgprwindows(''updateadd'');'],... 'DeleteFcn',['matgprwindows(''updateremove'', '... 'findobj(''Tag','MyNewFigure'));']); ....

The keywords used above are as follows: • Setup : Initialize the service in the current figure • updateadd : After creation, add a figure's name to the Windows menus of all open MATGPR

figures. • updateremove : Upon deletion, remove a figure's name from the Windows menus of the remaining

open figures.

Note: In the above code snippet you may have noticed that the FigureTools and ImageColours utili-ties are also set up by the CreateFcn Callback. Although these commands can be placed anywhere in a function or script or used from the command line, this is a very neat way to start them up and is recom-mended whenever possible.

19

Page 20: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

2.3.3. The SEG-Y and Seismic Unix Standards.

MATGPR may use the SEG-Y Revision 1 Data Exchange Format to import/ export data. This has achieved widespread usage within the geophysical community and has become a standard. Inasmuch as it can store all the information generated during GPR data processing (and much more), the SEG-Y stan-dard can be adopted as the preferred method of exporting data for long-term storage or for exchange be-tween different computer systems. The SEGY i/o utilities have been implemented using SEG Y standard (http://seg.org/publications/tech-stand/) as defined by the Society of Exploration Geophysicists (SEG). MATGPR also supports the format used by CWP’s Seismic Unix (http://www.cwp.mines.edu/cwpcodes/) package (the SU format), which is a simplified version the SEG-Y Rev.0 format (the first 3600 byte header is not used). A short description of the formats is given below.

2.3.3.1. Structure of a SEG-Y and a SU file

The SEG-Y file format is the standardized data storage for seismic magnetic reel tapes and has the fol-lowing general structure: <Reel Identification Header> <Trace Data Block 1> <Trace Data Block 2> ... ... ... <Trace Data Block N>

The 3600 byte reel identification header comprises three parts: • A 3200 (0xC80) byte Textual File Header, representing 40 × 80-byte “card images”, which can be ei-

ther EBCDIC formatted (Revision 0), or, either EBCDIC or ASCII formatted (Revision 1). • A 400 (0x190) byte Binary File Header of fixed-point integers, of which only 60 (Revision 0) or 66

(Revision 1) are assigned. The remaining 340 / 334 bytes are unassigned for optional use (MATGPR exploits this facility).

• In Revision 1 of the SEG-Y standard, an optional number of ’Extended Textual File Headers’, each 3200 bytes long, also ASCII or EBCDIC formatted.

• This is followed by the data block consisting of trace ID headers and trace data as follows: • Trace Header: 240 (0xF0) bytes of binary fixed-point and floating-point numbers, and, • Trace Data: samples (number, length, and type defined in the reel ID header) that can be formatted in

a number of ways, including IEEE floating point, IBM Floating Point and 1, 2 or 4 fixed point (inte-ger) numbers.

A SU file is similar to SEG-Y with the following differences: • • There is no 3600 byte reel header. • • There are no optional Textual File Headers. • • The trace data are IEEE floats. • • Data can be both little and big endian formatted.

20

Page 21: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

2.3.3.2. What is supported in MATGPR?

MATGPR R1 supports the following parts of the SEG - Revision 0 and 1 formats. • MATGPR can import data written in both Revision 0 and Revision 1 styles. • MATGPR will export data in Revision 1 style only.

A. Reel Identification Header The 3200 byte textual file header can be only ASCII formatted. If the imported textual header is EBCDIC formatted, (as is usually the case with Revision 0 files), it will be read but will not be decoded. The ex-ported textual header (created by MATGPR) comprises three parts: a The leading line is automatically assigned and has the form:

‘C Created with MATGPR on dd-mmm-yyyy hh:mm:ss. Format: SEG-Y Revision 1’. b The next N × 80 bytes (next N lines) are user comments, inserted on file creation by means of a dialog

box. c The next (N+1):40 × 80 bytes (next N+1:40 lines, ) are occupied by the original file header, or header

file comments and the processing history of the exported data set (IPD.history). If the history is longer than (N+1):40 lines, then only the first (N+1):40 lines are exported.

B. Extended Textual Headers In SEG-Y revision 1 a number of 3200-byte extended textual file headers are allowed. This feature is not supported in MATGPR. Extended textual headers may be implemented in future releases.

C. Data Sample Format The following data formats are supported:

SEG-Y revision 0 (1975) Type DataSampleFormat Supported 1 4 Byte IBM Floating Point (as defined in

IBM Form GA 22-6821) Yes

2 4 Byte Fixed Point No

3 2 Byte Fixed Point No

4 4 Byte Fixed Point with Gain No

SEG-Y revision 1 (2002) Type DataSampleFormat Supported 1 4-Byte IBM Floating Point Yes

2 4-Byte two’s complement Integer Yes

3 2-Byte two’s complement Integer Yes

4 4-Byte Fixed Point with Gain No

5 4-Byte IEEE Floating Point Yes

6 Not Specified No

7 Not Specified No

8 1-Byte two’s complement Integer Yes

The Type number is the number that should be used as the Data Sample Format, in functions read-segy.m and writesegy.m (field SEGYreelhdr.format = Type). The most used format has been SEG-Y

21

Page 22: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

revision 0, Type 1 (IBM Floating Point). Now that Revision of SEG Y has been published, the preferred way to read and write SEG-Y data may soon be Type 5 (IEEE Floating Point).

• In GPR, the default data sample format is Type 5 (IEEE Floating Point). MAT

The SEG-Y reel ID header and the SEG-Y / SU trace headers live in the form of MATLAB data struc-tures that can have fields with static or variable content. The static fields contain such invariant parame-ters as standard flags and constants, the sampling rate, number of traces etc. Such fields are the same in all trace headers. The variable fields contain parameters that change as a function of location, (e.g. co-ordinates), and are trace specific. The following two tables detail how MATGPR assigns parameter val-ues to the reel ID and trace header fields (and also where it expects to find and read these parameters).

D. SEG-Y Reel Header Value Assignments (structure SEGYreelhdr)

Header Field Byte Type Description Value headertext 1 uchar 3200-byte text area ASCII-coded block User text jobid 3201 int32 Job identification number User lino 3205 int32 Line number (only one scan line per reel) User reno 3209 int32 Reel number User ntrpr 3213 int16 Number of traces in line IPD.ntr nart 3215 int16 Number of auxiliary traces 0 hdt 3217 uint16 Sample interval in microseconds 1000 × IPD.dt dto 3219 uint16 Same for original field recording 0 hns 3221 uint16 Number of samples per trace IPD.ns nso 3223 uint16 Number of samples per trace for original

field recording 0

format 3225 int16 Data sample format code: 1 = IBM Floating Point (4 bytes) 2 = Fixed-point (4 bytes) 3 = Fixed-point (2 bytes) 5 = IEEE Floating Ppoint 8 = Fixed-point, 1-byte

User

fold 3227 int16 CDP fold expected per CDP ensemble 0 tsort 3229 int16 Trace sorting code:

1 = as recorded (no sorting) 2 = CDP ensemble 3 = single fold continuous profile 4 = horizontally stacked …

3

vscode 3231 int16 Vertical sum code: 1 = no sum 2 = two sum ... N = N sum (N = 32,767)

1

hsfs 3233 int16 Sweep frequency at start 0 hsfe 3235 int16 Sweep frequency at end 0 hslen 3237 int16 Sweep length (ms) 0 hstyp 3239 int16 Sweep type code:

1 = linear; 2 = parabolic; 3 = exponential; 4 = other

0

schn 3241 int16 trace number of sweep channel 0

22

Page 23: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

hstas 3243 int16 Sweep trace taper length (msec) at start if tapered (the taper starts at zero time and is effective for this length)

0

hstae 3245 int16 Sweep trace taper length (msec) at end (the ending taper starts at sweep length minus the taper length at end)

0

htatyp 3247 int16 Sweep trace taper type code: 1 = linear; 2 = cos2; 3 = other

0

hcorr 3249 int16 Correlated data traces code: 1 = no , 2 = yes

0

bgrcv 3251 int16 Binary gain recovered code: 1 = yes, 2 = no

0

rcvm 3253 int16 Amplitude recovery method code: 1 = none, 2 = spherical divergence, 3 = AGC, 4 = other

1

mfeet 3255 int16 Measurement system code: 1 = meters; 2 = feet

1

polyt 3257 int16 Impulse signal polarity code: 1 = negative; 2 = positive

0

vpol 3259 int16 Vibratory polarity code: 0 dt 3261 float32 Sample spacing (sampling rate) in ns IPD.dt t1 3265 float32 First sample location (in ns) IPD.tt2w(1) dx 3269 float32 Sample spacing between traces in m IPD.dx x1 3273 float32 First trace location in m IPD.x(1) hunass1 3277 int16 Unassigned, 224 bytes 112 × 0 revision 3501 uint16 Revision number 1 fixedlenr 3503 int16 Fixed length trace flag 1 ntexthdrs 3505 int16 Number of extended textual headers 0 hunass2 3507 int16 Unassigned, 94 bytes 47 × 0

• The yellow highlighted fields above are MATGPR-specific and occupy the first 16 bytes of the first 240-byte unassigned block. These fields contain the sampling rate, the first sample location (in time), the trace spacing and the first trace location. Some of this information has been assigned in other fields of the reel ID structure in the form of 2-byte integers (and will be reassigned in appropriate fields of the trace header structures). Here they are entered as IEEE floats in order to avoid rounding errors (from the back-conversion of the integers) and loss of precision. Moreover, their presence in certain locations of the reel ID and trace headers serves as a test, by which MATGPR verifies whether an imported SEG-Y file was produced by itself, or by a third party. On importing a data file, MATGPR will cross-check the corresponding (floating point) dt and dx fields in the reel ID and trace headers and if it finds them identical (file is own), it will adopt the values read from the SEG-Y reel ID header.

• Attention should be paid to the orange highlighted field above. It is a mandatory SEG-Y Rev.1 field and contains the “fixed trace length” flag: fixedlen = 1 implies that all traces in the reel have the same length (number of samples). This is mandatory in MATGPR, which cannot handle variable length traces. If MATGPR finds any value other than one in bytes 3503 – 3504 of the reel header, it will abort!

23

Page 24: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

E. SEG-Y Trace Header assignments (structure SEGYtracehdr)

Header Field Byte Type Description Value tracl 1 int32 Trace sequence number within line Trace number (i) trac 5 int32 Trace sequence number within reel Trace number (i) fldr 9 int32 Field record number 1 tracf 13 int32 Trace number within field record Trace number (i) ep 17 int32 Energy source point number 0 cdp 21 int32 CDP ensemble number 0 cdpt 25 int32 Trace number within CDP ensemble 0 trid 29 int16 Trace identification code:

1= seismic data; 2= dead; 3= dummy; 4= time break; 5= uphole; 6= sweep; 7= timing; 8= water break; 9 - N= optional use N= 32,767) 200 = GPR data (MATGPR flag)

7182

(ASCII [71 82] = ‘GR’

for GeoRadar)

nvs 31 int16 Number of vertically summed traces (see vscode in reel header structure)

1

nhs 33 int16 Number of horizontally summed traces (see vscode in reel header structure)

1

duse 35 int16 Data use: 1 = production; 2 = test 1 offset 37 int32 Distance from source point to receiver

group(negative if opposite to direction in which the line was shot)

103 × IPD.TxRx

gelev 41 int32 Receiver group elevation from sea level (above sea level is positive)

103 × IPD.xyz.Rx(i,3)or 0

selev 45 int32 Source elevation from sea level above sea level is positive)

103 × IPD.xyz.Tx(i,3)or 0

sdepth 49 int32 Source depth below surface (positive) 0 gdel 53 int32 Datum elevation at receiver group 0 sdel 57 int32 Datum elevation at source 0 swdep 61 int32 Water depth at source 0 gwdep 65 int32 Water depth at receiver group 0 scalel 69 int16 Scale factor for previous 7 entries with

value +/- 10 to the power power 0, 1, 2, 3, or 4 (if positie multiply, if negative divide)

-3

scalco 71 int16 Scale factor for next 4 entries with value +/- 10 to the power 0, 1, 2, 3, or 4 (if posi-tive, multiply, if negative divide)

-3

sx 73 int32 X source coordinate 103 × IPD.xyz.Tx(i,1)or 0

sy 77 int32 Y source coordinate 103 × IPD.xyz.Tx(i,2)or 0

gx 81 int32 X group coordinate 103 × IPD.xyz.Rx(i,1)or 0

gy 85 int32 Y group coordinate 103 × IPD.xyz.Rx(i,2)or 0

24

Page 25: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

counit 89 int16 Coordinate units code for previous four entries 1= length (meters or feet) 2= seconds of arc X -longitude Y -latitude, positive to the east of Greenwich or north of the equator.

1

wevel 91 int16 Weathering velocity 0 swevel 93 int16 Subweathering velocity 0 sut 95 int16 Uphole time at source 0 gut 97 int16 Uphole time at receiver group 0 sstat 99 int16 Source static correction 0 gstat 101 int16 Group static correction 0 tstat 103 int16 Total static applied 0 laga 105 int16 Lag time A, time in ms between end of

240-byte trace identification header and time break, positive if time break occurs after end of header, time break is defined as the initiation pulse which maybe re-corded n an auxiliary trace or as otherwise specified by the recording system.

0

lagb 107 int16 Lag time B, time in ms between the time break and the initiation time of the energy source, may be positive or negative.

0

delrt 109 int16 Delay recording time, time in ms between initiation time of energy source and time when recording of data samples begins (if recording does not start at zero time).

103 × IPD.sigpos

muts 111 int16 Mute time--start 0 mute 113 int16 Mute time--end 0 ns 115 uint16 Number of samples in this trace IPD.ns dt 117 uint16 Sampling interval; in micro-secs 103 × IPD.dt gain 119 int16 Gain type of field instruments code:

1 = fixed; 2 = binary, 3 = floating point; 4 - N=optional use.

0

igc 121 int16 Instrument gain constant 0 igi 123 int16 Instrument early or initial gain 0 corrsu 125 int16 Correlated: 1 = no; 2 = yes 0 sfs 127 int16 Sweep frequency at start 0 sfe 129 int16 Sweep frequency at end 0 slen 131 int16 Sweep length in ms 0 styp 133 int16 Sweep type code:

1 = linear; 2 = parabolic; 3 = exponential; 4 = other

0

stas 135 int16 Sweep trace taper length at start in ms 0 stae 137 int16 Sweep trace taper length at end in ms 0 tatyp 139 int16 Taper type:

1 =linear, 2 =cos2, 3 =other 0

afilf 141 int16 Alias filter frequency if used 0 afils 143 int16 Alias filter slope 0 nofilf 145 int16 Notch filter frequency if used 0 nofils 147 int16 Notch filter slope 0 lcf 149 int16 Low cut frequency if used 0

25

Page 26: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

hcf 151 int16 High cut frequency if used 0 lcs 153 int16 Low cut slope 0 hcs 155 int16 High cut slope 0 year 157 int16 Year data recorded Year of file

creation day 159 int16 Day of year Day of file

creation hour 161 int16 Hour of day (24 hour clock) Hour of file

creation minute 163 int16 Minute of hour Minute of file

creation sec 165 int16 Second of minute Second of file

creation timbas 167 int16 Time basis code:

1 = local; 2 = GMT; 3 = other. 1

trwf

169 int16 Trace weighting factor, defined as 1/2^N volts for the least significant bit.

0

grnors 171 int16 Geophone group number of roll switch position one

0

grnofr 173 int16 Geophone group number of trace one within original field record

0

grnlof 175 int16 Geophone group number of last trace within original field record

0

gaps 177 int16 Gap size (total number of groups dropped) 0 otrav 179 int16 Overtravel taper code:

1 = down (or behind); 2 = up (or ahead) 0

cdpx 181 int32 X coordinate of CDP position of this trace 0 cdpy 185 int32 Y coordinate of CDP position of this trace 0 inline3d 189 int32 In-line number for 3-D poststack data 0 crossline3d 193 int32 Cross-line number for 3-D poststack data 0 shotpt 197 int32 Shot Point 0 shotptscalar 201 int16 Shot Point Scalar 0 tvmu 203 int16 Trace Value Measurement Unit 0 tcm 205 int32 Transduction Constant Mantissa 0 tcp 209 int16 Transduction Constant Power 0 tdu 211 int16 Transduction Units 0 traceid 213 int16 Trace Identifier 0 sthdr 215 int16 Scalar Trace Header 0 srctype 217 int16 Source Type 0 sedm 219 int32 Source Energy Direction Mantissa 0 sede 223 int16 Source Energy Direction Exponent 0 smm 225 int32 Source Measurement Mantissa sme 229 int16 Source Measurement Exponent smu 231 int16 Source Measurement Unit 0 dx 233 float32 Sample spacing between traces IPD.dx

or 0 ntr 237 int16 Number or traces in scan line IPD.ntr Mark 239 int16 Mark selected traces 1 = Marker Trace

0 = Normal Trace

• The yellow highlighted fields above are MATGPR-specific and occupy the last 8 bytes of the unas-signed block.

26

Page 27: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

F. SU Trace Header assignments (structure SUHDR)

Header Field Byte Type Description Value • The SU and SEG-Y Revision 1 trace headers are identical from byte 1 to byte 180 • The SU trace header is designed on the basis of the SEG-Y Revision 0 trace header. • The SU standard trace header uses the unassigned last 140 bytes of the SEG-Y Revision 0

header as follows: d1 181 float32 Sample spacing for non-seismic data IPD.dt*1000; f1 185 float32 First sample location for non-seismic data IPD.tt2w(1) d2 189 float32 Sample spacing between traces IPD.dx

or 0 f2 193 float32 First trace location IPD.x(1)

or 1 ungpow 197 float32 Negative of power used for dynamic range

compression 0

unscale 201 float32 Reciprocal of scaling factor to normalize range

0

ntr 205 int32 Number of traces IPD.ntr mark 209 int16 Mark selected traces 1 = Marker Trace

0 = Normal Trace shortpad 211 int16 Alignment padding 0 unass 213 int16 Unassigned 14 × 0

27

Page 28: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

2.4. Programming tips: How to write a MATGPR module

MATGPR has modular architecture. This means that you can add your own analysis modules easily and without having to know many details about the program’s infrastructure. This section will provide a simple example on how to expand MATGPR. Some basic familiarity with the MATLAB language and the use of uimenu in particular, is necessary. There are three steps towards integrating your work into MATGPR: 1) Prepare your bottom level analysis i/o or function, 2) set up a menu (uimenu) to access the function, and, 3) set up the callback routine to execute the function and handle results. Assuming that your i/o or analysis function has already been prepared, the following sections will deal only with Steps 2 and 3 above.

2.4.1 Setting up the uimenu. There are two approaches to this effect: The hard(er) way means tampering with matgpr.m and is the least recommended option, if you do not want to get into the trouble of deciphering the code. The easier way is to create your very own, add-on menus in a separate M-file. Both approaches will be discussed below.

2.4.1.1. The harder way: Reprogramming the MATGPR GUI. Let us begin by supposing that there’s no Standard AGC entry in the Basic Handling superset menu and we need to augment it with one. This is a gain manipulation operation and should be included in the gain manipulation group.

Note that there’s no formal way to group similar tasks in a superset (parent) uimenu, other than bracketing them with separator lines (i.e. by setting the Separator property of the first child uimenu item in the group to on).

The location of a group is relatively easy to find in matgpr.m, inasmuch as all groups are meticulously demarcated and annotated.

Figure 2.5. The Basic Handling menu before (left) and after the addition the Standard AGC item (right).

28

Page 29: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

Suppose now, with reasoning similar to mine, that the new item should be put second in the group. In short, the Basic Handling menu, which before the looked like in Figure 2.5.left, should now look like Figure 2.5.right.

MATGPR recognizes and identifies all objects by their Tag property. Only objects that do not need to be recalled or referred to during execution may not have a Tag (this includes the lowest ranking uimenu items). The Tag of the Basic Handling parent menu is ’handlemenu’, so refer to this object by findobj('Tag','handlemenu'). With this in mind, the code for realizing the gain manipulation group of uimenus within the Basic Handling superset is given in the snippet bellow (as would appear in the MATLAB Editor):

Code snippet: Extract from matgpr.m BEFORE introduction of the Standard AGC module %%% %%% ------- GAIN MANIPULATION --------------------------------------------- %%% %%% Remove (header) gain from GSSI (DZT) data uimenu(findobj('Tag','handlemenu'),'Label','Remove DZT Header Gain', ... 'Separator','on', 'Callback', ... 'OPD = do_removeDZThdrgain(IPD); ' ); %%% %%% Apply Gaussian tapered AGC uimenu(findobj('Tag','handlemenu'), 'Label','Gaussian-tapered AGC)', ... 'Callback', ... 'OPD = do_gaingagc(IPD);' ); %%% %%% %%% Apply exponential gain function uimenu(findobj('Tag','handlemenu'),'Label','Apply g(t)=scale * t^power',... 'Callback', ... 'OPD = do_gaintpow(IPD); ' ); %%%

When chosen, each uimenu item invokes its Callback property, which executes a Callback function, normally residing in the directory MATGPR/toplevel/callbacks. Thus, in order to introduce a new module in the MATGPR GUI, we need to specify the parent, the Label property and the Callback property of its related uimenu. In the case under consideration the Tag property need not be assigned because our new uimenu will not be parent to a submenu (lower ranking uimenu). It belongs to the lowest hierarchical level of its context. However, if it were intended to have a submenu, then a Tag should be specified. At the end of this section, Table 1 lists the MATGPR uimenus and their corresponding Tags, as they stand in the current release.

The augmented code (expanded with the new Standard AGC choice in the gain manipulation group) is given in the snippet below, where the new entry is highlighted with light grey shading:

Code snippet: Extract from matgpr.m AFTER introduction of the Standard AGC module %%% %%% ------- GAIN MANIPULATION --------------------------------------------- %%% %%% Remove (header) gain from GSSI (DZT) data uimenu(findobj('Tag','handlemenu'),'Label','Remove DZT Header Gain', ... 'Separator','on', 'Callback', ... 'OPD = do_removeDZThdrgain(IPD); ' ); %%% %%% Apply Standard AGC uimenu(findobj('Tag','handlemenu'), 'Label','Standard AGC', ... 'Callback', ... 'OPD = do_gainagc(IPD); ' ); %%% %%% Apply Gaussian tapered AGC

29

Page 30: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

uimenu(findobj('Tag','handlemenu'), 'Label','Gaussian-tapered AGC)', ... 'Callback', ... 'OPD = do_gaingagc(IPD);' ); %%% %%% %%% Apply exponential gain function uimenu(findobj('Tag','handlemenu'),'Label','Apply g(t)=scale * t^power',... 'Callback', ... 'OPD = do_gaintpow(IPD); ' ); %%%

2.4.1.2. The easy way: Creating add-on menus. In order to create an add-on menu, you should first create an M-file for it. Let us call this file mymenu.m. The first line to this file is, of course, a function declaration:

function mymenu();

The first thing that mymenu.m should do, is to focus on the MATGPR GUI. Because the tag of the MATGPR GUI is fi0, we can use the commands:

%%% Focus on matGPR home window if ~isempty(findobj('Tag','fi0')), % Ensure that MATGPR is running figure(findobj('Tag','fi0')); else erh = errordlg('matGPR is not running!', 'MATGPR : ERROR'); uiwait(erh); return; end

This code includes checking of whether the MATGPR GUI is active, so as to preclude annoying red error messages from MATLAB. The next step is simply to define your custom superset menu, by giving it a label and a tag. Let us label it “MY MENU”:

%%% ======================================================================== %%% THIS IS MY VERY OWN MENU %%% ========================================================================

uimenu('Label',' MY MENU ', 'Tag', 'mynewmenu');

Now, define the menu choices as children of “MY MENU” and assign them their label and their callback property. For example, suppose that you want to add a spiking deconvolution utility:

uimenu(findobj('Tag','mynewmenu'),'Label','Spiking Deconvolution',... 'Callback', 'OPD = do_spikedc(IPD); ' );

In a final step, save mymenu.m to the MATGPR/toplevel directory. Mymenu.m should be executed right after invoking the MATGPR GUI (i.e. after running matgpr.m). Note that you can automate this procedure by preparing a dummy script with only two lines:

matgpr mymenu

When done, the augmented MATGPR GUI should look as in Figure 2.6 and ready to recall the analysis function.

30

Page 31: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

Figure 2.6. Augmenting matGPR with your own menus

2.4.2. Setting up the Callback function Augmenting the MATGPR GUI is only a part of the job. We now need to specify the Callback function, which in turn will execute the analysis function. • Note that for simple tasks, a Callback function is not necessary.

There’s no rule or restriction in naming the Callback function and you call it whatever you like. However, and in order to distinguish between Callback and the other i/o and analysis functions, the official MATGPR release(s) by convention uses a name of the form do_xxxxxx.m, where the prefix do_ indicates a driver (callback) function and ‘xxxxxx’ is the name of the driven analysis function. In the “Standard AGC” example above, the driven function, i.e. the function which applies the Standard AGC is gainagc.m, therefore the Callback (driving) function should be named do_gainagc.m. Callback functions would normally reside in the toplevel/callbacks directory. This is also not obligatory, so long as the function’s parent directory is in the MATLAB search path. It is however neat and helps with bookkeeping. For these reasons alone the convention is faithfully observed in the official MATLAB release(s). In our example, the Callback function is (as would appear in the MATLAB editor):

Code snippet: An example callback function. function OPD = do_gainagc(IPD); % % Callback function to drive the routine "gainagc.m" % Standard Automatic Gain Control % OPD = discardprocdata; % discard the current OPD % Trap common errors if isempty(IPD.d), erh = errordlg('No data to process!', 'MATGPR: ERROR'); uiwait(erh); return end % Proceed ... OPD = IPD; % Copy IPD to OPD % Apply Standard AGC OPD.d = gainagc(IPD.d,IPD.dt); % Check if analysis was aborted for some reason if isempty(OPD.d), disp('GAIN AGC > Operation aborted - No data returned!'); return end

31

Page 32: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

% Display the results viewdata(OPD.x,OPD.tt2w,OPD.d,'outdata',OPD.xlab,OPD.zlab); % Update processing history iss = size(OPD.history,1); text = 'Applied Standard AGC'; OPD.history(iss+1,1) = cellstr(text); return

The size and complexity of the Callback function is unrestricted. However, it should rather have some standard features. Some of them are obligatory ( ), while others are merely recommended as being helpful (•):

• Discard of the OPD structure. This is not absolutely necessary, but it tidies up memory for the next processing step, and because it re-initializes the OPD structure, on occasion, it might prove helpful if something goes wrong during the execution of the analysis (driven) function.

• Obvious or Common Error trapping. In our example, it is not inconceivable that one will accidentally try to execute the driven function before loading any data, or after accidentally destroying the IPD. Common error trapping is also not absolutely necessary, but helps in avoiding unpleasant crashes and error messages.

Copy the IPD onto the OPD.

Processing (this modifies the OPD).

Display the results.

• Update the processing history. This is also not necessary, but it is very useful for bookkeeping.

In order to help with creating Callback functions for new modules, MATGPR furnishes a (sort of) template, which is found in the Callbacks directory and is called do_SOMETHING.m, where SOMETHING stands for the new analysis function that will be driven by the new Callback. And because the creation of a driver function means nothing without something to drive, something important is up to you …

Remider: If the analysis generates a figure that you want to keep open for future reference, you may wish to register it with the MATGPR Windows service.

32

Page 33: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

2.4.3. Reserved variable names and object tags

2.4.3.1. Reserved variable names By design, the MATGPR M-functions keep their variables strictly within their scope and do not export them to the MATLAB root workspace. Thus, the root workspace is generally clear, with the exception of a handful of the most fundamental and globally required variables (including the data of course). These are the input and output data structures, and the velocity models required for interpretation. Their (case sensitive) names are: ENVAR, IPD, OPD, v1d, v2d, zv2d, dzmig, vhalfspace.

2.4.3.2. Reserved GUI and graphics object tags. Because MATGPR can have many processes up and running in parallel, it is useful to provide a summary of the names (tags) of the GUI and graphics objects, so as to avoid duplication in case you wish to expand MATGPR with your own menus and analysis function. Although this should be extremely rare it could happen and could lead to crashes. Debugging such problems can be tricky because the error messages are often mystifying and occasionally misleading. Tables 1 and 2 provide a summary of the reserved GUI and graphics object tags.

Table 1. The MATGPR uimenus and corresponding Tags.

Superset Menu

Submenu Level 1

Submenu Level2 Tag Properties

Data View Header Information iomenu hdrs

Import Raw Data importdata

Export exportdata

Settings MAT-file Save Format settingsmenu matformat

Byte Ordering bytemenu

SEG-Y Data Sample Format segymenu

Display Mode plotoption

Design F or K Filters filterdesign

View Attenuation Characteristics plotmenu attenuationchars

Basic Handling Edit Markers handlemenu editmarkers

Filtering FIR Frequency Filter filtsm firffilt

FIR Wavenum-ber Filter firkfilt

Imaging imaging Modelling modeling Windows winmenu About aboutinfo

33

Page 34: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 2: The Top Layer

Table 2. The MATGPR GUI and graphics objects with corresponding Tags.

Object Tag axes viewinspectraaxes axes viewoutspectraaxes axes viewintraceaxes axes viewouttraceaxes axes modelaxes figure fi0 figure headerinfofigure figure datafigure figure procdatafigure figure viewindatatraces figure viewoutdatatraces figure viewindataspectra figure viewoutdataspectra figure attenuationfigure figure velanfigure figure modelfigure figure concat_gui figure modelfigure figure markercheckfigure figure edscanaxgui figure equalizegui figure fkfiltfig figure v2dfig figure staticgui Figure badtrfigure line dummy uicontrol (checkbox) trimstart uicontrol (checkbox) trimend uicontrol (checkbox) extractpart uicontrol (checkbox) datummax uicontrol (checkbox) datummin uicontrol (checkbox) datumave uicontrol (checkbox) datum1tr uicontrol (editbox) filebox uicontrol (editbox) indatainfobox uicontrol (editbox) newx uicontrol (editbox) newy uicontrol (editbox) headerinfobox uicontrol (editbox) antennaf uicontrol (editbox) markerinfobox uicontrol (editbox) startposition uicontrol (editbox) endposition uicontrol (editbox) wvgui uicontrol (editbox) swvgui uicontrol (editbox) datumusr uicontrol (frame) indataframe uicontrol (listbox) lsbox uicontrol (popupmenu) inschandle uicontrol (popupmenu) outschandle

Object Tag uicontrol (popupmenu) outschandle uicontrol (popupmenu) attnaxisscale uicontrol (pushbutton) browsebutn uicontrol (pushbutton) rmlsbutn uicontrol (pushbutton) gobutn uicontrol (pushbutton) markerokbutton uicontrol (pushbutton) markerbadbutton uicontrol (pushbutton) attngridonoff uicontrol (radiobutton) usecursor uicontrol (radiobutton) usefingers uicontrol (radiobutton) shiftdn uicontrol (radiobutton) shiftup uicontrol (slider) intrhandle uicontrol (slider) intmhandle uicontrol (slider) outtrhandle uicontrol (slider) outtmhandle uicontrol (slider) scalehandle1 uicontrol (slider) nwigshandle1 uicontrol (slider) scalehandle2 uicontrol (slider) nwigshandle2 uicontrol (slider) insphandle uicontrol (slider) insfhandle uicontrol (slider) outsphandle uicontrol (slider) outsfhandle uicontrol (slider) vel_handle uicontrol (slider) depth_handle uicontrol (slider) radius_handle uicontrol (slider) hloc_handle uicontrol (text) indatatitstr uicontrol (text) insp4 uicontrol (text) outsp4 uicontrol (text) intr4 uicontrol (text) outtr4 uicontrol (text) vt4 uicontrol (text) dt4 uicontrol (text) rt4 uicontrol (text) ht4 uimenu zoomon uimenu panon uimenu inspon uimenu savefig uimenu figedt uimenu axedt uimenu plotedt uimenu cmgui uimenu brscaled uimenu cmadjust

34

Page 35: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

CHAPTER 3. THE BOTTOM LAYER

The Bottom Layer comprises a set of self-contained and self-documented functions to visualize process and interpret GPR data. The Bottom Layer is expandable with addition of your own functions. The software is organized in 6 basic units: Data (management), Plotting, Basic Handling, Filtering, Imaging and Modelling (Figures 2.2 and 3.2.1). Each unit comprises a number of homologous task groups

3.1. I/O and Flow Control: The 'Data' Menu

Import Raw Data. In MATGPR, the term “Raw Data” defines data sets that exist in the GPR manufacturer’s native storage format and prior to their importation /conversion to the MATGPR data structure format. • MATGPR can import raw data in the formats of the GPR manufacturers GSSI (RADAN / DZT), Måla

Geophysics (RAMAC / RD3) and Sensors and Software (PULSE EKKO / DT1). Only single-channel data files are acceptable, inasmuch as MATGPR is currently being offered for zero- or single-offset surveys,

• With reference to bistatic Pulse Ekko (DT1) data in particular, note that only data recorded in “Reflection” mode (single-offset) are fully supported. Multiple-offset data, (e.g. CMP gathers) can be imported and displayed, but at this stage of development, MATGPR does not offer any processing utilities beyond rudimentary editing and filtering.

• Data stored in Seismic Unix (SU) and SEG-Y Revision 0 and Revision 1 formats can also be imported. Please refer to § 2.3.3 for details about the implementation of the SEG-Y and SU standards in MATGPR. Figure 3.1.1 shows the expanded Data Import Raw Data submenu.

Once read, the data is automatically saved in the MATGPR binary format (MAT-file) for faster and easier subsequent access. The destination directory of the MAT-file is the same as the parent directory of the raw data file. The saved file name is simply the raw data file name with the extension ’.mat’ appended at the end. For example, if the raw data file testdata.dzt is imported, the resulting IPD will be saved in the MAT-file testdata.dzt.mat. Likewise, trench.su will beget trench.su.mat. By default, all subsequent output operations concerning the derivate (processed) data sets will be directed to the parent directory of the raw data file, which thus becomes the home directory of the data analysis project. For additional information refer to the item Save Data to MAT-file.

Read documentation of relevant functions.

View Header Information. Prior to importing any raw data and at any time during a MATGPR session, you can inspect the complete information held in the file header of any one of the supported data formats. Figure 3.1.2 shows the Header Information window generated by MATGPR for a single channel RADAN / DZT data file.

Read documentations of relevant functions.

35

Page 36: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Figure 3.1.1. The expanded Data Import Raw Data submenu

Figure 3.1.2. The Header Information Viewer window for RADAN / DZT data.

36

Page 37: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Load Data from MAT-file. MATGPR saves the Input Data structure (IPD) in MATLAB binary format (MAT-file), for fast and easy access during subsequent analysis sessions. A save operation is done automatically, right after importation of a raw data file. In addition, the IPD can be saved to a MAT-file at any time during a processing session. All these data sets are imported using the Load Data from MAT-file option. For additional information see the items Import Raw Data and Save Data to MAT-file.

Concatenate Sections. Consecutive or broken GPR sections can be joined into a single data set using this menu option. All data sets must be in MATGPR (.mat) format and have the same number of samples per trace (IPD.ns), the same sampling rate (IPD.dt) and the same trace spacing (IPD.dx). This also applies to unequally spaced data, i.e. those taken with instruments without survey wheels, or prior to marker interpolation (IPD.dx is empty). Marker trace information is preserved during concatenation. When selected, MATGPR generates the window of Figure 3.1.3, to assemble the files for concatenation. This can be done either by typing full path names, or by using the file browser. Files can be moved out of the list by selecting and clicking of the Remove from list button. The GO button starts the concatenation procedure, which generates a new IPD structure that can be saved or manipulated at will.

Read documentation of relevant function.

Figure 3.1.3. The "Concatenate Files" GUI

37

Page 38: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Hold Processed Data / Discard Processed Data. As stated above, the IPD and OPD structures rotate during a processing session as follows: 1) The IPD structure is copied onto the OPD structure. 2) OPD is modified by application of some processing step. 3) If the result is acceptable, OPD is copied onto IPD. This is done by selecting the Hold Processed

Data option. 4) If the result is not acceptable you may discard the OPD using the Discard Processed Data option,

otherwise it will be automatically erased, upon application of another processing step.

Read documentation of relevant functions.

Save Data to MAT-file. MATGPR saves the IPD structure in MATLAB binary format (MAT-file), either automatically upon importing a raw data file, or at any other time Save Data to MAT-file request. This makes it much faster and easier to handle the interim data sets generated during one or more processing sessions of a particular GPR section (i.e. during a project). By default, the destination (home) directory of the MAT-file is the parent directory of the raw data file. MATGPR remembers the path to the project’s home directory by storing it in the variable IPD.pname, upon importation of the raw data file. This default can be overridden by changing the destination directory in the “Save Current Input Data as …” dialog box. In such a case, the new destination directory becomes the default (home) for all subsequent save operations. The file names generated during a save operation comprise three parts, e.g. testdata.2.mat. The 1st part is the principal file name; by default it is the same as the file name of the raw data begetting the Current IPD. In the above example, testdata derives from the raw file name testdata.dzt. The 2nd part is an incremental save identifier, indicating the sequential number of the save operation. In the above example, a save identifier of 2 indicates that this was the second time the Current IPD was saved after the data was originally imported from testdata.dzt. This helps in keeping track of the processing history of a given data set. Third is the default extension ".mat". You can modify any, or both of the first and second parts without consequences. The saved data sets can be re-imported to MATGPR for further manipulation using the Load Data from MAT-file menu option. • On start up, MATGPR specifies that the MAT-file format will be the default for the version under

which it is running. However, while the MAT-file formats of MATLAB versions 5.x and 6.x are readable by version 7.x, the converse is not true! MATLAB Version 7, by default compresses the data it saves to MAT-files and uses Unicode character encoding when saving character data. Earlier MATLAB versions cannot read this file format. If you use MATLAB v7.x and want your MAT-files to be readable by earlier versions, you can disable these features through the Data Settings MAT-file Save Format V.6 menu choice. Note that you should do this before any saving operation. You can switch back to the default by selecting the Data Settings MAT-file Save Format V.7 (Default) submenu option. If you are using a MATLAB version earlier than 7.0, this submenu is not available because it is not needed. See also § 2.3.1 for additional information.

• Saving in MATLAB Version 4 Format is not possible. Version 4 does not support data constructs like structures, cell arrays, multidimensional arrays, or objects, which are essential to MATGPR.

38

Page 39: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Save Depth Migrated Data. Depth migration marks the end-point of a data processing line. At present, there's practically nothing more that can be done with MATGPR, that would be theoretically correct and would extract meaningful information. Accordingly, depth migrated data can only be saved to a MAT-file, for future use (e.g. concatenation or generation of 3-D volumes), in the form of an IPD structure . Moreover, it can be saved and printed using the FigureTools printing utilities, or, simply be discarded.

Export. For distribution or exchange, the data can be exported to SU and SEG-Y Revision 1 file formats. The exportation procedure is straightforward. It should be noted that these formats have achieved widespread usage within the geophysical community and have become standards, readable by practically all existing GPR analysis and interpretation software. For this important reason, these file formats, and SEG-Y in particular, have been adopted as the preferred method of exporting data for long-term storage and for exchange between different computer systems. It is for the same reason that MATGPR does not export data to proprietary file formats (RADAN, RAMAC, etc.). For details about the implementation of the SU and SEG-Y standards refer to § 2.3.3.

Settings. See Section 2.1.2 (Runtime Variables).

39

Page 40: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

3.2. Data Visualization: The "View" menu

Data visualization options include image (colour-coded) displays with several colour maps for better discrimination of the details, wiggle-trace displays and variable-area displays. It is also possible to plot and scrutinize individual traces and trace spectra. MATGPR also provides utilities to study the attenuation characteristics of the input and processed data, as well as the instantaneous attributes of the input data.

View Data / View Processed Data. View Data displays the IPD structure and View Processed Data displays the OPD structure according to the settings of the appropriate fields in the runtime variables collection. The GPR Data figure is created automatically whenever a new data set is imported or loaded and is updated whenever a processed data set is held (i.e. when the OPD replaces the IPD). It can also be refreshed through the View Data menu choice at any time. The ”Processed GPR Data” figure is created whenever a processing step is taken, in order to display the OPD, and is destroyed when the OPD is held, discarded, or another processing step is taken. • The colour scheme can be changed by means of the ImageColours menu. • The FigureTools menu provides for colour scheme editing, zooming, panning and data inspection,

exporting the figure in various graphics formats, printing, and editing the figure, axes and their children graphics objects.

Figure 3.2.1 shows the MATGPR GUI together with the Data and Processed Data figures in image display mode. Figure 3.2.2 shows the GPR Data in wiggle-trace display mode. The vertical slider-rule GUIs facilitate changing the scale of the wiggles (Scale) and the number of traces shown (# Traces). Figure 3.2.3 shows the IPD data in variable-area display mode and Figure 3.2.4 in combined wiggle-trace / image display mode. The slider rules again serve the purpose of adjusting the scale and number of traces shown.

Read documentation of relevant functions.

Figure 3.2.1. The "GPR Data" figure presenting the radargram contained in the IPD structure and in 'image' display mode. The OPD is displayed by an identical figure.

40

Page 41: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Figure 3.2.2. The "GPR Data" figure in wiggle-trace display mode.

Figure 3.2.3. The "GPR Data" figure in variable-area display mode.

Figure 3.2.4. The "GPR Data" figure in combined wiggle-trace / image display mode. The image is displayed in a brightened hot colormap.

41

Page 42: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Show Markers. Overlays Marker Trace locations on the "GPR Data" figure.

Read documentation of relevant function.

View Traces / View Spectra. MATGPR provides two utilities to facilitate scrutiny into the details of the data. These comprise a ”Trace Viewer” to visualize and inspect the traces of the IPD, and a ”Spectra Viewer” to visualize and inspect the Fourier amplitude spectra of the traces. Both programs use a slider-rule GUI to scan through the traces and facilitate scrutiny into the time series and spectrum of any individual trace with appropriate graphics tools (zooming, panning and peeking by means of the FigureTools menu). Note also that although these utilities are primarily intended for use with the MATGPR GUI, they can also be employed independently (see function documentations for additional information). View self-documentation of relevant functions.

View Processed Traces / View Processed Spectra. These options are Identical to the View Traces and View Spectra options described above, but apply to the OPD structure only. The tasks are performed with the same functions.

42

Page 43: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Attenuation Characteristics. This option allows visualization and scrutiny into the propagation and attenuation properties of the GPR signal. The program computes the analytic signal for all traces in the IPD or OPD GPR section, hence their instantaneous power. Then it computes the median and a mean attenuation function, that is, the respective median and mean instantaneous power of all traces in the section. It also determines best fitting models for power-law and exponential attenuation based on the median attenuation function. Finally, it displays the attenuation functions and the best fitting power-law and exponential decay models as per Figure3.2.5. The result of this operation may allow insight into the properties of the propagation medium and facilitate gain manipulations.

Read documentation of relevant functions.

Figure 3.2.5. The “Attenuation Characteristics” figure. It features the median and mean power attenuation functions and the best fitting power-law and exponential decay models.

Instantaneous Attributes. This will calculate the analytic signal and hence the instantaneous attributes of GPR traces. The instantaneous amplitude of the input sequence is the amplitude of the analytic signal. For GPR data it measures the reflectivity strength, reducing the appearance of random signal in the data. The instantaneous phase angle of the input sequence is the (unwrapped) angle of the analytic signal; the instantaneous frequency is the time rate of change of the instantaneous phase angle.

Read documentation of the relevant function.

43

Page 44: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

3.3. Basic Processing: The "Basic Handling" menu

Basic data handling includes graphical determination and adjustment of time-zero, basic trace editing (trimming and extraction utilities) removal of the global mean (background trace), dewow and gain manipulation. The latter includes Automatic Gain Control (AGC) functions, both in the standard form and with Gaussian tapering A gain function of the form ( ) * pg t scale t= , can also be interactively applied. Additional handling facilities include resampling (increase or decrease of the sampling-rate) in time and in space (along the scan line), using the versatile band limited sinc interpolation algorithm of Smith and Gosset (1984). For GPR instruments not equipped with survey wheels or other automatic distance measuring and triggering devices, a suite of marker interpolation routines is also provided, so as to transform data collected at equal-time spacing mode, to data at equal-distance spacing. This suite of routines also facilitates the three-dimensional determination of trace locations, with respect to some local co-ordinate system. Such information is necessary for the application of static corrections prior to imaging, as well as for 3D data visualization among other things.

Adjust Signal Position. This option allows control of the vertical position of the surface reflection, i.e. the place in time where the radar pulse leaves the antenna, and enters the subsurface. It can therefore be considered to be “time zero”, and its position should be at the top of the scan.. Modern GPR systems

are usually supplied with built-in utilities, manual or automatic, to identify the surface reflection and place it correctly at the top of the time window. Quite often, the system overshoots, leaving a zone of flat-line data at the top of the trace (no signal). The large reflection just below the flat data zone will be the surface reflection. Sometimes system undershoots or is incorrectly set up. At any rate, proper positioning of the time-zero is necessary, otherwise the location of sub-surface reflectors may be misidentified. The post-acquisition determina-tion of time-zero amounts to a static correction. MATGPR provides for the graphical determination and adjustment of time-zero using the Trace Viewer utility.

Details of this operation are shown in shown in Figure 3.3.1. You select a representative trace and zoom in at the beginning of the time window using the slider rule. The time-zero is determined by pointing with the crosshair cursor and clicking the left mouse button (the location of the cursor is shown above the axes). The system’s estimate of pulse duration displayed at the MATGPR information window may assist in making a better decision. MATGPR displays the current pick through the “Request” interface and waits for your decision (see below). By pressing “Yes” you loop to improve your selection. By pressing “No” the Figure 3.3.1. A snapshot in the course of

determining the true time-zero of GPR data

44

Page 45: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

program asks for confirmation by means of the Please confirm dialog box, in which you can fine-tune your decision if necessary. Pressing OK in the “Confirmation” dialog box completes the operation.

Read documentation of relevant function.

Trim Time Window. This option reduces the size of the GPR data matrix by discarding the late arrivals. Very often, the later parts of the traces contain only useless noise occupying valuable memory. This option is also useful when one wishes to extract a certain part of the data for some specific purpose. You need to provide the cut-off time at which the time window will be trimmed (the data after this time will be discarded). MATGPR displays a menu asking how you wish to enter the required information.

If you choose to Use Cursor the program focuses on the Data Figure and a hairline cursor appears. You enter the cut-off time by pointing and left clicking at the desired location along the time axis. I you choose to “Use Fingertips”, the program displays a dialog box in which you enter the exact cut-off time in nanoseconds.

Read documentation of relevant function.

Edit Scan Axis. This option reduces the size of the GPR data array by discarding groups of traces at the beginning or at the end of the section’s scan axis (scanline). It is also used to extract groups of traces or even large parts of the section to a separate data set. The routine initializes a GUI, in which you specify the desired operation (e.g. trim, or extract, input mode, see Figure 3.3.2). The table below explains how to use the GUI. By pressing Go MATGPR performs the desired action. • If the data (IPD.d) is trimmed, then the scan axis (IPD.x) is reset, i.e. the first trace of the trimmed

data will be at 0 m. Note also that if Marker Traces exist and IPD.markertr is assigned, the ID numbers of the Marker Traces are reset but their coordinates (assumed fixed with respect to a local reference frame) are not changed. Likewise, if you have created XYZ coordinates of the traces, then IPD.xyz is trimmed but the remaining coordinates are not changed because they are fixed w.r.t. the local reference frame.

Read documentation of relevant function.

45

Page 46: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

IInnppuutt mmooddee DDeessiirreedd aaccttiioonn.. Use Pointer selects location by pointing the hair-line cursor and clicking on the “GPR Data” figure.

Trim Front removes groups of traces at the be-ginning of the scan axis.

Use Fingers allows direct input of location in the edit boxes below.

Trim Back removes groups of traces at the rear of the scan axis.

The edit boxes are disabled when Use Pointer is checked (Figure 3.3.2.left).

Extract removes a group of traces to a separate data set.

Edit boxes are enabled when Use Fingers is checked, but which edit box is enabled de-pends on the desired action, i.e. which check-box is activated (Figure 3.3.2.right).

Figure 3.3.2. The Edit Scan Axis GUI: Left, when in graphical (Use Pointer) input mode and right, in direct (Use Fingers) input mode.

Remove Bad Traces. Pick bad traces by pointing and clicking and replace them with interpolants computed from their near neighbours. The routine displays the input GPR section in the display mode determined by ENVAR. Then, it issues a short help message at the lower left corner of the screen and with a delay of 0.5s it displays a cross-hair cursor. Pick the bad traces by pointing with the cursor and clicking the left mouse button. To facilitate po-sitioning, the cursor co-ordinates are displayed at the bottom of the figure. A selected bad trace is marked with a vertical red line. If you make a mistake, (pick the wrong trace), you can undo it by clicking the middle mouse button. To finish, click the right button. The routine then uses the near neighbours of the bad traces to compute their interpolant substitutes and replaces the bad traces in the output data section. • Note, because this function uses interpolation, it works best for isolated bad traces, or small clusters

of adjacent bad traces. In the latter case the clusters should better be separated by relatively extended groups of consecutive good traces. For the same reason, the function is not recommended for remov-ing extended groups of bad traces, as it will probably fail to produce reliable interpolants.

Read documentation of relevant function.

46

Page 47: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Remove DC. This will remove the DC component (arithmetic mean) from each trace of the GPR sec-tion.

Read documentation of relevant function.

Dewow. This operation will eliminate wow by applying a apply zero-phase high pass FIR filter with a cutoff frequency at exactly 2% of the Nyquist.

Read documentation of relevant function.

Equalize traces. If equalization is selected then the sum of the absolute values of all samples in a trace is made the same for all traces. For instance, if the trace that is selected to be used for equalization has a sum of all absolute values of 1000, then the sum of absolute values of every trace in the data set will be set to 1000 using a multiplying factor. When called, the routine displays a GUI, in which the user specifies the trace which will be used as the base.

This can be a) the first trace; b) the mean (average) trace; c) the median trace; d) the n'th, (i.e. any) trace specified by the user in the edit box, and, e) any positive number (base value) provided in the edit box. Read documentation of relevant function.

Remove DZT header gain. GSSI DZT data usually have time-varying (range) gain applied and the gain breakpoints and values are stored in the file header. On importing a DZT data set, the range gain data is stored in the IPD.DZThdgain field. The header gain information is preserved during manipulations that change the size of the data array (e.g. signal position adjustments, trimmings, marker interpolation, re-sampling, etc.) and is possible to remove at any time, recovering the raw data without amplification. This operation is useful if you wish to compare data files acquired with different gain functions or use true amplitude information.

• This option applies only to GSSI DZT data. Måla RD3 and S&S DT1 data usually do not have gain applied.

Read documentation of relevant function.

47

Page 48: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Standard AGC. Automatic Gain Control (AGC) is a process by which gain is automatically adjusted in a specified manner, as a function of a specified parameter, such as signal level. In MATGPR, the time-varying signal level is measured by the RMS amplitude computed over a sliding time window of a given length. MATGPR requests the length of the window in nanoseconds, by means of a dialog box:

By scaling the amplitude of the data at the centre of the sliding window with respect to the RMS amplitude of the window, the process ensures that ranges of low amplitudes are emphasized with respect to ranges with high amplitudes. Information of the true (measured) amplitude is lost. The result depends essentially on the length of the AGC sliding window. Short lengths (e.g. a very few ns) will introduce a more uniform distribution in the amplitudes of the output traces and will tend to smear the stronger reflections. On the other hand, very long windows may not provide adequate amplification of low amplitude ranges. Inasmuch as each data set has its own peculiarities, experimentation is recommended prior to holding the output data.

Read documentation of relevant function.

Gaussian-tapered AGC. Automatic Gain Control (AGC) is a process by which gain is automatically adjusted in a specified manner, as a function of a specified parameter, such as signal level. In MATGPR, the time-varying signal level is measured by the RMS amplitude computed over a sliding time window of a given length. However, in contrast to the simple boxcar window of the standard AGC operation described above, this variant a uses a boxcar window weighted (tapered) with a Gaussian bell function, whose breadth is a function of the noise level. MATGPR will request an estimate of the noise level (if unknown, zero is an acceptable figure) and the length of the AGC window in ns.

By scaling the amplitude of the data at the centre of the sliding window with respect to the RMS amplitude of the window, the process ensures that ranges of low amplitudes are amplified with respect to ranges with high amplitudes. However, the Gaussian taper emphasizes the contribution of the data around the centre of the window, thus producing a more focused result than standard AGC. Information of the true (measured) amplitude is lost. Here as well, the result depends strongly on the length of the AGC sliding window. Inasmuch as each data set has its own peculiarities, experimentation is recommended prior to holding the output data.

Read documentation of relevant function.

48

Page 49: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Apply g(t)=scale * t^power. This option applies a gain function of the form g(t) = scale× tpower. You will be asked to supply the power. Note, however, that the program uses the function getattenuation.m to compute the attenuation characteristics of the IPD and obtain a best fitting power-law attenuation model. The suggested power is the exponent of the best-fitting model less 1. This is usually a very good solution, but experimentation may provide a result more suitable for the data. You can inspect the attenuation characteristics and the best fitting power-law model by selecting Attenuation Characteristics under the View menu, or by running getattenuation.m as: getattenuation(IPD.d, IPD.tt2w,’do_plot’,’no_expow’) The scale is computed automatically, so as to preserve the amplitude range values of the input data (compensate for the effects of tpower).

Experience shows that for zero-mean and time-zero adjusted data, the suggested power is around 2 and the observed attenuation is fractional and around 3. From a practical point of view, power ~ 3 applies little gain, or even attenuates the early (near surface) arrivals, while applying too much gain and emphasizing the late arrivals. On the other hand, power ~ 2 apportions higher gain at the early parts of the time window and lower gain at the late parts, providing for a more balanced eventual distribution of amplitudes. Claerbout (1996, pp. 222-223) gives a theoretical justification for using power = 2 in seismic data. He shows that the basic geometry of energy spreading predicts a single power of time for the spherical divergence correction and argues that an additional power arises from a simple absorption calculation: This justification has not been demonstrated and may, or may not hold water in the case of GPR data. This is a theoretical exercise for the future, but is nevertheless worth noting!

Read documentation of relevant function.

Resample Time Axis / Resample Scan Axis. This option will increase or decrease the sampling rate, either in time (IPD.dt) or is space (IPD.dx), using band-limited sinc interpolation. Band-limited interpolation of discrete-time signals is a basic tool with extensive application in digital signal processing. The problem is to correctly compute signal values at arbitrary continuous times from a set of discrete-time samples of the signal amplitude (interpolate the signal between samples). Since the original signal is always assumed to be band-limited to half the sampling rate, (otherwise aliasing distortion would occur upon sampling), Shannon's sampling theorem tells that the signal can be exactly and uniquely reconstructed for all time from its samples by band-limited interpolation. Crochiere and Rabiner (1983) provide a comprehensive summary of classical signal processing techniques for sampling-rate conversion. In these techniques, the signal is first interpolated by an integer factor L and then decimated by an integer factor M. This provides sampling-rate conversion by any rational factor L/M. The conversion requires a digital low pass filter whose cut-off frequency depends on max{L, M}. While sufficiently general, this formulation is less convenient when it is desired to resample the signal at arbitrary times / locations or change the sampling-rate conversion factor smoothly over time. MATGPR employs a flexible public-domain resampling algorithm, which will evaluate a signal at any time or location specifiable by a fixed-point number (Smith and Gosset, 1984). In addition, one low pass filter is used regardless of the sampling-rate conversion factor. The algorithm effectively implements the “analogue interpretation" of rate conversion, as discussed in Crochiere and Rabiner (1983), in which a certain low pass filter impulse response must be available as a continuous function. Continuity of the

49

Page 50: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

impulse response is simulated by linearly interpolating between samples of the impulse response stored in a table. The resampling routines (see below) have but only one request: The output number of samples in the time dimension (Samples per scan / OPD.ns), or the output number of traces in the horizontal (spatial) dimension (OPD.ntr).

Read documentation for time-axis resampling and scan-axis resampling.

Edit Markers. For GPR instruments not equipped with survey wheels or other automatic distance measuring and triggering device, MATGPR provides a suite of marker interpolation utilities, so as to transform data collected in equal-time spacing mode, to data at equal-distance spacing. This function is presently not available for PULSE EKKO (DT1) data. Key to this operation is the marker information matrix (the IPD.markertr field). On importing raw, unequally spaced data with Marker Trace information, IPD.markertr will comprise a single column vector with the ID (sequential) numbers of the Marker Traces. In order to be useful for marker interpolation, the field must be augmented to a 4 column matrix as follows:

1) First Column : The ID (sequential) number of the Marker Traces; 2) Second Column : The x-coordinates of the Marker Traces in a local reference system; 3) Third Column : The y-coordinate of the Marker Traces in the local reference system; 4) Fourth Column : The z-coordinates of the Marker Traces in the local reference system.

The x, y and z coordinates should be fixed with respect to the reference frame! This information is used by the marker interpolator to transform the unequally spaced traces to equally spaced w.r.t. the local reference system (see Interpolate to Equal Spacing below). You must provide the co-ordinates of the Marker Traces and may do this in two ways: 1) Using an in-house screen editing facility (Use Editor Mode), or, 2) Entering the information through dialog boxes (Use Interactive Mode).

In Editor Mode, MATGPR generates the “Marker Information” window featuring an edit area, where the Marker Trace information is displayed as column vector(s). You may insert or change the Marker Trace co-ordinates in a simple screen-editing process, as shown in Figure 3.3.3 and click OK to accept and save them, or Abort to discard them.

In Interactive Mode, MATGPR will first inquire whether the Marker Traces are regularly or irregularly spaced. In the former case it will respond by asking for the location of the first Marker Trace and the marker spacing along each one of the x, y and z coordinate axes. Once it has accepted this data, it will generate the IPD.markertr field. In the latter case it will loop asking for the x,y and z coordinates of each Marker Trace, one by one.

Read documentation of relevant function.

50

Page 51: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Figure 3.3.3. The "Marker Information" window generated when the user decides to process Marker Trace information in "Editor Mode".

Interpolate to Equal Spacing. This option uses the spatial data of Marker Traces (prepared by Edit Markers or imported from an ASCII disk file), to transform data collected at equal-time spacing mode, to data at equal-distance spacing. The interpolation routine uses the piecewise cubic Hermite polynomials method.

Note 1: Inasmuch as the x, y and z coordinates of the marker traces are fixed with respect to the reference frame, if the section was recorded in a reverse direction (i.e. in a sense opposite to the positive direction of the coordinate axes), as for instance when the survey is conducted in meandering forward - backward sense, the transformed section and marker trace data are flipped and streamlined with the axes of the ref-erence frame.

Note 2: This function is presently not available for PULSE EKKO (DT1) data.

Read documentation of relevant function.

Make X Y Z. Generate x, y and z coordinates of the IPD traces, with respect to a local (survey) reference system. This is done with interpolation between the known coordinates of control (marker) traces. The coordinates of the control traces are passed as arguments (by the field IPD.markertr) or read from a disk (marker) file. The IPD must have equally-spaced traces. The output x, y and z coordinates are stored in IPD.xyz and are equally spaced in only one of the x or y axes, (independent coordinate), always taken to be the longest monotonically varying dimension. However, the horizontal distance 2 2h x y= +

is equal to the length of the scan axis and the spacing 2 2 2 21i i i idh x y x y 1− −= + − + is, to a sufficient

approximation, equal to the trace spacing IPD.dx.

Note: This function is presently not available for PULSE EKKO (DT1) data.

Read documentation of relevant function.

51

Page 52: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

3.4. Advanced Processing: The "Filtering" menu

MATGPR offers a suite of data smoothing facilities. These include: Mean and median spatial filtering in one and two dimensions, removal of a sliding window mean (background) trace to expose reflections that dip at high angles and removal of the sliding-window's "foreground" traces to eliminate high-angle reflections and enhance horizontal (e.g. hydrogeologic features). The latest addition is Karhunen - Loeve filtering (Karhunen, 1946; Loeve, 1955; Fukunaga, 1990), useful in enhancing the lateral coherence of the GPR data. MATGPR also provides for zero-phase FIR filtering of the frequency content (applied 'vertically' to traces), and of the wavenumber content (applied 'horizontally' to - equally spaced - scan lines). All types of filters are available (low / high / band pass, band stop and notch). All filters can be designed interactively (graphically) and tested before they're applied to the data. This suite of functions is complemented with an interactive F-K filter design and implementation routine, facilitating the application of zone pass / stop filters, fan (velocity range) filters and up-dip/ down-dip mapping in the frequency - wavenumber domain. A routine to perform predictive deconvolution to suppress multiple reflections is also provided.

Mean Filter / Median Filter. These options will respectively perform mean and median spatial filtering in one and two dimensions. The filter is applied by sliding a user-specified filter window over a 2-D data wall. The data value corresponding to the central element of the window is substituted by the mean or median of the window data. Zero padding equal to 1/2 the window length is applied, therefore the edges of the output data are expected to be distorted. Because this type of filtering is computationally intensive, a Fortran 90 MEX-file is usually employed to do the heavier part of the numerical work. For MS Windows OS, the MEX-file is provided ready to use (mfiltr.dll). For Linux OS and any flavour of Unix, you will have to compile the MEX-file from the mfiltr.f90 source code included with MATGPR, in the directory MATGPR/analysis/mex_src. If the MEX-file is not found by the system, a backup M-function will step in to do the work, but will perform quite slowly. The size of the filter window is defined in a dialog as per Figure 3.4.1. The size of the filter window in either dimension cannot be longer than one half of the data size in the corresponding dimension. In order to specify a 1-D filter in a given dimension, set the size of its orthogonal dimension equal to unity.

Note. If you do not have a MEX compliant compiler and somehow lose or cannot create the MEX-file, you might wish to consider using the alternative filtering routine mmfilter.m in the folder analy-sis/alternative/ mmfilter+mfilt.f90, together with the program mfilt.f90. This is a stand alone version of mfiltr.f90 and takes only a FORTRAN 90 compiler to make it work. In this way, you may retain the ad-vantage of speed afforded by compiled programs.

Read documentation of relevant function.

Figure 3.4.1. Dialog box to define the size of the mean or median filter window.

52

Page 53: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Remove Global Background. This will remove a “global” background trace from the data. The background trace is the average trace determined by adding all traces together and dividing by the number of traces. This is also called stacking. The stacking process enhances coherent signal and reduces randomly varying signal (or noise). In this case, the coherent signal is the horizontal banding often seen in GPR data (what we call system noise) and the randomly varying signal is the received radar signal from the subsurface. The appearance of the data is often improved by removing the horizontal banding. Caution must be exercised, however, with small data sets (less than about 1000 traces) or data that has strong natural horizontal reflectors. Frequency filtering may be an alternative for some data sets.

Read documentation of relevant function.

Suppress Horizontal Features. Background trace removal calculations: The mean (background) trace of a sliding window is subtracted from the data in the window. This operation will eliminate small horizontal features (coherent signal) from the data and may be used to expose reflections that dip at high angles, (removing for instance most reflections due to hydrogeologic sources). MATGPR has only one request (see below): the size (width) of the sliding window. The appropriate size of the window is unique for each data set and should be decided after due experimentation.

Read documentation of relevant function.

Suppress Dipping Features. Background trace calculation and retention. As opposed to removing the sliding-window's average, trace as above, this operation removes the foreground, that is the background trace is assigned to the centre trace in the sliding window (rather than being subtracted from the data). This operation will remove high-angle reflections (a dip filter), for instance to expose the sub-horizontal hydrogeologic features more clearly. MATGPR has only one request (see above): the size (width) of the sliding window. The appropriate size of the window is unique for each data set and should be decided after due experimentation.

Read documentation of relevant function.

Karhunen - Loeve Filter. The Karhunen–Loeve (KL) transform is a preferred method for approximating a set of vectors or images by a low dimensional subspace. In MATGPR the approximating subspace is defined in terms of the first (largest) N singular values and associated singular vectors of the input data matrix. The MATLAB routine "svds" is used for the transformation. The KL transform of the data is re-synthesized from the N largest singular values / vectors and is a smooth version of the input

53

Page 54: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

data, exhibiting enhanced lateral coherence of the GPR events. MATGPR has only one request (see below): the number N of the largest singular values. It is emphasized that N should be low (of the order of 10) but the appropriate value is unique for each data set and should be determined by experiment.

Read documentation of relevant function.

FIR Frequency Filter. Design and apply a FIR frequency filter on the traces of the GPR data. Low / high pass, band pass and band stop filters can be designed. The simple strategy employed in MATGPR is to construct a very long FIR wavelet (75% of the data length) in order to achieve very narrow transition bands, while eliminating Gibbs effects and ripple structure. The filter is applied in the frequency domain and in a forward and a backward sense, so to preserve phase information. The process is fully vectorized, so that very large data matrices can be processed in less than 1 second with modern machines.

There are three ways to design the filter, which you can control the filter design mode through the Data Settings Design F or K Filters menu and one of the choices: 1. On a test trace or scanline: The filter will be designed on the basis of the spectrum of a particular test trace. This is the default. When you request a filtering operation, MATGPR will prompt you to pick a test trace, whose spectrum will be used as a template for determining the characteristics of the filter. You will then point the hairline cursor on the desired test trace and click the left mouse button. The spectrum of the trace will be displayed and you will again be prompted to pick the cut-off frequency(ies) using the crosshair pointer. Figure 3.4.2 shows an instance from the design of a band-pass filter, where the lower cut-off frequency has already been entered and the upper cut-off is about to be decided. MATGPR will then compute the filter and will display the spectrum of the test trace (blue), the spectrum of the filter (red) and the spectrum of the filtered test trace (green), as per Figure 3.4.3. Then, it will ask you to accept or reject the design. A negative reply will discard the filter and repeat the procedure. A positive reply will apply the filter. 2. On the mean trace or scanline: The filter will be designed on the basis of the spectrum of the average (mean) trace computed from the input data, following exactly the same procedure as above. 3. Just type the cut-off frequencies: The predefined cut-off frequencies will be given directly, through an appropriate dialog box.

• For more technical information, please refer to § 2.3.1 (Runtime Variables).

Read documentation of relevant function.

54

Page 55: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Figure 3.4.2. An in-stance from the design of a FIR band-pass fil-ter. The lower cutoff frequency has already been determined and the upper cutoff is about to be decided and picked with the crosshair cursor

Figure 3.4.3. The filter is designed and applied to the test trace. The program displays the result and waits for the user to decide the next step.

FIR Wavenumber Filter. Design and apply a FIR frequency filter along the scan axis of the GPR data. A necessary condition for the application of the wavenumber filter is that traces are equally spaced. This operation is exactly the same as in the FIR Frequency Filter described above, but works line-wise instead of column-wise, thus filtering wavenumbers instead of frequencies. Identical procedures are also used in designing the wavenumber filters. Thus, selecting Data Settings Design F or K Filters menu and: 1. On a test trace or scanline determines that the filter will be designed on the spectrum of a test

particular test line,

55

Page 56: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Figure 3.4.4. The menus of available F - K filtering operations (left) and methods of defining the polygonal pass / stop zone (right).

2. On the mean trace or scanline, determines that the filter will be designed on the spectrum of the average (mean) line,

3. Just type the cut-off frequencies determines that cut-off frequencies will be given through an appropriate dialog box.

• For more technical information, please refer to § 2.3.1 (Runtime Variables).

Read documentation of relevant function.

F - K Filter. Design and apply an F - K filter. Note that a necessary condition for the application of the F-K filter is that traces are equally spaced. If not, the procedure aborts automatically, issuing an appropriate error message. Available F-K filter options include zone-pass / stop filtering, fan-filtering (velocity range pass/ stop) and up-dipping / down-dipping event separation. The desired option is selected by left-clicking on the appropriate button of the menu that appears as soon as the F-K Filter option is selected (Figure 3.4.4 left).

Read documentation of relevant function.

General Comment: For MATLAB Release 13 and upward, the filtering operation uses the MATLAB function inpolygon.m. For earlier MATLAB releases it uses the in-house routine isinpoly.m, by Kirill Pankratov. Both routines are highly vectorized and remarkably fast.

Zone pass / Zone stop. This works like a band pass / band stop filter. You are asked to define a polygonal area (zone). If you select Zone pass, the spectral contributions in and on the sides of the zone will be retained. Those outside the zone will be rejected. If you select Zone stop, the spectral contributions outside the zone will be retained. Those inside and on the sides of the zone will be rejected. There are two methods of defining the pass / stop zone (Figure 3.4.4 right):

The coordinates (vertices) of the zone are imported from an ASCII disk file. This means that you have accurately pre-defined the pass or stop region and allows for repeated applications of the F-K

56

Page 57: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

filter on multiple data sets. The structure of the ASCII file is very simple: No header; two columns of floats, the first column being the wavenumber co-ordinates and the second column being the frequency co-ordinates of the F-K spectrum. Important Note: Define the polygonal area using only the positive frequency coordinates and both the positive and negative wavenumber co-ordinates.

The coordinates of the polygonal area are set interactively on-screen. MATGPR generates the F-K spectrum and displays the logarithm of its amplitude. Then, it issues a short help message which remains visible for the duration of the procedure, and with a delay of 1s displays a cross-hair cursor. Set the vertices of the polygon defining the pass / stop zone by clicking the left mouse button at the desired position of the F-K spectrum map. To facilitate positioning, the cursor co-ordinates are displayed at the bottom of the figure. The zone vertices are marked with a star and the enclosed area is outlined with a transparent rubber band to enhance visualization and facilitate the design process (Figure 3.4.5). If you set a vertex incorrectly, you can undo it by clicking the middle mouse button, whereupon the vertex, the line to the vertex and the rubber band to the vertex are automatically erased. There's no backward limit to this type of undo operations, other than the size of the zone. To finish, the right button must be clicked after the last vertex has been set. MATGPR will then ask whether the polygon was defined to your satisfaction. If not, the zone is erased and the process starts over. If yes, MATGPR proceeds with filtering.

Figure 3.4.5. F - K filter-ing: Graphical introduction of a polygonal pass / reject zone.

Velocity range pass / Velocity range stop. This option allows for fan filtering in the F-K domain. You need to define the [upper, lower] negative, and [lower, upper] positive apparent velocity limits (Figure 3.4.6). If you have selected Velocity range pass, the spectral contributions within the [lower, upper] apparent velocity range will be retained. Those outside the range will be rejected (set equal to 0). If you have pressed Velocity range stop", the spectral contributions outside the [lower, upper] apparent velocity range will be retained. Those within the range will be rejected (set equal to 0). The positive and negative velocity bounds do not need to be symmetric, but in this case, caution is necessary because some dipping events may be differentially amplified or attenuated. MATGPR paints the velocity fan on the F - K spectrum map and awaits input (Figure 3.4.7). If satisfied, you will press Yes and MATGPR will proceed with filtering. If not, the procedure starts over.

57

Page 58: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Figure 3.4.6. F - K fan-filtering: Interactive defini-tion of the pass / reject veloc-ity fan. In this case the fan is focused on rejecting clutter structure from the data.

Figure 3.4.7. F - K fan-filtering: The velocity fan designed in Figure 3.4.6 is displayed and the user is prompted to accept or reject it. The fan focuses on reject-ing clutter structure.

Up-dip / Down-dip. The F - K transform has the property that reflections with positive slope (up-dipping) map into the positive-K quadrant of the F - K domain, while reflections with negative slope (down-dipping) map into the negative-K quadrant. Therefore, by specifying a filter that stops an entire quadrant while passing the other, it is possible to reject reflections dipping in one direction or the other. The result is a section with features having a unique dip direction. In this way one can separate intersecting or overlaid reflections and study tem independently.

58

Page 59: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Predictive Deconvolution. The objective of predictive deconvolution is the suppression of multiples or reverberations. The desired output is a time advanced (lagged) version of the input signal. The deconvolution altogether needs three parameters: The prediction distance (lag), the length of the filter wavelet and percent prewhitening). The length of the filter wavelet (filter length) normally can be kept relatively small and cannot exceed 1/2 of the trace length. The lag must be smaller than filter length. To suppress multiples choose a lag corresponding to the two-way-traveltime of the multiple, to suppress reverberations choose a small lag corresponding to the duration of the primary reverberation. Filter length and lag can be given either in time units (ns) or in number of samples, depending on the user's preference (see below). If you choose Samples in the left box, then you should enter number of samples in the box to the right (appearing immediately afterwards). Conversely, if you choose ns (nanoseconds) in the left box, you should enter values in nanoseconds in the right box.

Read documentation of relevant function.

59

Page 60: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

3.5. Interpretation: The "Imaging" menu

MATGPR offers a number of imaging and modelling tools to assist interpretation. These include velocity analysis by interactive fitting of diffraction front hyperbolae (assumes non- dispersive propagation) and static (topographic) corrections. Advanced interpretation tools include F-K migration (Stolt, 1978), Phase-shift migration (Gazdag, 1978) and time-to-depth conversion for uniform or layered velocity structures. They also include Split-step F-K migration (Stoffa et al., 1990; Sena et al., 2003) and Phase-shift plus Interpolation migration for 2-D velocity structures (Gazdag and Sguazzero, 1984).

Fit Diffraction Hyperbola. A simple approximation to the problem of fitting a diffraction front hyperbola, as it is based on the premise of non-dispersive propagation in a uniform halfspace and deals only with point diffractors, or finite sized targets of circular cross section (quasi-cylinders and quasi-spheres). MATGPR generates the "Fit Diffraction Hyperbola" figure, which displays the IPD structure in ’image’ display mode (Figure 3.5.1). Parameters involved in the fitting process are the halfspace velocity, the radius of the target and the coordinates of its centre (depth and location on the scan line). The parameters can be changed interactively, by means of slider rules as shown at the bottom of Figure 3.5.1. The upper and lower limits of the slider rules and the minimum and maximum slider steps are determined automatically. The calculated hyperbola is plotted on the data and the quality of fitting is determined by the eye, (depends on the experience of the user). When finished, by clicking DONE, you cause the current estimate of the halfspace velocity to become a global runtime variable and be accessible by other imaging and interpretation functions (it is also displayed on the information window of the MATGPR GUI). The figure can be fully manipulated using the FigureTools and ImageColours menus

Read documentation of relevant function.

Figure 3.5.1. Interactive fitting of a diffraction front hyperbola. A uniform half-space is assumed and the model parameters are changed with the slider rules.

60

Page 61: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Static Correction. Apply topographic corrections to zero-offset GPR data. The routine initializes a GUI, in which you specify the necessary parameters: Velocity of the “subweathering” layer to be used for correction, the sense of the correction (up or down) and the elevation datum in which to refer the reduced GPR section (see Figure 3.3.2 for details). The elevation data necessary for the corrections are passed with the array IPD.xyz, prepared with the Make X Y Z procedure. By pressing Go the routine performs the topographic reduction.

Read documentation of relevant function.

Figure 3.5.2. The GUI to define parameters necessary for topographic corrections.

Get 1-D velocity model. This is a utility to import, or introduce and export 1-D (layered) velocity models for use with 1-D migration routines. At this stage development, the migration routines will only implement the real (non-dispersive) term of the phase velocity. The models can be imported from a disk file or may be given interactively by means of a dialog box. The format of the disk file is very simple. The first line is the number of layers NLAY, including the basal half space. This is followed by NLAY pairs of velocities (m/ns) and thicknesses (in m), one per line as in the following table:

Nlay Velocity of layer 1 Thickness of layer 1 Velocity of layer 2 Thickness of layer 2 ... ... Velocity of layer NLAY-1 Thickness of layer NLAY-1; Velocity of basal halfspace 0

• The thickness of the basal halfspace is always equal to zero!

• A uniform halfspace is introduced as a 1-LAYER velocity structure with a thickness equal to zero.

• Basic error checking (e.g. for velocities exceeding the speed of light in free space) is done before the routine returns.

Read documentation of relevant function.

61

Page 62: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

1-D F-K Migration. This is a compact implementation of Stolt's (1978) F-K migration for uniform or layered velocity structures. The program uses Stolt stretching to accommodate non-uniform (layered) velocity structures, while the actual migration code was built with tips from Jon Claerbout (1996, pp 53-57). However, this is a much more compact, robust and fully vectorized code, fast enough to outperform some compiled Fortran or C implementations of Stolt migration. The required input velocity model must have been prepared with Get 1-D velocity model. User intervention is not required during execution of the program.

Read documentation of relevant function.

1-D Phase-shift migration. This is a compact implementation of Gazdag's phase-shift migration for uniform or layered velocity structures. The required input velocity model must have been prepared with Get 1-Dd velocity model. Inasmuch as Phase-shifting migration requires a good deal of number crunching, the heavier (and non-vectorizable) numerical work is carried out with an external Fortran-90 MEX-file. For MS Windows OS, the MEX-file is provided ready to use (gazdag.dll). For Linux OS or any other flavour of Unix, you will have to build the MEX-file from the gazdag.f90 source code provided in the directory MATGPR/analysis/mex_src. There’s also backup M-code attached to the main routine gazdagmig.m in the form of sub-functions gazdagcv and gazdaglv. If the MEX-file is not available, the M-code will take over. The M-code used in gazdagcv is semi-vectorized and is reasonably fast. It will do a [512 x 512] job in about 36 seconds, as opposed to the 5 seconds needed by the FORTRAN MEX-file. The M-code in gazdaglv is typically sequential (the same as in the MEX-file) and is damned slow! User intervention is not required during execution of the program. Note 1. If you do not have a MEX compliant compiler and somehow lose or cannot create the MEX-file, you might wish to consider using the alternative phase-shift migration routine gazdagmig.m in the folder analysis/alternative/gazdagmig+migrate.f90, together with the program migrate.f90; this is a stand alone version of gazdag.f90 and takes only a FORTRAN 90 compiler to make it work. In this way, you may retain the advantage of speed afforded by compiled programs. Note 2: There actually two implementations of the image reconstruction code, one for layered structures and one for constant velocity structures. The former is by the author, Andreas Tzanis. The latter was tipped off by Jon Claerbout’s book (1996, pp 50-53) and is quite fast and accurate, enough to warrant its separate place in MATGPR.

Read documentation of relevant function.

Time-to-Depth Conversion. This utility migrates (remaps) a GPR section from travel time vs. distance to depth vs. distance, assuming a uniform or layered velocity structure. The required 1-D velocity model must have been prepared with Get 1-D velocity model. The program: 1. Computes a time vs depth function t(z) from the velocity vs. depth function v( t) . 2. Inverts t(z) to z( t) by inverse linear interpolation. 3. Remaps z( t) to depth z and, based on this mapping, 4. Remaps E( t) E(z) , where E stands for a GPR trace (scan).

Read documentation of relevant function.

62

Page 63: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Get 2-D velocity model. Import or build a 2-D velocity structure for Split-step and PSPI migrations. MATGPR will ask whether you wish to import, or create the velocity model. In the former case, the ve-locity model will be read from a binary disk file, where it was stored during some previous session. In the latter case, the program will ask you to import (from a disk file) a synthetic structural model prepared by Build 2-D Model and to confirm the antenna central frequency and the depth step size to be used for inte-gration. Then, it will generate the corresponding velocity model, optionally saving it to a binary disk file (recommended). The velocity structure is returned in a three-element cell array containing:

1) The non-dispersive term of the phase velocity model, with values expressed in m/ns. This is com-puted after Bano (1996).

2) The quality factor Q of the model. 3) The central frequency of the antenna (a scalar).

The antenna frequency and the quality factor are useful in incorporating the frequency dependence of the phase velocity (dispersion) in 2-D Split-step Fourier depth migration (and future implementations of other 2-D spectral domain migration / modelling methods), also in the sense of Bano (1996). The size of the ve-locity matrix and the Q matrix are the same as the size of the GPR section in the IPD. Along with the ve-locity model, the program generates and stores the array of z-coordinate axis of the velocity model and the depth stepping size to be used for migration. The structure of the velocity model is [iz][ix], i.e. the x-direction is the fastest (MATLAB default). Such a structure is more convenient for the downward continuation type migration algorithm than using z as fast-est dimension. Note that this is also very convenient for employing Seismic Unix migration programs (see 2-D Phase-shift + Interpolation migration).

Overview: In the frequency domain, the total current density flowing in the Earth is related to the EM field as J T (ω ) =σE (ω ) + iωε (ω )E (ω ) = σ*(ω)E (ω) = iωε*(ω)E (ω) , where the quantities

*( ) ( )iσ ω = σ+ ωε ω and *( )*( ) i σ ω

ε ω = −ω

,

respectively are the composite conductivity and the composite permittivity. They express the electric properties of the medium in terms of a unique complex quantity. Hence, we can write:

( )*( ) ( ) ( ) ( )i i′′σ +ωε ω′ ′ε ω = ε ω − = ε ω − ε ω

ω′′ .

The total (ohmic + dielectric) losses are expressed in terms of the imaginary part ε″ of ε*. The character-istics of energy dissipation are frequently expressed in terms of the loss tangent, i.e. the ratio of the imaginary to the real part of ε*:

tan′′σ + ωε

δ =′ωε

.

The quality factor is defined to be the inverse of the loss tangent: 1

tanQ =

δ

In a medium where ε′(ω) and ε″(ω) have the same frequency dependence, attenuation is linearly depend-ent on frequency, so that the medium can be approximated by a constant Q factor. The reference relative permittivity K of such a medium, is defined to be the relative permittivity when Q ∞. The constant-Q approximation is valid over narrow bandwidths (e.g. Turner and Siggins, 1994). In the case of GPR, be-cause we use narrow frequency bandwidths Δf around the antenna central frequency fc such, that Δf = fc, (Davis and Annan, 1989), the constant Q approximation is still valid. Bano (1996) has shown that the phase velocity V(ω) are given by the product of a non-dispersive term V0 and a power-law term P(ω), as follows:

12 1

0 0

0

1 2( ) ( ), , ( ) , tancos (1 )

4

n

cV V P V P n

K n

−⎛ ⎞ωω = ω = ω = =⎜ ⎟π ω π⎛ ⎞ ⎝ ⎠μ ε −⎜ ⎟

⎝ ⎠

Q

63

Page 64: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Comment: For MATLAB Release 13 and upward, the filtering operation uses the MATLAB function inpolygon.m. For earlier MATLAB releases it uses the in-house routine isinpoly.m, by Kirill Pankratov. Both routines are highly vectorized and remarkably fast.

Read documentation of relevant function.

2-D Split-step Fourier Migration. A vectorized implementation of the algorithm by Stoffa et al. (1990). In addition, the algorithm has been augmented to account for the frequency dependence of the phase velocity (dispersion), depending on the form of the variable conveying the velocity model used for migration. The default for MATGPR is to include dispersion. The velocity model must have been prepared by Get 2-D velocity model and comprises a {1 x 3} cell array v2d = {V0 Q fc }, with the three sub-array elements respectively being the non-dispersive term of the phase velocity, the quality factor and the antenna central frequency. V0 and Q must have the same number of columns and rows as in the GPR section. Inclusion of the dispersion effects follows the work of Bano (1996), who has shown that

12 1

0 0

0

1 2( ) , , tancos (1 )

4

n

cV V V n Q

K n

−⎛ ⎞ωω = = =⎜ ⎟ πω π⎛ ⎞⎝ ⎠ μ ε −⎜ ⎟

⎝ ⎠

with K being the reference relative permittivity and μ the magnetic permeability. In the augmented Spilt-step algorithm realized in MATGPR, both the layer reference velocities (vertically) and the layer pertur-bation velocities (horizontally) are reduced for their frequency dependence. The Split-step migration routine can be used independently of MATGPR, in which case you can opt not to include dispersion. This is done by introducing the velocity model, either as a cell array with fewer than 3 elements, (in which case the first element of the cell array should be V0), or, as a single real matrix. In both cases the velocity model must have the same number of columns and rows as in the GPR section. Please refer to the documentation of function splitstepmig.m for additional information. Credits: Some programming tips were taken from a split-step migration routine by G.F. Margrave,

CREWES Project, U. of Calgary, 1996.

Read documentation of relevant function.

2-D Phase-shift + Interpolation Migration. This is a driver routine for the Seismic Unix program sumigpspi, implementing Gazdag and Sguazzerro's (1984) phase-shift plus interpolation migration for zero-offset data, with lateral velocity variation. MATGPR does the following: 1. Exports the GPR section to an interim SU file format and the velocity structure to an interim SU

compatible binary file. These files are created in the system’s temp directory. 2. Executes sumigpspi which generates an interim SU format results file, also in the system’s temp

directory. 3. Imports the results file and creates the OPD structure. 4. Deletes all the interim files. 5. Displays the migrated section.

Note: The MS Windows executable sumigpspi.exe was created with the DJGPP, (Windows XP edition of the GNU GCC suite), by DJ Delorie. This is provided together with MATGPR. In Linux OS and all other flavours of Unix, the users must provide their own copy of the sumigpspi executable.

Read documentation of relevant function.

64

Page 65: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Simple Velocity Calculator. Utility to calculate EM field velocities in finite media. The function enquires the nominal frequency of the GPR antenna, the resistivity, relative dielectric constant and rela-tive permeability of the medium (below left) and calculates the non-dispersive term of the phase velocity, with values expressed in m/ns, and the quality factor, both after Bano (1996). For additional details see item Get 2D velocity model.

Read documentation of relevant function.

65

Page 66: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

3.6. Interpretation: The "Modelling" menu

Build 2-D Model. MATGPR offers a GUI utility (the Model Builder) to construct 2-D models for processing with the Split-step and Phase-shift plus Interpolation migration methods, as well as for forward modelling with Bitri and Grandjean’s (1998) Split-step algorithm. At this stage of development, the model comprises an ensemble of objects with polygonal or circular cross-sections. The objects can be overlapping and the order in which they are introduced in the model determines the way in which they will appear in the velocity model (or whether they will appear at all). The program employs a front to back hierarchy: foreground objects will appear whole in the model; background objects will not appear at all if they are totally obscured or will appear partially if they are partially obscured (their visible portion). Therefore, the objects added later to the model take precedence over the objects introduced earlier! The Model Builder also provides for the graphical editing of object shape and properties (inserting, relocating or removing vertices and changing EM properties, with unlimited levels of undo). The following few paragraphs will provide a basic description of the utility.

Figure 3.6.1 shows the window and menus of the Model Builder. The Figuretools and Windows menus have already been described in Section 2.1.3. Particular to the Builder are the Data and Actions menus. The Data menu helps you initialize the program and import or export models. Its function and options are straightforward and there will be no time or space wasted to their detailed description. The Actions menu provides access to the main collection of tools by which you can build and edit a model and will be given due consideration.

Figure 3.6.1. The Model Builder window and its menus

66

Page 67: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Creating a new model. On selecting Data New Model, the Builder displays a dialog box, in which you will define the size and extent of the model. Required parameters are the left and right limits in the horizontal direction and the vertical (depth) extent of the model. The model is always assumed to begin at the surface (z=0). In order to create a velocity model for 2-D migrations, i.e. one that will be processed with Get 2-D Velocity, make absolutely sure that the horizontal extent of the model matches the horizontal extent of the GPR section.

Once the size of the model is defined, the Builder automatically creates and paints a background structure with dimensions equal to the size of the model and enquires for the antenna central frequency, the background resistivity, relative dielectric constant and relative magnetic permeability (Figure 3.6.2 left). Given these figures, it calculates the phase velocity for the central frequency and asks for your approval (Figure 3.6.2 right). If you press No, the Builder asks for new electric and magnetic properties and so on... Cancel discards the current background and the procedure starts over. If you press Yes the background is accepted as the first object in the list. The builder is now ready to accept new structural objects (bodies). As mentioned previously, the model comprises an ensemble of bodies with polygonal or circular cross-sections.

Figure 3.6.2. Left: The dialog box enquiring the EM properties of the new object. Right: The Builder always

asks for confirmation of the body's properties

Inserting polygonal objects (bodies). There are three ways to enter a polygonal object, selectable from the Actions Input Mode menu: 1. Use Fingers : Type the coordinates of its vertices in dialog boxes. 2. Use Pointer : Point and click on the desired coordinates 3. From File : Read ASCII file from disk.

67

Page 68: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

• General comment: When a new polygonal body is inserted, the Builder checks whether its vertices lie close to the vertices of already existing polygons. If yes, the vertices of all polygons found to be within 1% of each other are snapped together.

1. Inserting polygonal bodies graphically: The Builder issues a short help message which remains visible for the duration of the process, and with a delay of 1s displays a crosshair cursor. Set the vertices of the polygonal body by clicking the left mouse button at the desired coordinates. To facilitate positioning, the cursor coordinates are displayed at the bottom of the figure. The vertices are marked with a star and the area they enclose is outlined with a transparent rubber band to enhance visualization and facilitate the design process (Figure 3.6.3). This is particularly helpful when inserting complex shapes. If you set a vertex incorrectly, you can undo it by clicking the middle mouse button, whereupon the vertex, the line to the vertex and the rubber band to the vertex are erased. There's no backward limit to this type of undo operations, other than the size of the zone. To finish, click the right mouse button after the last vertex has been set. The Builder will now paint the body and will ask its properties, as per Figure 3.6.4. Accepting the body (by pressing Yes in the quest dialog) will cause the Builder to ask for an ID tag by which it will identify the body (as per Figure 3.6.5). The tag is then painted on the centre of gravity of the polygonal shape.

Figure 3.6.3. Use Pointer for inserting a “trench” in the background structure.

68

Page 69: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Figure 3.6.4. The trench is painted on the model and the properties of the filling material are now enquired.

Figure 3.6.5. The Trench is now given a name (Tag).

2. Inserting polygonal objects through dialog boxes: The Builder will first ask for the number of vertices in the body. Then, it will loop through the number of vertices, asking for the vertex coordinates, one at a time. You should enter (x, z) pairs of coordinates as per Figure 3.6.6. When the coordinates have been entered, the Builder will paint the body and will enquire its properties, also by means of dialog boxes as per Figures 3.6.2 and 3.6.4. Accepting the body will cause the Builder to ask for an ID tag by which it will identify the body (Figure 3.6.5). The tag is then painted on the centre of gravity of the polygonal body.

Figure 3.6.6. Dialog box to enter the vertices of a polygonal body.

3. Inserting polygonal bodies from disk files: The coordinates (vertices) of the body can be imported from an ASCII disk file with a very simple structure: No header; two columns of floats, the first column being the horizontal (x) coordinate and the second column being the vertical (z) coordinate. After importing the polygon, the Builder paints the body and asks for its properties with the procedure described above.

69

Page 70: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Inserting circular objects (bodies). There are two ways to enter a polygonal object, selectable from the Actions Input Mode menu:

1. Use Fingers : The Builder will ask you to type the coordinates of the centre of the circular body and the length of its radius in a dialog box as shown below. In this here example, a water pipe of diameter 0.25m is specified and put in the trench of Figure 3.6.4. The result is shown in Figure 3.6.7.

2. Use Pointer : The Builder issues a short help message which remains visible for the duration of the process and with a delay of 1s displays a crosshair cursor. You are required to point and left-click, first at the coordinates of the centre and then at a distance radius from the centre. To facilitate positioning, the cursor coordinates are displayed at the bottom of the figure. Note that this input method is not recommended when precise placement of the object is required.

In both cases above, when the location and size of the circular object have been set, the Builder calculates a polygonal approximation to the circumference, paints it on the model enquires its properties, also by means of dialog boxes as per Figures 3.6.2 and 3.6.4. Accepting the body and defining its ID tag will complete the process. Figure 3.6.7 shows a model comprising a “trench” dug in the background, with a water pipe located at (7, 2.5) metres, and a metal pipe running at (13, 2) metres, both running parallel to the strike of the trench.

Figure 3.6.7. The final model of the trench and two pipes

70

Page 71: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Removing an object. A body can be removed from the model through the Actions Undo Shape menu choice. The Builder will then display a drop menu above the top left corner of the model axes, in which you can identify a body by its tag and remove it.

Figure 3.6.8. Remove (Undo) a body by selecting it in the drop menu.

Editing a model. The Model Builder allows extensive editing and modification of the model. This includes both the geometry and the properties of the constituent bodies.

Changing EM properties. The EM properties of any body can be changed through the Actions Review EM Properties menu choice. The Builder will then display a drop menu above the top left corner of the model axes, in which you can identify a body by its tag and select it. The Builder projects the current body properties in a dialog box, as per Figure 3.6.2.left, and enquires for the new properties initiating the familiar procedure. It calculates the phase velocity for the central frequency and asks for your approval (e.g. Figure 3.6.2 right). If you press Yes the new properties are accepted for the body. If you press No, the Builder asks for new electric and magnetic properties and so on... Cancel discards the procedure and returns the program to the idle state.

Figure 3.6.9. Select a body in the drop menu to change its EM properties.

71

Page 72: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Changing model geometry. The geometry of the constituent bodies can be changed through the menu choices Actions Move Vertex / Remove Vertex / Insert Vertex. • General comment: When a polygonal body is modified, the Builder checks whether its modified

vertices lie close to the vertices of an already existing polygon. If yes, the vertices of all polygons found to be within 1% of each other are snapped together.

1. To move (relocate) a vertex to another location, you must first select it by pointing on the vertex and clicking any mouse button. If you’re in Use Fingers or From File input mode, the Builder will enquire the new location of the vertex by displaying the following dialog box

Figure 3.6.10

If you’re in Use Pointer input mode, you should relocate the vertex by pointing and clicking on its new location. The cursor coordinates displayed at the bottom of the model figure will assist in pointing as accurately as possible, but this method of relocating vertices is not recommended when precise positioning is required.

2. Remove a vertex simply by pointing on it and clicking any mouse button.

3. To insert a new vertex you must first define by pointing and clicking, the two vertices adjacent to the new vertex (equivalently the side of the polygon to be split by the new vertex). The builder will remind you this by issuing a help message. Then, if you’re in Use Fingers or From File input mode, the Builder will display the dialog box of Figure 3.6.10, enquiring the location of the new vertex. If you’re in Use Pointer input mode, you should relocate the vertex by pointing and clicking on its new location. The cursor coordinates displayed at the bottom of the model figure will assist in pointing as accurately as possible, but this method of relocating vertices is not recommended when precise positioning is required.

Undoing changes to the model geometry. Use the Actions Undo Changes menu choice to reverse any modifications you have made in the geometry of the constituent bodies. The number of undo operations is not limited. Note however that it is not indefinite. The backup register is reset every time there’s a major change in the structure of the model, i.e. when a new object (body) is inserted or removed. You must finish undoing geometry changes before such an action, or they will become permanent. It is a good idea to consider doing geometry changes after laying out the basic structural elements of the model.

Recolouring the model. The Builder assigns object (body) colours randomly. In consequence, the resulting colouring scheme is difficult to read, or even aesthetically offensive. Use the menu choice Actions Recolor to change the scheme to something more acceptable to your taste.

Utilities. Some utilities useful in editing and illustrating the model are provided with menu choices Actions Marks / Tags / EM Properties.

• You can show or hide the square markers demarcating the vertices of the polygonal bodies.

72

Page 73: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

• You can show / hide the body tags or toggle them with the corresponding EM properties

• You can show / hide the EM properties or toggle them with the corresponding tags

For example, Figure 3.6.11 illustrates the trench and pipes model of Figure 3.6.7 without markers, and while Figure 3.6.12 the same model without markers and with EM properties shown in the place of tags.

Figure 3.6.11. The trench and two pipes model of Figure 3.6.7 without vertex markers.

Figure 3.6.12. The trench and two pipes model of Figure 3.6.7 without vertex markers, and with its EM properties shown in the place of tags

73

Page 74: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

The model file. The Builder saves the model for later access by itself, get2dvelocity.m and splitstep2dmodel.m, as a free format ASCII file (the model file), with the following structure:

Line Model Parameter Size and description 1 antenna float, antenna frequency. 2

Xmin Xmax Zmin Zmax float, horizontal and vertical extent of the model.

3 nbody int, number of bodies in the model. 4 tag string, Tag of 1st body. 5 nv, K, Q, mu, rho int + 4 x float. Respectively are: a) The # vertices in 1st body, b) its relative dielectric constant, c) its quality factor, d) its relative magnetic permeability, e) its resistivity 6 x(1) z(1) float, float: coordinates of the first vertex 7 x(2) z(2) float, float: coordinates of the second vertex … ... ... ... nv x(nv) z(nv) float, float: coordinates of the last vertex nv+1 Tag string, Tag of the 2nd body. nv+2 nv, K, Q, mu, rho int + 4 x float: Respectively # of vertices, relative dielectric constant, quality factor, relative permeability and resistivity of the 2nd body nv+3 x(1) z(1) float, float: coordinates of the first vertex of the 2nd body … .... and so on

For example, the “background” and the “trench” of the model in Figure 3.6.7 would be written as: 500.000 antenna

0.000 20.000 0.000 10.000 Xmin Xmax Zmin Zmax

2 nbody

Background tag

4 9.000 125.170476 1.000 1000.000 nv, K, Q, mu, rho

0.000 0.000 x(1) z(1)

20.000 0.000 x(2) z(2)

20.000 10.000 x(3) z(3)

0.000 10.000 x(4) z(4)

Trench tag

4 4.500000 625.852380 1.000 10000.000 nv, K, Q, mu, rho

2.015625 0.012500 x(1) z(1)

8.046875 4.512500 x(2) z(2)

12.015625 4.512500 x(3) z(3)

18.015625 0.000 x(4) z(4)

74

Page 75: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Split-step 2-D Modelling. MATGPR offers a forward modelling utility. You can generate synthetic GPR sections with the method of Bitri and Grandjean (1998). This program imports (from disk file) a synthetic structural model prepared by function build2dmodel.m and generates matrices of the relative dielectric constant, magnetic permeability and quality factor structures. These are passed to a FORTRAN 90 MEX-file that computes the corresponding velocity structure after Bano (1996), and hence the forward model. The program will first ask you to specify a model file. It will import the model and based on the range of velocities it will calculate from the EM properties of its elements, it will compute and suggest a low (Small), Medium and high resolution (Large) grid for the synthetic radargram (Figure 3.6.13.left). It will also offer you the choice of customizing the synthetic radargram for particular requirements (e.g. simula-tion of observed data). Experience shows that the high resolution synthetic is not necessarily the best choice, as it always comes at the expense of considerable computing time. It does, however, exhibit the least amount of artefacts and aliasing. The low resolution synthetic is computed quickly and is often acceptable, but depending on the model, it occasionally exhibits artefacts and aliasing. It is quite alright for the fast assessment of your data and/or interpretation. The medium resolution synthetic is often a good compromise. However, it should be noted that the dimension of the traveltime axis often tends to be overestimated and may be safely re-duced (through customization), saving a lot of storage space and computing time. At any rate, you shouldn’t rely exclusively on the program’s suggestions and it usually pays to make a few experiments to determine the optimal parameters before setting out to work. If you choose to customize the grid, the program responds with a dialog box as per Figure 3.6.13.right. The program always suggests the use of the Medium Resolution dimensions but this is only the dummy default. You should specify the desired dimension of the scan axis (nx), depth axis (nz) and time axis (nt), as well as the sampling rate (dt). For data simulation exercises, when dt, nx and nt are fixed, it may take a few experiments to determine the optimal dimension of the depth axis (nz), i.e. the optimal depth stepping size to be used in the calculations.

Figure 3.6.13. The dialog boxes produced by the MATGPR Split-step forward modelling routine

75

Page 76: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 3: The Bottom Layer

Forward modelling requires a good deal of number crunching and all of the numerical work is carried out with an external FORTRAN-90 MEX-file. For MS Windows OS, the MEX-file is provided ready to use (radar2d.dll). For Linux OS or any other flavour of Unix, you will have to build the MEX-file from the radar2d.f90 source code provided in the directory MATGPR/analysis/mex_src. If you do not have a MEX compliant compiler and somehow lose or cannot create the MEX-file, you might wish to consider using the alternative modelling routine splitstep2dmodel.m in the folder analysis/alternative/ Splitstep_model+radar2d4.f90, together with the program radar2d4.f90; which is stand alone and takes only a FORTRAN 90 compiler to make it work.

Read documentation of relevant function

76

Page 77: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

CHAPTER 4. REFERENCES

Bano, M., 1996. Constant dielectric losses of ground-penetrating radar waves, Geophysical Journal Int., 124, 279-288.

Bitri, A. and Grandjean, G., 1998. Frequency - wavenumber modelling and migration of 2D GPR data in moderately heterogeneous dispersive media, Geophysical Prospecting, 46, 287-301.

Claerbout, J., 1996, Imaging the Earth’s Interior, Network Distribution Version, pp. 50-57 and 222-223; http://sepwww.stanford.edu/sep/prof/index.html.

Crochiere, R and Rabiner, L. R., 1983. Multirate Digital Signal Processing, Englewood Cliffs, NJ: Pren-tice-Hall, Inc.

Davis, J.L. and Annan A.P., 1989. Ground-penetrating radar for high resolution mapping of soil and rock stratigraphy, Geophysical Prospecting, 37, 531-551.

Fukunaga, K., 1990, "Introduction to Statistical Recognition", Academic Press.

Gazdag, J., 1978. Wave equation migration with the phase-shift method, Geophysics, 43, 1342-1351.

Gazdag, J. and Sguazzero, P., 1984. Migration of seismic data by phase-shift plus interpolation, Geophysics, 49, 124-131.

Grandjean, G. and Durand, H., 1999. Radar Unix: a complete package for GPR data processing, Computers & Geosciences, 25 141-149.

Karhunen, K., 1946, "Zur Spektraltheorie Stochastischer Prozesse", Ann. Acad. Sci. Fennicae, 372.

Loeve, M.M., 1955, "Probability Theory", Princeton, N.J.: VanNostrand.

Lucius, J.E. and Powers, M.H., 2002. GPR Data Processing Computer Software for the PC, USGS Open-File Report 02-166.

Smith, J. O. and Gossett, P., 1984. A flexible sampling-rate conversion method in “Proceedings of the International Conference on Acoustics, Speech, and Signal Processing” ICASSP-84, Volume II, pp. 19.4.1-19.4.2, New York: IEEE Press. Also, see expanded tutorial and associated free software at the Digital Audio Resampling Home Page: http://www-ccrma.stanford.edu/~jos/resample/

Sena, A.R., Stoffa, P.L. and Sen, M. K., 2003. Split Step Fourier Migration of Ground Penetrating Radar Data: 73th Annual Internat. Mtg., Soc. Expl. Geophys., Expanded Abstracts, 1023-1026.

Stoffa, P.L., Fokkema, J.T., de Luna Freire, R.M. and Kessinger, W.P., 1990. Split-step Fourier migration, Geophysics, 55, 410-421.

Stolt, R.H., 1978. Migration by Fourier Transform, Geophysics, 43, 23-48.

Turner, G. and Siggins, A.F., 1994. Constant Q attenuation of subsurface radar pulses, Geophysics, 59, 410-421.

77

Page 78: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

CHAPTER 5. FUNCTION DOCUMENTATION

5.1. MATGPR GUI Complementary and Data Handling Utilities

discardprocdata.m Description DISCARDPROCDATA : Utility to erase the current output data from memory. Usage OPD = discardprocdata; Requires : initdatastr.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

figuretools.m Description FIGURETOOLS: Set up a uimenu with a collection of useful tools and utilities that everybody would like to have handy, but without the full (and not always useful) complement of the MATLAB figure menu. However, if access to some util-ity of the MATLAB Figure Menu, is necessary, FIGURETOOLS provides choice to toggle it on and off. FIGURETOOLS provides for: 1. Colour map editing (specific to the current figure). 2. Zooming, panning and data inspection. 3. Exporting the figure in various graphics formats. 4. Printing the current figure. 5. Editing the current figure, axes and their children. Usage figuretools; Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

78

Page 79: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

imagecolors.m Description IMAGECOLORS: Sets up a uimenu to facilitate changing the image display colour scheme. The default colormap is JET(rainbow). Each of the menu choices changes the colormap to GREY, BONE, JET, HSV, HOT,

COOL, COPPER and Blue-white-Red colour reel. These changes are global and per-manent. In addition, there's a Blue-White-Red colour reel scaled exactly w.r.t. the

maximum and minimum values of the displayed data set, so that white will al-ways correspond to zero. This change is neither global nor permanent, but op-erates only on the particular figure where it has been applied and for as long as the figure is open, or until the colormap changes. Colormap manipulation features include:

BRIGHTEN increases the brightness. DARKEN decreases the brightness. FLIPUD reverses colour order. PERMUTE interchanges colour indices The changes apply to the current global colormap until they are reset or the colormap changes. Requires : twocolors.m, twocolorsc.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

initdatastr.m Description INITDATASTR : Initializes the Input (IPD) and output (OPD) MATGPR data struc-tures. Usage DATA = initdatastr; Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

keepprocdata.m Description KEEPPROCDATA : Utility to replace the current input data (IPD, before a proc-essing step) with the current output data (OPD, after the processing step). Usage [IPD, OPD] = keepprocdata(IPD, OPD); Requires : showinfo.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

79

Page 80: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

matgprwindows.m Description MATGPRWINDOWS : The MATGPR fast window switching service. Generates a custom "Windows" menu, which provides for fast switching between MATGPR windows. The function will display windows EXCLUSIVE to MATGPR and, moreover, only those registered with the service (see the 'setup' block below). These would nor-mally be windows with information deserving to be left on the screen for fu-ture reference (and consume memory), and not trivial stuff, as for instance dialog boxes. Usage The function will normally not be used through the command line. Although it is not mandatory, it should rather be used in the CreateFcn and DeleteFcn callbacks (on creation or destruction of a window). For example:

figure('name','My Figure','Tag','MyNewFigure', ... 'menubar','none', ... 'CreateFcn',['figuretools; imagecolors; ' ... 'matgprwindows(''setup''); ' ... 'matgprwindows(''updateadd'');'],... 'DeleteFcn',['matgprwindows(''updateremove'', '... 'findobj('Tag','MyNewFigure'));']);

MATGPRWINDOWS is a self-recursive, keyword activated routine. The activating keywords are : ‘setup’ : Initialize the service in the current figure ‘updateadd’ : After creation, add a figure's name to the "Windows" menus of all open figures (windows) ‘updateremove’ : Upon deletion, remove a figure's name from the "Windows" menus of the remaining open figures. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

showinfo.m Description SHOWINFO : The MATGPR data information processor: 1. Assembles a column cell array of strings with information about the input

data structure and its processing history. 2. Assembles information about the velocity models used for interpretation, or

derived from data analysis 3. Displays this information on the MATGPR information window using the "wel-

come.m" utility. Usage showinfo(DATA) Input DATA : the IPD or OPD data structures of MATGPR Requires : welcome.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

80

Page 81: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

welcome.m Description WELCOME: The MATGPR data information projector: 1. On startup, creates the MATGPR information window on the MATGPR GUI, window

and displays the GPL statement and disclaimer. 2. In runtime is projects on the MATGPR information window the data passed in

the string cell array "infotext". "Infotext" is normally generated by show-info.m

Usage welcome(infotext) Input infotext : A column cell array of strings. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

81

Page 82: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.2. I/O functions

concatenate.m Description CONCATENATE : Join or concatenate two or more GPR radar data sets. Unequally spaced data (no survey wheels and prior to marker interpolation) - IPD.dx is empty: This type of data can be handled but all necessary trace editing and trimming operations must be done before calling CONCATENATE. Marker trace information is preserved and the concatenated section can be subsequently interpolated to equal spacing. Equally spaced data (with survey wheels or after marker interpolation (IPD.dx assigned): All data sets must be in MATGPR (.mat) format and have the same number of samples per trace (IPD.ns), the same sampling rate (IPD.dt) and the same trace spacing (IPD.dx). Marker trace information is preserved in the resulting section, but it is advisable that trace coordi-nates (IPD.xyz) be assigned before CONCATENATE is called, otherwise IPD.xyz will be empty. For GSSI (.DZT)data, header gain manipulations must have been done before CONCATENATE is called, because IPD.DZThdgain is not preserved.

Usage concatenate('initialize'), to set up the GUI for assembling the data files to concatenate. Afterwards, the routine recurses on itself (IPD = concatenate('process') to perform the concatenation. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

initSEGYreelheader.m Description INITSEGYREELHEADER: Initialize parameters needed for exporting data in the SEG-Y Revision 1 format. These include: 1. The SEG-Y reel header structure. Field values are assigned with information passed through the input data structure DATA (== IPD), and through the ENVAR collection of global runtime variables 2. The "SEGYdataformat" structure of available data sample formats. Usage initSEGYreelheader(DATA) Note : This is not a stand-alone program but a dependency of “writesegy.m” Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

82

Page 83: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

dt1read.m Description DT1READ: Read bistatic PULSE EKKO GPR data for binary file .DT1 (ignore the header file .HD) Usage data = dt1read(filename); [data, trheaders] = dt1read(filename); Input filename : The path and name of the DT1 data file Output data : The imported 2-D GPR section trheaders: Array of data structures with the trace headers of the GPR data

(optional) Author : Luca Baradello, [email protected] Acknowledgements : Lian Zhao for info

initSEGYtraceheader.m Description INITSEGYTRACEHEADER : Initializes the SEG-Y U trace header structure "SEGY-tracehdr" and assigns some standard parameters. These are passed by the input structure DATA (which can be either IPD or OPD). Note that this is not a stand-alone program but a dependency of “writesegy.m” Usage initSEGYtraceheader(DATA) Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

initSUheader.m Description INITSUHEADER : Initializes the SU trace header structure SUHDR and assigns some standard parameters. These are passed in the input structure DATA (IPD or OPD). Note that this is not a stand-alone program but a dependency of “writesu.m” and “writesegy.m” Usage initSUheader(DATA) Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

83

Page 84: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

readdzt.m Description READDZT : Import SINGLE channel monostatic GSSI (.DZT) georadar data. Usage DATA = readdzt; [DATA, HEADER] = readdzt; Returns A structure DATA containing the GPR data and other necessary parameters and, optionally, a structure HEADER containing the header of the imported DZT data file. At present accepts only SINGLE header files and NEW style 1024 byte headers. Requires : initdatastr.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

readrd3.m Description READRD3 : Imports SINGLE channel monostatic RAMAC (.RD3) georadar data. Usage DATA = readrd3; [DATA, HEADER] = readrd3; Returns A structure DATA containing the GPR data and other necessary parameters and, optionally, a structure HEADER containing the header of the imported RD3 data file taken from the associated file *.RAD Requires : initdatastr.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

readdt1.m Description READDT1 : Imports SINGLE channel bistatic PULSE EKKO (.DT1) georadar data. Usage DATA = readdt1; [DATA, HEADER] = readdt1; Returns A structure DATA containing the GPR data and other necessary parameters and, optionally, a structure HEADER containing the information about the imported DT1 data file, as obtained from the associated header file *.HD Requires : initdatastr.m, dt1read.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

84

Page 85: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

readsegy.m Description READSEGY : Import GPR data from file stored in the SEG-Y format, either Revi-sion 0 or Revision 1. Usage DATA = readsegy; [DATA, SEGYreehdr] = readsegy; Returns A MATGPR data structure DATA containing the GPR data and the other necessary parameters and, optionally, a structure SEGYreelhdr with the reel header of the SEGY file Requires : initdatastr.m, readsuheader.m, ibm2num.m Caveat : It is not recommended to use this program as is, in order to read seismic data. For seismic data, either modify this program or use something else. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

readsu.m Description READSU : Imports GPR data and related information form file stored in the Seismic Unix format (*.SU) Usage : DATA = readsu; Returns A structure DATA containing the GPR data and other necessary parameters. Requires : initdatastr.m, initSUheader.m, readsuheader.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

readsuheader.m Description READSUHEADER : Read SU trace headers and return their content in the structure SUHDR. Note that this is not a stand-alone program but a dependency of “readsu.m” and “readsegy.m” Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

85

Page 86: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

reviewDT1headerfile.m REVIEWDT1HEADERFILE: Import and display the .HD header file associated with a .DT1 file of PULSE EKKO georadar data. Optionally return the header in a data structure HDR. Usage HEADER = reviewdt1headerfile; Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

reviewDZTheader.m Description REVIEWDZTHEADER : Import single channel GSSI (.DZT) georadar data and return a structure HDR containing the file header. Usage HEADER = reviewDZTheader Caveat At present accepts only SINGLE header files and NEW style 1024 byte headers. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

reviewRD3header.m Description REVIEWRD3HEADER : Import and display the .RAD header file associated with a .RD3 file of RAMAC georadar data (Måla Geophysics). Optionally return the header in a data structure HDR. Usage HEADER = reviewrd3header Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

reviewSEGYreelheader.m Description REVIEWSEGYREELHEADER: Import and display the reel header of a SEG-Y data file. Optionally return the header in a data structure HDR. Usage HEADER = reviewSEGYreelheader; Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

86

Page 87: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

writesegy.m Description WRITESEGY : Export GPR data to SEGY Revision 1 format. Usage writesegy(DATA) Input DATA : A MATGPR IPD or OPD data structure. Requires : initSEGYreelheader.m, initSEGYtraceheader.m, num2ibm.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

writesu.m Description WRITESU : Export GPR data and related information to Seismic Unix format (.SU) Usage writesu(DATA); writesu(DATA,SUfile); Input DATA : The IPD or OPD data structures of MATGPR SUfile : Optional! The destination SU file name if known or predetermined.

Otherwise the routine will enquire the output file name. Requires : initSUheader.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

87

Page 88: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.3. Display and Data Inspection Utilities

getattenuation.m Description Computes the analytic signal for all traces in the GPR section, hence

their instantaneous power. Computes the median and a mean attenuation function, i.e. respectively

the median and mean instantaneous power of all traces in the section. Computes best fitting models for power-law and exponential attenuation

based on the median attenuation function. Optionally displays the attenuation functions and the best fitting

power-law and exponential decay models. Usage [p, e, attn] = getattenuation(d, tt2w, do_plot, do_model) Input d : [ns x ntr] data array (GPR section) tt2w : [1 x ns] vector of the 2-way traveltime do_plot : Keyword. = 'no_plot' : Do not display the attenuation curves and best fitting models = anything else or absent : Display the attenuation curves and best fitting models do_model : Keyword. = 'no_tpow' : Do not compute the best fitting power-law attenuation model = 'no_expow': Do not compute the best fitting exponential attenuation model = anything else or absent : Compute the best fitting attenuation models Output p : [1 x 2] vector, the best fitting power-law attenuation model. Defaults to [NaN NaN] if do_model = 'no_tpow'. e : [1 x 2] vector, the best fitting exponential attenuation model. Defaults to [NaN NaN] if do_model = 'no_expow' attn : [ns x 2] vector holding the median attenuation (1st column) and the mean attenuation (2nd column). Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

88

Page 89: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

instattributes.m Description Computes instantaneous attributes of GPR sections. These are the: 1. Instantaneous amplitude, 2. Instantaneous phase in [-90, 90], 3. Instantaneous phase in [-180, 180], 4. Unwrapped (continuous) phase, and 5. Instantaneous frequency. Usage dinst = instattributes(din, dt, attribute) Input din : the 2-D GPR section dt : the sampling rate attribute : Keyword. Selects attribute with one of: 'amplitude' for instantaneous amplitude (envelope) 'atan' for instantaneous phase in [-90, 90] 'atan2' for instantaneous phase in [-180, 180] 'unwraped' for continuous instantaneous phase 'ifreq' for instantaneous frequency Output dinst : the resulting instantaneous attribute Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

markerdisplay.m Description Plots the location of Marker Traces on the "GPR DATA" figure Usage markerdisplay(d, x, markertr) Input d : The GPR section of size [ns, ntr] x : [1 x ntr], vector of the horizontal dimension in data units, usually distance. markertr : The locations of the Marked Traces Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

89

Page 90: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

viewdata.m Description VIEWDATA : Scaled image or wiggle displays of GPR data. This program is mainly intended for use within the MATGPR package. The data can also be viewed independently with the simpler non-gui programs imagedisplay.m and wiggledisplay.m Usage viewdata(x, t, d, content, xlab, zlab) viewdata(x, t, d, content) Input x : the horizontal dimension in data units, usually distance t : the vertical dimension in data units, usually time d : the matrix (GPR section). xlab : x-axis label zlab : z-axis label. content : keyword - content of the figure. 'indata' for the current IPD, before the next processing step. 'outdata' for the current OPD, after the last processing step. The following global runtime variables are also required and are passed by the structure ENVAR: ENVAR.DisplayOption : Method of display. Keyword with values 'image', 'wiggle', 'vararea', ‘wig&img’, ‘var&img’ ENVAR.wigglescale : factor controlling the scale of the wiggles in wiggle-trace displays ENVAR.maxwigs : the maximum number of wiggle traces to be shown ==> If ENVAR is not assigned, the runtime variables default to: ENVAR.DisplayOption = 'image'; ENVAR.wigglescale = 1; ENVAR.maxwigs = 100; Requires : wiggledisplay.m, imagecolors.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

90

Page 91: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

viewtraces.m Description VIEWTRACES : Visualize and inspect the columns (traces) of a GPR data array. Uses a GUI to scan through the traces and facilitates scrutiny of any individ-ual trace with appropriate graphics tools. This utility is primarily intended for use with MATGPR but can also be employed independently. Usage viewtraces(dt, dx, d, content) Input d : the observed radargram (IPD.d or OPD.d) dt : the sampling rate (IPD.dt or OPD.dt) dx : trace spacing in m (IPD.dx or OPD.dx) content : keyword - content of the figure. 'indata' for the current data before the next processing step. 'outdata' for the 'indata' after the last processing step. => The input and output data can be viewed simultaneously with different instances of VIEWTRACES => To employ independently of MATGPR, use any one of the two keywords. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

viewspectra.m Description VIEWSPECTRA : Visualize and inspect of the frequency spectra of the columns (traces) of a GPR data array. Uses a GUI to scan through the traces and fa-cilitates scrutiny into the spectrum of any individual trace with appropriate graphics tools. This utility is primarily intended for use with MATGPR but can also be employed independently. Usage viewspectra(dt,d,content); Input d : The observed radargram (IPD.d or OPD.d) dt : is sampling rate (IPD.dt or OPD.dt) dx : is the trace spacing in m (IPD.dx or OPD.dx). content : keyword - content of the figure. 'indata' for the current data before the next processing step. 'outdata' for the 'indata' after the last processing step. => The input and output data can be viewed simultaneously with different instances of VIEWSPECTRA => To employ independently of MATGPR, use any one of the two keywords. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

91

Page 92: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

wiggledisplay.m Description WIGGLEDISPLAY : Wiggle/variable area/image or combined plot of GPR (or seis-mic) data. Also has the capability of projecting a colour-scale image of the data beneath the wiggles. Usage wiggledisplay(Data, dmax, t, x, style, showmax, wscale); Input Data : [ns,ntr ] matrix of the GPR or seismic section x : [1, ntr] vector of the horizontal (spatial) trace coordinates t : [1, ns] vector of the time coordinates - MUST BE ROW VECTOR for wiggledisplay to work properly. style : 'vararea' creates variable area plots 'wiggle' creates wiggle-trace plots 'wig&img' creates wiggle / image plots (shows data image beneath wiggles) 'var&img' creates variable area / image plots (shows data image beneath wiggles) showmax : scalar, max number of traces to display. Default = 100. wscale : scaling factor, can be set empty!. Optimize by trial and error Credits Several programming tips taken from the M-code of an unknown author, presumably Thomas Mejer Hansen of the Niels Bohr Institute for Astronomy, Physics and Geophysics, University of Copenhagen, Denmark. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

92

Page 93: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.4. Data Editing and Basic Processing Utilities

dewow.m Description Eliminates wow by applying a zero-phase high pass FIR filter with cutoff at 2% of the Nyquist Usage dwow = dewow( d ); Input d : the 2-D GPR section Output dwow : the reduced GPR section Requires : fir_f1.m, fir_f2.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

equalize.m Description Equalizes traces by making the sum of the absolute values of all samples in a trace the same for all traces. For instance, if the trace that is selected to be used for equalization has a sum of all absolute values of 1000 (base = 1000), then the sum of absolute values of every trace in the data set will be set to 1000 using a multiplying factor. The routine initializes a GUI, in which the user specifies the trace which will be used as the BASE. This can be: a) the first trace; b) the mean (average) trace; c) the median trace; d) the n'th trace (i.e. any trace); e) Any positive number (base value). Then, it will process the data via the function handle callback "eqlz". The reduced data set returns from "eqlz" by means of an interim global variable that are kept strictly within the scope of "equalize". The interim variable are copied onto the output variables just before "equalize" returns. Usage deq = equalize( d ) Inputs d : The [ns x ntr] GPR data array Outputs deq : The equalized-trace GPR data array Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

93

Page 94: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

editscanaxis.m Description Reduces the size of the GPR data array by discarding groups of traces at the beginning or at the end of the section’s scan axis (scanline). It is also used to extract groups of traces or even large parts of the section to a separate data set. The routine initializes a GUI, in which the user specifies the de-sired operation (e.g. trim, or extract, input mode). Then, it will process the data via the function handle callback "edt". The reduced data set returns from "edt" by means of interim global variables that are kept strictly within the scope of "editscanaxis". The interim variables are copied onto the output variables just before "editscanaxis" returns. Usage [d_out,x_out,ntr_out,markertr_out,xyz_out] =

editscanaxis(d, x, dx, markertr,xyz) Input d : The [ns x ntr] GPR data array x : The [1 x ntr] scan axis coordinate vector dx : The trace spacing in meters markertr : Array holding ID numbers and coordinates of the control (marker) traces. xyz : Data structure with fields: xyz.Tx : [ntr x 3] array with the X, Y and Z coordinates of the

source antenna in a local frame of reference. For monostatic GPR systems (zero-offset data) xyz.Tx = xyz.Rx

xyz.Rx : [ntr x 3] array with the X, Y and Z coordinates of the re-ceiver antenna in a local frame of reference. For monostatic GPR systems (zero-offset data)xyz.Rx = xyz.Tx

Output d_out : The trimmed GPR data array x_out : The trimmed scan axis coordinate vector ntr_out : The new dimension of the scan axis and horizontal dimension of "d_out". markertr_out : Array with updated data on marker traces xyz_out : The structure of trimmed source and receiver coordinates Requires : checkcomma.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

94

Page 95: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

removedc.m Description Subtracts the DC component (arithmetic mean) from each trace of the GPR sec-tion Usage ac = removedc( d ); Input d : the 2-D GPR section Output ac : the reduced GPR section Copyright (C) 2006, Andreas Tzanis, all rights reserved

95

Page 96: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

sigposition.m Description Determine and adjust for the vertical position of the surface reflection, i.e. the place in time where the radar pulse leaves the antenna, and enters the subsurface (true time-zero of the trace) Usage [dsp, ns_new, tt_new ] = sigposition('begin',dt,dx,d); This is a multiple-entry program, recursively calling itself. Always

launch the function with keyword action = 'begin'. Input d : The (ns x n) GPR section dt : The sampling rate dx : The trace spacing in m (empty if traces are unequally spaced). action : is a keyword. This is a multiple-entry recursive program. Each entry is activated by a keyword. The keywords are pre-programmed. For manual operation, always launch with action = 'begin'. Output dsp : (ns_new x n) matrix of the adjusted radargram ns_new : is the new value of ns (samples per scan) tt_new : The updated vector of time coordinates (2-way traveltime) Requires: viewtraces.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

trimtimewindow.m Description TRIMTIMEWINDOW: Trims the late times of the time window Usage [d_out,t_out,ns_out] = trimtimewindow(d,t,dt,ns) Input d : The 2-D GPR data matrix t : The vector of time coordinates (2 way traveltime) dt : The sampling rate in ns ns : The dimension of t, equal to the column dimension of "d". Output d_out : The trimmed GPR data matrix t_out : The trimmed vector of time coordinates ns_out : The new dimension t_out and d_out Requires : checkcomma.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

96

Page 97: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

scanlineresample.m Description Driver for routine RESAMPLE1.M - changes the spatial sampling rate (trace spacing) of the GPR section help in the array “d”. Usage [dout, dxout, ntrout] = scanlineresample(d, dx) Input d : Input 2-D GPR data dx : Trace spacing in m x : Trace locations along the scan line Output dout : The resampled GPR data dxout : The update sampling rate xout : The updated trace location vector ntrout : The number of traces dout Requires : resample1.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

timeresample.m Description Driver for routine RESAMPLE1.M - resamples the traces of the 2-D GPR data ar-ray “d” at a higher or lower rate. Usage [dout, dtout, nsout] = timeresample(d, dt) Input d : input 2-D radargram (IPD.d) dt : input sampling rate (IPD.dt) Output dout : the resampled radargram (OPD.d) dtout : the sampling rate in dout (OPD.dt) nsout : the # samples in dout (OPD.ns) Requires : resample1.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

97

Page 98: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

removebadtraces.m Description REMOVEBADTRACES : Pick bad traces by pointing and clicking and replace them with the interpolants computed from their near neighbours. Note, however, that because it uses interpolation, this function works best for isolated bad traces, or small clusters adjacent bad traces. In the latter case the clusters should better be separated by extended groups of consecutive good traces. For the same reason, this function is not recommended for removing extended groups of bad traces, as it will probably fail to produce reliable interpolants. Usage [dout, bad] = removebadtraces(x,t,d); dout = removebadtraces(x,t,d); Input d : The [ns x ntr] GPR data section t : [1 x ns] vector of time coordinates (2 way traveltime) x : [1 x ntr] vector of scan axis coordinates Output : dout : The [ns x ntr] GAPR section without bad traces bad : Vector holding the sequential numbers of bad traces Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

98

Page 99: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.5. Gain manipulation functions

gainagc.m Description AGC : Apply Automatic Gain Control to the traces of a GPR section by scaling the amplitude of the data at the centre of the sliding window with respect to the RMS amplitude of the window. Usage dagc = gainagc( d, dt ) Input dt : time sampling interval d : 2-D GPR section Output dagc : The agc'ed GPR section Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

gaingagc.m Description GAGC : Apply Automatic Gain Control to the traces of a GPR section by scaling the amplitude of the data at the centre of a Gaussian bell tapered sliding window with respect to the RMS amplitude of the window. Usage dagc = gaingagc( d, dt ) Input dt : sampling interval d : the input GPR section Output dagc : the amplified section Credits This function was transcoded and modified from the SU function do_gagc appear-ing in program sugain. Credits to CWP, Jack K.Cohen, Brian Sumner, and Dave Hale Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

99

Page 100: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

gainrmdzthdr.m Description GAINRMDZTHDR : Remove gain from GSSI (DZT) data using the range-gain information supplied in the header. Usage dg = rmdzthdrgain(d, DZThdgain ) Input d : the GPR section DZThdgain : the DZT header gain function in db Output dg : the output section (same size as d); Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

gaintpow.m Description GAINTPOW : Multiplies the columns (traces) of the input data matrix with a gain function of the form g(t) = scale * t^pow. The exponent "pow" is requested from the user. However, the program uses

function "getattenuation.m" to compute the attenuation characteristics of the data and determine a best fitting model, suggesting the resulting "pow" to the user. This is, usually, a nearly optimal solution, but experimentation may provide a result more suitable for some particular data or requirements. The attenuation characteristics and the best fitting power-law model can be

visualized by running "getattenuation" as: getattenuation(d, traveltime); The "scale" is computed automatically, so as to preserve the amplitude

range values of the input data (compensate for the effects of "t^pow"). Usage [dtpow, scale, pow] = gaintpow( d, dt ); Input d : [ns x ntr) input data array (GPR section). traveltime : [1 x ns] two-way traveltime vector. Output dtpow : The output (amplified) data array scale : The scale factor in the equation g(t) = scale * t^pow. pow : The exponent in the equation g(t) = scale * t^pow. Requires : getattenuation.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

100

Page 101: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.6. Marker interpolation functions

editmarkers.m Description EDITMARKERS : Utility to edit the marker trace information created on import-ing a DZT or RD3 raw data file and to augment it with the co-ordinates of the marker trace locations. For GPR systems without survey wheels, this info may be used for marker interpolation to equal spacing and for topographic /static corrections. It may also be used for creating 3-D data volumes. Usage markertr_out = editmarkers(markertr_in,Inpname,Infname,action) Input markertr_in : Column vector with marker trace ID numbers, or [ n x 4 ] matrix with each column representing the ID numbers and X, Y, Z coordinates of marker traces in a local frame of reference Inpname : String, the path of the input data file. Used for exporting the marker trace matrix to a disk file. Infname : String, the name of the input data file. Used for exporting the marker trace matrix to a disk file. action : String, keyword = 'editmode' invokes an in-house basic text editor in the form of a large edit box. = 'runmode' uses interactive data input by means of dialog boxes Output markertr_out: Column vector or [ n x 4 ] matrix with marker coordinates in a local frame of reference Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

101

Page 102: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

interpxyz.m Description INTERPXYZ : Generate x, y and z trace coordinates with respect to a local (survey) reference system, by interpolating between the known coordinates of control (marker) traces. The X, Y and Z coordinates of the control traces are passed as arguments or read from a disk (marker) file. The traces of the input radargram must be equally spaced. The output x, y and z data is equally spaced in only one of the x or y axes, (independent coordinate), chosen to be the longest monotonically varying dimension. However, the spacing of h = sqrt(x^2 + y^2) is roughly equal to the trace spacing. Usage xyz = interpxyz(dx, ntr, markertr) Input dx : Trace spacing of the input radargram data. (empty if data not equally spaced). ntr : the number of traces in the input radargram. markertr : [n x 4 ] matrix with the coordinates of control (marker) traces: The columns respectively are the id numbers of control traces and their x, y and z coordinates in a local frame of reference. Output xyz : Trace coordinates in a local frame of reference Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

102

Page 103: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

markerinterp.m Description MARKERINTERP : Marker Interpolation from GPR traces equally spaced in time to traces equally spaced in distance. If the section was recorded in a direction reverse with respect to the

positive axes of coordinate system, (for instance when the survey is conducted in meandering forward - backward sense), the section is flipped, and so are the marker trace data. This streamlines the transformed section with the axes of the reference frame. Usage [di,ntri,dx,markertr,scanline] = markerinterp(d, markertr, Inpname, Infname) Input d : the 2-D GPR section to be transformed from equal time spacing to equal-distance spacing markertr : [n x 4 ] array with the coordinates of control (marker) traces: The columns respectively are the id numbers of control traces and their x, y and z coordinates in a local frame of reference. Inpname : The path of the GPR data file Infname : The name of the GPR data file Output di : The transformed (equidistant trace) GPR section ntri : The number of traces in the transformed radargram dx : Trace spacing in the transformed radargram (in m) markertr : [n x 4 ] array of updated marker trace information scanline : ntri row vector of equally spaced trace coordinates along the Scan Line Requires : checkcomma.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

103

Page 104: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.7. Smoothing and Filtering Utilities

f_filter.m Description F_FILTER : Design and apply FIR frequency filters Usage : [dff, Ws] = freq_filter(scanaxis, d, dt, filtertype, design_option) Input scanaxis : Vector of the space coordinates of traces along the scanaxis (need not be equally spaced); d : 2-D array of distance vs time input data; dt : Sampling interval; filtertype : flag determining the type of the filter = 1 Low-pass filter = 2 High-pass filter = 3 Band-pass filter = 4 Band-stop filter design_option : keyword determining how the filter will be designed. = 'TESTTR' : Use a test trace. Point and click on some test trace, then define the cut-off frequency(ies) using the spectrum of a test trace as a template, also by pointing and clicking. = 'MEANTR' : Compute the mean (average) trace, then define the cut-off frequency(ies) by pointing and clicking, using the spectrum of the mean trace as template. = 'TYPEIN' : Enter predefined filter characteristics through dialog boxes. Output dff : 2-D array of filtered data Ws : The cutoff frequency (filtertype = 1 or 2), or, the pass / stop bands (filtertype = 3 or 4). Requires : fir_f1.m, fir_f2.m and checkcomma.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

104

Page 105: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

fk_filter.m Description FK_FILTER : Design and apply an F-K filter. There are three options: Zone pass / zone stop filtering: This works like a band pass or band re-

ject filter. A polygonal zone is defined graphically, by pointing and clicking at the desired positions on the F-K spectrum map. "Zone pass" means that ONLY the spectral contributions IN and ON the sides of the zone will be retained. "Zone stop" means that ONLY the spectral contributions OUTSIDE the zone will be retained. Velocity range pass / stop (velocity-fan filtering): The [upper lower]

negative, and [lower upper] positive apparent velocity limits are defined by means of a dialog box. "Velocity range pass " means that spectral contribu-tions within the [lower upper] apparent velocity range will be retained. "Ve-locity range stop" means that the spectral contributions outside the [lower, upper] apparent velocity range will be retained. Up-dipping / down-dipping event separation: This stops an entire F-K quad-

rant passing the other, thus rejecting reflections with positive (up-dipping) or negative (down-dipping) slopes. A necessary condition for the application of the F-K filter is that the

traces are equally spaced. Usage [dfk, fktype, vrange] = fk_filter(d, dt, dx) Input d : The 2-D input data matrix (GPR section) dt : Sampling rate along columns (time-dimension) dx : Sampling rate along rows (trace spacing in the space dimension) Output dfk : The F-K filtered data matrix (GPR section) fktype : Flag indicating the type of filtering performed. vrange : Two-column matrix containing the vertices of the polygonal pass / stop zones when fktype = 1, 2, or, the velocity pass / stop ranges when fktype = 3, 4 (fan filtering). Returned as an empty variable when fktype = 5, 6 (up-dipping / down-dipping event separation). Requires : isinpoly.m (for MATLAB R12 and earlier). Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

105

Page 106: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

k_filter.m Description K_FILTER : Design and apply FIR frequency filters. This routine is exactly the same as f_filter.m, only that it operates line-wise instead of column-wise, thus filtering wavenumbers instead of traces (time series). Usage [dkf, Ws] = k_filter(tt,d,dx,filtertype,design_option) Input tt : Time co-ordinates d : 2-D array of distance vs time input data ; dx : Trace spacing (constant along the scan line); filtertype : flag determining the type of the filter; = 1 Low-pass filter = 2 High-pass filter = 3 Band-pass filter = 4 Band-stop filter design_option : keyword determining how the filter will be designed. = 'TESTTR' : Use a test line. Point and click on some test line, then define the cut-off wavenumber(s) using the spectrum of the test line as a template, also by pointing and clicking. = 'MEANTR' : Compute the mean (average) scanline, then define the cutoff wavenumber(s) by pointing and clicking, using the spectrum of the mean line as template. = 'TYPEIN' : Enter predefined filter characteristics through dialog boxes. Output dkf : 2-D array of filtered data Ws : The cutoff frequency (filtertype = 1 or 2), or, the pass / stop bands (filtertype = 3 or 4). Requires : fir_f1.m, fir_f2.m and checkcomma.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

106

Page 107: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

karhunenloeve.m Description KARHUNENLOEVE : Karhunen Loeve filtering to enhance the lateral coherence of GPR events. Uses "svds" to compute the P largest singular values and associ-ated singular vectors of the input data. The KL transform is re-synthesized from the first P singular values /vectors and is a low-dimensional (smooth) approximation of the input data. Usage dout = = KarhunenLoeve(d) Input d : The input (full dimensional) data matrix (GPR section) Output dout : The low-dimensional approximation to the input data "d" (smoothed GPR section). P : Size of the approximating low-dimensional sub-space. Requires : checkcomma.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

mmfilter.m Description MMFILTER : Applies a 1-D or 2-D spatial smoothing filter by sliding a user de-fined 2-D window over a 2-D data wall. The data corresponding to the central element of the window is substituted by the mean or median of the window data. Zero padding equal to 1/2 the window length is applied, therefore the edges of the output data are expected to be distorted. For the sake of speed, the computations are usually performed in a FORTRAN

90 MEX-file (DLL in MS Windows) but the (much slower) native MATLAB code is also included and will step in, if the MEX-file is not available. Usage [dmf, fdim] = mmfilter( d, fmode ) Input d : The 2-D data matrix (GPR section) fmode : "medifilt" : Keyword invoking the median filter mode. "meanfilt" : Keyword invoking the mean filter mode Output dmf : The smoothed (filtered) data matrix fdim : [2 x 1] vector, the dimensions of the filter window Uses : FORTRAN'90 MEX function "mfiltr.<mex>" with source code "mfiltr.f90", and the attached subfunction "domfiltr". Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

107

Page 108: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

predc.m Description PREDC : Predictive deconvolution of the data passed in the 2-D matrix d. The program inquires the operator length, prediction distance and percent prewhit-ening, then designs and applies a deconvolution filter to each trace sepa-rately. The entire trace is used in computing the auto-correlation function. Operator (filter) length must be smaller than 1/2 trace length. The lag must be smaller than operator length. Length and lag are given either in actual time units (ns) or in number of samples. Usage [dout, nf, lp] = predc(d, dt) Input d : [ns x ntr ] matrix of the GPR data (section) dt : Sampling rate in nanosecs Output dout : The [ns x ntr ] deconvolved GPR section nf : Length of the prediction filter used in # samples lp : Prediction distance in # samples. Requires : checkcomma.m Depends on:toeplitz.m - constructs Toeplitz matrix, MATLAB core pinv.m - pseuodoinverse, MATLAB core Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

rmbackgr.m Description Remove a global background trace from the GPR section passed with "d". The background trace is the average trace determined by adding all traces together and dividing by the number of traces. Usage dbg = rmbackgr( d ) Input d : the input GPR section Output dbg : the reduced GPR section Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

108

Page 109: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

rmswbackgr.m Description RMSWBACKGR : Removes a sliding-window background trace to reduce subhorizontal features Usage [dsbg, ww] = rmswbackgr( d ) Input d : is the input GPR data matrix Output dsbg : The filtered data matrix ww : The width of the sliding window Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

rmswforegr.m Description RMSWFOREGR : Removes a sliding-window foreground trace from the 2-D GPR sec-tion passed in d, to reduce dipping features. Usage [dsfg, ww] = rmswforegr( d ) Input d : the 2-D GPR data matrix Output dsfg : The filtered data matrix ww : The width of the sliding window Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

109

Page 110: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.8. Velocity Analysis and Imaging Utilities

fitdiffractionhyperbola.m Description FITDIFRACTIONHYPERBOLA : Interactively fit a diffraction front hyperbola to common-offset GPR data. Simple approximation to the problem of fitting a dif-fraction front hyperbola, assuming non-dispersive propagation in a uniform halfspace and point diffractors, or finite sized targets of circular cross section! Parameters involved in are the halfspace velocity, the radius of the target and the coordinates of its centre (depth and location in the scan line). The parameters can be changed interactively, by means of slider rules. Fitting is done with the eye and thus depends on the experience of the user. The function returns the halfspace velocity as a global runtime variable. Usage fitdiffractionhyperbola(DATA) Input DATA : the MATGPR data structure (IPD or OPD) Returns vhalfspace : the velocity of the halfspace as a global variable. Requires : hyperbola.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

110

Page 111: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

gazdagmig.m Description GAZDAGMIG : Gazdag phase-shifting migration for constant or layered velocity structures. For the sake of speed, the construction of the image is usually performed

with the FORTRAN '90 MEX-file "gazdag.f90". For MS Windows OS, the MEX-file is provided ready to use (gazdag.dll). For Linux OS or any other flavour of Unix, the MEX-file should be built by the user. At any rate (very much) slower na-tive M-code to perform the same tasks is attached in the sub-functions "gaz-dagcv" and "gazdaglv". This will take over if the MEX-file is not available. Usage dmig = gazdagmig(d, dt, dx, vofh) Input d : The zero- or common-offset GPR section dt : The sampling rate dx : The trace spacing (spatial sampling rate) vofh(n,2): The 1-D velocity model of "nlay" velocity - thickness pairs, for example: [ 0.1 1 ; ... 1st layer 0.08 2 ; ... 2nd layer ... 0.18 0 ] ... n'th layer==basal halfspace. A uniform halfspace is given as a single layer stucture with zero thickness. Velocity values are given in m/ns and thicknesses in m. Output dmig : The migrated GPR section Requires : yxtoxy.m Uses The FORTRAN'90 MEX function "gazdag.<mex> with source code "gazdag.f90", and the attached sub-functions "do_gazdagcv" and "do_gazdaglv" Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

111

Page 112: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

get1dvelocity.m Description GET1DVELOCITY : Imports 1-D velocity models for passing to 1-D migration and modelling routines. The models can be imported from file or typed in. The structure of the model is: NLAY [Velocity, layer 1 Thickness, layer 1; Velocity, layer 2 Thickness, layer 2; ... ... ; Velocity, layer NLAY-1 Thickness, layer NLAY-1; Velocity, basal halfspace 0 ]; The thickness of the basal halfspace is always equal to zero! A uniform halfspace is introduced as a 1-layer velocity model with a

thickness equal to zero. Basic error checking (e.g. for velocities exceeding the speed of light in

free space) is done before the routine returns. Usage vofh = get1dvelocity Returns vofh : The 1-D velocity / thickness model Requires : checkcomma.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

hyperbola.m Description HYPERBOLA : Calculate a diffraction front hyperbola for a simple object, - point diffractor, (quasi)cylinder or )quasi)sphere - assuming that it is embedded in a non-dispersive uniform halfspace (constant velocity). Usage [scanline,tt2w] = hyperbola(xstart,xstop,TxRx,x,d,r,v) Input xstart: First point on the scan line to (in meters); xstop : Last point of the scan line (meters); TxRx : Source - Receiver offset; x : Location of the centre of the object relative to xstart (in m) d : Depth to the centre of the object (in m) r : Object radius (in m) v : Velocity (in m/ns) Output scanline : Coordinates of the midpoint between Tx and Rx offset tt2w : 2-way traveltime (hyperbola) Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

112

Page 113: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

get2dvelocity.m Description GET2DVELOCITY : Imports (from disk file) a synthetic structural model prepared by function build2dmodel.m and returns the corresponding velocity structure. The return variable is a cell array containing: 1. The non-dispersive term of the 2-D phase velocity model with values expressed in m/ns, computed after Bano (1996, Geophys. J. Int., 279 - 288). 2. The 2-D quality factor of the model structure. 3. Antenna central frequency (a scalar). * The antenna frequency and the quality factor will be useful in incorporating the frequency dependence of the phase velocity (dispersion) in 2-D Split-step Fourier depth migration, (and future implementations of other 2-D spectral domain migration methods), also in the sense of Bano (1996). Usage [v2d, zv, dzmig] = get2dvelocity(ns, dt, ntr, dx) Input ns : The vertical dimension of the GPR section, equal to the number of samples per trace. ntr : The horizontal dimension of the GPR section, equal to the number of traces. dx : The trace spacing. Output v2d : {1 x 3} Cell array containing: 1. v2d{1} : [ns x ntr] array, the non-dispersive term of the velocity model. 2. v2d{2} : [ns x ntr] array, the quality factor of the the 2-D model. 3. v2d{3} : Scalar, float, antenna central frequency. zv(ns) : The z-coordinate axis of the velocity model. dzmig : The depth stepping to be used for depth migration. Requires : checkcomma.m, isinpoly.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

113

Page 114: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

migpspi.m Description MIGPSPI : Gazdag's phase-shift plus interpolation migration for zero-offset data, with lateral velocity variation. This is actually a driver for program, SUMIGPSPI of the Seismic Unix suite. The required velocity model has been cre-ated with "get2dvelocity.m". MIGPSI does the following: 1. Exports the GPR section to an interim SU file and the velocity model to an interim SU compatible file, both in the system’s temp directory. 2. Executes SUMIGPSPI which generates an interim SU results file, also in the system’s temp directory. 3. Imports the results file and creates the output data. 4. Deletes all the interim files. Usage [dmig, zmig, nz] = migpspi(IPD, v2d, zv, dzmig) Input IPD : the current input data structure. The field IPD.d is the [ns x ntr] GPR data matrix (section). v2d : The velocity structure. ** If v2d was prepared by "get2dvelocity.m", then it is a {1 x 3} cell array structured as follows: 1. v2d{1) : [ns x ntr] array, the non-dispersive term of the velocity model. 2. v2d{2} : [ns x ntr] array, the quality factor of the 2-D model. 3. v2d{3) : Scalar, float, antenna central frequency. ** If v2d was not prepared by "get2dvelocity.m" but still is a cell array with less than 3 sub-array elements, then v2d{1} must be the [ns x ntr] non-dispersive term of the velocity model. ==> IN BOTH CASES ABOVE, ONLY v2d{1} IS NEEDED AND KEPT BY MIGPSPI! ** If v2d is a single matrix, provided by the user, then it must be the [ns x ntr] non-dispersive term of the velocity model. zv : z coordinate for the velocity model dzmig : depth spacing (integration stepping size) Output dmig : [nz x ntr] array, the depth migrated GPR section. zmig : [nz x 1] vector, the depth coordinates of the migrated section. nz : The vertical dimension of dmig == dimension of zmig Requires : checkcomma.m Important Note The MS Windows executable SUMIGPSPI.EXE was created with the DJGPP Windows XP edition of the GNU GCC suite, created by DJ Delorie. This is provided together with MATGPR. In Linux OS, and all other flavours of Unix, the users must pro-vide their own copy of the "SUMIGPSPI" executable. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

114

Page 115: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

staticsgui.m Description STATICSGUI: Interface and driver for program "static.m", to do topographic corrections. The routine initializes a GUI, in which the user will specify the velocity of the weathering and subweathering layers to be used in the topog-raphic correction, the sense of the correction (up or down), and the elevation datum in which to refer the reduced GPR section. Then, it will drive the rou-tine "static.m" via the function handle callback "stc". The statics-corrected section returns from "stc" by means of an interim global variable that is kept strictly within the scope of "staticsgui". The interim variable is copied onto the output variable just before "staticsgui" returns. Input d : (m x n) matrix of the observed data (GPR section); dt : Sampling rate (in ns) xyz_Tx : [n x 3] array with the X, Y and Z coordinates of the source antenna

in a local frame of reference. For monostatic GPR systems (zero-offset data) xyz_Tx = xyz_Rx

xyz_Rx : [n x 3] array with the X, Y and Z coordinates of the receiver antenna in a local frame of reference For monostatic GPR systems (zero-offset data) xyz_Rx = xyz_Tx

Output dstc : (m x n) matrix of the statics-corrected data Requires : static.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

115

Page 116: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

static.m Description STATIC : Apply topographic corrections to single- and zero-offset GPR data Usage dstcorr = static(d,dt,xyz_Tx,xyz_Rx,sdel,wv,swv,direction) Input d : The input [ns x ntr] GPR section dt : Sampling interval xyz_Tx : [ntr x 3] array with the X, Y and Z coordinates of the source an-

tenna in a local frame of reference. For monostatic GPR systems (zero-offset data) xyz_Tx = xyz_Rx

xyz_Rx : [ntr x 3] array with the X, Y and Z coordinates of the receiver antenna in a local frame of reference For monostatic GPR systems (zero-offset data) xyz_Rx = xyz_Tx

wv : Weathering layer velocity swv : Subweathering layer velocity sdel : Datum elevation for the source (Tx) antenna. direction : The sense of correction. = -1 shift down in time (default) = 1 shift up in time Output dstcorr : [ns, ntr] GPR section reduced for topography. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

116

Page 117: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

splitstepmig.m Description SPLITSTEPMIG : Split-step Fourier depth migration. Depending on the user's input, this routine may, account for the frequency

dependence of the phase velocity (dispersion). This is done with the approach of Bano (1996, Geophys. J. Int., 279 - 288), whereby the phase velocity depends on a non-dispersive term Vo and an exponential correction: V(w) = Vo*(w / wc)^p, p = (1 - n)/2, n = (2/pi)*atan(Q), where w is the ang. frequency, wc is the antenna central frequency, and Q is the quality factor. * Both the layer reference velocity and layer perturbation velocities are reduced for frequency dependence in the F-domain. To account for dispersion effects, introduce the velocity structure "v2d"

as a {1 x 3} cell array, with sub-array elements {Vo Q antenna_frequency} in this order. If the velocity structure "v2d" is introduced as a cell array with fewer

than 3 elements, or as a single matrix, the routine will use only the non-dispersive term Vo. Usage [dmig, zmig, nz] = splitstepmig(d, dt, dx, v2d, zv, dz) Input d : The [ns x ntr] array of the equally-spaced GPR section dt : The sampling rate in the ns dimension (in nanosecs) dx : Trace spacing in the ntr dimension (in m). v2d : The velocity structure. ** If it is a {1 x 3} cell array it must be structured as: 1. v2d{1) : [ns x ntr] array, the non-dispersive term of the velocity model. 2. v2d{2} : [ns x ntr] array, the quality factor of the 2-D model. 3. v2d{3) : Scalar, float, antenna central frequency. ** If v2d is a {1 x 1} or a {1 x 2} cell array, then v2d{1) must be the [ns x ntr] non-dispersive term of the velocity model. ** If v2d is a single matrix, then it must be the [ns x ntr] non-dispersive term of the velocity model. zv : [ns x 1] vector, the z-coordinates of the velocity model. dz : Depth spacing used for integration (stepping size). Output dmig : [nz x ntr] array, the depth migrated GPR section. zmig : [nz x 1] vector, the depth coordinates of the migrated section. nz : The vertical dimension of dmig == dimension of zmig Uses Attached subfunction "tofk.m" : Performs F-K transform Attached subfunction "cosbel.m" : Cosine-tapered boxcar window Requires : checkcomma.m Credits : Some programming tips were taken from the split-step migration routine by G.F. Margrave, CREWES Project, U. of Calgary, 1996. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

117

Page 118: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

stoltmig.m Description STOLTMIG : Compact implementation of Stolt's F-K migration for uniform or lay-ered velocity structures. The program uses Stolt stretching to accommodate non-uniform (layered) velocity structures, while the actual migration code was built with tips from Jon Claerbout's implementation of the Stolt algorithm (see Imaging the Earth's Interior, 1996, pp 55-57). However, in contrast to his sequential RATFOR programming, this implementation is fully vectorized and fast enough, so as to compete with compiled Fortran or C Stolt migration rou-tines. Usage dmig = stoltmig(d, dt, dx, vofh, interpm) Input d : is the zero- or common-offset GPR section dt : is the sampling rate dx : is the trace spacing (spatial sampling rate) vofh(n,2) : the 1-D velocity model of "nlay" velocity - thickness pairs, for example: [ 0.1 1 ; ... 1st layer 0.08 2 ; ... 2nd layer ... 0.18 0 ] ... n'th layer==basal halfspace *** A uniform halfspace is given as a single layer stucture with zero thickness. Velocity values are given in m/ns and thicknesses in m. interpm : defines the interpolation method to be used. Any of the methods implemented in MATLAB's "interp1" routine can be used, i.e. 'nearest', 'linear', 'spline', 'pchip', 'cubic' and 'v5cubic'. Default is the band limited linear interpolation (very fast and stable). Best choice is 'cubic' (slower). Least recommended are 'spline' and 'nearest'. Output dmig : The migrated GPR section Requires : yxtoxy.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

118

Page 119: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

ttoz.m Description TTOZ : Remap or resample a GPR section from traveltime vs. distance to depth vs. distance, assuming a uniform or layered velocity structure. The program: 1. Computes a time vs depth function t(z) from the velocity vs. depth function v(t). 2. Inverts t(z) to z(t). 3. Remaps z(t) to depth z and, based on this mapping, 4. Remaps E(t) --> E(z), where E stands for the amplitude of a GPR trace. Usage [zv,nz,dz,dm] = ttoz(traveltime,d,dt,vofh,firstt,firstz) Input d : [ns x ntr] matrix of the common-offset GPR section. dt : Time sampling rate in nanosecs. vofh : [nlayer x 2 ] velocity model to be used for migration. Two-column vector of "nlay" velocity - thickness pairs like: [ 0.1 1 ; ... 1st layer 0.08 2 ; ... 2nd layer ... 0.18 0 ] ... n'th layer==basal halfspace A uniform halfspace is given as a single layer structure with zero thickness. Velocity values in m/ns and thicknesses in m. firstt : first time sample from which to begin migrating. firstz : first z sample from which to begin migrating. Output dm : [nz x ntr] matrix of the depth-migrated GPR section. nz : The number of depth samples in "dm", computed internally. In the current version of the program, nz = ns. dz : The depth sampling interval in m. zv : [1 x nz ] vector of the depth coordinates of "dm". tz : times mapped onto depths zv Requires : yxtoxy.m Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

119

Page 120: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

vcalc.m Description VCALC : Velocity Calculator. Enquires the nominal frequency of the GPR an-tenna, the resistivity, relative dielectric constant and relative permeability of the medium and calculates the non-dispersive term of the phase velocity and the quality factor after Bano (1996, Geophys. J. Int., 279 - 288). Usage [v, Q ] = vcalc; Output v : The non-dispersive term of the phase velocity for the given medium and

frequency. Q : The quality factor for the given medium and frequency. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

120

Page 121: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.9. Modelling Utilities

build2dmodel.m Description BUILD2DMODEL : Construct synthetic 2-D models whence to obtain 2-D velocity models for processing with the Split-step and Phase-shift plus Interpolation migration methods, as well as for forward modelling with Bitri and Grandjean’s (1998) Split-step algorithm Usage build2dmodel; Requires : setpolygon.m, getpoint.m, snappolytoaxes.m, centroid.m, getprops.m General features The model comprises an ensemble of objects with polygonal or circular cross-sections. There is no limit to the number of vertices. The order in which ob-jects are introduced in the structural model, determines whether they will ap-pear in the final velocity model, (or if they will appear at all).The program implements a FRONT to BACK object hierarchy: Foreground objects will appear whole in the model. Background objects that are totally obscured will not appear in the

velocity model. Background objects that are partially obscured will appear partially

(their visible parts). The object coordinates and properties are introduced in three ways: 1. Graphically, by pointing and clicking on the model figure, 2. Through dialog boxes, and, 3. From ASCII files on disk. These are very simple in structure, comprising only a two column list with the horizontal (x) and vertical (z) coordinates of the object. BUILD2DMODEL provides for the graphical editing of object shape and properties (insert, move or remove vertices and review EM properties, with unlimited lev-els of undo). The program comprises a parent GUI function with menus, the items of which call function handle functions. Information between the main and handle func-tions is communicated with global variables, but is otherwise kept strictly within the scope of BUILD2DMODEL. These variables are: nbody : The number of bodies in the model inpmod : Input mode (1 for typing, 2 for graphically entering information) bodies : (NBODY x 4), cell array holding body data. bodies{j,1}, vector holding the X-vertices of the j'th body bodies{j,2}, vector holding the Z-vertices of the j'th body bodies{j,3}, 4-vector holding the EM properties of the j'th body bodies{j,4}, vector holding the ASCII code of the j'th tag

121

Page 122: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

handles : (NBODY x 4), cell array holding the handles of graphics objects handles{j,1}, is a vector holding the handles of the vertices of the j'th body handles{j,2}, is a vector holding the patch of the j'th body handles{j,3}, is a vector holding the graphic data for the "ID tag" of the j'th body handles{j,4}, is a vector holding the graphic objects for the "EM properties" of the j'th body backup :(M x NBODY x 4) cell array holding backup body data for undo actions. M is arbitrary and self-updating BUILD2DMODEL exports the synthetic model to a free format ASCII model file with structure as follows: antenna float, antenna frequency. Xmin Xmax Zmin Zmax float, horizontal and vertical extent of the model. nbody int, number of bodies in the model. tag string, Tag of 1st body. nv, K, Q, mu, rho int + 4 x float. Respectively are: a) The # vertices in 1st body, b) its relative dielectric constant, c) quality factor, d) relative magnetic permeability, e) resistivity x(1) z(1) float, float: coordinates of the first vertex x(2) z(2) float, float: coordinates of the second vertex ... ... x(nv) z(nv) float, float: coordinates of the last vertex tag string, Tag of the 2nd body. nv, K, Q, mu, rho int + 4 x float: Respectively # of vertices, relative dielectric constant, quality factor, relative permeability and resistivity of the 2nd body x(1) z(1) float, float: coordinates of the first vertex of the 2nd body .... and so on Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

122

Page 123: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

getprops.m Description GETPROPS : Function used by BUILD2DMODEL, to set, or reset, the EM properties of a structural element in the synthetic model. The routine inquires for the resistivity, relative dielectric constant and relative permeability of the ob-ject via a dialog box, converses with the user to optimize their values and upon confirmation, calculates the quality factor after Bano (1996, Geophys. J. Int., 279 - 288). Usage To obtain fresh values of EM properties: properties = getprops(fc) To revise already EM properties set earlier, properties = getprops(fc,props) Input fc : Antenna central frequency. props : [1 x 4] vector holding the relative dielectric constant, quality factor, relative magnetic permeability and resistivity of an object. Output properties : The EM properties of the object. These are: a) relative dielectric constant, b) quality factor, c) relative magnetic permeability, d) resistivity Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

123

Page 124: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

splitstep2dmodel.m Description SPLITSTEP2DMODEL: GPR forward modelling using the method of Bitri and Grand-jean (1998,Geophysical Prospecting, 46, 287-301). This program imports (from disk file) a synthetic structural model prepared by function build2dmodel.m and generates matrices of the relative dielectric constant, magnetic perme-ability and quality factor structures. These are passed to a Fortran-90 MEX-file that computes the corresponding velocity structure after Bano (1996, Geo-phys. J. Int., 279 - 288) and hence the forward model. Usage [dm,scanaxis,tt2w,nx,dx,nt,dt,antenna_freq] = splitstep2dmodel; Output dm : The synthetic GPR section tt2w : The 2-way traveltime of the synthetic model nt : The dimension of tt2w dt : The sampling rate of tt2w scanaxis : The vector of traces coordinates along the scan axis of the synthetic model nx : The dimension of scanaxis dx : Trace spacing of the synthetic model antenna_freq : The central frequency of the GPR antenna. Requires : checkcomma.m, isinpoly.m (for MATLAB R12 and earlier). Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

124

Page 125: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

5.10. Complementary Analysis and Support Utilities

baseline.m Description Determine a baseline BLY(NBL) for the vector Y(N) and optionally remove it. Usage [yo, blx, bly] = baseline(istep,y,action,interpm) Input istep = bin size for determining the baseline y = the data vector action = 'base' determine a baseline ONLY = 'high' determine and remove a baseline (high-pass filter) = 'low' determine baseline and replace the input series with the baseline(low pass filter) interpm defines the interpolation method to be used. Any of the methods implemented in MATLAB's "interp1" routine can be used, i.e. 'nearest', 'linear', 'spline', 'pchip', 'cubic' and 'v5cubic'. Default is linear interpolation. Output yo = the processed data vector blx = x-coordinates of the base line w.r.t. the elements of the input vector bly = the baseline in input data units Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

125

Page 126: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

centroid.m Description CENTROID: Centre of mass of a polygon. Calculates centroid (centre of mass) of planar polygon with vertex coordinates X, Y. Z0 = CENTROID(X+i*Y) returns Z0=X0+i*Y0, the same as CENTROID(X,Y). Usage [X0,Y0] = CENTROID(X,Y) Copyright (c) 1995 by Kirill K. Pankratov, [email protected]. 06/01/95, 06/07/95 Algorithm: X0 = Int{x*ds}/Int{ds}, where ds - area element so that Int{ds} is total area of a polygon. Using Green's theorem the area integral can be reduced to a con-tour integral: Int{x*ds} = -Int{x^2*dy}, Int{ds} = Int{x*dy} along the perimeter of a polygon. For a polygon as a sequence of line segments this can be reduced exactly to a sum: Int{x^2*dy} = Sum{ (x_{i}^2+x_{i+1}^2+x_{i}*x_{i+1})*(y_{i+1}-y_{i})}/3; Int{x*dy} = Sum{(x_{i}+x_{i+1})(y_{i+1}-y_{i})}/2. Similarly Y0 = Int{y*ds}/Int{ds}, where Int{y*ds} = Int{y^2*dx} = ... = Sum{ (y_{i}^2+y_{i+1}^2+y_{i}*y_{i+1})*(x_{i+1}-x_{i})}/3.

checkcomma.m Description CHECKCOMMA: Replaces commas in the input string with dots. When applied to strings or cell arrays of strings returned from MATLAB ui dialogs (e.g. in-putdlg), and which contain comma delimited decimal numbers (Continental Euro-pean notation), changes them to dot delimited decimal numbers (Anglosaxon, therefore MATLAB notation), so as to avoid inadvertent errors and crashes Usage outstr = checkcomma(instr) Input instr : The input string or cell array of strings, with comma delimited decimals Output outstr : The output string or cell array of strings with dot delimited decimals Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

126

Page 127: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

fir_f1.m Produce an order n FIR filter with the given frequency cut-off, returning the n+1 filter coefficients in b. usage: b = fir_f1(n, w [, type] [, window] [, noscale]) n: order of the filter (1 less than the length of the filter) w: band edges strictly increasing vector in range [0, 1] singleton for highpass or lowpass, vector pair for bandpass or bandstop, or vector for alternating pass/stop filter. type: choose between pass and stop bands 'high' for highpass filter, cut-off at w 'stop' for bandstop filter, edges at w = [lo, hi] 'DC-0' for bandstop as first band of multiband filter 'DC-1' for bandpass as first band of multiband filter window: smoothing window defaults to hamming(n+1) row vector returned filter is the same shape as the smoothing window noscale: choose whether to normalize or not 'scale': set the magnitude of the center of the first passband to 1 'noscale': don't normalize To apply the filter, use the return vector b: y=filter(b,1,x); Examples: freqz(fir_f1(40,0.3)); freqz(fir_f1(15,[0.2, 0.5], 'stop')); % note the zero-crossing at 0.1 freqz(fir_f1(15,[0.2, 0.5], 'stop', 'noscale')); Copyright (C) 2000 Paul Kienzle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA => Original function name was fir1.m, built for OCTAVE. => Adapted for MATLAB/MATGPR by Andreas Tzanis, April 2004. => Renamed to fir_f1.m so as not to conflict with MATLAB’s own fir1.m function (Signal Analysis toolbox).

127

Page 128: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

fir_f2.m Produce an FIR filter of order n with arbitrary frequency response, returning the n+1 filter coefficients in b. usage: b = fir_f2(n, f, m [, grid_n [, ramp_n]] [, window]) n: order of the filter (1 less than the length of the filter) f: frequency at band edges f is a vector of non decreasing elements in [0,1] the first element must be 0 and the last element must be 1 if elements are identical, it indicates a jump in freq. response m: magnitude at band edges m is a vector of length(f) grid_n: length of ideal frequency response function defaults to 512, should be a power of 2 bigger than n ramp_n: transition width for jumps in filter response defaults to grid_n/20; a wider ramp gives wider transitions but has better stop band characteristics. window: smoothing window defaults to hamming(n+1) row vector returned filter is the same shape as the smoothing window To apply the filter, use the return vector b: y=filter(b,1,x); Note that plot(f,m) shows target response. Example: f=[0, 0.3, 0.3, 0.6, 0.6, 1]; m=[0, 0, 1, 1/2, 0, 0]; [h, w] = freqz(fir2(100,f,m)); plot(f,m,';target response;',w/pi,abs(h),';filter response;'); Copyright (C) 2000 Paul Kienzle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA => Original function name was fir2.m; built for OCTAVE. => Adapted for MATLAB/MATGPR by Andreas Tzanis, April 2004. => Renamed to fir_f2.m so as not to conflict with MATLAB's own fir2 function (Signal Analysis toolbox).

128

Page 129: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

getpoint.m Description GETPOINT : Peek on the current axes, a pair of points [ x y ] by pointing and clicking. Accurate pointing is facilitated by a streaming display at the bot-tom of the figure, of the current pointer position (coordinates) in data units. The display is erased as soon as the program returns. The program returns the number of mouse button pressed. In effect, this is a surrogate "ginput" routine, without extensive error

checking or keyboard support, but with the added flexibility of letting you know the exact location of the pointer. Usage [x, y, button] = getpoint(s1,s2); [x, y ] = getpoint(s1,s2); [x, y ] = getpoint; getpoint; Calling getpoint without input of output arguments will simply display the

cursor coordinates at the bottom of the figure (data peeking utility). Input s1, s2 : The physical units of the data in the X- and Y- axes respectively, e.g. 'meters', 'nanoseconds', etc. These will be shown together with the cursor co-ordinates Output x, y : The coordinates of the clicked point in data units. button : The mouse button pressed: 1 = LEFT button 2 = MIDDLE button 3 = RIGHT button Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

129

Page 130: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

ibm2num.m Description IBM2NUM: Convert IBM 32 bit floating point format to IEEE 754 doubles (MATLAB standard) Usage x = num2ibm(b) Input b : A matrix of uint32 numbers (IBM Floating point eqv) Output x : A corresponding to "b" matrix of IEEE doubles Note : See also num2ibm.m This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Author and copyright holder (C) Brian Farrelly, 22 October 2001 mailto:[email protected] Norsk Hydro Research Centre phone +47 55 99 68 74 ((( Postboks 7190 fax +47 55 99 69 70 2oooS N-5020 Bergen home +47 55 13 78 49 HYDRO Norway

130

Page 131: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

isinpoly.m Description ISINPOLY : Finds whether points with coordinates X and Y are inside or outside of a polygon with vertices XP, YP. % Usage isin = isinpoly(x,y,xp,yp) Output Returns a quasi-boolean matrix ISIN, of the same size as X and Y, with 0 for points outside a polygon XP, YP), 1 for points inside the polygon and 0.5 for points on the side of the polygon. Copyright (c) 1995 by Kirill K. Pankratov [email protected] 4/10/94, 8/26/94.

num2ibm.m Description NUM2IBM: Convert IEEE 754 doubles to IBM 32 bit floating point format Usage b = num2ibm(x) Input x : A matrix of IEEE doubles (MATLAB standard) Output b : A a corresponding to "x" matrix of uint32 (IBM FP) Note : The representations for NaN and inf are arbitrary. See also ibm2num.m This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. (C) Brian Farrelly, 22 October 2001 mailto:[email protected] Norsk Hydro Research Centre phone +47 55 99 68 74 ((( Postboks 7190 fax +47 55 99 69 70 2oooS N-5020 Bergen home +47 55 13 78 49 HYDRO Norway

131

Page 132: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

resample1.m Description Change the sample rate of x by a factor of p/q. Note that p and q do % not need to be integers since this routine does not use a polyphase rate change algorithm, but instead uses band limited interpolation, wherein the continuous time signal is estimated by summing the sinc functions of the nearest neighbouring points up to distance d. This is discussed in: J.O. Smith and P. Gossett (1984). A flexible sampling-rate conversion method. In ICASSP-84, Volume II, pp. 19.4.1-19.4.2. New York: IEEE Press. See the authors page at: http://www-ccrma.stanford.edu/~jos/resample/ Usage y = resample1(x,p,q,order) Input x : is the 2-D data matrix to be resampled p,q : determine the new sampling rate order : is the half order of sinc summation Output y : is the resampled data matrix Copyright (C) 2000, Paul Kienzle. Modified for MATLAB / MATGPR by: Andreas Tzanis, [email protected], 2005. Now resamples a rectangular matrix along any one of its dimensions

132

Page 133: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

setpolygon.m Description SETPOLYGON : Define, on the current axes, a polygonal line [ x(n) y(n) ], by pointing and clicking. The polygonal line is clipped with respect to the axes limits. Accurate pointing is facilitated by a streaming display at the bottom of

the figure, of the current pointer position (coordinates) in data units. The display is erased as soon as the program returns. The operation is controlled exclusively with the mouse:

** To set an x,y pair of coordinates click the LEFT mouse button. ** To correct mistakes click the MIDDLE button. Back stepping is permitted until the polyline runs out of points. ** To finish, click the RIGHT mouse button. Usage : [x, y] = setpolygon(s1, s2); [x, y] = setpolygon; Input : s1, s2 : The physical units of the data in the X- and Y- axes respectively, e.g. 'meters', 'nanoseconds', etc. These will be shown together with the cursor co-ordinates Output x, y : The coordinates of the polygonal line in data units. Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

snappolytoaxes.m Description SNAPPOLYTOAXES : Clip a polygonal area to the axes limits. For a given polygon with vertices [x,z] and an axes object with limits xl = [xlow, xhigh] and zl = [zlow, zhigh], the routine checks for the indices ii and jj of outlier verti-ces: x(ii)< xl < x(jj) & z(ii)< zl < z(jj). Those found coming on or going off are snapped onto the axes limits, by linear interpolation. The rest are snapped by brute force. This program will never claim credit for its intelligent programming!

Usage [x, z] = snappolytoaxes(x, z, xl, zl) Input xi, zi : Column vectors containing the polygon vertices xl, zl : The horizontal and vetical limits of the axes containing the polygon. Output x, z : Column vectors containing the snapped polygon vertices Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

133

Page 134: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

twocolors.m Description TWOCOLORS: Make a smooth 3-colour reel of length NCOLORS, comprising: 1. color1 to White reel for the first [1 NCOLORS/2] elements, and, RBG 2. White to RGB color2 reel for the next [1+NCOLORS/2,NCOLORS] elements. ** color1 and color2 are [1 x 3] vectors with elements in the range [0, 255] (RGB colours). ** Useful for emphasizing the high amplitude data while hiding low amplitude noise Usage cmap = twocolors(ncolors, color1, color2) Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

twocolorsc.m Description TWOCOLORSC : Make a 3-color colormap of length ncolors, scaled in the range [dmin,d1] and [d2,dmax], where ** dmin, dmax respectively are the maximum and minimum values of the data to be displayed. ** d1, d2 are cutoff values such, that dmin < d1 < d2 < dmax and are given by the user. The colormap comprises: 1. RBG color1 to White reel for data in range [dmin, d1], and, 2. White to RGB color2 reel for data in range [d2, dmax]. ** color1 and color2 are [1 x 3] vectors with elements in the range [0, 255] (RGB colours). ** Useful for emphasizing the high amplitude data while hiding low amplitude noise. In this colour scheme, zero data values will always correspond to pure white. Usage cmap = twocolorsc(dmin, d1, d2, dmax, ncolors, color1, color2) Copyright (C) 2005, Andreas Tzanis ([email protected]). All rights reserved.

134

Page 135: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

Chapter 5: Function Documentation

yxtoxy.m Description YXTOXY : Compute a regularly-sampled, monotonically increasing function x(y) from a regularly-sampled, monotonically increasing function y(x) by inverse linear interpolation. Usage x = yxtoxy(nx, dx, fx, y, ny, dy, fy, xylo, xyhi) Input nx : number of samples of y(x) dx : x sampling interval; dx>0.0 is required fx : first x y : array[nx] of y(x) values; y[0] < y[1] < ... < y[nx-1] required ny : number of samples of x(y) dy : y sampling interval; dy>0.0 is required fy : first y xylo : x value assigned to x(y) when y is less than smallest y(x) xyhi : x value assigned to x(y) when y is greater than largest y(x) Output x : array[ny] of x(y) values User must ensure that: (1) dx>0.0 && dy>0.0 (2) y[0] < y[1] < ... < y[nx-1] ************************************************************************* Transcoded from function yxtoxy.c, which is part of the CWP library. For function yxtoxy.c : Copyright (c) Colorado School of Mines, 2002. Author: Dave Hale, Colorado School of Mines, 06/02/89 For function yxtoxy.m : Copyright (c) 2005, Andreas Tzanis. Author: Andreas Tzanis, Department of Geophysics, University of Athens, [email protected] *************************************************************************

135

Page 136: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

GNU Free Documentation License

Version 1.1, March 2000 Copyright ©

2000 Free Software Foundation, Inc.

59 Temple Place, Suite 330, Boston, MA 02111-1307, USA

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

0. PREAMBLE The purpose of this License is to make a manual, textbook, or other written document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License pre-serves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It comple-ments the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or refer-ence.

1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The “Document”, below, re-fers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document’s overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philoso-phical, ethical or political position regarding them. The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this Li-cense. The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) ge-neric paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input

136

Page 137: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

GNU Free Documentation License

to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not “Transparent” is called “Opaque”. Examples of suitable formats for Transparent copies include plain ascii without markup, Tex-info input format, LaTEX input format, sgml or xml using a publicly available dtd, and standard-conforming simple html designed for human modification. Opaque formats include PostScript, pdf, proprietary formats that can be read and edited only by proprietary word processors, sgml or xml for which the dtd and/or processing tools are not generally available, and the machine-generated html produced by some word processors for output purposes only. The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work’s title, preceding the beginning of the body of the text.

2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncom-mercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other condi-tions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly dis-play copies.

3. COPYING IN QUANTITY If you publish printed copies of the Document numbering more than 100, and the Document’s license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally promi-nent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these condi-tions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redis-tributing any large number of copies, to give them a chance to provide you with an updated ver-sion of the Document.

4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sec-tions 2 and 3 above, provided that you release the Modified Version under precisely this Li-

137

Page 138: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

GNU Free Documentation License

cense, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document,

and from those of previous versions (which should, if there were any, be listed in the His-tory section of the Document). You may use the same title as a previous version if the origi-nal publisher of that version gives permission.

B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal au-thors of the Document (all of its principal authors, if it has less than five).

C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright

notices. F. Include, immediately after the copyright notices, a license notice giving the public permis-

sion to use the Modified Version under the terms of this License, in the form shown in the Addendum below.

G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document’s license notice.

H. Include an unaltered copy of this License. I. Preserve the section entitled “History”, and its title, and add to it an item stating at least the

title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled “History” in the Document, create one stating the title, year, au-thors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.

J. Preserve the network location, if any, given in the Document for public access to a Trans-parent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. You may omit a network location for a work that was published at least four years before the Docu-ment itself, or if the original publisher of the version it refers to gives permission.

K. In any section entitled “Acknowledgments” or “Dedications”, preserve the section’s title, and preserve in the section all the substance and tone of each of the contributor acknowl-edgments and/or dedications given therein.

L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.

M. Delete any section entitled “Endorsements”. Such a section may not be included in the Modified Version.

N. Do not retitle any existing section as “Endorsements” or to conflict in title with any Invari-ant Section.

If the Modified Version includes new front-matter sections or appendices that qualify as Secon-dary Sections and contain no material copied from the Document, you may at your option des-ignate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version’s license notice. These titles must be distinct from any other section titles. You may add a section entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through ar-

138

Page 139: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

GNU Free Documentation License

rangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for Modified versions, provided that you include in the combi-nation all of the Invariant Sections of all of the original documents, Unmodified, and list them all as Invariant Sections of your combined work in its license notice. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sec-tions in the license notice of the combined work. In the combination, you must combine any sections entitled “History” in the various original documents, forming one section entitled “History”; likewise combine any sections entitled “Ac-knowledgments”, and any sections entitled “Dedications”. You must delete all sections entitled “Endorsements.”

6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent docu-ments or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an “aggregate”, and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document’s Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.

8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may in-clude a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.

9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided

139

Page 140: Andreas Tzanis - search read.pudn.comread.pudn.com/downloads96/sourcecode/math/393900/MATGPR_R1/d… · power from the Seismic Unix (SU) analysis system, but as it is based on an

GNU Free Documentation License

for under this License. Any other attempt to copy, modify, sublicense or distribute the Docu-ment is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documenta-tion License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Docu-ment does not specify a version number of this License, you may choose any version ever pub-lished (not as a draft) by the Free Software Foundation.

140