1SURFACE(1)                   Generic Mapping Tools                  SURFACE(1)
2
3
4

NAME

6       surface  -  adjustable  tension  continuous  curvature surface gridding
7       algorithm
8

SYNOPSIS

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

DESCRIPTION

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.  Note  that
45              the smallest grid dimension must be at least 4.
46
47       -I     x_inc  [and  optionally  y_inc] is the grid spacing. Optionally,
48              append a suffix modifier.  Geographical  (degrees)  coordinates:
49              Append  m  to indicate arc minutes or c to indicate arc seconds.
50              If one of the units e, k, i,  or  n  is  appended  instead,  the
51              increment  is assumed to be given in meter, km, miles, or nauti‐
52              cal miles, respectively, and will be converted to the equivalent
53              degrees longitude at the middle latitude of the region (the con‐
54              version depends on ELLIPSOID).  If /y_inc is given but set to  0
55              it  will be reset equal to x_inc; otherwise it will be converted
56              to degrees latitude.  All coordinates: If = is appended then the
57              corresponding max x (east) or y (north) may be slightly adjusted
58              to fit exactly the given increment [by default the increment may
59              be adjusted slightly to fit the given domain].  Finally, instead
60              of giving an increment you  may  specify  the  number  of  nodes
61              desired  by  appending  +  to the supplied integer argument; the
62              increment is then recalculated from the number of nodes and  the
63              domain.   The  resulting  increment value depends on whether you
64              have selected a gridline-registered  or  pixel-registered  grid;
65              see  Appendix  B  for  details.  Note: if -Rgrdfile is used then
66              grid spacing has already been initialized; use  -I  to  override
67              the values.
68
69       -R     xmin,  xmax, ymin, and ymax specify the Region of interest.  For
70              geographic regions,  these  limits  correspond  to  west,  east,
71              south,  and north and you may specify them in decimal degrees or
72              in [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append r if  lower  left
73              and  upper  right  map coordinates are given instead of w/e/s/n.
74              The two shorthands -Rg and -Rd stand for  global  domain  (0/360
75              and  -180/+180  in longitude respectively, with -90/+90 in lati‐
76              tude).  Alternatively, specify the name of an existing grid file
77              and the -R settings (and grid spacing, if applicable) are copied
78              from the grid.  For calendar time  coordinates  you  may  either
79              give  (a) relative time (relative to the selected TIME_EPOCH and
80              in the selected TIME_UNIT; append t to -JX|x), or  (b)  absolute
81              time  of  the form [date]T[clock] (append T to -JX|x).  At least
82              one of date and clock must be present; the T is always required.
83              The date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian
84              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
85              string  must  be  of the form hh:mm:ss[.xxx].  The use of delim‐
86              iters and their type and positions must be exactly as  indicated
87              (however,  input,  output and plot formats are customizable; see
88              gmtdefaults).
89

OPTIONS

91       -A     Aspect ratio.  If desired, grid anisotropy can be added  to  the
92              equations.   Enter  aspect_ratio,  where  dy = dx / aspect_ratio
93              relates the grid dimensions.  [Default  =  1  assumes  isotropic
94              grid.]
95
96       -C     Convergence  limit.  Iteration is assumed to have converged when
97              the maximum absolute change in any grid value is less than  con‐
98              vergence_limit.   (Units  same  as  data  z units).  [Default is
99              scaled to 0.1 percent of typical gradient in input data.]
100
101       -H     Input file(s) has header record(s).  If used, the default number
102              of  header records is N_HEADER_RECS.  Use -Hi if only input data
103              should have  header  records  [Default  will  write  out  header
104              records  if  the  input  data  have them]. Blank lines and lines
105              starting with # are always skipped.  Not used with binary data.
106
107       -L     Impose limits on the output solution.   llower  sets  the  lower
108              bound.   lower  can  be the name of a grid file with lower bound
109              values, a fixed value, d to set to minimum input value, or u for
110              unconstrained [Default].  uupper sets the upper bound and can be
111              the name of a grid file with upper bound values, a fixed  value,
112              d  to  set  to  maximum  input  value,  or  u  for unconstrained
113              [Default].
114
115       -N     Number  of  iterations.   Iteration  will  cease  when   conver‐
116              gence_limit  is  reached  or  when  number of iterations reaches
117              max_iterations. [Default is 250.]
118
119       -Q     Suggest grid dimensions which have a highly  composite  greatest
120              common  factor.  This allows surface to use several intermediate
121              steps in the solution, yielding  faster  run  times  and  better
122              results.  The  sizes suggested by -Q can be achieved by altering
123              -R and/or -I. You can recover the -R and -I you  want  later  by
124              using grdsample or grdcut on the output of surface.
125
126       -S     Search  radius.   Enter search_radius in same units as x,y data;
127              append m to indicate minutes.  This is used  to  initialize  the
128              grid before the first iteration; it is not worth the time unless
129              the grid lattice is  prime  and  cannot  have  regional  stages.
130              [Default = 0.0 and no search is made.]
131
132       -T     Tension  factor[s].  These must be between 0 and 1.  Tension may
133              be used in the interior solution (above equation, where it  sup‐
134              presses  spurious  oscillations)  and in the boundary conditions
135              (where it tends to flatten the solution approaching the  edges).
136              Using  zero  for both values results in a minimum curvature sur‐
137              face with free edges, i.e. a natural bicubic spline.  Use -Tten‐
138              sion_factori  to  set interior tension, and -Ttension_factorb to
139              set boundary tension.  If you do not append i or b, both will be
140              set to the same value.  [Default = 0 for both gives minimum cur‐
141              vature solution.]
142
143       -V     Selects verbose mode, which will send progress reports to stderr
144              [Default  runs  "silently"].   -Vl  will  report the convergence
145              after each iteration;  -V will report only after  each  regional
146              grid is converged.
147
148       -Z     Over-relaxation  factor.   This  parameter is used to accelerate
149              the convergence; it is a number between 1 and 2.  A value  of  1
150              iterates  the  equations  exactly, and will always assure stable
151              convergence.  Larger values overestimate the incremental changes
152              during  convergence,  and will reach a solution more rapidly but
153              may become unstable.  If you use a large value for this  factor,
154              it is a good idea to monitor each iteration with the -Vl option.
155              [Default = 1.4 converges quickly and is almost always stable.]
156
157       -:     Toggles between  (longitude,latitude)  and  (latitude,longitude)
158              input and/or output.  [Default is (longitude,latitude)].  Append
159              i to select input only or o to  select  output  only.   [Default
160              affects both].
161
162       -bi    Selects binary input.  Append s for single precision [Default is
163              d  (double)].   Uppercase  S  or  D  will  force  byte-swapping.
164              Optionally,  append  ncol,  the number of columns in your binary
165              input file if it exceeds the columns needed by the program.   Or
166              append  c  if  the  input  file  is  netCDF.  Optionally, append
167              var1/var2/... to specify the variables to be read.  [Default  is
168              3 input columns].
169
170       -f     Special  formatting of input and/or output columns (time or geo‐
171              graphical data).  Specify i or o to  make  this  apply  only  to
172              input  or  output  [Default  applies to both].  Give one or more
173              columns (or column ranges) separated by commas.  Append T (abso‐
174              lute  calendar time), t (relative time in chosen TIME_UNIT since
175              TIME_EPOCH), x (longitude), y (latitude), or f (floating  point)
176              to  each  column or column range item.  Shorthand -f[i|o]g means
177              -f[i|o]0x,1y (geographic coordinates).
178

GRID VALUES PRECISION

180       Regardless of the precision of the input data, GMT programs that create
181       grid  files  will  internally  hold  the grids in 4-byte floating point
182       arrays.  This is done to conserve memory and furthermore  most  if  not
183       all  real  data can be stored using 4-byte floating point values.  Data
184       with higher precision (i.e., double precision values)  will  lose  that
185       precision  once  GMT  operates on the grid or writes out new grids.  To
186       limit loss of precision when processing data you should always consider
187       normalizing the data prior to processing.
188

EXAMPLES

190       To  grid  5  by  5  minute  gravity  block means from the ASCII data in
191       hawaii_5x5.xyg, using a tension_factor = 0.25,  a  convergence_limit  =
192       0.1  milligal,  writing the result to a file called hawaii_grd.grd, and
193       monitoring each iteration, try:
194
195       surface hawaii_5x5.xyg  -R198/208/18/25  -I5m  -Ghawaii_grd.grd  -T0.25
196       -C0.1 -Vl
197

BUGS

199       surface  will  complain  when more than one data point is found for any
200       node and suggest that you  run  blockmean,  blockmedian,  or  blockmode
201       first.   If  you  did run blockm* and still get this message it usually
202       means that your grid spacing is so small that you need more decimals in
203       the output format used by blockm*.  You may specify more decimal places
204       by editing the parameter D_FORMAT in your .gmtdefaults4 file  prior  to
205       running  blockm*,  or choose binary input and/or output using single or
206       double precision storage.
207       Note that only gridline registration is possible with surface.  If  you
208       need  a  pixel-registered  grid  you can resample a gridline registered
209       grid using grdsample -T.
210

SEE ALSO

212       blockmean(1), blockmedian(1),  blockmode(1),  GMT(1),  nearneighbor(1),
213       triangulate(1)
214

REFERENCES

216       Smith, W. H. F, and P. Wessel, 1990, Gridding with continuous curvature
217       splines in tension, Geophysics, 55, 293-305.
218
219
220
221GMT 4.5.6                         10 Mar 2011                       SURFACE(1)
Impressum