.\" Man page generated from reStructuredText. . .TH "SURFACE" "1gmt" "May 21, 2019" "5.4.5" "GMT" .SH NAME surface \- Grid table data using adjustable tension continuous curvature splines . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fBsurface\fP [ \fItable\fP ] \fB\-G\fP\fIoutputfile.nc\fP \fB\-I\fP\fIincrement\fP \fB\-R\fP\fIregion\fP [ \fB\-A\fP\fIaspect_ratio\fP ] [ \fB\-C\fP\fIconvergence_limit\fP[%] ] [ \fB\-L\fP\fBl\fP\fIlower\fP ] [ \fB\-Lu\fP\fIupper\fP ] [ \fB\-N\fP\fImax_iterations\fP ] [ \fB\-Q\fP ] [ \fB\-S\fP\fIsearch_radius\fP[\fBm\fP|\fBs\fP] ] [ \fB\-T\fP[\fBi\fP|\fBb\fP]\fItension_factor\fP ] [ \fB\-V\fP[\fIlevel\fP] ] [ \fB\-Z\fP\fIover\-relaxation_factor\fP ] [ \fB\-a\fPflags ] [ \fB\-bi\fPbinary ] [ \fB\-di\fPnodata ] [ \fB\-e\fPregexp ] [ \fB\-f\fPflags ] [ \fB\-h\fPheaders ] [ \fB\-i\fPflags ] [ \fB\-r\fP ] [ \fB\-:\fP[\fBi\fP|\fBo\fP] ] .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBsurface\fP reads randomly\-spaced (x,y,z) triples from standard input [or \fItable\fP] and produces a binary grid file of gridded values z(x,y) by solving: .INDENT 0.0 .INDENT 3.5 (1 \- T) * L (L (z)) + T * L (z) = 0 .UNINDENT .UNINDENT .sp where T is a tension factor between 0 and 1, and L indicates the Laplacian operator. T = 0 gives the "minimum curvature" solution which is equivalent to SuperMISP and the ISM packages. Minimum curvature can cause undesired oscillations and false local maxima or minima (See Smith and Wessel, 1990), and you may wish to use T > 0 to suppress these effects. Experience suggests T ~ 0.25 usually looks good for potential field data and T should be larger (T ~ 0.35) for steep topography data. T = 1 gives a harmonic surface (no maxima or minima are possible except at control data points). It is recommended that the user pre\-process the data with blockmean, blockmedian, or blockmode to avoid spatial aliasing and eliminate redundant data. You may impose lower and/or upper bounds on the solution. These may be entered in the form of a fixed value, a grid with values, or simply be the minimum/maximum input data values. Natural boundary conditions are applied at the edges, except for geographic data with 360\-degree range where we apply periodic boundary conditions in the longitude direction. .SH REQUIRED ARGUMENTS .INDENT 0.0 .TP \fB\-G\fP\fIoutputfile.nc\fP Output file name. Output is a binary 2\-D \fI\&.nc\fP file. Note that the smallest grid dimension must be at least 4. .UNINDENT .INDENT 0.0 .TP \fB\-I\fP\fIxinc\fP[\fIunit\fP][\fB+e\fP|\fBn\fP][/\fIyinc\fP[\fIunit\fP][\fB+e\fP|\fBn\fP]] \fIx_inc\fP [and optionally \fIy_inc\fP] is the grid spacing. Optionally, append a suffix modifier. \fBGeographical (degrees) coordinates\fP: Append \fBm\fP to indicate arc minutes or \fBs\fP to indicate arc seconds. If one of the units \fBe\fP, \fBf\fP, \fBk\fP, \fBM\fP, \fBn\fP or \fBu\fP is appended instead, the increment is assumed to be given in meter, foot, km, Mile, nautical mile or US survey foot, respectively, and will be converted to the equivalent degrees longitude at the middle latitude of the region (the conversion depends on PROJ_ELLIPSOID). If \fIy_inc\fP is given but set to 0 it will be reset equal to \fIx_inc\fP; otherwise it will be converted to degrees latitude. \fBAll coordinates\fP: If \fB+e\fP is appended then the corresponding max \fIx\fP (\fIeast\fP) or \fIy\fP (\fInorth\fP) 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 the \fInumber of nodes\fP desired by appending \fB+n\fP to the supplied integer argument; the increment is then recalculated from the number of nodes and the domain. The resulting increment value depends on whether you have selected a gridline\-registered or pixel\-registered grid; see App\-file\-formats for details. Note: if \fB\-R\fP\fIgrdfile\fP is used then the grid spacing has already been initialized; use \fB\-I\fP to override the values. .UNINDENT .INDENT 0.0 .TP \fB\-R\fP\fIxmin\fP/\fIxmax\fP/\fIymin\fP/\fIymax\fP[\fB+r\fP][\fB+u\fP\fIunit\fP] (more ...) Specify the region of interest. .UNINDENT .SH OPTIONAL ARGUMENTS .INDENT 0.0 .TP .B \fItable\fP One or more ASCII (or binary, see \fB\-bi\fP[\fIncols\fP][\fItype\fP]) data table file(s) holding a number of data columns. If no tables are given then we read from standard input. .UNINDENT .INDENT 0.0 .TP \fB\-A\fP\fIaspect_ratio\fP Aspect ratio. If desired, grid anisotropy can be added to the equations. Enter \fIaspect_ratio\fP, where dy = dx / \fIaspect_ratio\fP relates the grid dimensions. [Default = 1 assumes isotropic grid.] .UNINDENT .INDENT 0.0 .TP \fB\-C\fP\fIconvergence_limit\fP[%] Convergence limit. Iteration is assumed to have converged when the maximum absolute change in any grid value is less than \fIconvergence_limit\fP\&. (Units same as data z units). Alternatively, give limit in percentage of rms deviation by appending %. [Default is scaled to 1e\-4 of the root\-mean\-square deviation of the data from a best\-fit (least\-squares) plane.]. This is the final convergence limit at the desired grid spacing; for intermediate (coarser) grids the effective convergence limit is divided by the grid spacing multiplier. .UNINDENT .INDENT 0.0 .TP \fB\-Ll\fP\fIlower\fP and \fB\-Lu\fP\fIupper\fP Impose limits on the output solution. \fBl\fP\fIlower\fP sets the lower bound. \fIlower\fP can be the name of a grid file with lower bound values, a fixed value, \fBd\fP to set to minimum input value, or \fBu\fP for unconstrained [Default]. \fBu\fP\fIupper\fP sets the upper bound and can be the name of a grid file with upper bound values, a fixed value, \fBd\fP to set to maximum input value, or \fBu\fP for unconstrained [Default]. Grid files used to set the limits may contain NaNs. In the presence of NaNs, the limit of a node masked with NaN is unconstrained. .UNINDENT .INDENT 0.0 .TP \fB\-N\fP\fImax_iterations\fP Number of iterations. Iteration will cease when \fIconvergence_limit\fP is reached or when number of iterations reaches \fImax_iterations\fP\&. This is the final iteration limit at the desired grid spacing; for intermediate (coarser) grids the effective iteration limit is scaled by the grid spacing multiplier. [Default is 500.] .UNINDENT .INDENT 0.0 .TP \fB\-Q\fP Suggest grid dimensions which have a highly composite greatest common factor. This allows surface to use several intermediate steps in the solution, yielding faster run times and better results. The sizes suggested by \fB\-Q\fP can be achieved by altering \fB\-R\fP and/or \fB\-I\fP\&. You can recover the \fB\-R\fP and \fB\-I\fP you want later by using grdsample or grdcut on the output of \fBsurface\fP\&. .UNINDENT .INDENT 0.0 .TP \fB\-S\fP\fIsearch_radius\fP[\fBm\fP|\fBs\fP] Search radius. Enter \fIsearch_radius\fP in same units as x,y data; append \fBm\fP to indicate arc minutes or \fBs\fP for arc seconds. This is used to initialize the grid before the first iteration; it is not worth the time unless the grid lattice is prime and cannot have regional stages. [Default = 0.0 and no search is made.] .UNINDENT .INDENT 0.0 .TP \fB\-T\fP[\fBi\fP|\fBb\fP]\fItension_factor\fP Tension factor[s]. These must be between 0 and 1. Tension may be used in the interior solution (above equation, where it suppresses spurious oscillations) and in the boundary conditions (where it tends to flatten the solution approaching the edges). Using zero for both values results in a minimum curvature surface with free edges, i.e., a natural bicubic spline. Use \fB\-Ti\fP\fItension_factor\fP to set interior tension, and \fB\-Tb\fP\fItension_factor\fP to set boundary tension. If you do not prepend \fBi\fP or \fBb\fP, both will be set to the same value. [Default = 0 for both gives minimum curvature solution.] .UNINDENT .INDENT 0.0 .TP \fB\-V\fP[\fIlevel\fP] (more ...) Select verbosity level [c]. \fB\-V3\fP will report the convergence after each iteration; \fB\-V\fP will report only after each regional grid is converged. .UNINDENT .INDENT 0.0 .TP \fB\-Z\fP\fIover\-relaxation_factor\fP Over\-relaxation factor. This parameter is used to accelerate the convergence; it is a number between 1 and 2. A value of 1 iterates the equations exactly, and will always assure stable convergence. Larger values overestimate the incremental changes during convergence, and will reach a solution more rapidly but may become unstable. If you use a large value for this factor, it is a good idea to monitor each iteration with the \fB\-Vl\fP option. [Default = 1.4 converges quickly and is almost always stable.] .UNINDENT .INDENT 0.0 .TP \fB\-a\fP\fIcol\fP=\fIname\fP[\fI\&...\fP] (more ...) Set aspatial column associations \fIcol\fP=\fIname\fP\&. .UNINDENT .INDENT 0.0 .TP \fB\-bi\fP[\fIncols\fP][\fBt\fP] (more ...) Select native binary input. [Default is 3 input columns]. .UNINDENT .INDENT 0.0 .TP \fB\-di\fP\fInodata\fP (more ...) Replace input columns that equal \fInodata\fP with NaN. .UNINDENT .INDENT 0.0 .TP \fB\-e\fP[\fB~\fP]\fI"pattern"\fP \fB|\fP \fB\-e\fP[\fB~\fP]/\fIregexp\fP/[\fBi\fP] (more ...) Only accept data records that match the given pattern. .UNINDENT .INDENT 0.0 .TP \fB\-f\fP[\fBi\fP|\fBo\fP]\fIcolinfo\fP (more ...) Specify data types of input and/or output columns. .UNINDENT .INDENT 0.0 .TP \fB\-h\fP[\fBi\fP|\fBo\fP][\fIn\fP][\fB+c\fP][\fB+d\fP][\fB+r\fP\fIremark\fP][\fB+r\fP\fItitle\fP] (more ...) Skip or produce header record(s). Not used with binary data. .UNINDENT .INDENT 0.0 .TP \fB\-i\fP\fIcols\fP[\fB+l\fP][\fB+s\fP\fIscale\fP][\fB+o\fP\fIoffset\fP][,\fI\&...\fP] (more ...) Select input columns and transformations (0 is first column). .UNINDENT .INDENT 0.0 .TP \fB\-r\fP (more ...) Set pixel node registration [gridline]. .UNINDENT .INDENT 0.0 .TP \fB\-:\fP[\fBi\fP|\fBo\fP] (more ...) Swap 1st and 2nd column on input and/or output. .UNINDENT .INDENT 0.0 .TP \fB\-^\fP or just \fB\-\fP Print a short message about the syntax of the command, then exits (NOTE: on Windows just use \fB\-\fP). .TP \fB\-+\fP or just \fB+\fP Print an extensive usage (help) message, including the explanation of any module\-specific option (but not the GMT common options), then exits. .TP \fB\-?\fP or no arguments Print a complete usage (help) message, including the explanation of all options, then exits. .UNINDENT .SH GRID VALUES PRECISION .sp Regardless of the precision of the input data, GMT programs that create grid files will internally hold the grids in 4\-byte floating point arrays. This is done to conserve memory and furthermore most if not all real data can be stored using 4\-byte floating point values. Data with higher precision (i.e., double precision values) will lose that precision once GMT operates on the grid or writes out new grids. To limit loss of precision when processing data you should always consider normalizing the data prior to processing. .SH EXAMPLES .sp To grid 5 by 5 minute gravity block means from the ASCII data in hawaii_5x5.xyg, using a \fItension_factor\fP = 0.25, a \fIconvergence_limit\fP = 0.1 milligal, writing the result to a file called hawaii_grd.nc, and monitoring each iteration, try: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt surface hawaii_5x5.xyg \-R198/208/18/25 \-I5m \-Ghawaii_grd.nc \-T0.25 \-C0.1 \-Vl .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH BUGS .sp \fBsurface\fP will complain when more than one data point is found for any node and suggest that you run blockmean, blockmedian, or blockmode first. If you did run these decimators and still get this message it usually means that your grid spacing is so small that you need more decimals in the output format used. You may specify more decimal places by editing the parameter \fBFORMAT_FLOAT_OUT\fP in your gmt.conf file prior to running the decimators or choose binary input and/or output using single or double precision storage. .sp Note that only gridline registration is possible with \fBsurface\fP\&. If you need a pixel\-registered grid you can resample a gridline registered grid using grdsample \fB\-T\fP\&. .SH SEE ALSO .sp blockmean, blockmedian, blockmode, gmt, grdcut, grdsample, greenspline, nearneighbor, triangulate, sphtriangulate .SH REFERENCES .sp Smith, W. H. F, and P. Wessel, 1990, Gridding with continuous curvature splines in tension, \fIGeophysics\fP, 55, 293\-305. .SH COPYRIGHT 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe .\" Generated by docutils manpage writer. .