NLLoc Guide PDF
NLLoc Guide PDF
NLLoc Guide PDF
1. Acknowledgements.......................................................................................................................4
2. Overview......................................................................................................................................5
Copyright notice......................................................................................................................5
3. The Programs...............................................................................................................................6
4. A Typical Location Run...............................................................................................................7
5. Getting Started..............................................................................................................................8
Download the NonLinLoc Software........................................................................................8
NonLinLoc ........................................................................................................................8
SeismicityViewer ...............................................................................................................8
Sample Location Problem.......................................................................................................8
6. NonLinLoc Release Notes............................................................................................................9
7. Installing and Running the Sample Location Tutorial.................................................................16
Overview...............................................................................................................................16
Installing the sample location ...............................................................................................16
Running the sample location tutorial.....................................................................................17
8. Vel2Grid Program velocity model description to 3D model grid.............................................20
Overview...............................................................................................................................20
Running the program.............................................................................................................20
Input.................................................................................................................................20
Output...............................................................................................................................21
Processing and Display of results..........................................................................................21
9. Grid2Time Program 3D model grid to traveltime and angles grids........................................22
Overview...............................................................................................................................22
Podvin and Lecomte, Eikonal, Finitedifference Algorithm..................................................22
TakeOff Angles Algorithm..................................................................................................23
Running the program.............................................................................................................23
Input.................................................................................................................................23
Output...............................................................................................................................24
Processing and Display of results..........................................................................................24
10. Time2EQ Program traveltime grid to synthetic observations...............................................25
Overview...............................................................................................................................25
Running the program.............................................................................................................25
Input.................................................................................................................................25
Output...............................................................................................................................26
Processing and Display of results..........................................................................................26
11. NLLoc Program nonlinear, earthquake location program....................................................27
Overview...............................................................................................................................27
Inversion Approach...............................................................................................................28
Gaussian Error Assumption..............................................................................................29
Complete, Nonlinear Location PDF.............................................................................30
Maximum likelihood hypocenter.......................................................................................30
Gaussian estimators...........................................................................................................31
Confidence Ellipsoid.........................................................................................................31
GridSearch Algorithm.........................................................................................................32
Procedure..........................................................................................................................32
MetropolisGibbs Sampling Algorithm.................................................................................34
Procedure..........................................................................................................................34
NonLinLoc Version 2.30 (18MAY2001)
1. Acknowledgements
The utility, quality and evolution of the NonLinLoc software package depends entirely on feedback
from its users. Many thanks to the following people for contributions, comments and suggestions
for the NonLinLoc software:
This work is supported in part by funding from IPSN, FontenayauxRoses, France, and by the
European Union project TomoVes (ENV44980696).
2. Overview
NonLinLoc Version 2.30 (18MAY2001)
The NonLinLoc (NonLinear Location) package is a set of programs and utilities for velocity
model construction, traveltime calculation and probabilistic, nonlinear, globalsearch earthquake
location in 3D structures, and for visualisation of 3D volume data and location results. Many of the
programs operate with 3D volumes, usually in the form of a 3D Grid structure which defines a
specific, gridded, rectangular volume in space.
See the book chapter Probabilistic earthquake location in 3D and layered models: Introduction
of a MetropolisGibbs method and comparison with linear locations for further information on
NonLinLoc and for an examination of synthetic 3D and 1D locations. See the article Lomax,
Zollo, Capuano, and Virieux, 2001 for further information on NonLinLoc and for an examination
of 3D locations of microseismicity under Vesuvius volcano.
Copyright notice
Most of the NonLinLoc software and source code are distributed under the terms of the GNU
General Public License (GNU GPL). PLEASE READ, UNDERSTAND AND AGREE WITH THE
GNU GPL BEFORE DOWNLOADING OR USING THE SEISMICITY VIEWER SOFTWARE:
GNU General Public License (GNU GPL, see Appendix 2, or
http://www.gnu.org/copyleft/gpl.html).
3. The Programs
The NonLinLoc package consists of the following programs:
NLLoc
NonLinear Location Determines the location for one or more events within a 3D
Grid using a systematic gridsearch, a stochastic, MetropolisGibbs search, or a
hybrid "OctTree" method. (outputs misfit or probability density function (PDF) on a
3D Grid, PDF samples or "scatter cloud", description of best hypocenter, and other
results).
Vel2Grid Velocity model to 3D Model Grid Given a velocity model description, creates a
model grid. (outputs a 3D Grid)
Grid2Time 3D Model Grid to Travel Time Grid Given a 3D Model Grid, calculates travel
times from a point within a 3D Grid to all other points within the grid. Optionally
calculates ray takeoff angles within the 3D Grid. (outputs a set of 3D Grids)
Time2EQ Travel Time Grid to Synthetic Observations Given a hypocenter location and a
set of travel time grids, calculated predicted travel times. (outputs a Phase file in
NonLinLoc format)
LocSum
Location Summation Utility that combines NLLoc location results and PDF
"scattercloud" samples from a number of events. (outputs a single set of summary
location files)
Grid2GMT Grid to GMT commands Utility that creates a command script for plotting plotting
sections and plan views of 3D Grid files, and misfit, PDF and location "scattercloud"
results using the GMT plotting package.
Utilities
Miscellaneous utility programs Utilities for conversion between HYPOELLIPSE
summary or FPFIT summary formats and NonLinLoc HypocenterPhase location
format.
In addition, the following analysis and visualisation software supports NonLinLoc event location
output formats:
SeismicityViewer Java program for viewing seismicity in 3D Interactive, animated, local or
Internetbased viewing in 3D of hypocenter, PDF "scatterclouds", error
ellipses, residuals, geographic data and other information.
5. Getting Started
Download the NonLinLoc Software
Go to the NonLinLoc home page (http://www.alomax.net/nlloc) for links to downloadable files.
NonLinLoc
Version 2.30 (18MAY2001)
Download the NonLinLoc Software and compile it on your machine,
or
Download the NonLinLoc Linux binary executables.
NOTES:
1. With gcc and Sun Solaris 2.6 on a Sun Workstation I have successfully compiled the
NonLinLoc software using the command make distrib. With gcc and Linux(SuSE
6.4) on a Pentium III PC I have successfully compiled the NonLinLoc software using
the command make R distrib. If you have successfully installed and run the
NonLinLoc software on another system, I would appreciate hearing about the details
of your hardware, operating system, compiler and compiler flags. Thanks.
[email protected]
2. Grid2GMT: I have made changes to Grid2GMT to support GMT 3.3.6, though there
seems to be bugs or other problems, i.e. the labelling of scale bars is incorrect. If you
use an earlier version of GMT, you may need to change the line #define
GMT_VER_3_3_4 1 in Grid2GMT to #define GMT_VER_3_3_4 0.
SeismicityViewer
Download the SeismicityViewer java code and class files.
Description
NonLinLoc software v2.30 released (Updated release of the NonLinLoc
software and documentation.)
New Features:
1. NLLoc: Added copying of output files from last location to files
last.hdr, last.hyp, etc.
2. NLLoc: Added new magnitude type MD_FMAG (duration
magnitude) to control statement LOCMAG.
3. NLLoc: Added SIMULPS format for phase pick files.
4. NLLoc: Added N Calif Seismic Network (NCSN)format.
5. NLLoc: Added grid memory management; NLLoc program
keeps and reuses traveltime grids in memory while there is
space.
6. NLLoc: Added Octtree importance sampling search method.
7. Grid2GMT: Added plotting of mechanisms and residuals.
8. NLLoc: Added new STAT_GEOG line to HypocenterPhase file
output.
9. Generic control statement MAPLINE: Added support for GMT
grd file plotting in Grid2GMT.
10.Generic: Added new, optional control statement MAPTRANS:
Specifies geographic transformation for plotting in Grid2GMT.
11.Generic: Added new, optional control statement MAPGRID:
Specifies grid region for plotting in Grid2GMT.
Date
Type
Description
Updates/Changes:
1. NLLoc: Added new station parameter sta_corr_fd_fmag
(duration magnitude station correction) to control statement
LOCCMP.
2. Seismicity Viewer: Updated version, runs as standalone and
applet.
3. NonLinLoc: Binary executable files provided for Linux, no
longer for Solaris.
4. NLLoc: Added maximum difference of SP to Hypocenter
Phase file VpVs line output.
5. NLLoc: Added quick fix for HYPO71 phase data Y2K problem:
if year < 20, year = year + 100.
6. NLLoc: Added quick fix for HYPO71 phase data Y2K problem:
if year < 20, year = year + 100.
Bug Fixes:
1. NLLoc: Fixed bug: hypoinverse format: W long and S lat were
not correctly written to summary file.
2. NLLoc: Fixed bug: Events with maximumlikelihood
hypocenters on ymax boundary of location search grid were
not identified as being on the grid boundary, and consequently
were not "rejected".
3. NLLoc: Fixed bug in Hutton Boore magnitude calculation:
epicentral and not hypocentral distance was used for r in K(r
100) term; changed to hypocentral distance.
4. NLLoc: Fixed bug in identifications of maximum likelihood
location on search grid boundary: locations on Ymax boundary
were not correctly identified.
10
Date
17FEB2000
Type
New
Version
v2.00
Description
NonLinLoc software v2.00 released (New version of the NonLinLoc
software and documentation. Significant changes are indicated in the
documentation by (ver 2.0))
New Features:
1. NLLoc:
Control
statement
LOCMETH:
Added
minNumberSphases, minimum number of S phases that
must be accepted before event will be located (Important: You
must add a minNumberSphases value to the LOCMETH
statement in any existing NLLoc control files to update them
for NLLoc v2.0)
2. NLLoc: Added new control statement LOCEXCLUDE to
explicitly exclude selected station/phase observations from being
used for location
3. NLLoc: output HypocenterPhase file: Added Vp/Vs estimation
(in VPVSRATIO line) following methodology of Lahr (1989)
4. Grid2GMT: Added optional override of default GMTcpt
colours. If a GMTcpt file named Grid2GMT.cpt is present
in the directory in which the GMT script is run, it will be used
for the plot and scalebar contours levels and colours for all plot
types that use contouring.
5. Grid2GMT: Added optional additional GMT script to be run for
each view type. If a GMT script file named
Grid2GMT.?.gmt, where ? = H, X, Y or V is present in
the directory in which the main GMT script is run, it will be run
for the corresponding view (H, X, Y or V)after all standard
GMT script is run for that view.
6. Time2EQ: Added new control statement EQVPVS to specify
constant Vp/Vs ratio to allow use of P phase traveltime grids to
calculate S phase travel times.
Updates/Changes:
1. Grid2GMT: Added support for oblique vertical cross sections in
V mode and for specification of cross section end points in
latitude and longitude (new VL mode).
2. Time2EQ: Control statement EQSTA: Added NONE error type
11
Date
Type
Description
Bug Fixes:
25JUN1999
New
Release
v1.30
08APR1999
New
Release
v1.21
12
Date
Type
10MAR1999 New
Release
v1.2
Description
NonLinLoc software v1.2 released (Third "Beta" release of the
NonLinLoc software and updated documentation.)
New Features:
1. NLLoc: LOCMETH Added option for constant Vp/Vs ratio to
allow use of P phase traveltime grids to calculate S phase travel
times.
Updates/Changes:
1. Generic control statement CONTROL: Added random number
seed.
Bug Fixes:
1. NLLoc: Fixed bug that automatic x grid positioning could not be
switched off (see Control statement LOCGRID).
13
Date
25JAN1999
Type
New
Release
v1.1
Description
NonLinLoc software v1.1 released (Second "Beta" release of the
NonLinLoc software and updated documentation.)
New Features:
1. NLLoc: Control statement LOCPHSTAT: Added RMS_Max,
NRdgs_Min and Gap_Max cutoffs for selection of residuals to
be used in calculation of average residuals.
2. Grid2Time: Control statement GTSRCE: Added LATLONDS
(degrees + minutes + decimal seconds latitude/longitude) format
for source location.
3. Time2EQ: Added control statement EQMECH to allow
specification of a double couple or explosion mechanism for
synthetic first motion calculation.
4. Time2EQ: Added control statement EQSRCE to allow
specification of multiple sources.
5. Time2EQ: Control statement EQSTA: Added FIX option to
allow a fixed noise or static shift to travel time.
6. Time2EQ: Control statement EQSTA: Added parameters
errorReportType and errorReport to specify how phase error is
written to phase file.
7. Time2EQ: Added control statement EQMODE to select
calculation of times from single source to multiple stations or
from multiple sources to single station.
8. Time2EQ: Added control statement EQQUAL2ERR to allow
mapping of errorReport to HYPO71 format quality levels.
9. LocSum: Added additional command arguments Len3Max,
ProbMin, RMSMax, NRdgsMin and GapMax to filter events
that are summed.
Updates/Changes:
1. Generic control statement TRANS: Implemented rotAngle in
SIMPLE transformation.
2. NLLoc: GridSearch and Control statement LOCGRID:
Automatic grid shifting added to attempt to get nested grids
inside original grid.
3. NLLoc: MetropolisGibbs search: Initial walk location now set
under the station with earliest arrival time. Algorithm for
automatic setting of initial step size changed.
4. NLLoc: MetropolisGibbs search: Walk algorithm modified to
handle the case that new walk locations are rejected for a large
number of consecutive tries. This case may indicate that the
search has found a deep, narrow minima in misfit.
5. Grid2GMT: 2D error ellipses replaced by projections of 3D
confidence ellipsoid.
6.
14
Date
Type
Description
Bug Fixes:
20JAN1999
Known
Bug
11AUG1998 New
Release
v1.0
for
15
Overview
The following steps will lead you through the installation of files, the creation of a model grid and
calculation of travel time grids, and the location and visualisation of the sample location.
Before doing the sample location, you must download and install the NonLinLoc software, and, for
visualisation, the Seismogram Viewer software (see the NonLinLoc Home page). For postscript
plotting, you need to have the the GMT plotting package available on your system. (Note that the
sample location tar include a hidden ".gmtdefaults" file that will be installed in your sample location
working directory. You may want to modify this file, but for proper functioning of Grid2GMT
leave the units as "MEASURE_UNIT = cm")
Copies of some the output files you should obtain will be in the original_output/ sub
directory of the directory where you install the sample location files.
gmt/
Examine the NonLinLoc Control file: run/nlloc_sample.in, this file contains the
statements used by each of the NonLinLoc programs when the sample is run.
17
G 0 0 0 301
Look at the postscript with your favourite viewer, i.e.:
gs gmt/layer.P.AURF.angle.VG.ps
Generate some synthetic arrival times
Create the synthetic times:
Time2EQ run/nlloc_sample.in
Look at the synthetic times:
more obs/synth.obs
Do the event Location
Locate the event using the OctTree search:
NLLoc run/nlloc_sample.in
Look at the NonLinLoc HypocenterPhase location file:
more loc/vinti.19950421.080259.grid0.loc.hyp
Plot the first event location with GMT
Create a GMT script and postscript image of the location PDF:
Grid2GMT run/nlloc_sample.in
loc/vinti.19950421.080259.grid0.loc gmt/ L S
Look at the postscript with your favourite viewer, i.e.:
gs gmt/vinti.19950421.080259.grid0.loc.LS.ps
Combine all event locations with LocSum
Combine the HypocenterPhase and scatter files into a location summary file:
LocSum ./run/vinti 1 loc/vinti "loc/vinti.*.*.grid0.loc"
Plot the combined locations with GMT
Create a GMT script and postscript image of the location Expectations and Ellipsoids:
Grid2GMT run/nlloc_sample.in loc/vinti gmt/ L E101
Look at the postscript with your favourite viewer, i.e.:
18
gs gmt/vinti.LE_101.ps
Visualise the location with Seismicity Viewer (you must have installed Seismicity
Viewer, see Seismicity Viewer software guide)
Go to the viewer directory, i.e.:
cd $HOME/NLLoc/nlloc_sample/viewer
Run Seismicity Viewer and visualise interactively the combined locations:
java seismicity.Seismicity ../loc/vinti.hyp
19
Overview
The Vel2Grid program converts analytic or other velocity model specifications into a 3D Grid file
containing velocity or slowness values.
The Vel2Grid program uses a "flat earth", rectangular, lefthanded, x,y,z,t coordinate system
(positive X = East, positive Y = North, positive Z = down). Distance units are kilometres.
background model must be defined if the transformed 2D polygon model does not
completely fill the requested 3D grid.
Output
The velocity or slowness values throughout the requested grid are written to a new 3D Grid File.
For a description of the naming convention for these grid files, see the VGOUT statement in the
Vel2Grid Statements section of the Input Control File.
21
Overview Podvin and Lecomte Algorithm TakeOff Angles Algorithm Running the
programInput Output Processing and Display of results [NonLinLoc Home]
Overview
The Grid2Time program calculates the traveltimes between a station and all nodes of an x,y,z
spatial grid using the Eikonal finitedifference scheme of Podvin and Lecomte (1991). The results
are stored on disk in a traveltime 3D Grid files.
Optionally, the Grid2Time program also estimates the takeoff angles for rays from each point in
the grid to the source by examining the gradients of the traveltime field. These results are stored in
an angles grid.
The 3D traveltime computation and the size of the output timegrid files grow rapidly with grid
dimension. However, for location in horizontally layered models the traveltimes can be stored on
compact 2D grids. A layered model / 2D grid can also be used for"regional" stations far from the
local search volume in combination with 3D models and 3D grids for stations within the search
volume. This option may introduce some error if strong heterogeneity in the local 3D velocity
structure intersects the (usually downgoing) ray paths to the regional stations.
The Grid2Time program uses a "flat earth", rectangular, lefthanded, x,y,z,t coordinate system
(positive X = East, positive Y = North, positive Z = down). Distance units are kilometres, and many
input/output distance quantities can be expressed in rectangular or geographic (latitude and
longitude) coordinates.
22
23
Generic Statements section of the Input Control File must contain the CONTROL and TRANS
(Geographic Transformation) statements.
In addition, the Grid2Time program requires:
1. A 2D or a 3D velocity model 3D Grid file created using Vel2Grid or other software. One
velocity model grid is required for each wave type (i.e. P or S). Note that a 3D Grid file may
specify a 2D model.
The names, locations and other information for these files is specified in the Grid2Time Statements
section of the Input Control File.
Output
The traveltimes and takeoff angles throughout a grid are written to a separate 3D Grid File for
each phase at each station. For a description of the naming convention for these grid files, see the
GTFILES statement in the Grid2Time Statements section of the Input Control File.
24
Running the programInput Output Processing and Display of results [NonLinLoc Home]
Overview
The Time2EQ program calculates predicted traveltimes between one or more synthetic events and
one or more stations. Predicted takeoff angles at the source are also calculated if an event
mechanism is given and the corresponding takeoff angles grids are available.
25
Output
The predicted traveltimes are written to an observation file in NonLinLoc phase file format.
26
Overview
The NLLoc program produces a misfit function, "optimal" hypocenters, an estimate of the
posterior probability density function (PDF) for the spatial, x,y,z hypocenter location, and other
results using either a systematic GridSearch, a stochastic, MetropolisGibbs sampling
approach, or an octtree importance sampling algorithm.
The location algorithm used in NLLoc (Lomax, et al., 2000) follows the inversion approach of
Tarantola and Valette (1982), and the earthquake location methods of Tarantola and Valette (1982),
Moser, van Eck and Nolet (1992) and Wittlinger et al. (1993). The errors in the observations (phase
time picks) and in the forward problem (traveltime calculation) are assumed to be Gaussian. This
assumption allows the direct, analytic calculation of a maximum likelihood origin time given the
observed arrival times and the calculated travel times between the observing stations and a point in
x,y,z space. Thus the 4D problem of hypocenter location reduces to a 3D search over x,y,z space.
To make the location program efficient for complicated, 3D models, the traveltimes between each
station and all nodes of an x,y,z spatial grid are calculated once using a 3D version (Le Meur, 1994;
Le Meur, Virieux and Podvin, 1997) of the Eikonal finitedifference scheme of Podvin and
Lecomte (1991) and then stored on disk as traveltime grid files. This storage technique has been
used by Wittlinger et al. (1993), and in related approaches by Nelson and Vidale (1990) and Shearer
(1997). The forward calculation during location reduces to retrieving the traveltimes from the grid
files and forming the misfit function g(x) in, equation (3).
In addition, to save disk space and for faster calculation, a constant Vp/Vs ratio can be specified,
and then only P traveltime grids are required for each station.
The Podvin and Lecomte (1991) algorithm and related methods use a finitedifferences
approximation of Huygens principle to find the first arriving, infinite frequency travel times at all
nodes of the grid. The algorithm of Podvin and Lecomte (1991) gives stable recovery of diffracted
waves near surfaces of strong velocity contrast and thus it accurately produces travel times for
diffracted and head waves. A limitation of the current 3D version of the method is a restriction to
cubic grids. This may lead to excessively large traveltime grids if a relatively fine cell spacing is
required along one dimension since the same spacing must be used for the other dimensions. This
can be a problem for regional studies where a fine node spacing in depth is necessary, but the
NonLinLoc Version 2.30 (18MAY2001)
27
horizontal extent of the study volume can be much greater than the depth extent. Thus a
modification of the travel times calculation to allow use of an irregular grid would be very useful.
After the travel times are calculated throughout the grid, the NonLinLoc program uses the gradients
of traveltime at the node to estimate the takeoff angles at each node. Two gradients are estimated
for each axis direction x, y, and z one Glow between the node and its preceding neighbour along the
axis, and a second Ghigh between the following neighbour and the node. The total gradient Gaxis
along an axis is the mean of these two gradients; the total gradient along the three axes determines
the vector gradient of traveltime. The direction opposite to the vector gradient of traveltime gives
the ray takeoff angles for dip and azimuth. An estimate of the quality of the angle determination is
given by a comparison of the magnitudes and signs of Glow and Ghigh. If these two values are not
similar, then there may be two rays which arrive nearly simultaneously at the station, and the take
off angle determination at the node may be unstable.
The x,y,z volume used for location must be fully contained within the 3D traveltime grids. This
limits the largest station distance that can be used for location since the 3D traveltime computation
and the size of the output timegrid files grow rapidly with grid dimension. However, for location
in flatlayered media, the travel times can be stored on very compact 2D grids, and readings for
"regional" stations far from the search volume can be used.
The NLLoc program uses a "flat earth", rectangular, lefthanded, x,y,z coordinate system (positive
X = East, positive Y = North, positive Z = down). Distance units are kilometres, and many
input/output distance quantities can be expressed in rectangular or geographic (latitude and
longitude) coordinates.
See the book chapter Probabilistic earthquake location in 3D and layered models: Introduction
of a MetropolisGibbs method and comparison with linear locations (Lomax, et al., 2000) for
further information on the NonLinLoc location algorithms.
Inversion Approach
The earthquake location algorithm implemented in the program NLLoc (Lomax, et al., 2000)
follows the probabilistic formulation of inversion presented in Tarantola and Valette (1982) and
Tarantola (1987). This formulation relies on the use of normalised and nonnnormalised probability
density functions to express our knowledge about the values of parameters. Thus, given the
normalised density function f(x) for value of a parameter x, the probability that x has a value
between X and X+X is
.
(1)
posterior probability density function (PDF) p(p) (Tarantola and Valette, 1982; Tarantola,
1987)
,
(2)
where p(p) and d(d) are null information density functions specifying the state of total ignorance.
In this expression K is a normalisation factor, (x) is a density function of prior information on the
model parameters, and g(x) is an L2 misfit function.
is the vector of observed arrival times t
minus their weighted mean,
(5)
The posterior density function (PDF) (x) given by equation (3) represents a complete, probabilistic
solution to the location problem, including information on uncertainty and resolution. This solution
does not require a linearised theory, and the resulting PDF may be irregular and multimodal
because the forward calculation involves a nonlinear relationship between hypocenter location and
traveltimes.
This solution includes location uncertainties due to the spatial relation between the network and the
event, measurement uncertainty in the observed arrival times, and errors in the calculation of
theoretical travel times. However, realistic estimates of uncertainties in the observed and theoretical
NonLinLoc Version 2.30 (18MAY2001)
29
times must be available and specified in a Gaussian form through Ct and CT, respectively. Absolute
location errors due to incorrect velocity structure could be included through CT if the resulting
travel time errors can be estimated and described with a Gaussian structure. Estimating these travel
time errors is difficult and often not attempted. When the model used for location is a poor
approximation to the "true" structure (as is often the case with layered model approximations), the
absolute location uncertainties can be very large.
30
Gaussian estimators
"Traditional" Gaussian or normal estimators, such as the expectation E(x) and covariance matrix C
may be obtained from the gridded values of the normalised location PDF or from samples of this
function (e.g. Tarantola and Valette, 1982; Sen and Stoffa,1995). For the grid case with nodes at
xi,j,k,
,
(6)
where V is the volume of a grid cell. For N samples drawn from the PDF with locations xn,
,
(7)
where the PDF values (xn) are not required since the samples are assumed distributed according to
the PDF. For both cases, the covariance matrix is then given by
.
(8)
The Gaussian estimators are output to the NNLoc, ASCII HypocenterPhase File (STATISTICS
line).
Confidence Ellipsoid
The 68% confidence ellipsoid can be obtained from singular value decomposition (SVD) of the
covariance matrix C, following Press et al. (1992; their sec. 15.6 and eqs. 2.6.1 and 15.6.10). The
SVD gives:
,
(9)
where U = V are square, symmetric matrices and wi are singular values. The columns Vi of V give
the principle axes of the confidence ellipsoid. The corresponding semidiameters for a 68%
confidence ellipsoid are (3.53wi), where 3.53 is the 2 value for 68.3% confidence and 3 degrees
of freedom.
The Gaussian estimators and resulting confidence ellipsoid will be good indicators of the
uncertainties in the location only in the case where the complete, nonlinear PDF has a single
maximum and has an ellipsoidal form.
31
GridSearch Algorithm
The gridsearch algorithm performs successively finer, systematic gridsearches within a spatial,
x,y,z volume to obtain a misfit function, an optimal hypocenter and an estimate of the posterior
probability density function (PDF) for hypocenter location.
Advantages:
1. Does not require partial derivatives, thus can be used with complicated, 3D velocity
structures
2. Systematic, deterministic coverage of search region
3. Accurate recovery of very irregular (nonellipsoidal) PDFs with multiple minima
4. Efficiently reads into memory 2D planes of 3D traveltime grid files, thus can be used with
large number of observations and large 3D traveltime grids
5. Results can be used to obtain confidence contours
Drawbacks:
1. Very time consuming relative to stochastic and linear location techniques
2. Relative to the size of the most significant region of the PDF, the final search grids may be
too large (giving low resolution) or too small (giving truncation of the PDF)
3. Requires careful selection of grid size and node spacing
Procedure
The GridSearch location is based on a nested grid search using one or more location grids as
specified by LOCGRID statements in the Input Control File. The first LOCGRID statement
specifies a specific initial search grid with fixed size, number of nodes and location. Subsequent
LOCGRID statements specify the size and number of nodes for subsequent, nested grids; the
location of these nested grids is usually set automatically in one or more of the x,y,z directions.
32
For each location grid, the location quality (misfit or PDF value) at every node is obtained. For each
node, the traveltimes for each observation are obtained from the corresponding traveltime grid
file and the PDF (x), or misfit value g(x) is calculated using the equations given above in the
Inversion Approach section. These location quality values are saved to a 3D grid file if requested. If
there is a subsequent nested grid, its position (for the directions with automatic positioning) is set so
that it is centred on the maximum PDF node (or, equivalently, the minimum misfit node) of the
current grid.
The initial location grid must be fully contained within the traveltime grid files corresponding to a
given observation for that observation to be used in the location. Subsequent location grids, even if
their position is set automatically, must be fully contained within the initial grid. The NLLoc
program will attempt to translate a nested grid that intersects a boundary of the initial grid so that it
is contained inside of the initial grid; if this is not possible the location will be terminated
prematurely.
For every node of each location grid, the gridsearch algorithm must obtain traveltimes for every
observation. These times are stored on disk in 3D traveltime grid files which may be very large. It
would be extremely time consuming to read these times one by one directly from the disk files, but
there is also not enough space in general to fully read all the relevant 3D grid files into memory.
However, the grid search is performed systematically throughout each location grid with the x index
varying last. Thus, it is adequate to have 2D planes or "sheets" corresponding to the current x index
available in memory at any one time. This approach is used by the gridsearch algorithm. Sheets of
data with a given x index are read from the 3D traveltime grid files as large blocks of bytes, which
33
is very fast in comparison to reading the same number of data values individually.
Procedure
The MetropolisGibbs search procedure to obtain samples of a PDF is based on the algorithm of
Metropolis et al. (1953) for the simulation of the distribution of a set of atoms at a given
temperature. The MetropolisGibbs algorithm used here is similar to the "Metropolis" algorithm
described in Mosegaard and Tarantola (1995) and the "Gibbs sampler" with temperature T=1
described in Sen and Stoffa (1995; sec 7.2). It may be considered as a version of Metropolis
simulated annealing Kirkpatrick et al. (1983) where the temperature parameter is a constant
determined by the covariance matrix for the observational and forward problem uncertainties. Thus
the algorithm does not "anneal" or converge to an optimal solution, but instead produces a set of
samples which follow the posterior PDF for the inverse problem.
The MetropolisGibbs sampler used in the program NonLinLoc for earthquake location consists of
a directed walk in the solution space (x, y, z) which tends towards regions of high likelihood for the
location PDF, (x) given by equation (3). At each step, the current walk location xcurr is perturbed
by a vector dx of arbitrary direction and given length l to give a new location xnew. The likelihood
(xnew) is calculated for the new location and compared to the likelihood (xcurr) at the current
location. If (xnew) (xcurr), then the new location is accepted. If (xnew) < (xcurr), then the new
location is accepted with probability P = (xnew) / (xcurr). When a new location is accepted it
34
becomes the current location and may be saved as a sample of the location PDF.
In earthquake location, the dimensions of the significant regions of the location PDF can vary
enormously and are not known a priori. It is important to choose an initial step size large enough to
allow global exploration of the search volume, and to obtain a final step size that gives good
coverage of the location PDF while resolving details and irregular structure of the PDF. The
NonLinLoc MetropolisGibbs sampler uses three distinct sampling stages to determine adaptively
an optimal step size l for the walk:
1. A learning stage where the step size is fixed and relatively large. The walk can explore
globally the search volume and migrate towards regions of high likelihood. "Accepted"
samples are not saved.
2. An equilibration stage where the step size l is adjusted in proportion to the standard
deviations (sx, sy, sz) of the spatial distribution of all previously "accepted" samples obtained
after the middle of the learning stage. After each new accepted sample, the standard
deviations are updated and the step size l is set equal to fs (sxsysz/Ns)1/3, where Ns is the
number of previously "accepted" samples, and fs=8 is a step size scaling factor. This formula
sets l in proportion to the cell size required to tile with Ns cells the rectangular volume with
sides sx, sy and sz. The walk can continue to migrate towards or may begin to explore regions
of high likelihood. "Accepted" samples are not saved.
3. A saving stage where the step size l is fixed at its final value from the equilibration stage.
The walk can continue to explore regions of high likelihood. "Accepted" samples are
assumed to follow the location PDF and can be saved, but there may be a waiting time of
several samples between saves to insure the independence of saved samples.
35
It is important to set the parameters for the directed walk so that (1) during the learning and
equilibration stages the walk approaches and reaches the high likelihood regions of the location
PDF, and so that (2) by the saving stage a suitable, relatively small, fixed step size has been
obtained to accurately explore and image the PDF.
36
37
Procedure
The octtree method uses recursive subdivision and sampling of cells in 3D space (below) to
generate a cascade of sampled cells, where the density of sampled cells follows the PDF values of
the cell centre.
38
Pi= Vi PDF(xi)
where Vi is the cell volume and xi are the coordinates of the cell centre.
The core of the method is an ordered list LP of probability values Pi for all previously sampled cells:
39
The octtree sampling procedure is initialised by a global sampling of the full search space on a
coarse, regular grid (B below). The misfit value gi(x) at the centre of each grid cell is determined,
the probability Pi is calculated, and the cell is inserted in the probability list LP at the position
corresponding to its probability Pi.
Next the following steps are repeated (CE below) until a predetermined number of evaluations of
the forward problem or other termination criterion has been reached:
1. The cell Cmax with the largest probability Pmax (red squares below) is obtained from the
ordered list LP
2. Cmax is divided into 8 childcells
3. The misfit and probability Pi are calculated for each of the 8 childcells
4. The 8 new cells are inserted into the ordered list LP according to their Pi
5. Repeat
This recursive procedure converges rapidly, producing an octtree structure of cells specifying
location PDF values in 3D space (F above). This octtree structure will have a larger number of
cells in the regions of higher PDF (lower misfit) and thus gives approximate importance sampling
of the PDF (A above).
40
Finally, samples in 3D drawn from the octtree structure (below) give a useful and compact
representation of the PDF.
41
42
An image of all cell centres visited by the octtree method (blow, left) shows that this method
samples globally while producing efficient importance sampling: i.e. The distribution of cell centres
follows closely the distribution of samples of the final PDF (right).
Discussion
The octtree method performs well for the earthquake location problem because it is 3D. This
allows the use of the simple geometry of octtree division of rectangular cells: the volume of each
cell is always known and it can be determined easily which cell contains a given point. The octtree
method should be applicable in 4D, allowing a search over origin time. But in higher dimensional
problems the determination of the volume of a cell and whether or not a cell contains a given point
may become difficult or impossible.
The octtree approach can be applied to teleseismic location in a spherical earth by a) performing
NonLinLoc Version 2.30 (18MAY2001)
43
the location in a cubic region containing the spherical earth, or b) dividing the spherical earth into
organised curvilinear cells which can be further subdivided into 8 child cells.
Output
The location results can be output for single event and summary (all events) as:
1. A 3D Grid containing misfit values or PDF* (probability density function) values
throughout the search volume (Gridsearch only).
2. An ASCII HypocenterPhase File containing hypocentral coordinates and origin time
for the best (minimum misfit / maximum likelihood) point in the the search volume and an
associated phase list! containing station and phase identifiers, phase times, residuals, take
off angles and other station/phase information. This file contains other information,
including the hypocentral coordinates and uncertainty* given by the traditional
(Gaussian/Normal) expectation and covariance matrix measures of the PDF.
3. A binary Scatter file containing samples drawn from the PDF
4. An ASCII Confidence Levels giving the value of the PDF corresponding to confidence
levels from 0.1 to 1.0
44
* these output types are only generated for grids where the PDF is calculated.
! these output types are only written to single event files
The location results can also be output as summary (all events) files containing:
1.
2.
3.
4.
Single event and summary files are only saved for specific nested searchgrids as specified in the
LOCGRID statement in the Input Control File.
45
Overview
The LocSum utility combines single event NLLoc location files ( HypocenterPhase files and
binary Scatter files) into a single set of summary location files.
For flexibility, the LocSum utility takes most of its parameters from the command line.
OutRoot
LocRoot
[Len3Max
Parameters:
SizeGridRoot (chars)
full or relative path and root name (no extension) for a 3D Grid Header file. The
grid dimensions in this header file are used to create an empty grid buffer and new
grid header file with root name OutRoot.
decimFactor (integer)
decimation factor (decimFactor > 0) for decimating the number of PDF
Scatter samples. Every decimFactorth sample is saved to the output files.
OutRoot (chars)
full or relative path and root name for output files.
LocRoot (chars)
full or relative path and root name (no extension) for one or more NLLoc single
Event Location files. Multiple root names may be specified using standard UNIX
"wildcard" characters (* and ?); however, if any "wildcard" characters are used
then the path and root name must be enclosed in double quotes (") to prevent the
46
Output
The LocSum utility creates the following files:
1. A summary HypocenterPhase file named OutRoot.hyp. This file includes SCATTER
blocks.
2. A summary binary Scatter file named OutRoot.scat.
3. A set of summary ASCII Scatter files for xy, xy and zy projections, named
OutRoot.scat.ext, where ext = XY, XZ, ZY for sample locations in kilometres and
ext = longlat.XY, longlat.XZ, longlat.ZY for sample locations in degrees of
latitude and longitude and depth in kilometres. These ASCII formats are compatible with the
GMT plotting package.
4. A 3D Grid Header file named OutRoot.hdr and an empty 3D Grid Buffer file named
OutRoot.buf. These file are created to insure compatibility with postprocessing
programs and utilities.
47
Overview
The Grid2GMT utility generates and runs an ASCII, GMT command script for plotting sections and
plan views of 3D grid files and location misfit, PDF and "scattercloud" results. When run, the
GMT command script creates a postscript file which can be viewed on screen or printed. Running
the GMT command script requires the installation of the GMT plotting package.
For flexibility, the Grid2GMT utility takes most of its parameters from the command line.
The default GMT script plots the views in the transformed XY coordinates. Horizontal (plan)
view only plots can also be plotted in geographic latlong coordinates. See the notice and
instructions in the *.gmt script file generated by Grid2GMT for more details.
Grid2GMT can be somewhat cumbersome and confusing to use because it combines several
functions (i.e. plotting sections and location results), it requires several paths and filenames, and it
does not have as sophisticated error checking as other NonLinLoc programs.
48
49
location statistics.
S Plot location "scattercloud" results. For locations (L), also plots location
statistics.
Ennndx Plot location statistics (Maximum Likelihood location and/or
traditional, Gaussian/Normal Expectation and Confidence Ellipsoid). nnndx is a
code of: three integers with values n = 0 (no) or 1 (yes) specifying which
statistics to plot (Maximum Likelihood point, Expectation point and Confidence
Ellipsoid, respectively), and an optional float dx which specifies a maximum
distance in km between the Expectation and Maximum Likelihood points allowed
for each event to be plotted.
M (ver 2.3) Plot focal mechanisms.
Rphases/scale (ver 2.3) Plot phase residuals as symbols with a size
proportional to residual magnitude and with type and color dependent on phase.
phases is a set of phase codes, i.e. P or SnSg specifying which phases to plot.
scale (float) specifies the relative size of the residual symbols.
Parameters: (Vertical cross section V)
iX1 iY1 iX2 iY2 (integers)
the minimum and maximum grid indices (0 to Num1, where Num is the number
of grid nodes) for the x and y directions. This option plots sections parallel to the
coordinate axes and oblique sections (ver 2.0). Set iX1=iX2 and iY1<iY2 for
a section in the y,z plane, or iY1=iY2 and iX1<iX2 for a section in the x,z
plane. The full grid range in the z direction is always plotted.
Parameters: (Vertical cross section lat/long VL) (ver 2.0)
lat1 long1 lat2 long2 (floats)
the latitude and longitude of the left (1) and right (2) end of the cross section (all
lat/long locations must be within the 3D grid) . This option plots sections parallel
to the coordinate axes and oblique sections. The lat/long locations are converted
to grid locations using the transformation specified in the TRANS statement of the
InputControlFile. The full grid range in the z direction is always plotted.
Parameters: (Horizontal cross section H)
iZ (integer)
the grid index (0 to zNum1, where zNum is the number of grid nodes) for the
section level in the z direction. Currently this option only plots sections parallel to
the x,y coordinate axes. The full grid range in the x and y directions is always
plotted.
Parameters: (Location L)
(no additional parameters)
The full grid range in the x, y and z directions is always plotted.
50
Notes:
1. See the Definitions section of the NonLinLoc Control File documentation for more
information on datatypes.
2. Grid2GMT uses cm units, thus for proper execution of the GMT command script, the
MEASURE_UNIT entry in the .gmtdefaults file must be set to cm (i.e.
MEASURE_UNIT = cm)
3. The x, y and z coordinate limits and the number of grid nodes is determined by the
grid origin and dimensions in the grid header file corresponding to the GridRoot
root name. For plotting event locations which have no corresponding grid files, create
a 3D Grid header file named (GridRoot.hdr) with the desired grid origin and
dimensions.
4. The plotted ellipsoids are 2D projections of the Confidence Ellipsoids as calculated by
the NLLoc location program (see Inversion section of the NLLoc program
documentation); the 2D projections DO NOT represent the 2D, marginal distributions
of the 3D Confidence Ellipsoids.
51
Examples:
1. Grid2GMT run/nlloc_sample.in time/layer.P.AURF.time gmt/ V
G 0 0 0 301
Using Input Control File run/nlloc_sample.in, creates a GMT script for the 3D
grid traveltime file with root name time/layer.P.AURF.time. The GMT script
and temporary files are written to directory ./gmt/. The script will plot a Vertical
cross section (V), showing the traveltime grid (G) for grid nodes = 0 in the x direction
and between grid nodes 0 and 301 in the y direction. (HYPERLINK
"file:///zip/nlloc/soft2.30/Grid2GMT_ex1.gif"View resulting plot)
52
53
54
55
56
Output
The Grid2GMT utility generates and runs an ASCII, GMT command script with the name
Outroot/GridRoot.gmt. When run, this GMT command script creates a postscript file which
can be viewed on screen with a postscript viewer, or printed on a postscript printer. Running the
GMT command script requires the installation of the GMT plotting package.
The GMT command script can be edited and elements of the script extracted to produce custom
GMT plots.
57
hypoe2hyp fpfit2hyp
hypoe2hyp
The hypoe2hyp utility converts a file containing HYPOELLIPSE hypocenter summary records to a
file in NonLinLoc hypocenterPhase summary format. Optionally, the events written to output can
be selected based on cutoff values for the maximum length of the confidence ellipsoid major axis,
the maximum RMS misfit, the minimum number of observation readings, or the maximum azimuth
gap.
Synopsis:
hypoe2hyp inputHypoellipseFile outputNonLinLocHypFile
[EllLenMax [RMSMax [NRdgsMin [GapMax]]]]
Parameters:
inputHypoellipseFile (chars)
specifies the complete path and filename for an existing HYPOELLIPSE
hypocenter summary file.
outputNonLinLocHypFile (chars)
specifies the complete path, filename and file extension for the output NonLinLoc
hypocenterPhase summary file. The extension .hyp is recommended.
EllLenMax (float, default=1.0e6)
maximum length of the confidence ellipsoid major axis for event selection.
RMSMax (float, default=1.0e6)
maximum RMS misfit for event selection.
NRdgsMin (int, default=0)
minimum number of observation readings for event selection.
GapMax (int, default=360)
maximum RMS misfit for event selection.
Notes:
1. If a given event selection criteria is used, then values for all preceding selection
criteria on the command line must also be included.
2. Only a subset of the NonLinLoc hypocenterPhase file format lines are included in
58
the output.
fpfit2hyp
The fpfit2hyp utility converts a file containing FPFIT (Reasenberg et al., 1985) focal mechanism
summary records to a file in NonLinLoc hypocenterPhase summary format. Optionally, the
events written to output can be selected based on cutoff values for the the maximum RMS misfit
for the mechanism determination, the maximum RMS misfit for the event location, the minimum
number of observation readings, or the maximum azimuth gap.
Synopsis:
hypoe2hyp inputFPFITSumFile outputNonLinLocHypFile
[MechMisfitMax [RMSMax [NRdgsMin [GapMax]]]]
Parameters:
inputFPFITSumFile (chars)
specifies the complete path and filename for an existing FPFIT summary file.
(The extension for this file is usually .sum).
outputNonLinLocHypFile (chars)
specifies the complete path, filename and file extension for the output NonLinLoc
hypocenterPhase summary file. The extension .hyp is reccommended.
MechMisfitMax (float, default=1.0e6)
maximum RMS misfit of the mechanism determination for event selection.
RMSMax (float, default=1.0e6)
maximum RMS misfit of the event location for event selection.
NRdgsMin (int, default=0)
minimum number of observation readings for event selection.
GapMax (int, default=360)
maximum RMS misfit for event selection.
Notes:
1. If a given event slection criteria is used, then values for all preceeding selection
criteria on the comand line must also be included.
2. Only a subset of the NonLinLoc hypocenterPhase file format lines are included in
the output.
59
Overview
This chapter describes the input and output file formats used by the various NonLinLoc programs.
Some formats (such as the 3D Grid format) are used by many of the programs, while others are
specific to a particular program.
Many files have an easy to read ascii format with spaces between fields. To minimize disk space
usage and to speed input/output some files are binary (such as the 3D Grid "buffer" file containing
the grid data.
Definitions
General ASCII Datatypes Binary Datatypes
General:
FileExtension=
required extension for file name
required
item must be present in file
optional
item is optional in file
repeatable
item may be present multiple times file
ignored
may be present in file but is not used
ASCII Datatypes:
integer
ascii decimal integer (i.e. 0, 5, 285)
float
ascii decimal floating point number (i.e. 1.0, 34.68, 4.5)
expFloat
60
Binary Datatypes:
char
1 byte character
int
signed integer (usually 4 bytes)
short
short integer (usually 2 bytes)
long
long integer (usually 4? bytes)
float
4 byte floating point number
double
8 byte floating point number
61
62
Buffer: (required) Sequence of one float for each node on the grid specifying a physical
value at the node (i.e. traveltime between the node and the source), or a coded set of values
(i.e. takeoff angles at the node for rays to the source)
d(N) (N = 0, xNum*yNum*zNum 1)
Fields:
d(N) (float)
value at node N = ((Nx1)*yNum + (Ny1))*zNum + Nz, where
xNum yNum zNum are the number of grid nodes in the x, y and z
directions and Nx Ny Nz are the node indexes (starting at 0) along the x,
y and z axes, respectively.
Notes:
1. The values are stored as a succession of planes in x, each plane consisting of a
succession of vectors in y, each vector consisting of a succession of points in z.
Thus, to read/write the buffer requires a loop over z, contained within a loop
over y, contained within a loop over x. If the file is read directly into a memory
buffer, it might be accessed in C with an array d[Nx][Ny][Nz], and in
FORTRAN with an array d(Nz,Ny,Nx).
2. For takeoff angle data (gridType = ANGLE, ANGLE2D) each float
value contains a coded set of 3 values the ray takeoff azimuth (16 bit
integer, 0 to 3600 in tenths deg clockwise from North), the ray takeoff dip (12
bit integer, 0 (down) to 1800 (up) in tenths deg) and a quality value (4 bit
integer, 0 (low) to 10 (high)). The 3 values are related to the float with a C
union:
typedef union
{
float fval;
unsigned short ival[2];
} TakeOffAngles;
The dummy variable float fval allows accessing, reading and writing of
the buffer with the same functions that operate on the other data buffer types.
An analogue to this union can be formed in FORTRAN using an
EQUIVALENCE statement. The unsigned short ival[2] can be coded
and decoded with the folowing C functions:
/*** function to set angle values in takeoff angles union */
TakeOffAngles SetTakeOffAngles(double azim, double dip, int
iqual)
{
TakeOffAngles angles;
angles.ival[1] = (unsigned
angles.ival[0] = (unsigned
+ (unsigned short)
* (unsigned short)
return(angles);
63
}
/*** function to get values in takeoff angles union */
int GetTakeOffAngles(TakeOffAngles *pangles,
double *pazim, double *pdip, int
*piqual)
{
*pazim = ((double) pangles>ival[1]) / 10.0;
*pdip = ((double) (pangles>ival[0] / (int) 16)) / 10.0;
*piqual = (int) pangles>ival[0] % (int) 16;
return(*piqual);
}
64
Instrument (char*4)
instument identification for the trace for which the time pick corresponds
(i.e. SP, BRB, VBB)
Component (char*4)
component identification for the trace for which the time pick corresponds
(i.e. Z, N, E, H)
P phase onset (char*1)
description of P phase arrival onset; i, e
Phase descriptor (char*6)
Phase identification (i.e. P, S, PmP)
First Motion (char*1)
first motion direction of P arrival; c, C, u, U = compression; d, D =
dilatation; +, , Z, N; . or ? = not readable.
Date (yyyymmdd) (int*6)
year (with century), month, day
Hour/minute (hhmm) (int*4)
Hour, min
Seconds (float*7.4)
seconds of phase arrival
Err (char*3)
Error/uncertainty type; GAU
ErrMag (expFloat*9.2)
Error/uncertainty magnitude in seconds
Coda duration (expFloat*9.2)
coda duration reading
Amplitude (expFloat*9.2)
Maxumim peaktopeak amplitude
Period (expFloat*9.2)
Period of amplitude reading
Example:
GRX
?
1.00e+00
GRX
?
1.00e+00
CAD
?
1.00e+00
CAD
?
1.00e+00
BMT
?
1.00e+00
BMT
?
1.00e+00
ESC
?
1.00e+00
ESC
?
1.00e+00
BST
?
1.00e+00
BST
?
1.00e+00
?
? P
U 19940217
1.00e+00 1.00e+00
?
? S
? 19940217
1.00e+00 1.00e+00
?
? P
D 19940217
1.00e+00 1.00e+00
?
? S
? 19940217
1.00e+00 1.00e+00
?
? P
U 19940217
1.00e+00 1.00e+00
?
? S
? 19940217
1.00e+00 1.00e+00
?
? P
D 19940217
1.00e+00 1.00e+00
?
? S
? 19940217
1.00e+00 1.00e+00
?
? P
D 19940217
1.00e+00 1.00e+00
?
? S
? 19940217
1.00e+00 1.00e+00
2216
44.9200 GAU
2.00e02
2216
48.6900 GAU
4.00e02
2216
46.3500 GAU
2.00e02
2216
50.4000 GAU
4.00e02
2216
47.3500 GAU
2.00e02
2216
52.8700 GAU
4.00e02
2216
47.4700 GAU
2.00e02
2216
52.8100 GAU
4.00e02
2216
48.0000 GAU
1.00e+05
2216
54.6600 GAU
4.00e02
65
66
45.64 S 1
52.80 S 2
53.65 S 2
Northern California Seismic Netowrk (NCSN) "Raw phase data (Y2K compliant)" file
format ( ASCII, NLLoc obsFileType = NCSN_Y2K_5)
The Northern California Seismic Netowrk (NCSN) "Raw phase data (Y2K compliant)" file
format allows direct reading by NLLoc of Northern California Earthquake Catalog Search
phase data files (available from the Northern California Earthquake Data Center
(http://quake.geo.berkeley.edu/ncedc)).
The documentation for the NCSN "Raw phase data (Y2K compliant)" file format is at
ftp://quake.geo.berkeley.edu/pub/doc/cat5/ncsn.phase.y2k.5
Note: NLLoc ignores all NCSN phases for which the P phase onset is "X", "Y", or "Z". This
filter should remove all RTP picks.
Example:
198910180009294237 910121 5738 196340 5240 19
244 00LOM 59 1 240 719 8 13
0 5 0LOMT2
10090510X342 13
JLX NC VVHZ EPD3198910180009 3047 49 0
0
8
0 62 6504 0
0334 00 00
0
02
JBC NC VVHZ EPU3198910180009 3041 68 0
0
2
0 67 8104 0
0283 00 00
0
02
JBL NC EVLE EPU3198910180009 3274 40 0 3604ES
37 66 191 6902 0
17262 00 00
0 9992
JSF NC ZVLZ IPD1198910180009 3638
1258
0
33
0 341 5634 25M
0326 00340 959
02 X
CAL NC ZVLZ EPU3198910180009 3705
3 52
0
66
0 359 5524 32M
0 22 00330 997
02 X
JMP NC FVFZ EPD2198910180009 3694 7103
0
21
0 385 5424 14P
0332 00350 512
02
CAO NC ZVLZ EPD3198910180009 3924 109 0
0
55
0 433 5224 35M
0 59 00350
0
02 X
HMO NC VVHZ EPD4198910180009 3871176 0
0
30
0 613 5504 0
0176 00 00
0
02
CMC NC VVHZ EPU3198910180009 4281 4 35
0
58
0 725 4904 0
0345 00 00 530
02
334579 73214810
2D 9X
0
00 0
00 0
00 0 52
15200 0
4700 0
1200 0
4900 0
00 0
00 0
10090510
67
84 3 7 4 7 56.92 46N20.89
7E26.59
ZZB_IP1 1.03ZZE_IP1 1.06ZZA_IP1
1.11ZZF_IP1 1.11
6.09
1.50
1.07ZZC_IP1
1.11ZZD_IP1
The description of the SEISAN/HYPOCENTER Phase file format below is available from the
at
HYPOCENTER
3.2
reference
manual
(hypocent.ps,
ftp://ftp.ifjf.uib.no/pub/seismo/SEISAN/) (Lienert, 1994, and HYPOCENTER download at
ftp://elepaio.soest.hawaii.edu/pub/lienert/). Some SEISAN/HYPOCENTER fields are not used by
NLLoc.
For each event to be located, this file contains one set of records. In each set there is one
"phase header line" with general date and hyocenter information followed by optional
information lines followed by a "phase data line" for each arrival times of a single P, S or
other phase. The final record of each set is a blank. As many events as desired can be
included in one file.
Example:
1997 1014 2347 54.5 L 43.069 12.817 8.0 ITA 5 0.1 0.4CITA
1.23
7.2
6.5 9.5 0.2402E+01 0.7041E+01
0.1050E+02E
ACTION:UPD 980507 09:49 OP:fran STATUS:
ID:19971014234754
I
971014234711S.ITA_018
6
STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO SNR AR TRES
W DIS CAZ7
ANNI
IP
D 2347 56.36
0.110
3 110
ANNI
IS
4
2347 57.80
0.2
0
3 110
COLF
IP
D 2347 56.97
18
0.110
8 135
COLF
IS
1
2347 58.96
0.2
7
8 135
FRAN
IP
1
2347 57.09
0.1
7
9 173
FRAN
IS
1
2347 58.85
0.1
7
9 173
SVIT
IP
C 2347 57.18
22
0.110
10 216
SVIT
IS
1
2347 59.15
0.0
7
10 216
FEMA
IP
D 2347 59.06
0.1
9
21 135
FEMA
IS
1
2348 2.70
0.0
7
21 135
68
69
70
Fields: (GRID)
numSamplesDraw (integer)
specifies the number of samples drawn from a PDF grid
Fields: (METROPOLIS)
numSamples (integer)
total number of accepted samples obtained
numSaved (integer)
number of accepted samples saved
numClipped (integer)
number of samples rejected because they were outside of the search grid (a
high value indicates that event maximum likelihood location may be
outside search grid)
stepInit (integer)
initial step size in km used for the learning stage
stepFinal (integer)
step size in km used for the saving stage
HYPOCENTER Line: (required) Maximum likelihood hypocenter xyz coordinates.
HYPOCENTER x xLoc y yLoc z zLoc OT originSec ix iX iy iY iz iZ
Fields:
xLoc yLoc (float)
x and y positions of hypocenter relative to geographic origin in kilometers
zLoc (float)
z position (depth) of hypocenter in kilometers
originSec (float)
seconds of origin time of hypocenter
iX iY iZ (integer)
x, y and z index of grid node location of hypocenter
GEOGRAPHIC Line: (required) Maximum likelihood hypocenter Geographic co
ordinates.
GEOGRAPHIC OT year month day hour minute second Lat latitude Long
longitude Depth depth
Fields:
year month day (integer)
date of origin time
hour minute (float)
hour and minute of origin time
second (float)
seconds of origin time
latitude longitude depth (float)
latitude and longitude in decimal degrees and depth in kilometers of
NonLinLoc Version 2.30 (18MAY2001)
71
hypocenter
STAT_GEOG Line: (optional) Gaussian Expectation (Statistical) hypocenter Geographic
coordinates.
STAT_GEOG ExpectLat latitude Long longitude Depth depth
Fields:
latitude longitude depth (float)
latitude and longitude in decimal degrees and depth in kilometers of
expectation hypocenter
QUALITY Line: (required) Maximum likelihood hypocenter Geographic coordinates.
QUALITY Pmax probMax MFmin misfitMin MFmax misfitMax RMS rms
Nphs nPhases Gap maxGap Dist minStaDist Mamp magAmp nMagAmp
Mdur magDur nMagDur
Fields:
probMax (float)
maximum probability on grid
misfitMin misfitMax rms (float)
maximum and minimum weighted misfit on grid
rms (float)
rootmeansquare of residuals at maximum likelihood hypocenter
magAmp (float)
amplitude (i.e. ML) magnitude for maximum likelihood hypocenter
nMagAmp (integer)
number of readings used for amplitude magnitude
magDur (float)
duration magnitude for maximum likelihood hypocenter
nMagDur (integer)
number of readings used for duration magnitude
VPVSRATIO Line: (required) Estimated Vp/Vs ratio. (ver 2.0)
VPVSRATIO VpVsRatio ratio Npair numPair
Fields:
ratio (float)
Vp/Vs ratio estimated following the iterative minimization technique of
Lahr (1989; ch. 5)
Npair (integer)
number of PS pairs used to calculate Vp/Vs ratio
STATISTICS Line: (required) "Traditional" Gaussian (normal) statistics of PDF (evaluated
for PROB_DENSITY grids only).
72
73
Fields: (LAMBERT)
refEllipsoid (chars)
reference ellipsoid (one of: WGS84, GRS80, WGS72,
Australian, Krasovsky, International, Hayford
1909, Clarke1880, Clarke1866, Airy, Bessel,
Hayford1830, Sphere)
latOrig (float)
latitude in decimal degrees of the rectangular coordinates origin
longOrig (float)
longitude in decimal degrees of the rectangular coordinates origin
firstStdParal secondStdParal (float)
first and second standard parallels (meridians) in decimal degrees
FOCALMECH Line: (optional) Focal mechanism description line. Specifies the hypocenter,
focal mechanism, and mechanisn statistics
FOCALMECH dlat dlong depth Mech dipDir dipAng rake mf misfit nObs nObs
Fields:
dlat dlong (floats)
latitude and logitude in decimal degrees of the hypocenter
depth (float)
depth in kilometers of the hypocenter
dipDir dipAng rake (floats)
dip strike and rake of double couple mechanism
mf (float)
misfit of mechanism determination
nObs (float)
number of first motion observations used in mechanism determination
PHASE Line: (optional) Phase format description line. Specifies the beginning of a block
with a list of phase records. The end of the block is denoted by an END_PHASE line (see
below)
PHASE ID Ins Cmp On Pha FM Date HrMn Sec Err ErrMag Coda
Amp Per > TTpred Res Weight StaLoc(X Y Z) SDist SAzim RAz
RDip RQual
Fields:
None
next N Lines: (optional) Phase data for N phases.
ID Ins Cmp On Pha FM Q Date HrMn Sec Coda Amp Per > Err ErrMag TTpred Res
Weight StaLoc(X Y Z) SDist SAzim RAz RDip RQual
Fields:
74
ID (char*6)
station name or code
Ins (char*4)
instrument identification for the trace for which the time pick corresponds
(i.e. SP, BRB, VBB)
Cmp (char*4)
component identification for the trace for which the time pick corresponds
(i.e. Z, N, E, H)
On (char*1)
description of P phase arrival onset; i, e
Pha (char*6)
Phase identification (i.e. P, S, PmP)
FM (char*1)
first motion direction of P arrival; c, C, u, U = compression; d, D =
dilatation; +, , Z, N; . or ? = not readable.
Date (yyyymmdd) (int*6)
year (with century), month, day
HrMn (hhmm) (int*4)
Hour, min
Sec (float*7.4)
seconds of phase arrival
Err (char*3)
Error/uncertainty type; GAU
ErrMag (expFloat*9.2)
Error/uncertainty magnitude in seconds
Coda (expFloat*9.2)
coda duration reading
Amp (expFloat*9.2)
Maxumim peaktopeak amplitude
Per (expFloat*9.2)
Period of amplitude reading
> (char*1)
Required separator between first part (observations) and second part
(calculated values) of phase record.
TTpred (float*9.4)
Predicted travel time
Res (float*9.4)
Residual (observed predicted arrival time)
Weight (float*9.4)
Phase weight
StaLoc(X Y Z) (3 * float*9.4)
x, y, z location of station in transformed, rectangular coordinates
SDist (float*9.4)
Maximum likelihood hypocenter to station epicentral distance in
kilometers
SAzim (float*6.2)
Maximum likelihood hypocenter to station epicentral azimuth in degrees
CCW from North
RAz (float*5.1)
Ray takeoff azimuth at maximum likelihood hypocenter in degrees CCW
from North
75
RDip (float*5.1)
Ray takeoff dip at maximum likelihood hypocenter in degrees upwards
from vertical down (0 = down, 180 = up)
RQual (float*5.1)
Quality of takeoff angle estimation (0 = unreliable, 10 = best)
END_PHASE Line: (required if Phase format description line is present) Specifies the end
of a block with a list of phase records.
END_PHASE
Fields:
None
END_NLLOC Line: (required) Specifies the end of a NLLoc HypocenterPhase description
block.
END_NLLOC
Fields:
None
SCATTER Line: (optional) Specifies the begining of a NLLoc Scatter block containing
samples of the location PDF.
SCATTER Nsamples nSamples
Fields:
Nsamples (integer)
number of scatter samples
next Nsamples Lines: (optional) PDF samples.
x y z prob
Fields:
x y z (float)
x, y and z location of the sample in kilometers relative to the geographic
origin.
prob (float)
relative probability density value at sample (for Grid Search, the
probability density values are normalized so that the volume integral over
the corresponding search grid of the PDF = 1.0)
END_SCATTER Line: (required if SCATTER line is present) Specifies the end of a NLLoc
Scatter block.
76
END_SCATTER
Fields:
None
Example:
NLLOC "./loc/dur.19940217.221644.grid0" "LOCATED" "Location
completed."
SIGNATURE "Anthony Lomax Geosciences Azur
NLLoc:v2.00 04Aug1998
16h40m19"
COMMENT "IPSN Reseau Durance 9497 Grid/Layer"
GRID 51 51 43 50.000000 50.000000 1.500000 2.000000 2.000000
1.000000 PROB_DENSITY
SEARCH METROPOLIS nSamp 13829 nAcc 10000 nSave 1000 nClip 0 Dstep0
1.774978 Dstep 0.789846
HYPOCENTER x 24.705017 y 8.665524 z 1.592826 OT 40.998183 ix 1
iy 1 iz 1
GEOGRAPHIC OT 1994 02 17 22 16 40.998183 Lat 43.671585 Long
6.056350 Depth 1.592826
QUALITY Pmax 2.370e02 MFmin 0.865120 MFmax 5.701586 RMS 0.157467
Nphs 10 Gap 329 Dist 18.346664 Mamp 9.90 0 Mdur 9.90 0
STATISTICS ExpectX 2.6546e+01 Y 7.5794e+00 Z 5.1371e+00 CovXX
1.69e+00 XY 3.78e01 XZ 9.87e01 YY 2.08e+00 YZ 1.08e+00 ZZ 9.78e+00
EllAz1 296.7 Dip1 2.7 Len1 2.26e+00 Az2 206.2 Dip2 10.3 Len2
2.69e+00 Len3 5.96e+00
TRANSFORM LAMBERT RefEllipsoid Clarke1880 LatOrig 43.750000
LongOrig 5.750000 FirstStdParal 43.199300 SecondStdParal 44.996100
PHASE ID Ins Cmp On Pha FM Date
HrMn
Sec
Err ErrMag
Coda
Amp
Per
>
TTpred
Res
Weight
StaLoc(X Y
Z)
SDist
SAzim RAz
RDip RQual
GRX
?
?
? P
U 19940217 2216
44.9200 GAU 2.00e02
1.00e+00 1.00e+00 1.00e+00 >
4.1083
0.1865
1.3136
9.1262
1.0246
0.3350
18.3467 301.88 301.9 90.9 7
GRX
?
?
? S
? 19940217 2216
48.6900 GAU 4.00e02
1.00e+00 1.00e+00 1.00e+00 >
7.6074
0.0844
1.2757
9.1262
1.0246
0.3350
18.3467 301.88 301.9 90.5 6
CAD
?
?
? P
D 19940217 2216
46.3500 GAU 2.00e02
1.00e+00 1.00e+00 1.00e+00 >
5.1083
0.2435
1.3136
1.3977
8.1653
0.3700
23.3127 271.23 271.2 59.3 8
CAD
?
?
? S
? 19940217 2216
50.4000 GAU 4.00e02
1.00e+00 1.00e+00 1.00e+00 >
9.4494
0.0476
1.2757
1.3977
8.1653
0.3700
23.3127 271.23 271.2 58.4 8
BMT
?
?
? P
U 19940217 2216
47.3500 GAU 2.00e02
1.00e+00 1.00e+00 1.00e+00 >
6.3464
0.0054
0.8953
5.0083
2.0904
0.4300
30.4321 282.48 282.5 50.9 10
BMT
?
?
? S
? 19940217 2216
52.8700 GAU 4.00e02
1.00e+00 1.00e+00 1.00e+00 >
11.7356
0.1362
0.8776
5.0083
2.0904
0.4300
30.4321 282.48 282.5 50.7 10
ESC
?
?
? P
D 19940217 2216
47.4700 GAU 2.00e02
1.00e+00 1.00e+00 1.00e+00 >
6.5539
0.0821
0.8953
6.2166
1.8857
0.4050
31.6561 282.37 282.4 50.9 10
ESC
?
?
? S
? 19940217 2216
52.8100 GAU 4.00e02
1.00e+00 1.00e+00 1.00e+00 >
12.1189
0.3071
0.8776
6.2166
1.8857
0.4050
31.6561 282.37 282.4 50.7 10
BST
?
?
? P
D 19940217 2216
48.0000 GAU 1.00e+05
1.00e+00 1.00e+00 1.00e+00 >
7.3481
0.3463
0.0000
8.4624
5.8008
0.5000
36.1850 293.56 293.6 50.9 10
BST
?
?
? S
? 19940217 2216
54.6600 GAU 4.00e02
1.00e+00 1.00e+00 1.00e+00 >
13.5860
0.0758
1.2757
8.4624
5.8008
0.5000
36.1850 293.56 293.6 50.7 10
END_PHASE
END_NLLOC
77
The Phase Statistics file contains the average residuals (denoted by Average Phase
Residuals) for P and S phases at each station. The average residuals are calculated for all
station/phase combinations that are present in the observations files and for which the
corresponding time grids exist, regardless of the weight of the station/phase reading used for
location.
In the Phase Statistics file there are 2 sets of phase statistics. One is based on the residuals
for the maximum likelihood hypocenter. The other is based on a PDFweighted average of
the residuals for locations throughout the search region, where the weight is given by the
PDF function likelihood values (Grid Search) or the density of samples (Metroplolis).
The Phase Statistics file also lists a cumulative delay (denoted by Total Phase
Corrections) for P and S phases at each station. The cumulative delay is given by the
sum of the average residuals and the input delay specified in LOCDELAY statements in the
NLLoc Statements section of the Input Control File. The cumulative delay is listed for the
maximum likelihood hypocenter residuals and for the PDFweighted residuals.
The body of a Phase Statistics file can be used directly as a set of time delay LOCDELAY
statements in the Input Control File. Thus the average phase residuals from a run of NLLoc
can be used as the station corrections for later runs of NLLoc.
Line 1: (required) Title and maximum values for P and S average residual calculation.
Average Phase Residuals (CalcResidual) P_Residual_Max:
P_residualMax S_Residual_Max: S_residualMax
or
Total Phase Corrections (CalcResidual + InputDelay)
P_Residual_Max: P_residualMax S_Residual_Max: S_residualMax
or
Average Phase Residuals PDF (CalcPDFResidual)
P_Residual_Max: P_residualMax S_Residual_Max: S_residualMax
or
Total Phase Corrections PDF (CalcPDFResidual + InputDelay)
P_Residual_Max: P_residualMax S_Residual_Max: S_residualMax
Fields:
P_residualMax S_residualMax (float)
maximum (cutoff) value for P and S average residual calculation (set in
Input Control File statement LOCPHSTAT). Residuals larger than the cut
off are not used in the calculation.
Line 2: (required) Column headings.
ID Phase Nres AveRes
Lines 3N: (required) Average residuals.
LOCDELAY label phaseType nResiduals residual
Fields:
78
label (chars)
source/station label
phaseType (chars)
phase type P or S
nResiduals (int)
number of residuals used to calculate average residual
residual (float)
average residual
Example:
Average Phase Residuals (CalcResidual) P_Residual_Max: 1.000000
S_Residual_Max: 1.000000
ID
Phase
Nres
AveRes
LOCDELAY BST
P
19
0.033835
LOCDELAY BST
S
17
0.032845
LOCDELAY CAD
P
22
0.155235
LOCDELAY CAD
S
24
0.070664
Total Phase Corrections (CalcResidual + InputDelay)
1.000000 S_Residual_Max: 1.000000
ID
Phase
Nres
TotCorr
LOCDELAY BST
P
19
0.033835
LOCDELAY BST
S
17
0.032845
LOCDELAY CAD
P
22
0.155235
LOCDELAY CAD
S
24
0.070664
Average PDF Phase Residuals (CalcPDFResidual)
1.000000 S_Residual_Max: 1.000000
ID
Phase
Nres
AveRes
LOCDELAY BST
P
19
0.051917
LOCDELAY BST
S
17
0.026063
LOCDELAY CAD
P
22
0.151105
LOCDELAY CAD
S
24
0.058676
P_Residual_Max:
P_Residual_Max:
79
Buffer: (required) Sequence of four float values for each PDF sample
x(N), y(N), z(N), pdf(N) (N = 0, nSamples 1)
Fields:
x(N), y(N), z(N) (float)
x, y and z location of the sample in kilometers relative to the geographic
origin.
pdf(N) (float)
PDF value of the sample, normalized so that the volume integral over the
corresponding search grid of the PDF = 1.0
80
C
C
C
C
C
C
C
C
C
C
C
1.00
0.90
0.80
0.70
0.60
0.50
0.40
0.30
0.20
0.10
0.00
81
AIN
RMK
105
000
105
000
88
000
87
000
81
000
81
000
77
000
77
000
72
000
72
000
M RMS
I
0 0.11
0
PWT AMX
DT
1.31 0.0
1.28 0.0
0.00 0.0
1.28 0.0
0.90 0.0
0.88 0.0
0.90 0.0
0.88 0.0
1.31 0.0
1.28 0.0
Notes:
1. The AZM field contains the ray takeoff azuimuth, not the source to station aziumth.
These two values may differ if 3D velocity models are used.
2. The quality value in the PRMK field contains the integer quality value coressponding
to the phase time uncertainty in seconds. This correspondence is obtained by
82
written
only
if secondary magnitudes
are
present.
83
position
and use the label codes given by the FC2 and XC2 commands.
The code L is for ML calculated by the USGS from Berkeley
amp
litudes, and B is for ML from the Berkeley catalog.
115
11618
11921
122
12325
12628
A1
F3.2
F3.1
A1
F3.2
F3.1
MAGNITUDES
The magnitudes and their label codes are:
E
X
Example:
9608011344195144 2727 7E2285 4000 0
0
0
0
0 0
SURF P?0 9608011344 2857 19100 3524
0 0228 0
0
0
JAUF P?0 9608011344 2929
2100 3581
0 0228 0
0
0
OG30 P?0 9608011344 3069 16100 3795
0 0228 0
0
0
9608020434148944 2619 7E1611 500 0
0
0
0
0 0
PZZ P?0 9608020434 1800
4100 1999
0 0161 0
0
0
STV P?0 9608020434 1906
7100 2179
0 0161 0
0
0
ENR P?0 9608020434 1974
2100 2293
0 0161 0
0
0
84
6317 45
S 0
14
0 0
0 0
0 0XXX
18
0100
0 451
000
S 0 10
0100
0 501
000
S 0
0100
0 614
000
6212 15
0 0
0 0
0 0XXX
S 0
0100
0 153
000
S 0
0100
0 218
000
S 0
0100
0 263
000
Overview
The various NonLinLoc programs all use the same control file syntax and share some "generic"
control statements. The control statements for all the NonLinLoc programs for a project (a study
with common "generic" control statements) may be combined into one file without conflicts. The
basic control file statement syntax consists of a control keyword followed by one or more
parameters on a single line (except when a newline is explicitely required). KEYWORD parameter1
parameter2 ... The keyword must begin in the first column and is always in upper case. Keywords
and parameters must be separated by one or more spaces or tabs. A required newline in a parameter
list is indicated by [newline]. Blank lines and lines with # in the first column are ignored. Use #
in the first column for comments and to "comment out" a statement. View a sample control file for
the NonLinLoc programs.
Definitions
Statement Priority
required must be present in control file to run the coressponding program
optional optional in control file
repeatable may be present multiple times in control file
ignored may be present but is not used by program under certain conditions
85
Datatypes
integer decimal integer ( i.e. 0, 5, 285)
float decimal floating point number (i.e. 1.0, 3.68, 4.5, 5.4e6)
chars sequence of
/data/bigevent.dat)
characters
without
spaces
(i.e.
NO_SAVE,
abcdef,
string sequence of characters which is read until the end of line, spaces are allowed (i.e. The
biggest earthquake sequence in history)
choice selection from a fixed list of items (i.e. SAVE NO_SAVE)
Miscellaneous
default: indicates default values for parameters when an optional control statement is not present
in the control file
min: max: indicates minimum and maximum allowed values for parameters
VERY_LARGE_DOUBLE a large floating point value (typically 1.0e+30)
86
INCLUDE Include
optional, repeatable
Syntax 1: INCLUDE includeFile
Inserts text from another file at current positon in control file.
includeFile (string) path and name of file to include
Notes:
1. This statement is implemented only for NonLinLoc programs Vel2Grid, Grid2Time, Time2EQ
and NLLoc.
2. The included text must contain only valid NonLinLoc control statements, blank lines or
comment lines, but may not have another INCLUDE statement.
CONTROL Control
required, nonrepeatable
Syntax 1: CONTROL messageFlag randomNumberSeed
Sets various general program control parameters.
messageFlag (integer, min:0, default:1) sets the verbosity level for messages printed to the
terminal ( 0 = error messages only, 1 = 0 + higherlevel warning and progress messages, 2 = 1 +
lowerlevel warning and progress messages + information messages, ...)
randomNumberSeed (integer) integer seed value for generating random number sequences
(used by program NLLoc to generate Metropolis samples and by program Time2EQ to generate
noisy time picks)
87
89
90
Vel2Grid Program
VGOUT VGTYPE VGGRID LAYER 2DTO3DTRANS VERTEX EDGE
POLYGON2
91
xOrig yOrig zOrig (float) x, y and z location of the grid origin in km relative to the
geographic origin.
dx dy dz (float) grid node spacing in kilometers along the x, y and z axes
gridType (choice: VELOCITY VELOCITY_METERS SLOWNESS VEL2 SLOW2
SLOW_2_METERS SLOW_LEN) physical quantity to store on grid ( VELOCITY = km/s,
VELOCITY_METERS = m/s, SLOWNESS = s/km, VEL2 = vel**2, SLOW2 = (s/km)**2,
SLOW_2_METERS = slow**2 ((s/m)**2), SLOW_LEN = slow*dx (sec)).
Notes:
1. The 3D grid dimensions are in kilometers with Z positive down (lefthanded coordinate
system).
2. The grid is dx*(xNum1) km long in the x direction, and similarly for y and z.
(float,
min:360.0,
max:360.0)
rotation
angle
in
degreees
COUNTERCLOCKWISE.
Notes:
1. The 2D to 3D transformation is applied after the general geographic transformation specified
by the Generic control statement TRANS .
2. With rotation =0 the 2D model section will be parallel to the x direction in the 3D model, and
the 2D model will be extended along the y direction in the 3D model.
93
depth (float) reference depth for velocity and density (use negative values for depths above z=0)
VpTop VsTop rhoTop (float) P velocity, and S velocity in km/s and density in kg/m**3 at
the reference depth ( depth ).
VpGrad VsGrad rhoGrad (float) Linear P velocity and S velocity gradients in km/s/km and
density gradient in kg/m**3/km increasing directly downwards from the reference depth ( depth ).
Notes:
1. A 2D polygon may share edges with other 2D polygons.
2. The reference depth ( depth ) may be above, within, or below the polygon.
94
Grid2Time Program
GTFILES GTMODE GTSRCE GT_PLFD
inputFileRoot
outputFileRoot
waveType
Specifies the directory path and file root name (no extension), and the wave type identifier for the
input velocity grid and output time grids.
inputFileRoot (string) full or relative path and file root name (no extension) for input
velocity grid (generated by program Vel2Grid)
outputFileRoot (string) full or relative path and file root name (no extension) for output
traveltime and takeoff angle grids
waveType (choice: P S) wave type
iSwapBytesOnInput (integer, min:0, max:1, default:0) flag to indicate if hi and low bytes of
input velocity grid file should be swapped
Notes:
1. The inputFileRoot and outputFileRoot are appended with . waveType
2. The 3D time grid ouput files have names of the form:
outputFileRoot.waveType . label . gridType . FileExtension
where label is a source label ( i.e. a station code), gridType is time or angle , FileExtension is
.buf or .hdr.
95
latMinSrce
latDir
97
Time2EQ Program
EQFILES EQEVENT EQSTA EQSRCE EQMECH EQMODE EQQUAL2ERR
EQVPVS
98
label
phase
errorType
error
errorReportType
Specifies a station, phase and timing error to use to generate a synthetic phase reading.
label (string) station label ( i.e. a station code: ABC )
phase (string) phase type ( i.e. P or S )
errorType (choice: GAU BOX FIX NONE) calculated random timing error type ( GAU for
normal deviate with zero mean and variance = error , or BOX for boxcar deviate with zero mean
and width = 2 * error , or FIX for time error/static = error , or NONE for time error/static = 0.0 )
error (float) error magnitude in seconds
errorReportType (choice: GAU) timing error type to write to output phase/observation file
Err field (The current version of NLLoc recognizes only GAU )
errorReport (float) error magnitude in seconds to write to output phase/observation file
ErrMag field.
Notes:
1. The label and phase when concatenated to the inputFileRoot (i.e.
inputFileRoot.label.phase ) should correspond to the path and root name of an existing,
traveltime grid file.
2. The error is calculated stochastically and added to the traveltime. Use error = 0.0 to
obtain exact synthetic traveltimes.
latMinSrce
latDir
99
101
NLLoc Program
LOCSIG LOCCOM LOCFILES LOCHYPOUT LOCSEARCH LOCMETH LOCGAU
LOCPHASEID LOCQUAL2ERR LOCGRID LOCPHSTAT LOCANGLES LOCMAG
LOCCMP LOCALIAS LOCEXCLUDE HLOCDELAY
Formats)
inputFileRoot (string) full or relative path and file root name (no extension) for input time
grids (generated by program Grid2Time)
outputFileRoot (string) full or relative path and file root name (no extension) for output
files
numEquil
numBeginSave
103
Specifies the search type and search parameters. The possible search types are GRID (grid search),
MET (Metropolis), and OCT (Octtree).
numSamplesDraw (integer) specifies the number of scatter samples to draw from each saved
PDF grid ( i.e. grid with gridType = PROB_DENSITY and saveFlag = SAVE ) No samples are
drawn if saveFlag 0.
numSamples (integer, min:0) total number of accepted samples to obtain
numLearn (integer, min:0) number of accepted samples for learning stage of search
numEquil (integer, min:0) number of accepted samples for equilibration stage of search
numBeginSave (integer, min:0) number of accepted samples after which to begin saving stage
of search, denotes end of equilibration stage
numSkip (integer, min:1) number of accepted samples to skip between saves ( numSkip = 1
saves every accepted sample)
stepInit (float) initial step size in km for the learning stage ( stepInit 0.0 gives automatic
step size selection. If the search takes too long, the initial step size may be too large; this may be the
case if the search region is very large relative to the volume of the high confidence region for the
locations.)
stepMin (float, min:0.0) minimum step size allowed during any search stage (This parameter
should not be critical, set it to a low value.)
stepFact (float, min:0.0) step factor for scaling step size during equilibration stage (Try a
value of 8.0 to start.)
probMin (float) minimum value of the maximum probability (likelihood) that must be found by
the end of learning stage, if this value is not reached the search is aborted (This parameters allows
the filtering of locations outside of the search grid and locations with large residuals.)
initNumCells_x initNumCells_y
octtree cells in the x, y, and z directions
minNodeSize (float) smallest octtree node side length to process (not used)
maxNumNodes (integer) total number of nodes to process
numScatter (integer) the number of scatter samples to draw from the octtree results
Notes:
1. See NLLoc Program GridSearch Algorithm and Metropolis Sampling Algorithm for more
information.
2. Samples are saved to a binary, event Scatter file (see Scatter file formats ). For the gridsearch,
because the samples are drawn stochastically, the number of samples actually obtained my differ
slightly from the requested number.
3. If a large number of samples are saved, the spatial density of samples will be proportional to
the PDF.
104
4. The scatter samples are useful for plotting the PDF as a transparent "cloud" and for relatively
compact disk storage of the PDF.
105
107
RMS_Max
NRdgs_Min
Gap_Max
P_ResidualMax
Specifies selection criteria for phase residuals to be included in calculation of average P and S
station residuals. The average residuals are saved to a summary, phase statistics file (see Phase
Statistics file formats ).
RMS_Max (float, default:VERY_LARGE_DOUBLE) the maximum allowed hypocenter RMS in
seconds
NRdgs_Min (integer, default:1) the minimum allowed hypocenter number of readings
Gap_Max (float, default:VERY_LARGE_DOUBLE) the maximum allowed hypocenter gap in
degrees
P_ResidualMax S_ResidualMax (float, default:VERY_LARGE_DOUBLE) the maximum
allowed residual in seconds for a P or S phase
Notes:
1. Because the maximum residual cutoff is abrupt, it should be chosen and used with care.
2. In the current version of NLLoc, it is assumed in the calculation of average P and S station
residuals that the standardized phase codes are P and S . Thus it is important to use these codes, if
possible.
108
Specifies whether to determine takeoff angles for the maximum likelihood hypocenter and sets
minimum quality cutoff for saving angles and corresponding phases to the HypoInverse Archive
file .
angleMode (choice: ANGLES_YES ANGLES_NO, default:ANGLES_YES) sets if takeoff
angles are read from angles grid files and output to locations files. ( ANGLES_YES for angles
determination or ANGLES_NO for no angles determination)
qualtiyMin (integer, default:5) sets the minimum quality (see TakeOff Angles Algorithm )
for writing takeoff angles and corresponding phase to the HypoInverse Archive file . ( 0 to 10 )
109
label
inst
comp
ampFactor
sta_corr_ml_hb
110
Notes:
1. In NLLoc, the alias evaluation is applied recursively, regardless of the order of the LOCALIAS
statements. Thus, when selecting and specifying alias names, beware of infinite recursion.
2. A trailing underscore "_" in an alias will only be used for time grid identification, not for
output. This allows, for example, a station name ABC to be aliases to the name ABC_ to enforce
certain dates of validity for the station, this requires that the time grids generated by Grid2Time use
the station code ABC_ ; in all NLLoc output, the code ABC will be used.
111
17. References
Hutton, L.K., and Boore, D.M., 1987. The ML scale in Southern California, Bull.
Seism. Soc. Am., 77, 20742094.
Lahr, J.C., 1989. HYPOELLIPSE Version 2.0: A computer program for determining
local earthquake hypocentral parameters, magnitude and first motion pattern, U.S.
Geological Survey OpenFile Report 89116, 92p.
Le Meur, Helene, 1994. Tomographie tridimensionnelle a partir des temps des
premieres arrivees des ondes P et S, application a la region de Patras (Grece), These de
Doctorat, Paris VII, France.
Le Meur H, J. Virieux et P. Podvin, 1997. Seismic Tomography of the gulf of
Corinth: a comparison of methods, Annali di Geofisica, 40, 6, 124.
Lee, W.H.K. and Lahr, J.C., 1975. HYPO71 (revised): A computer program for
determining hypocenter, magnitude and first motion pattern of local earthquakes, U.S.
Geological Survey OpenFile Report 75311, 116p.
Lienert, B.R., 1994. HYPOCENTER 3.2: A computer program for locating
earthquakes locally, regionally and globally, Hawaii Institute of Geophysics &
Planetology ([email protected]), 70p.
Lomax, A., J. Virieux, P. Volant and C. Berge, 2000. Probabilistic earthquake
location in 3D and layered models: Introduction of a MetropolisGibbs method and
comparison with linear locations, in Advances in Seismic Event Location Thurber, C.H.,
and N. Rabinowitz (eds.), Kluwer, Amsterdam, 101134..
Lomax, A., A. Zollo, P. Capuano, and J. Virieux, 2001. Precise, absoute earthquake
location under SommaVesuvius volcano using a new 3D velocity model, Gephys. J.
Int., xxx, nnn, nnnnnn. Accepted, in press.
Kirkpatrick, S., Gelatt, C.D. and Vecchi, M.P., 1983. Optimization by simulated
annealing, Science, 220, 671680.
Metropolis, N., Rosenbluth, A.W., Rosenbluth, M.N., Teller, A.H., and Teller, E.,
1953. Equation of state calculations by fast computing machines, J. Chem. Phys., 1,
10871092.
Mosegaard, K., and Tarantola, A., 1995, Monte Carlo sampling of solutions to
inverse problems, J. Geophys. Res., 100, 1243112447.
Moser, T.J., T. van Eck and Nolet, G., 1992, Hypocenter determination in strongly
heterogeneous earth models using the shortest path method., J. Geophys. Res., 97,
65636572.
112
113
Overview Copyright notice, Source code Installing and running: standalone Installing and
running: applet Parameter arguments Seismicity Viewer File Formats
Overview
Seismicity Viewer displays earthquake locations in a 3D volume as probability density functions
(PDFs), maximumlikelihood hypocenters, Gaussian expectation hypocenters, Gaussian confidence
ellipsoids, and focal mechanisms. Station locations, associated P and S residuals, and geographic
and geologic features are also displayed. The 3D volume can be interactively rotated, zoomed and
viewed along the coordinate axes in perspective or orthographic projections. The events can
viewed together, individually, or in an animated sequence.
View an example earthquake location with the Seismicity Viewer at
http://www.alomax.net/seismicity/VentimigliaMain.html.
The event data can be in NonLinLoc HypocenterPhase File format or in several other formats
(SEISAN, ORFEUSSpyder...). (Conversion of HYPOELLIPSE summary or FPFIT summary
formats to NonLinLoc HypocenterPhase format is available with the NonLinLoc Utility
programs.)
Seismicity Viewer displays events in a local/region mode using rectangular Cartesian coordinates,
and in a global mode using spherical coordinates (default if no NonLinLoc Grid Header file is
used; see below).
The Seismicity Viewer is written in the Java language.
The Seismicity Viewer can be run as:
A standalone application (Seismicity) that runs locally and which can read data files
locally or across the Internet. Seismicity Viewer standalone will run on any type of
computer which has the runtime for Java 1.1 or higher installed. Additional features of the
standalone application Seismicity Viewer include:
direct reading of data files over the Internet from any server
printing
An "applet" (SeismicityApp) that is installed on a central web server and which is launched
114
over the Internet from an HTML web page on the server. SeismicityApp "applet" can be
viewed from any type of computer with Internet access and a recent web browser that
supports Java 1.1 or higher (i.e. Netscape 4 or higher, Internet Explorer 5 or higher). The
default applet security settings restrict SeismicityApp to reading data files only from the
same server from which it was launched. These security restrictions also prevent or limit the
printing and writing of data files.
Important note
This page gives instructions and links for downloading and installing the Seismicity Viewer v2.0.
NOTE: Parts of this software are new and have not yet been reviewed or thoroughly tested
IT IS IMPORTANT THAT YOU VERIFY THE CORRECT FUNCTIONING OF THE
SOFTWARE FOR YOUR PURPOSES.
If you have problems or suggestions, please contact Anthony Lomax; please specify the type and
version of your computer hardware, Java installation, and browser. I would also appreciate hearing
about the details of your installation and application of Seismicity Viewer.
Copyright notice
The Seismicity Viewer program and source code are distributed under the terms of the GNU
General Public License (GNU GPL). PLEASE READ, UNDERSTAND AND AGREE WITH THE
GNU GPL BEFORE DOWNLOADING OR USING THE SEISMICITY VIEWER SOFTWARE:
GNU General Public License (GNU GPL http://www.gnu.org/copyleft/gpl.html).
Source code
The Seismicity Viewer is currently under development. If you would like a copy of the source code
in its current state, please contact Anthony Lomax.
115
or
jre
If you do not have Java SDK/JDK (Java Software Development Kit) or JRE (Java Runtime
Environment) 1.1 or higher available on your system, you can download Java from Sun for
Solaris, Windows 95/98/NT or LINUX (Java2) free of charge. For a minimum installation
use the JRE for Java 2 or Java 1.1. For other operating systems (LINUX, MacOS, etc) see
Suns Java(TM) Platform Ports page.
If not done automatically at installation, remember to update the path environment variable
(UNIX) or the PATH variable (Windows) if you want to be able to run the Java executables
(java, jar, etc.) from any directory without having to type the full path of the command.
See the Java installation documentation for more details.
2. Create the installation directories and download the Seismicity Viewer program files:
Create a program directory for the Seismicity Viewer class files, i.e.
my_java_dir/seismicity
Download the following files to the program directory (To download from a browser
directly to local disk, press the right mouse button over each link and select "Save Link
As..." (Netscape) or "Save Target As..." (IE), or press Shift+Button1 (Netscape)):
SeisView20_global.jar Seismicity Viewer class files (the Java "bytecode" for Seismicity
Viewer DO NOT UNPACK THIS FILE))
Create a work directory for the Seismicity Viewer sample data files, i.e.
my_work_dir
Download the sample data files to the work directory:
vinti.hyp NonLinLoc HypocenterPhase file
vinti.hdr NonLinLoc Grid Header file
vinti.cont.xyz topography 3D line file
vinti.text 3D text file
Download the defaults file to the work directory:
seismicitydefaults (or .seismicitydefaults) Seismicity Viewer defaults file (the user default
preferences for Seismicity Viewer, and specifications of line files, text file and other display
parameters)
3. Set the CLASSPATH
The CLASSPATH environment variable tells the Java Virtual Machine and other Java
applications where to find the class libraries, including userdefined class libraries. If you
are only running Seismicity Viewer you can set the CLASSPATH as follows:
116
UNIX:
setenv CLASSPATH
my_java_dir/seismicity/SeisView20_global.jar
(all on one command line)
Windows:
set CLASSPATH =
my_java_dir\seismicity\SeisView20_global.jar
(all on one command line)
In these expressions, my_java_dir is substituted by the absolute path to the Java SDK/JDK
or JRE installation directory directory.
The full name of jar files (compressed archives containing class and other files) must always
be explicitly listed in the CLASSPATH. To access unarchived class files (*.class) directly
you must include in the CLASSPATH the path to the directory containing the *.class files.
Alternatively, the classpath commandline switch to the Java executables can be used
to specify the location of class files. Sun suggests the use of this switch and not the
CLASSPATH variable. See the Java installation documentation for more details.
NOTE: JRE (1.1 only?) on Windows ignores the CLASSPATH environment variable and the
classpath commandline switch. Instead use the cp commandline switch. See the
JRE README installation documentation for more details.
4. Run Seismicity Viewer
Run Seismicity Viewer and view the sample data files:
UNIX:
Go to the work directory created above and type:
java seismicity.Seismicity Viewer help
(if your are using the CLASSPATH environment variable)
or
java classpath
my_java_dir/seismicity/SeisView20_global.jar \
seismicity.Seismicity help
(all on one command line; if your are using the classpath commandline
switch)
You should see the Seismicity Viewer usage instructions and a list of command line
arguments. Next, type:
java seismicity.Seismicity vinti.hyp
(all on one command line; add the classpath commandline switch if
117
necessary)
This should launch the Seismicity Viewer viewer and read and display an earthquake
location. Read the documentation in the Help>Help submenu, and try the various
Seismicity Viewer options for "viewing" the earthquake.
The launcing of Seismicity Viewer can be simpified by the use of an alias, i.e.
alias svw java seismicity.Seismicity
Windows (use jre or jrew in place of java, as appropriate):
Open a DOS console window by selecting Start>Programs>MS DOS Prompt.
Make sure in the new DOS console window that the PATH includes the path to the Java
executables, and (if you are not using the classpath commandline switch) that the
CLASSPATH is set as described above. (You can check the environment by typing the DOS
command set. PATH and CLASSPATH may be set in AUTOEXEC.BAT, in another batch
file or from the command line.)
Go to the work directory created above and type:
java seismicity.Seismicity help
(add the classpath commandline switch if necessary)
or
jre cp my_java_dir\seismicity\SeisView20_global.jar
seismicity.Seismicity help
(all on one command line)
You should see the Seismicity Viewer usage instructions and a list of command line
arguments. Next, type:
java seismicity.Seismicity vinti.hyp
(all on one command line; add the classpath commandline switch if
necessary)
This should launch the Seismicity Viewer viewer and read and display an earthquake
location. Read the documentation in the Help>Help submenu, and try the various
Seismicity Viewer options for "viewing" the seismogram. (Note that wildcard characters
(*,?) can be used in filenames on a local file system.)
The launcing of Seismicity Viewer can be simpified by the use of a batch file, i.e. sgm.bat
containing, for example,
java seismicity.Seismicity %1 %2 %3
NOTE: With the JRE command jrew (Java 1.1 only?) you can launch Seismicity Viewer
directly from the Windows Start menu without the need to launch a DOS console window.
See the JRE README installation documentation for more details.
118
119
where:
codebase (chars)
is an optional attribute specifies the base URL of the applet the directory that contains
the applets *.class files. If this attribute is not specified, then the HTML
documents URL is used.
width height (integers)
are required attributes give the initial width and height (in pixels) of the applet display
area.
<PARAM NAME=appletAttribute1 VALUE=value1>
are tags that specify Seismicity Viewer program parameter arguments (see below).
Notes:
1. For more information on the <APPLET> tag see the Sun site <APPLET> tag
documentation.
2. Applets have strong security restrictions that limit their functionality. For example, applets
loaded over the internet can only open files on the same server they were loaded from, they
cannot open or write to files on the local system. See the Sun site Applet Security page for
more information.
Download and install Seismicity Viewer applet by following the steps below:
1. Install an appropriate browser:
To view the Seismicity Viewer applet, you need a browser with Java 1.1 or higher installed
and enabled. Netscape 4.5 or higher, Internet Explorer 5, or equivalent is recommended.
(You can also use the appletviewer program to view the Seismicity Viewer applet if
you have the Java SDK/JDK available on your system. See the SDK/JDK documentation for
more information.)
2. Create the html and installation directories and download the Seismicity Viewer
program files:
The Seismicity Viewer applet is launched from an HTML page in a public space on a web
server (a directory accessible from from the Internet with a URL, i.e.
http://www.alomax.net/seismicity). Default applet security restrictions limit applets to
reading files only from the server from which it was launched, and default local security
restrictions limit locally run applet to reading files only under the directory from which it is
launched (The directory specified by the codebase applet tag, if this tag exists, otherwise
the directory containing the HTML page). Thus, for your first Seismicity Viewer applet
installation, it is easiest to begin with a directory structure with the HTML page and
Seismicity Viewer program files in a top directory, and the data files in a subdirectory.
Create the top directory for the HTML files and Seismicity Viewer program files, i.e.
.../public_html/seismicity
Download the following files to the top directory (To download from a browser directly to
120
local disk, press the right mouse button over each link and select "Save Link As..."
(Netscape) or "Save Target As..." (IE), or press Shift+Button1 (Netscape)):
Seismicity_basic_applet.html HTML text file that will launch the Seismicity Viewer
applet
SeisView20_global.jar Seismicity Viewer class files (the Java "bytecode" for Seismicity
Viewer DO NOT UNPACK THIS FILE))
Directly under the top directory, create a subdirectory named "data" for the data files, i.e.
.../public_html/seismicity/data
Download the following data files to this subdirectory:
vinti.hyp NonLinLoc HypocenterPhase file
vinti.hdr NonLinLoc Grid Header file
vinti.cont.xyz topography 3D line file
vinti.text 3D text file
3. Run your browser and launch the Seismicity Viewer applet
Start your browser and open the HTML page Seismicity_basic_applet.html.
Click on the link. This will load the Seismicity Viewer applet, and read and display a 3
component seismogram. Read the documentation in the Help>Help submenu, and try the
various Seismicity Viewer options for "viewing" the seismogram.
(Click here Seismicity_basic_applet.html to see how the Seismicity Viewer applet loads
directly from the Seismicity Viewer site.)
121
122
123
segment.
Example:
14.3667 40.9285 2800
14.3655 40.9292 2800
14.3667 40.9302 2800
> the 2600 meter contour
14.3667 40.9355 2600
14.3708 40.9349 2600
14.375 40.9335 2600
124
125
DISTRIBUTION
AND
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By
contrast, the GNU General Public License is intended to guarantee your freedom to share and
change free softwareto make sure the software is free for all its users. This General Public
License applies to most of the Free Software Foundations software and to any other program
whose authors commit to using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public
Licenses are designed to make sure that you have the freedom to distribute copies of free software
(and charge for this service if you wish), that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free programs; and that you know you
can do these things.
126
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or
to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if
you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give
the recipients all the rights that you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license
which gives you legal permission to copy, distribute and/or modify the software.
Also, for each authors protection and ours, we want to make certain that everyone understands that
there is no warranty for this free software. If the software is modified by someone else and passed
on, we want its recipients to know that what they have is not the original, so that any problems
introduced by others will not reflect on the original authors reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger
that redistributors of a free program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any patent must be licensed for
everyones free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
127
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work
based on the Program, and copy and distribute such modifications or work under the terms of
Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the
files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains
or is derived from the Program or any part thereof, to be licensed as a whole at no charge to
all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must
cause it, when started running for such interactive use in the most ordinary way, to print or
display an announcement including an appropriate copyright notice and a notice that there is
no warranty (or else, saying that you provide a warranty) and that users may redistribute the
program under these conditions, and telling the user how to view a copy of this License.
(Exception: if the Program itself is interactive but does not normally print such an
announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are
not derived from the Program, and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those sections when you distribute them
as separate works. But when you distribute the same sections as part of a whole which is a work
based on the Program, the distribution of the whole must be on the terms of this License, whose
permissions for other licensees extend to the entire whole, and thus to each and every part
regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely
by you; rather, the intent is to exercise the right to control the distribution of derivative or collective
works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with
a work based on the Program) on a volume of a storage or distribution medium does not bring the
other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code
or executable form under the terms of Sections 1 and 2 above provided that you also do one of the
following:
b) Accompany it with a written offer, valid for at least three years, to give any third party,
for a charge no more than your cost of physically performing source distribution, a complete
machinereadable copy of the corresponding source code, to be distributed under the terms
of Sections 1 and 2 above on a medium customarily used for software interchange; or,
128
129
Many people have made generous contributions to the wide range of software distributed through
that system in reliance on consistent application of that system; it is up to the author/donor to decide
if he or she is willing to distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of
this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or
by copyrighted interfaces, the original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding those countries, so that
distribution is permitted only in or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public
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.
Each version is given a distinguishing version number. If the Program specifies a version number of
this License which applies to it and "any later version", you have the option of following the terms
and conditions either of that version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of this License, you may choose any
version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution
conditions are different, write to the author to ask for permission. For software which is copyrighted
by the Free Software Foundation, write to the Free Software Foundation; we sometimes make
exceptions for this. Our decision will be guided by the two goals of preserving the free status of all
derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU
ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE
TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
130
DAMAGES.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive
mode:
Gnomovision version 69, Copyright (C) yyyy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type show w. This is free software, and you are welcome
to redistribute it under certain conditions; type show c
for details.
The hypothetical commands show w and show c should show the appropriate parts of the
General Public License. Of course, the commands you use may be called something other than
show w and show c; they could even be mouseclicks or menu itemswhatever suits
your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a
"copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright
interest in the program Gnomovision
(which makes passes at compilers) written
by James Hacker.
signature of Ty Coon, 1 April 1989
Ty Coon, President of Vice
131
This General Public License does not permit incorporating your program into proprietary programs.
If your program is a subroutine library, you may consider it more useful to permit linking
proprietary applications with the library. If this is what you want to do, use the GNU Library
General Public License instead of this License.
FSF & GNU inquiries & questions to [email protected].
Comments on these web pages to [email protected], send other questions to
[email protected].
Copyright notice above.
Free Software Foundation, Inc., 59 Temple Place Suite 330, Boston, MA 02111, USA
Updated: 16 Feb 1998 tower
132