1SPHINTERPOLATE(1) Generic Mapping Tools SPHINTERPOLATE(1)
2
3
4
6 sphinterpolate - Gridding in tension of spherical data
7
9 sphinterpolate infiles -Ggrdfile [ -F ] [ -H[i][nrec] ] [
10 -Ixinc[unit][=|+][/yinc[unit][=|+]] ] [ -Qmode[/options] ] [
11 -Rwest/east/south/north[r] ] [ -V ] [ -Z ] [ -:[i|o] ] [
12 -b[i|o][s|S|d|D[ncol]|c[var1/...]] ][ -m[i|o][flag] ]
13
15 sphinterpolate reads one or more ASCII [or binary] files (or standard
16 input) containing lon, lat, f and performs a Delaunay triangulation to
17 set up a spherical interpolation in tension. The final grid is saved
18 to the specified file. Several options may be used to affect the out‐
19 come, such as choosing local versus global gradient estimation or opti‐
20 mize the tension selection to satisfy one of four criteria.
21
22 infiles
23 Data files with the (lon, lat, f) coordinates in ASCII (or
24 binary; see -b). If no files are given the standard input is
25 read.
26
27 -G Name of the output grid to hold the interpolation.
28
30 -F Force pixel node registration [Default is gridline registra‐
31 tion]. (Node registrations are defined in GMT Cookbook Appendix
32 B on grid file formats.)
33
34 -H Input file(s) has header record(s). If used, the default number
35 of header records is N_HEADER_RECS. Use -Hi if only input data
36 should have header records [Default will write out header
37 records if the input data have them]. Blank lines and lines
38 starting with # are always skipped.
39
40 -I x_inc [and optionally y_inc] is the grid spacing. Optionally,
41 append a suffix modifier. Geographical (degrees) coordinates:
42 Append m to indicate arc minutes or c to indicate arc seconds.
43 If one of the units e, k, i, or n is appended instead, the
44 increment is assumed to be given in meter, km, miles, or nauti‐
45 cal miles, respectively, and will be converted to the equivalent
46 degrees longitude at the middle latitude of the region (the con‐
47 version depends on ELLIPSOID). If /y_inc is given but set to 0
48 it will be reset equal to x_inc; otherwise it will be converted
49 to degrees latitude. All coordinates: If = is appended then the
50 corresponding max x (east) or y (north) may be slightly adjusted
51 to fit exactly the given increment [by default the increment may
52 be adjusted slightly to fit the given domain]. Finally, instead
53 of giving an increment you may specify the number of nodes
54 desired by appending + to the supplied integer argument; the
55 increment is then recalculated from the number of nodes and the
56 domain. The resulting increment value depends on whether you
57 have selected a gridline-registered or pixel-registered grid;
58 see Appendix B for details. Note: if -Rgrdfile is used then
59 grid spacing has already been initialized; use -I to override
60 the values.
61
62 -Q Specify one of four ways to calculate tension factors to pre‐
63 serve local shape properties or satisfy arc constraints [Default
64 is no tension].
65
66 -Q0 Piecewise linear interpolation; no tension is applied.
67
68 -QQ1 Smooth interpolation with local gradient estimates.
69
70 -QQ2 Smooth interpolation with global gradient estimates. You may
71 optionally append /N/M/U, where N is the number of iterations
72 used to converge at solutions for gradients when variable ten‐
73 sions are selected (e.g., -T only) [3], M is the number of
74 Gauss-Seidel iterations used when determining the global gradi‐
75 ents [10], and U is the maximum change in a gradient at the last
76 iteration [0.01].
77
78 -QQ3 Smoothing. Optionally append /E/U [/0/0], where E is Expected
79 squared error in a typical (scaled) data value, and U is Upper
80 bound on weighted sum of squares of deviations from data.
81
82 -R west, east, south, and north specify the Region of interest, and
83 you may specify them in decimal degrees or in
84 [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left and
85 upper right map coordinates are given instead of w/e/s/n. The
86 two shorthands -Rg and -Rd stand for global domain (0/360 and
87 -180/+180 in longitude respectively, with -90/+90 in latitude).
88 Alternatively, specify the name of an existing grid file and the
89 -R settings (and grid spacing, if applicable) are copied from
90 the grid.
91
92 -T Use variable tension (ignored with -Q0 [constant]
93
94 -V Selects verbose mode, which will send progress reports to stderr
95 [Default runs "silently"].
96
97 -Z Before interpolation, scale data by the maximum data range [no
98 scaling].
99
100 -: Toggles between (longitude,latitude) and (latitude,longitude)
101 input and/or output. [Default is (longitude,latitude)]. Append
102 i to select input only or o to select output only. [Default
103 affects both].
104
105 -bi Selects binary input. Append s for single precision [Default is
106 d (double)]. Uppercase S or D will force byte-swapping.
107 Optionally, append ncol, the number of columns in your binary
108 input file if it exceeds the columns needed by the program. Or
109 append c if the input file is netCDF. Optionally, append
110 var1/var2/... to specify the variables to be read. [Default is
111 3 input columns].
112
113 -bo Selects binary output. Append s for single precision [Default
114 is d (double)]. Uppercase S or D will force byte-swapping.
115 Optionally, append ncol, the number of desired columns in your
116 binary output file. [Default is same as input].
117
118 -m Multiple segment file(s). Segments are separated by a special
119 record. For ASCII files the first character must be flag
120 [Default is '>']. For binary files all fields must be NaN and
121 -b must set the number of output columns explicitly. By default
122 the -m setting applies to both input and output. Use -mi and
123 -mo to give separate settings to input and output.
124
126 The ASCII output formats of numerical data are controlled by parameters
127 in your .gmtdefaults4 file. Longitude and latitude are formatted
128 according to OUTPUT_DEGREE_FORMAT, whereas other values are formatted
129 according to D_FORMAT. Be aware that the format in effect can lead to
130 loss of precision in the output, which can lead to various problems
131 downstream. If you find the output is not written with enough preci‐
132 sion, consider switching to binary output (-bo if available) or specify
133 more decimals using the D_FORMAT setting.
134
136 Regardless of the precision of the input data, GMT programs that create
137 grid files will internally hold the grids in 4-byte floating point
138 arrays. This is done to conserve memory and furthermore most if not
139 all real data can be stored using 4-byte floating point values. Data
140 with higher precision (i.e., double precision values) will lose that
141 precision once GMT operates on the grid or writes out new grids. To
142 limit loss of precision when processing data you should always consider
143 normalizing the data prior to processing.
144
146 To interpolate the points in the file testdata.txt on a global 1x1
147 degree grid with no tension, use
148
149 sphinterpolate testdata.txt -Rg -I1 -Gsolution.grd
150
152 GMT(1), greenspline(1) sphdistance(1) sphtriangulate(1) triangulate(1)
153
155 Renka, R, J., 1997, Algorithm 772: STRIPACK: Delaunay Triangulation and
156 Voronoi Diagram on the Surface of a Sphere, AMC Trans. Math. Software,
157 23 (3), 416-434.
158 Renka, R, J,, 1997, Algorithm 773: SSRFPACK: Interpolation of scattered
159 data on the Surface of a Sphere with a surface under tension, AMC
160 Trans. Math. Software, 23 (3), 435-442.
161
162
163
164GMT 4.5.6 10 Mar 2011 SPHINTERPOLATE(1)