1SURFACE(1) Generic Mapping Tools SURFACE(1)
2
3
4
6 surface - adjustable tension continuous curvature surface gridding
7 algorithm
8
10 surface [ xyzfile ] -Goutputfile.grd
11 -Ixinc[unit][=|+][/yinc[unit][=|+]] -Rwest/east/south/north[r] [
12 -Aaspect_ratio ] [ -Cconvergence_limit ] [ -H[i][nrec] ] [ -Lllower ] [
13 -Luupper ] [ -Nmax_iterations ] [ -Q ] [ -Ssearch_radius[m] ] [ -Tten‐
14 sion_factor[i|b] ] [ -V[l] ] [ -Zover-relaxation_factor ] [ -:[i|o] ] [
15 -bi[s|S|d|D[ncol]|c[var1/...]] ] [ -fcolinfo ]
16
18 surface reads randomly-spaced (x,y,z) triples from standard input [or
19 xyzfile] and produces a binary grid file of gridded values z(x,y) by
20 solving:
21
22 (1 - T) * L (L (z)) + T * L (z) = 0
23
24 where T is a tension factor between 0 and 1, and L indicates the Lapla‐
25 cian operator. T = 0 gives the "minimum curvature" solution which is
26 equivalent to SuperMISP and the ISM packages. Minimum curvature can
27 cause undesired oscillations and false local maxima or minima (See
28 Smith and Wessel, 1990), and you may wish to use T > 0 to suppress
29 these effects. Experience suggests T ~ 0.25 usually looks good for
30 potential field data and T should be larger (T ~ 0.35) for steep topog‐
31 raphy data. T = 1 gives a harmonic surface (no maxima or minima are
32 possible except at control data points). It is recommended that the
33 user pre-process the data with blockmean, blockmedian, or blockmode to
34 avoid spatial aliasing and eliminate redundant data. You may impose
35 lower and/or upper bounds on the solution. These may be entered in the
36 form of a fixed value, a grid with values, or simply be the mini‐
37 mum/maximum input data values.
38
39 xyzfile
40 3 column ASCII file [or binary, see -b] holding (x,y,z) data
41 values. If no file is specified, surface will read from stan‐
42 dard input.
43
44 -G Output file name. Output is a binary 2-D .grd file.
45
46 -I x_inc [and optionally y_inc] is the grid spacing. Optionally,
47 append a suffix modifier. Geographical (degrees) coordinates:
48 Append m to indicate arc minutes or c to indicate arc seconds.
49 If one of the units e, k, i, or n is appended instead, the
50 increment is assumed to be given in meter, km, miles, or nauti‐
51 cal miles, respectively, and will be converted to the equivalent
52 degrees longitude at the middle latitude of the region (the con‐
53 version depends on ELLIPSOID). If /y_inc is given but set to 0
54 it will be reset equal to x_inc; otherwise it will be converted
55 to degrees latitude. All coordinates: If = is appended then the
56 corresponding max x (east) or y (north) may be slightly adjusted
57 to fit exactly the given increment [by default the increment may
58 be adjusted slightly to fit the given domain]. Finally, instead
59 of giving an increment you may specify the number of nodes
60 desired by appending + to the supplied integer argument; the
61 increment is then recalculated from the number of nodes and the
62 domain. The resulting increment value depends on whether you
63 have selected a gridline-registered or pixel-registered grid;
64 see Appendix B for details.
65
66 -R xmin, xmax, ymin, and ymax specify the Region of interest. For
67 geographic regions, these limits correspond to west, east,
68 south, and north and you may specify them in decimal degrees or
69 in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left
70 and upper right map coordinates are given instead of w/e/s/n.
71 The two shorthands -Rg and -Rd stand for global domain (0/360
72 and -180/+180 in longitude respectively, with -90/+90 in lati‐
73 tude). For calendar time coordinates you may either give (a)
74 relative time (relative to the selected TIME_EPOCH and in the
75 selected TIME_UNIT; append t to -JX|x), or (b) absolute time of
76 the form [date]T[clock] (append T to -JX|x). At least one of
77 date and clock must be present; the T is always required. The
78 date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian
79 calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
80 string must be of the form hh:mm:ss[.xxx]. The use of delim‐
81 iters and their type and positions must be exactly as indicated
82 (however, input, output and plot formats are customizable; see
83 gmtdefaults).
84
86 -A Aspect ratio. If desired, grid anisotropy can be added to the
87 equations. Enter aspect_ratio, where dy = dx / aspect_ratio
88 relates the grid dimensions. [Default = 1 assumes isotropic
89 grid.]
90
91 -C Convergence limit. Iteration is assumed to have converged when
92 the maximum absolute change in any grid value is less than con‐
93 vergence_limit. (Units same as data z units). [Default is
94 scaled to 0.1 percent of typical gradient in input data.]
95
96 -H Input file(s) has Header record(s). Number of header records
97 can be changed by editing your .gmtdefaults4 file. If used, GMT
98 default is 1 header record. Use -Hi if only input data should
99 have header records [Default will write out header records if
100 the input data have them]. Blank lines and lines starting with #
101 are always skipped. Not used with binary data.
102
103 -L Impose limits on the output solution. llower sets the lower
104 bound. lower can be the name of a grid file with lower bound
105 values, a fixed value, d to set to minimum input value, or u for
106 unconstrained [Default]. uupper sets the upper bound and can be
107 the name of a grid file with upper bound values, a fixed value,
108 d to set to maximum input value, or u for unconstrained
109 [Default].
110
111 -N Number of iterations. Iteration will cease when conver‐
112 gence_limit is reached or when number of iterations reaches
113 max_iterations. [Default is 250.]
114
115 -Q Suggest grid dimensions which have a highly composite greatest
116 common factor. This allows surface to use several intermediate
117 steps in the solution, yielding faster run times and better
118 results. The sizes suggested by -Q can be achieved by altering
119 -R and/or -I. You can recover the -R and -I you want later by
120 using grdsample or grdcut on the output of surface.
121
122 -S Search radius. Enter search_radius in same units as x,y data;
123 append m to indicate minutes. This is used to initialize the
124 grid before the first iteration; it is not worth the time unless
125 the grid lattice is prime and cannot have regional stages.
126 [Default = 0.0 and no search is made.]
127
128 -T Tension factor[s]. These must be between 0 and 1. Tension may
129 be used in the interior solution (above equation, where it sup‐
130 presses spurious oscillations) and in the boundary conditions
131 (where it tends to flatten the solution approaching the edges).
132 Using zero for both values results in a minimum curvature sur‐
133 face with free edges, i.e. a natural bicubic spline. Use -Tten‐
134 sion_factori to set interior tension, and -Ttension_factorb to
135 set boundary tension. If you do not append i or b, both will be
136 set to the same value. [Default = 0 for both gives minimum cur‐
137 vature solution.]
138
139 -V Selects verbose mode, which will send progress reports to stderr
140 [Default runs "silently"]. -Vl will report the convergence
141 after each iteration; -V will report only after each regional
142 grid is converged.
143
144 -Z Over-relaxation factor. This parameter is used to accelerate
145 the convergence; it is a number between 1 and 2. A value of 1
146 iterates the equations exactly, and will always assure stable
147 convergence. Larger values overestimate the incremental changes
148 during convergence, and will reach a solution more rapidly but
149 may become unstable. If you use a large value for this factor,
150 it is a good idea to monitor each iteration with the -Vl option.
151 [Default = 1.4 converges quickly and is almost always stable.]
152
153 -: Toggles between (longitude,latitude) and (latitude,longitude)
154 input and/or output. [Default is (longitude,latitude)]. Append
155 i to select input only or o to select output only. [Default
156 affects both].
157
158 -bi Selects binary input. Append s for single precision [Default is
159 d (double)]. Uppercase S or D will force byte-swapping.
160 Optionally, append ncol, the number of columns in your binary
161 input file if it exceeds the columns needed by the program. Or
162 append c if the input file is netCDF. Optionally, append
163 var1/var2/... to specify the variables to be read. [Default is
164 3 input columns].
165
166 -f Special formatting of input and/or output columns (time or geo‐
167 graphical data). Specify i or o to make this apply only to
168 input or output [Default applies to both]. Give one or more
169 columns (or column ranges) separated by commas. Append T (abso‐
170 lute calendar time), t (relative time in chosen TIME_UNIT since
171 TIME_EPOCH), x (longitude), y (latitude), or f (floating point)
172 to each column or column range item. Shorthand -f[i|o]g means
173 -f[i|o]0x,1y (geographic coordinates).
174
176 Regardless of the precision of the input data, GMT programs that create
177 gridded files will internally hold the grids in 4-byte floating point
178 arrays. This is done to conserve memory and futhermore most if not all
179 real data can be stored using 4-byte floating point values. Data with
180 higher precision (i.e., double precision values) will lose that preci‐
181 sion once GMT operates on the grid or writes out new grids. To limit
182 loss of precision when processing data you should always consider nor‐
183 malizing the data prior to processing.
184
186 To grid 5 by 5 minute gravity block means from the ASCII data in
187 hawaii_5x5.xyg, using a tension_factor = 0.25, a convergence_limit =
188 0.1 milligal, writing the result to a file called hawaii_grd.grd, and
189 monitoring each iteration, try:
190
191 surface hawaii_5x5.xyg -R198/208/18/25 -I5m -Ghawaii_grd.grd -T0.25
192 -C0.1 -Vl
193
195 surface will complain when more than one data point is found for any
196 node and suggest that you run blockmean, blockmedian, or blockmode
197 first. If you did run blockm* and still get this message it usually
198 means that your grid spacing is so small that you need more decimals in
199 the output format used by blockm*. You may specify more decimal places
200 by editing the parameter D_FORMAT in your .gmtdefaults4 file prior to
201 running blockm*, or choose binary input and/or output using single or
202 double precision storage.
203 Note that only gridline registration is possible with surface. If you
204 need a pixel-registered grid you can resample a gridline registered
205 grid using grdsample -T.
206
208 blockmean(1), blockmedian(1), blockmode(1), GMT(1), nearneighbor(1),
209 triangulate(1)
210
212 Smith, W. H. F, and P. Wessel, 1990, Gridding with continuous curvature
213 splines in tension, Geophysics, 55, 293-305.
214
215
216
217GMT 4.3.1 15 May 2008 SURFACE(1)