.\" Man page generated from reStructuredText. . .TH "SPH2GRD" "1gmt" "Jan 10, 2019" "5.4.5" "GMT" .SH NAME sph2grd \- Compute grid from spherical harmonic coefficients . .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 \fBsph2grd\fP [ \fItable\fP ] \fB\-G\fP\fIgrdfile\fP \fB\-I\fP\fIincrement\fP \fB\-R\fP\fIregion\fP [ \fB\-D\fP[\fBg\fP|\fBn\fP] ] [ \fB\-E\fP ] [ \fB\-F\fP[\fBk\fP]\fIfilter\fP ] [ \fB\-N\fP[\fInorm\fP] ] [ \fB\-Q\fP ] [ \fB\-V\fP[\fIlevel\fP] ] [ \fB\-bi\fPbinary ] [ \fB\-h\fPheaders ] [ \fB\-i\fPflags ] [ \fB\-r\fP ] [ \fB\-x\fP[[\-]\fIn\fP] ] .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBsph2grd\fP reads a spherical harmonics coefficient table with records of L, M, C[L,M], S[L,M] and evaluates the spherical harmonic model on the specified grid. .SH REQUIRED ARGUMENTS .INDENT 0.0 .TP \fB\-G\fP\fIgrdfile\fP \fIgrdfile\fP is the name of the binary output grid file. (See GRID FILE FORMAT below.) .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] files holding the spherical harmonic coefficients. We expect the first four columns to hold the degree L, the order M, followed by the cosine and sine coefficients. .UNINDENT .INDENT 0.0 .TP \fB\-D\fP[\fBg\fP|\fBn\fP] Will evaluate a derived field from a geopotential model. Choose between \fBDg\fP which will compute the gravitational field or \fBDn\fP to compute the geoid [Add \fB\-E\fP for anomalies on the ellipsoid]. .UNINDENT .INDENT 0.0 .TP \fB\-E\fP Evaluate expansion on the current ellipsoid [Default is sphere]. .UNINDENT .INDENT 0.0 .TP \fB\-F\fP[\fBd\fP]\fIfilter\fP Filter coefficients according to one of two kinds of filter specifications:. Select \fB\-Fk\fP if values are given in km [Default is coefficient harmonic degree L]. a) Cosine band\-pass: Append four wavelengths \fIlc/lp/hp/hc\fP\&. Coefficients outside \fIlc/hc\fP are cut; those inside \fIlp/hp\fP are passed, while the rest are tapered. Replace wavelength by \- to skip, e.g., \fB\-F\fP\-/\-/50/75 is a low\-pass filter. b) Gaussian band\-pass: Append two wavelengths \fIlo/hi\fP where filter amplitudes = 0.5. Replace wavelength by \- to skip, e.g., \fB\-F\fP70/\- is a high\-pass Gaussian filter. .UNINDENT .INDENT 0.0 .TP \fB\-N\fP[\fInorm\fP] Normalization used for coefficients. Choose among \fBm\fP: Mathematical normalization \- inner products summed over surface equal 1 [Default]. \fBg\fP Geodesy normalization \- inner products summed over surface equal 4pi. \fBs\fP: Schmidt normalization \- as used in geomagnetism. .UNINDENT .INDENT 0.0 .TP \fB\-V\fP[\fIlevel\fP] (more ...) Select verbosity level [c]. .UNINDENT .INDENT 0.0 .TP \fB\-bi\fP[\fIncols\fP][\fBt\fP] (more ...) Select native binary input. [Default is 4 input 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\-x\fP[[\-]\fIn\fP] (more ...) Limit number of cores used in multi\-threaded algorithms (OpenMP required). .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 GRID FILE FORMATS .sp By default GMT writes out grid as single precision floats in a COARDS\-complaint netCDF file format. However, GMT is able to produce grid files in many other commonly used grid file formats and also facilitates so called "packing" of grids, writing out floating point data as 1\- or 2\-byte integers. To specify the precision, scale and offset, the user should add the suffix =\fIID\fP[\fB+s\fP\fIscale\fP][\fB+o\fP\fIoffset\fP][\fB+n\fP\fIinvalid\fP], where \fIID\fP is a two\-letter identifier of the grid type and precision, and \fIscale\fP and \fIoffset\fP are optional scale factor and offset to be applied to all grid values, and \fIinvalid\fP is the value used to indicate missing data. See grdconvert and Section grid\-file\-format of the GMT Technical Reference and Cookbook for more information. .sp When writing a netCDF file, the grid is stored by default with the variable name "z". To specify another variable name \fIvarname\fP, append \fB?\fP\fIvarname\fP to the file name. Note that you may need to escape the special meaning of \fB?\fP in your shell program by putting a backslash in front of it, or by placing the filename and suffix between quotes or double quotes. .SH GEOGRAPHICAL AND TIME COORDINATES .sp When the output grid type is netCDF, the coordinates will be labeled "longitude", "latitude", or "time" based on the attributes of the input data or grid (if any) or on the \fB\-f\fP or \fB\-R\fP options. For example, both \fB\-f0x\fP \fB\-f1t\fP and \fB\-R\fP90w/90e/0t/3t will result in a longitude/time grid. When the x, y, or z coordinate is time, it will be stored in the grid as relative time since epoch as specified by TIME_UNIT and TIME_EPOCH in the gmt.conf file or on the command line. In addition, the \fBunit\fP attribute of the time variable will indicate both this unit and epoch. .SH EXAMPLES .sp To create a 1 x 1 degree global grid file from the ASCII coefficients in EGM96_to_360.txt, use .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt sph2grd EGM96_to_360.txt \-GEGM96_to_360.nc \-Rg \-I1 \-V .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH REFERENCE .sp Holmes, S. A., and Featherstone, W. E., 2002, A unified approach to the Clenshaw summation and the recursive computation of very high degree and order normalized associated Legendre functions: \fIJ. Geodesy, v. 76, p. 279\-299\fP\&. .SH SEE ALSO .sp gmt, grdfft, grdmath .SH COPYRIGHT 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe .\" Generated by docutils manpage writer. .