| |
Contents of this page: |
| 3 general files: |
GZFOR3D |
performs forward modelling. |
| |
GZSEN3D |
calculates sensitivity and the depth weighting function. |
| |
GZINV3D |
performs 3D gravity inversion. |
| |
GZPRE3D |
multiplies the sensitivity file by the model to get the predicted data. |
| Log file: |
Log file |
Explanation of the log file contents. |
3.1 Introduction
In a MS-WindowsXX operating environment codes are best run using the Graphical User Interface (GUI).
However, all programs in the package also can be run by typing the program name followed by command line arguments. With such a format, they can be executed directly on the command line or in a shell script. When a program is executed without any arguments, it will print a simple message describing the usage. The command format is described below.
Command format:
PROGRAM arg_1 arg_2 arg_3 ...
PROGRAM = name of the executable program. If the program is not in the current directory, its path must be included also.
arg_n = a command line argument which is the name of a file. It is usually one of those described in the preceding section or a control file containing input parameters.
3.2 GZFOR3D
This program performs forward modelling. Command line usage:
gzfor3d mesh obs.loc model.den [topo.dat]
Input files :
All files are in ASCII text format - they can be read with any text editor. Input files can have any name the user specifies.
mesh = the 3D mesh
obs.loc = the observation locations
model.den = the density model
topo.dat = surface topography (optional). If omitted, the surface will be treated as being flat.
Output file:
This file is created by GZFOR3D - it's name can NOT be specified.
gzfor3d.grv = the computed gravity anomaly data. Since the data in this file are accurate, the column of the standard deviations for the error is not included.
3.3 GZSEN3D
This program performs the sensitivity and depth weighting function calculations. Command line usage:
gzsen3d gzsen3d.inp
For a sample input file type: gzsen3d —inp .
Format of the control file gzsen3d.inp:
mesh
obs.grv
topo.dat
iwt
beta znot
wvlet
itol eps |
Input files and parameters:
mesh
|
| |
3D mesh |
obs.grv
|
| |
data file. Contains the observation locations and the observed gravity anomalies with estimated standard deviation. |
topo.dat
|
| |
surface topography (optional). If null is entered, the surface will be treated as being flat. |
iwt
|
| |
an integer identifying the type of generalized depth weighting to use in the inversion.
=1 for depth weighting (only for surface data);
=2 for distance weighting (surface - especially when topography is severe - and/or borehole). |
beta, znot
|
| |
parameters defining the depth weighting function.
When iwt=1, beta and znot are used as and z0 to define the depth weighting.
When iwt=2, beta and znot are used as and z0 to define the distance weighting.
If null is entered on this line (line 5), then the program sets beta=2 and calculates the value of znot based upon the mesh and data location. This is true for iwt=1 or 2.
For most inversions, however, setting this input line to "null" is recommended. The option for inputing beta and znot is provided for experienced users who would like to investigate the effect of the generalized depth weighting for special purposes.
The value of beta should normally be close to 2.0. Note the difference from the value used in MAG3D. Smaller values of give rise to weaker weighting. |
| wvlet
|
| |
a five-character string identifying the type of wavelet used to compress the sensitivity
matrix. The types of wavelets available are Daubechies wavelet with 1 to 6 vanishing moments (daub1, daub2, and so on) and Symmlets with 4 to 6 vanishing moments (symm4, symm5, symm6). Note that daub1 is the Haar wavelet and daub2 is the Daubechies-4 wavelet. The Daubechies-4 wavelet should be used for most inversions, while the others are provided for users' experimentation. If null is entered, no compression is performed and the program generates a dense matrix in its original form. |
itol, eps
|
| |
an integer and a real number that specify how the wavelet threshold level is to be
determined.
itol=1: program calculates the relative threshold and eps is the relative reconstruction error of the sensitivity. A reconstruction error of 0.05 is usually adequate.
itol=2: the user define the threshold level and eps is the relative threshold to be used.
If null is entered on this line, a default relative reconstruction error of 0.05 is used and the relative threshold level is calculated (i.e., itol=1, eps=0.05). |
Example of gzsen3d.inp control file
mesh ! mesh file
obs.nois ! data file
null ! topography
2 ! iwt=1 depth, =2 distance
null ! beta, znot | null
daub2 ! wavelet type
1 0.05 ! itol, eps | null |
Two output files:
1) gzinv3d.mtx is the sensitivity matrix file to be used in the inversion. This file contains the sensitivity matrix, generalized depth weighting function, mesh, and discretized surface topography. It is produced by the program and it's name is not adjustable. It is very large and may be deleted once the work is completed.
2) A file sensitivity.txt is output after running gzsen3d.exe. It contains the average sensitivity for each cell. This file can be used for depth of investigation analysis or for use in designing special model objective function weighting. (Added for grav3d version 3.0)
3.4 GZINV3D
This program performs 3D gravity inversion. Command line usage is:
gzinv3d gzinv3d.inp
For a sample input file type: gzinv3d —inp.
Format of the control file gzinv3d.inp is as follows:
irest
mode
par tolc
obs.mag
maginv3d.mtx
ini.sus
ref.sus
bounds.sus
LE LN LZ
w.dat
idisk |
Control parameters:
irest
|
| |
restarting flag:
=0: start inversion from scratch.
=1: restart inversion after it is interrupted. Restart requires two file written out by MAGINV3D before the interruption: maginv3d.aux and maginv3d.kap (see below). |
mode
|
| |
an integer specifying one of three choices for determining the tradeoff parameter
(see Figure 4 of background).
- mode=1: the program chooses the tradeoff parameter by carrying out a line search so that the target value of data misfit is achieved.
- mode=2: the user inputs the tradeoff parameter.
- mode=3: the program calculates the tradeoff parameter by applying the GCV analysis to the inversion without positivity.
|
par, tolc
|
| |
two real numbers that are used differently. Their use depends upon the value of
mode.
- mode=1: the target misfit value is given by the product of par and the number of data N, i.e.,. The second parameter, tolc, is the misfit tolerance. The target misfit is considered to be achieved when the relative difference between the true and target misifts is less than tolc. Normally, the value of
par should be 1.0 if the correct standard deviation of error is assigned to each datum. When 0.0 is entered for tolc, the program assumes a default value of tolc=0.02.
- mode=2: par is the user-input value of tradeoff parameter. In this case, tolc is not used by the program.
- mode=3: none of the two input values are used by the program. However, this line of input still needs to be there.
NOTE: When mode=1 both par and tolc are used. When mode=2 only par is used. When mode=3, neither par nor tolc are used. However, the third line should always have two values. |
LE, LN, LZ
|
| |
length scales in easting, northing, and depth directions respectively. These parameters
determine the weighting coefficients ( s;  x;  y;  z) in the model objective
function. The recommended value of the length scale is two to five cell widths in
the corresponding direction.
If the input sets LE=LN=LZ=0.0, the inversion will recover a smallest model.
If NULL or null is entered, the length scale will be equal to two times the maximum
cell width at the centre of the mesh. For example, if the cells are 50m x 50m x 25m at the centre of the mesh, then the default values are LE=LN=LZ=100m. |
idisk
|
| |
parameter which determines how the sensitivity matrix will be accessed.
=0: sensitivity matrix will be stored in memory. If there is not enough memory,
idisk will be set to 1 automatically.
=1: sensitivity matrix will be accessed from disk when needed. UPDATES FOR Ver4.0 IN THE APPENDIX. |
Example of gzinv3d.inp control file:
The inversion is started from scratch with a zero reference model. The inversion will try to converge to a target misfit equal to the number of data. The sensitivity matrix will be stored in memory.
0 !! irest
1 !! mode
1.0 0 !! par, tolc
obs.nois !! obsf
gzinv3d.mtx !! mtx file
null !! initial model
0.0 !! reference model
0.0 1.0 !! lower and upper bounds
100, 100, 100 !! alphaS, alphaE, alphaN, alphaZ
null !! 3D weighting
0 !! idisk |
Input files:
Input files can be any file name. If there are spaces in the path or file name, you MUST use quotes ("") around the entire path+filename. Details are in the "Elements" chapter.
obs.grv
|
| |
input data file. The file must specify the standard deviations of the error. By definition these are greater than zero. |
gzinv3d.mtx
|
| |
sensitivity matrix and depth weighting functionfile (calculated by GZSEN3D). |
ini.den
|
| |
initial model stored in the same way as model.den. If null is entered, the default value determined from the bounds is used. For a constant initial model, enter a value. |
ref.den
|
| |
reference model stored in the same way as model.sus. If null is entered, the default value of 0.0 is used. For a constant reference model, enter a value. |
bounds.den:
|
| |
lower and upper bounds on the recovered density value stored in the formats
bounds.den. If null is entered on this line, the default value of –2.0 and 2.0
are used for all cells. For constant bounds, enter two values for the lower and upper bounds in that order. For example, to construct a model that is bounded between
[0, 1.0], this line should be entered 0 1.0. |
w.dat
|
| |
weighting function (optional). If null is entered, the program assumes uniform weight of 1.0 . |
Output files:
Output files are created by the programs. They have fixed file names. Detail file formats are in the "Elements" chapter.
gzinv3d.log
|
| |
The log file containing more detailed information for each iteration and summary of
the inversion. |
gzinv3d.den
|
| |
Recovered density contrast model. |
gzinv3d.pre
|
| |
The predicted data. |
gzinv3d.aux
|
| |
Auxiliary file listing the data misfit model norm, and Lagrange multiplier at different
stages of the inversion. This is used only for the purpose of restarting the inversion. |
gzinv3d.rho
|
| |
Temporary file containing the density contrast model produced at different stages of the
inversion. This is used only for the purpose of restarting the inversion. |
gzinv3d_nopos.den
|
| |
This model file is output during the first part of the inversion. It contains the densities without the bounds constraints imposed. (Added for grav3d version 3.0) |
gzinv3d_XX.den
|
| |
These model files are output after each beta iteration. (Added for grav3d version 3.0) |
Log file explanation
The log file gzinv3d.log contains more detailed information about the convergence of
the inversion. Depending on how the inversion is set up by the users, the content of the log file
is slightly different. In general, there are two stages. In the first stage, the program estimates an
approximate regularization parameter. In the second stage, the program performs the inversion
with bound constraints using a logarithmic barrier method of minimization, which consists of
outer iterations with the barrier parameter and inner iterations of conjugate gradient solution of
an linear system within each barrier iteration. The log file information is organized according
to these two levels of iterations.
We can refer to the flow chart Figure 3 in the Background chapter to understand the output in the log
file. Below we briefly describe the content of the log file according to the parameter mode chosen for the inversion.
Mode 1:
In this mode, a user-defined target misfit is supplied by specifying chifact. The first
stage of inversion performs a line search without the bound constraints to estimate an approximate
value of the regularization parameter and the slope of the misfit curve. The log file identifies this
segment and lists summaries of each linear solution such as the number of conjugate gradient
(CG) iterations, data misfit, and model norm. The second stage of inversion carries out a number
of logarithmic barrier solutions. Each solution corresponding to a single regularization parameter
is obtained by a sequence of barrier iterations, and nested inside each barrier iteration is a set of
CG iterations. This portion of the log file begins with the value of regularization parameter, initial
values of data misfit and model norm. It is then organized in segments corresponding to barrier
iterations and lists the number of CG iterations, data misfit, model norm, barrier parameter,
and the value of the barrier function at the conclusion of that iteration. As barrier iterations
progress, the data misfit, barrier parameter, and barrier function should decrease monotonically.
The model objective function may increase or decrease depending on the nature of the initial
model of the logarithmic barrier minimization. However, both data misfit and model objective
function should plateau at the end.
One or more solutions may be obtained to complete the line search and to achieve the
target misfit. Each solution will have a distinct portion in the log file. The trial values of the
regularization are dynamically predicted during the inversion and they are not necessarily in any
order. Upon completion of line search and the inversion, the log file will list a summary of
the data misfit and model norm corresponding to different values of the regularization parameter
sorted in increasing order.
Mode 2:
In this mode, the user specifies a value of regularization parameter and the program
performs a single logarithmic barrier minimization to obtained the solution. The log file mainly
consists of the information for one logarithmic solution as described in Mode 1.
Mode 3:
In this mode, the program first performs a GCV estimate of data noise to obtain
an approximate value of the regularization parameter, and it then carries out a single logarithmic
barrier minimization to obtain the inverse solution. During the first stage, a number of trial values
of the regularization parameter is tested, and two linear systems are solved for each value. Thus the first part of the log file is organized according to the value of regularization parameter. For
each value, the numbers of CG iterations, data misfit, model norm, and GCV value are listed. At
the end of GCV search, the log file lists the data misfit, model norm, GCV value according to the
regularization parameter sorted in increasing order. The regularization parameter corresponding
to the lowest GCV value is used to obtain the final solution in the second stage. The second
part of the log file corresponds to a single logarithmic barrier minimization and it is identical
to that when mode 2 is chosen.
3.5 GZPRE3D
This utility multiplies a model by the sensitivity matrix in gZinv3d.mtx to produce the predicted data. This program is included so that users who are not familiar with the wavelet transform and the structure of gzinv3d.mtx can utilize the available sensitivity matrix to carry out model studies.
Command line usage:
gzpre3d gzinv3d.mtx obs.loc model.den
Input files:
gzinv3d.mtx = the sensitivityfile from GZSEN3D.
obs.loc = the observation locations.
model.den = the density contrast model.
Output file:
gzpre3d.mag = predicted data.
|
|