sphinterpolate(1) GMT sphinterpolate(1)

## NAME

sphinterpolate - Spherical gridding in tension of data on a sphere

## SYNOPSIS

sphinterpolate[table]-Ggrdfile[-Iincrement] [-Qmode[/options] ] [-Rregion] [-V[level] ] [-Z] [-bibinary ] [-dinodata ] [-eregexp ] [-hheaders ] [-iflags ] [-r] [-:[i|o] ]Note:No space is allowed between the option flag and the associated arguments.

## DESCRIPTION

sphinterpolatereads one or more ASCII [or binary] files (or standard input) containinglon,lat,zand performs a Delaunay triangulation to set up a spherical interpolation in tension. The final grid is saved to the specified file. Several options may be used to affect the outcome, such as choosing local versus global gradient estimation or optimize the tension selection to satisfy one of four criteria.

## REQUIRED ARGUMENTS

-GgrdfileName of the output grid to hold the interpolation.

## OPTIONAL ARGUMENTS

tableOne or more ASCII (or binary, see-bi[ncols][type]) data table file(s) holding a number of data columns. If no tables are given then we read from standard input.-Ixinc[unit][+e|n][/yinc[unit][+e|n]]x_inc[and optionallyy_inc] is the grid spacing. Optionally, append a suffix modifier.Geographical(degrees)coordinates: Appendmto indicate arc minutes orsto indicate arc seconds. If one of the unitse,f,k,M,noruis appended instead, the increment is assumed to be given in meter, foot, km, Mile, nau- tical mile or US survey foot, respectively, and will be con- verted to the equivalent degrees longitude at the middle lati- tude of the region (the conversion depends on PROJ_ELLIPSOID). Ify_incis given but set to 0 it will be reset equal tox_inc; otherwise it will be converted to degrees latitude.Allcoordi-nates: If+eis appended then the corresponding maxx(east) ory(north) may be slightly adjusted to fit exactly the given increment [by default the increment may be adjusted slightly to fit the given domain]. Finally, instead of giving an increment you may specify thenumberofnodesdesired by appending+nto the supplied integer argument; the increment is then recalcu- lated from the number of nodes and the domain. The resulting increment value depends on whether you have selected a grid- line-registered or pixel-registered grid; see App-file-formats for details. Note: if-Rgrdfileis used then the grid spacing has already been initialized; use-Ito override the values.-Qmode[/options] Specify one of four ways to calculate tension factors to pre- serve local shape properties or satisfy arc constraints [Default is no tension].-Q0 Piecewise linear interpolation; no tension is applied.-Q1 Smooth interpolation with local gradient estimates.-Q2 Smooth interpolation with global gradient estimates. You may optionally append /N/M/U, whereNis the number of iterations used to converge at solutions for gradients when variable ten- sions are selected (e.g.,-Tonly) [3],Mis the number of Gauss-Seidel iterations used when determining the global gradi- ents [10], andUis the maximum change in a gradient at the last iteration [0.01].-Q3 Smoothing. Optionally append/E/U[/0/0], whereEis Expected squared error in a typical (scaled) data value, andUis Upper bound on weighted sum of squares of deviations from data.-Rwest/east/south/north[/zmin/zmax][+r][+uunit]west,east,south, andnorthspecify the region of interest, and you may specify them in decimal degrees or in [A+-]dd:mm[:ss.xxx][W|E|S|N] format Append+rif lower left and upper right map coordinates are given instead of w/e/s/n. The two shorthands-Rgand-Rdstand for global domain (0/360 and -180/+180 in longitude respectively, with -90/+90 in latitude). Alternatively for grid creation, giveRcodelon/lat/nx/ny, wherecodeis a 2-character combination of L, C, R (for left, center, or right) and T, M, B for top, middle, or bottom. e.g., BL for lower left. This indicates which point on a rectangular region thelon/latcoordinate refers to, and the grid dimensionsnxandnywith grid spacings via-Iis used to create the corresponding region. Alternatively, specify the name of an existing grid file and the-Rsettings (and grid spacing, if applicable) are copied from the grid. Appending+uunitexpects projected (Carte- sian) coordinates compatible with chosen-Jand we inversely project to determine actual rectangular geographic region. For perspective view (-p), optionally append /zmin/zmax. In case of perspective view (-p), a z-range (zmin,zmax) can be appended to indicate the third dimension. This needs to be done only when using the-Jzoption, not when using only the-poption. In the latter case a perspective view of the plane is plotted, with no third dimension.-TUse variable tension (ignored with-Q0 [constant]-V[level] (morea|) Select verbosity level [c].-ZBefore interpolation, scale data by the maximum data range [no scaling].-bi[ncols][t] (morea|) Select native binary input. [Default is 3 input columns].-dinodata(morea|) Replace input columns that equalnodatawith NaN.-e[~]^<i>apattern^<i>a|-e[~]/regexp/[i] (morea|) Only accept data records that match the given pattern.-h[i|o][n][+c][+d][+rremark][+rtitle] (morea|) Skip or produce header record(s).-:[i|o] (morea|) Swap 1st and 2nd column on input and/or output.-r(morea|) Set pixel node registration [gridline].-^or just-Print a short message about the syntax of the command, then exits (NOTE: on Windows just use-).-+or just+Print an extensive usage (help) message, including the explana- tion of any module-specific option (but not the GMT common options), then exits.-?or no arguments Print a complete usage (help) message, including the explanation of all options, then exits.

## ASCII FORMAT PRECISION

The ASCII output formats of numerical data are controlled by parameters in your gmt.conf file. Longitude and latitude are formatted according to FORMAT_GEO_OUT, absolute time is under the control of FOR- MAT_DATE_OUT and FORMAT_CLOCK_OUT, whereas general floating point val- ues are formatted according to FORMAT_FLOAT_OUT. Be aware that the for- mat in effect can lead to loss of precision in ASCII output, which can lead to various problems downstream. If you find the output is not written with enough precision, consider switching to binary output (-boif available) or specify more decimals using the FORMAT_FLOAT_OUT set- ting.

## EXAMPLES

To interpolate the points in the file testdata.txt on a global 1x1 degree grid with no tension, use sphinterpolate testdata.txt -Rg -I1 -Gsolution.nc

## SEE ALSO

gmt(1),greenspline(1),nearneighbor(1),sphdistance(1),sphtriangulate(1),surface(1),triangulate(1)

## REFERENCES

Renka, R, J., 1997, Algorithm 772: STRIPACK: Delaunay Triangulation and Voronoi Diagram on the Surface of a Sphere,AMCTrans.Math.Software,23(3), 416-434. Renka, R, J,, 1997, Algorithm 773: SSRFPACK: Interpolation of scattered data on the Surface of a Sphere with a surface under tension,AMCTrans.Math.Software,23(3), 435-442.

## COPYRIGHT

2017, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe 5.4.2 Jun 24, 2017 sphinterpolate(1)

gmt5 5.4.2 - Generated Thu Jun 29 16:32:16 CDT 2017