.\" Man page generated from reStructuredText. . .TH "GRDMATH" "1gmt" "May 21, 2019" "5.4.5" "GMT" .SH NAME grdmath \- Reverse Polish Notation (RPN) calculator for grids (element by element) . .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 \fBgrdmath\fP [ \fB\-A\fP\fImin_area\fP[/\fImin_level\fP/\fImax_level\fP][\fB+ag\fP|\fBi\fP|\fBs\fP |\fBS\fP][\fB+r\fP|\fBl\fP][\fBp\fP\fIpercent\fP] ] [ \fB\-D\fP\fIresolution\fP[\fB+\fP] ] [ \fB\-I\fP\fIincrement\fP ] [ \fB\-M\fP ] [ \fB\-N\fP ] [ \fB\-R\fP\fIregion\fP ] [ \fB\-V\fP[\fIlevel\fP] ] [ \fB\-bi\fPbinary ] [ \fB\-di\fPnodata ] [ \fB\-f\fPflags ] [ \fB\-h\fPheaders ] [ \fB\-i\fPflags ] [ \fB\-n\fPflags ] [ \fB\-r\fP ] [ \fB\-x\fP[[\-]\fIn\fP] ] \fIoperand\fP [ \fIoperand\fP ] \fBOPERATOR\fP [ \fIoperand\fP ] \fBOPERATOR\fP ... \fB=\fP \fIoutgrdfile\fP .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBgrdmath\fP will perform operations like add, subtract, multiply, and divide on one or more grid files or constants using Reverse Polish Notation (RPN) syntax (e.g., Hewlett\-Packard calculator\-style). Arbitrarily complicated expressions may therefore be evaluated; the final result is written to an output grid file. Grid operations are element\-by\-element, not matrix manipulations. Some operators only require one operand (see below). If no grid files are used in the expression then options \fB\-R\fP, \fB\-I\fP must be set (and optionally \fB\-r\fP). The expression \fB=\fP \fIoutgrdfile\fP can occur as many times as the depth of the stack allows in order to save intermediate results. Complicated or frequently occurring expressions may be coded as a macro for future use or stored and recalled via named memory locations. .SH REQUIRED ARGUMENTS .INDENT 0.0 .TP .B \fIoperand\fP If \fIoperand\fP can be opened as a file it will be read as a grid file. If not a file, it is interpreted as a numerical constant or a special symbol (see below). .TP .B \fIoutgrdfile\fP The name of a 2\-D grid file that will hold the final result. (See GRID FILE FORMATS below). .UNINDENT .SH OPTIONAL ARGUMENTS .INDENT 0.0 .TP \fB\-A\fP\fImin_area\fP[/\fImin_level\fP/\fImax_level\fP][\fB+ag\fP|\fBi\fP|\fBs\fP|\fBS\fP][\fB+r\fP|\fBl\fP][\fB+p\fP\fIpercent\fP] Features with an area smaller than \fImin_area\fP in km^2 or of hierarchical level that is lower than \fImin_level\fP or higher than \fImax_level\fP will not be plotted [Default is 0/0/4 (all features)]. Level 2 (lakes) contains regular lakes and wide river bodies which we normally include as lakes; append \fB+r\fP to just get river\-lakes or \fB+l\fP to just get regular lakes. By default (\fB+ai\fP) we select the ice shelf boundary as the coastline for Antarctica; append \fB+ag\fP to instead select the ice grounding line as coastline. For expert users who wish to print their own Antarctica coastline and islands via \fIpsxy\fP you can use \fB+as\fP to skip all GSHHG features below 60S or \fB+aS\fP to instead skip all features north of 60S. Finally, append \fB+p\fP\fIpercent\fP to exclude polygons whose percentage area of the corresponding full\-resolution feature is less than \fIpercent\fP\&. See GSHHG INFORMATION below for more details. (\fB\-A\fP is only relevant to the \fBLDISTG\fP operator) .UNINDENT .INDENT 0.0 .TP \fB\-D\fP\fIresolution\fP[\fB+\fP] Selects the resolution of the data set to use with the operator LDISTG ((\fBf\fP)ull, (\fBh\fP)igh, (\fBi\fP)ntermediate, (\fBl\fP)ow, and (\fBc\fP)rude). The resolution drops off by 80% between data sets [Default is \fBl\fP]. Append \fB+\fP to automatically select a lower resolution should the one requested not be available [abort if not found]. .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\-M\fP By default any derivatives calculated are in z_units/ x(or y)_units. However, the user may choose this option to convert dx,dy in degrees of longitude,latitude into meters using a flat Earth approximation, so that gradients are in z_units/meter. .UNINDENT .INDENT 0.0 .TP \fB\-N\fP Turn off strict domain match checking when multiple grids are manipulated [Default will insist that each grid domain is within 1e\-4 * grid_spacing of the domain of the first grid listed]. .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 .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. The binary input option only applies to the data files needed by operators \fBLDIST\fP, \fBPDIST\fP, and \fBINSIDE\fP\&. .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\-f\fP[\fBi\fP|\fBo\fP]\fIcolinfo\fP (more ...) Specify data types of input and/or output columns. .UNINDENT .INDENT 0.0 .TP \fB\-g\fP[\fBa\fP]\fBx\fP|\fBy\fP|\fBd\fP|\fBX\fP|\fBY\fP|\fBD\fP|[\fIcol\fP]\fBz\fP[+|\-]\fIgap\fP[\fBu\fP] (more ...) Determine data gaps and line breaks. .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). .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\-n\fP[\fBb\fP|\fBc\fP|\fBl\fP|\fBn\fP][\fB+a\fP][\fB+b\fP\fIBC\fP][\fB+c\fP][\fB+t\fP\fIthreshold\fP] (more ...) Select interpolation mode for grids. .UNINDENT .INDENT 0.0 .TP \fB\-r\fP (more ...) Set pixel node registration [gridline]. Only used with \fB\-R\fP \fB\-I\fP\&. .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 OPERATORS .sp Choose among the following 209 operators. "args" are the number of input and output arguments. .TS center; |l|l|l|. _ T{ Operator T} T{ args T} T{ Returns T} _ T{ \fBABS\fP T} T{ 1 1 T} T{ abs (A) T} _ T{ \fBACOS\fP T} T{ 1 1 T} T{ acos (A) T} _ T{ \fBACOSH\fP T} T{ 1 1 T} T{ acosh (A) T} _ T{ \fBACOT\fP T} T{ 1 1 T} T{ acot (A) T} _ T{ \fBACSC\fP T} T{ 1 1 T} T{ acsc (A) T} _ T{ \fBADD\fP T} T{ 2 1 T} T{ A + B T} _ T{ \fBAND\fP T} T{ 2 1 T} T{ B if A == NaN, else A T} _ T{ \fBARC\fP T} T{ 2 1 T} T{ Return arc(A,B) on [0 pi] T} _ T{ \fBAREA\fP T} T{ 0 1 T} T{ Area of each gridnode cell (in km^2 if geographic) T} _ T{ \fBASEC\fP T} T{ 1 1 T} T{ asec (A) T} _ T{ \fBASIN\fP T} T{ 1 1 T} T{ asin (A) T} _ T{ \fBASINH\fP T} T{ 1 1 T} T{ asinh (A) T} _ T{ \fBATAN\fP T} T{ 1 1 T} T{ atan (A) T} _ T{ \fBATAN2\fP T} T{ 2 1 T} T{ atan2 (A, B) T} _ T{ \fBATANH\fP T} T{ 1 1 T} T{ atanh (A) T} _ T{ \fBBCDF\fP T} T{ 3 1 T} T{ Binomial cumulative distribution function for p = A, n = B, and x = C T} _ T{ \fBBPDF\fP T} T{ 3 1 T} T{ Binomial probability density function for p = A, n = B, and x = C T} _ T{ \fBBEI\fP T} T{ 1 1 T} T{ bei (A) T} _ T{ \fBBER\fP T} T{ 1 1 T} T{ ber (A) T} _ T{ \fBBITAND\fP T} T{ 2 1 T} T{ A & B (bitwise AND operator) T} _ T{ \fBBITLEFT\fP T} T{ 2 1 T} T{ A << B (bitwise left\-shift operator) T} _ T{ \fBBITNOT\fP T} T{ 1 1 T} T{ ~A (bitwise NOT operator, i.e., return two\(aqs complement) T} _ T{ \fBBITOR\fP T} T{ 2 1 T} T{ A | B (bitwise OR operator) T} _ T{ \fBBITRIGHT\fP T} T{ 2 1 T} T{ A >> B (bitwise right\-shift operator) T} _ T{ \fBBITTEST\fP T} T{ 2 1 T} T{ 1 if bit B of A is set, else 0 (bitwise TEST operator) T} _ T{ \fBBITXOR\fP T} T{ 2 1 T} T{ A ^ B (bitwise XOR operator) T} _ T{ \fBCAZ\fP T} T{ 2 1 T} T{ Cartesian azimuth from grid nodes to stack x,y (i.e., A, B) T} _ T{ \fBCBAZ\fP T} T{ 2 1 T} T{ Cartesian back\-azimuth from grid nodes to stack x,y (i.e., A, B) T} _ T{ \fBCDIST\fP T} T{ 2 1 T} T{ Cartesian distance between grid nodes and stack x,y (i.e., A, B) T} _ T{ \fBCDIST2\fP T} T{ 2 1 T} T{ As CDIST but only to nodes that are != 0 T} _ T{ \fBCEIL\fP T} T{ 1 1 T} T{ ceil (A) (smallest integer >= A) T} _ T{ \fBCHICRIT\fP T} T{ 2 1 T} T{ Chi\-squared critical value for alpha = A and nu = B T} _ T{ \fBCHICDF\fP T} T{ 2 1 T} T{ Chi\-squared cumulative distribution function for chi2 = A and nu = B T} _ T{ \fBCHIPDF\fP T} T{ 2 1 T} T{ Chi\-squared probability density function for chi2 = A and nu = B T} _ T{ \fBCOMB\fP T} T{ 2 1 T} T{ Combinations n_C_r, with n = A and r = B T} _ T{ \fBCORRCOEFF\fP T} T{ 2 1 T} T{ Correlation coefficient r(A, B) T} _ T{ \fBCOS\fP T} T{ 1 1 T} T{ cos (A) (A in radians) T} _ T{ \fBCOSD\fP T} T{ 1 1 T} T{ cos (A) (A in degrees) T} _ T{ \fBCOSH\fP T} T{ 1 1 T} T{ cosh (A) T} _ T{ \fBCOT\fP T} T{ 1 1 T} T{ cot (A) (A in radians) T} _ T{ \fBCOTD\fP T} T{ 1 1 T} T{ cot (A) (A in degrees) T} _ T{ \fBCSC\fP T} T{ 1 1 T} T{ csc (A) (A in radians) T} _ T{ \fBCSCD\fP T} T{ 1 1 T} T{ csc (A) (A in degrees) T} _ T{ \fBCURV\fP T} T{ 1 1 T} T{ Curvature of A (Laplacian) T} _ T{ \fBD2DX2\fP T} T{ 1 1 T} T{ d^2(A)/dx^2 2nd derivative T} _ T{ \fBD2DY2\fP T} T{ 1 1 T} T{ d^2(A)/dy^2 2nd derivative T} _ T{ \fBD2DXY\fP T} T{ 1 1 T} T{ d^2(A)/dxdy 2nd derivative T} _ T{ \fBD2R\fP T} T{ 1 1 T} T{ Converts Degrees to Radians T} _ T{ \fBDDX\fP T} T{ 1 1 T} T{ d(A)/dx Central 1st derivative T} _ T{ \fBDDY\fP T} T{ 1 1 T} T{ d(A)/dy Central 1st derivative T} _ T{ \fBDEG2KM\fP T} T{ 1 1 T} T{ Converts Spherical Degrees to Kilometers T} _ T{ \fBDENAN\fP T} T{ 2 1 T} T{ Replace NaNs in A with values from B T} _ T{ \fBDILOG\fP T} T{ 1 1 T} T{ dilog (A) T} _ T{ \fBDIV\fP T} T{ 2 1 T} T{ A / B T} _ T{ \fBDUP\fP T} T{ 1 2 T} T{ Places duplicate of A on the stack T} _ T{ \fBECDF\fP T} T{ 2 1 T} T{ Exponential cumulative distribution function for x = A and lambda = B T} _ T{ \fBECRIT\fP T} T{ 2 1 T} T{ Exponential distribution critical value for alpha = A and lambda = B T} _ T{ \fBEPDF\fP T} T{ 2 1 T} T{ Exponential probability density function for x = A and lambda = B T} _ T{ \fBERF\fP T} T{ 1 1 T} T{ Error function erf (A) T} _ T{ \fBERFC\fP T} T{ 1 1 T} T{ Complementary Error function erfc (A) T} _ T{ \fBEQ\fP T} T{ 2 1 T} T{ 1 if A == B, else 0 T} _ T{ \fBERFINV\fP T} T{ 1 1 T} T{ Inverse error function of A T} _ T{ \fBEXCH\fP T} T{ 2 2 T} T{ Exchanges A and B on the stack T} _ T{ \fBEXP\fP T} T{ 1 1 T} T{ exp (A) T} _ T{ \fBFACT\fP T} T{ 1 1 T} T{ A! (A factorial) T} _ T{ \fBEXTREMA\fP T} T{ 1 1 T} T{ Local Extrema: +2/\-2 is max/min, +1/\-1 is saddle with max/min in x, 0 elsewhere T} _ T{ \fBFCDF\fP T} T{ 3 1 T} T{ F cumulative distribution function for F = A, nu1 = B, and nu2 = C T} _ T{ \fBFCRIT\fP T} T{ 3 1 T} T{ F distribution critical value for alpha = A, nu1 = B, and nu2 = C T} _ T{ \fBFLIPLR\fP T} T{ 1 1 T} T{ Reverse order of values in each row T} _ T{ \fBFLIPUD\fP T} T{ 1 1 T} T{ Reverse order of values in each column T} _ T{ \fBFLOOR\fP T} T{ 1 1 T} T{ floor (A) (greatest integer <= A) T} _ T{ \fBFMOD\fP T} T{ 2 1 T} T{ A % B (remainder after truncated division) T} _ T{ \fBFPDF\fP T} T{ 3 1 T} T{ F probability density function for F = A, nu1 = B, and nu2 = C T} _ T{ \fBGE\fP T} T{ 2 1 T} T{ 1 if A >= B, else 0 T} _ T{ \fBGT\fP T} T{ 2 1 T} T{ 1 if A > B, else 0 T} _ T{ \fBHYPOT\fP T} T{ 2 1 T} T{ hypot (A, B) = sqrt (A*A + B*B) T} _ T{ \fBI0\fP T} T{ 1 1 T} T{ Modified Bessel function of A (1st kind, order 0) T} _ T{ \fBI1\fP T} T{ 1 1 T} T{ Modified Bessel function of A (1st kind, order 1) T} _ T{ \fBIFELSE\fP T} T{ 3 1 T} T{ B if A != 0, else C T} _ T{ \fBIN\fP T} T{ 2 1 T} T{ Modified Bessel function of A (1st kind, order B) T} _ T{ \fBINRANGE\fP T} T{ 3 1 T} T{ 1 if B <= A <= C, else 0 T} _ T{ \fBINSIDE\fP T} T{ 1 1 T} T{ 1 when inside or on polygon(s) in A, else 0 T} _ T{ \fBINV\fP T} T{ 1 1 T} T{ 1 / A T} _ T{ \fBISFINITE\fP T} T{ 1 1 T} T{ 1 if A is finite, else 0 T} _ T{ \fBISNAN\fP T} T{ 1 1 T} T{ 1 if A == NaN, else 0 T} _ T{ \fBJ0\fP T} T{ 1 1 T} T{ Bessel function of A (1st kind, order 0) T} _ T{ \fBJ1\fP T} T{ 1 1 T} T{ Bessel function of A (1st kind, order 1) T} _ T{ \fBJN\fP T} T{ 2 1 T} T{ Bessel function of A (1st kind, order B) T} _ T{ \fBK0\fP T} T{ 1 1 T} T{ Modified Kelvin function of A (2nd kind, order 0) T} _ T{ \fBK1\fP T} T{ 1 1 T} T{ Modified Bessel function of A (2nd kind, order 1) T} _ T{ \fBKEI\fP T} T{ 1 1 T} T{ kei (A) T} _ T{ \fBKER\fP T} T{ 1 1 T} T{ ker (A) T} _ T{ \fBKM2DEG\fP T} T{ 1 1 T} T{ Converts Kilometers to Spherical Degrees T} _ T{ \fBKN\fP T} T{ 2 1 T} T{ Modified Bessel function of A (2nd kind, order B) T} _ T{ \fBKURT\fP T} T{ 1 1 T} T{ Kurtosis of A T} _ T{ \fBLCDF\fP T} T{ 1 1 T} T{ Laplace cumulative distribution function for z = A T} _ T{ \fBLCRIT\fP T} T{ 1 1 T} T{ Laplace distribution critical value for alpha = A T} _ T{ \fBLDIST\fP T} T{ 1 1 T} T{ Compute minimum distance (in km if \-fg) from lines in multi\-segment ASCII file A T} _ T{ \fBLDIST2\fP T} T{ 2 1 T} T{ As LDIST, from lines in ASCII file B but only to nodes where A != 0 T} _ T{ \fBLDISTG\fP T} T{ 0 1 T} T{ As LDIST, but operates on the GSHHG dataset (see \-A, \-D for options). T} _ T{ \fBLE\fP T} T{ 2 1 T} T{ 1 if A <= B, else 0 T} _ T{ \fBLOG\fP T} T{ 1 1 T} T{ log (A) (natural log) T} _ T{ \fBLOG10\fP T} T{ 1 1 T} T{ log10 (A) (base 10) T} _ T{ \fBLOG1P\fP T} T{ 1 1 T} T{ log (1+A) (accurate for small A) T} _ T{ \fBLOG2\fP T} T{ 1 1 T} T{ log2 (A) (base 2) T} _ T{ \fBLMSSCL\fP T} T{ 1 1 T} T{ LMS scale estimate (LMS STD) of A T} _ T{ \fBLMSSCLW\fP T} T{ 2 1 T} T{ Weighted LMS scale estimate (LMS STD) of A for weights in B T} _ T{ \fBLOWER\fP T} T{ 1 1 T} T{ The lowest (minimum) value of A T} _ T{ \fBLPDF\fP T} T{ 1 1 T} T{ Laplace probability density function for z = A T} _ T{ \fBLRAND\fP T} T{ 2 1 T} T{ Laplace random noise with mean A and std. deviation B T} _ T{ \fBLT\fP T} T{ 2 1 T} T{ 1 if A < B, else 0 T} _ T{ \fBMAD\fP T} T{ 1 1 T} T{ Median Absolute Deviation (L1 STD) of A T} _ T{ \fBMAX\fP T} T{ 2 1 T} T{ Maximum of A and B T} _ T{ \fBMEAN\fP T} T{ 1 1 T} T{ Mean value of A T} _ T{ \fBMEANW\fP T} T{ 2 1 T} T{ Weighted mean value of A for weights in B T} _ T{ \fBMEDIAN\fP T} T{ 1 1 T} T{ Median value of A T} _ T{ \fBMEDIANW\fP T} T{ 2 1 T} T{ Weighted median value of A for weights in B T} _ T{ \fBMIN\fP T} T{ 2 1 T} T{ Minimum of A and B T} _ T{ \fBMOD\fP T} T{ 2 1 T} T{ A mod B (remainder after floored division) T} _ T{ \fBMODE\fP T} T{ 1 1 T} T{ Mode value (Least Median of Squares) of A T} _ T{ \fBMODEW\fP T} T{ 2 1 T} T{ Weighted mode value (Least Median of Squares) of A for weights in B T} _ T{ \fBMUL\fP T} T{ 2 1 T} T{ A * B T} _ T{ \fBNAN\fP T} T{ 2 1 T} T{ NaN if A == B, else A T} _ T{ \fBNEG\fP T} T{ 1 1 T} T{ \-A T} _ T{ \fBNEQ\fP T} T{ 2 1 T} T{ 1 if A != B, else 0 T} _ T{ \fBNORM\fP T} T{ 1 1 T} T{ Normalize (A) so max(A)\-min(A) = 1 T} _ T{ \fBNOT\fP T} T{ 1 1 T} T{ NaN if A == NaN, 1 if A == 0, else 0 T} _ T{ \fBNRAND\fP T} T{ 2 1 T} T{ Normal, random values with mean A and std. deviation B T} _ T{ \fBOR\fP T} T{ 2 1 T} T{ NaN if B == NaN, else A T} _ T{ \fBPCDF\fP T} T{ 2 1 T} T{ Poisson cumulative distribution function for x = A and lambda = B T} _ T{ \fBPDIST\fP T} T{ 1 1 T} T{ Compute minimum distance (in km if \-fg) from points in ASCII file A T} _ T{ \fBPDIST2\fP T} T{ 2 1 T} T{ As PDIST, from points in ASCII file B but only to nodes where A != 0 T} _ T{ \fBPERM\fP T} T{ 2 1 T} T{ Permutations n_P_r, with n = A and r = B T} _ T{ \fBPLM\fP T} T{ 3 1 T} T{ Associated Legendre polynomial P(A) degree B order C T} _ T{ \fBPLMg\fP T} T{ 3 1 T} T{ Normalized associated Legendre polynomial P(A) degree B order C (geophysical convention) T} _ T{ \fBPOINT\fP T} T{ 1 2 T} T{ Compute mean x and y from ASCII file A and place them on the stack T} _ T{ \fBPOP\fP T} T{ 1 0 T} T{ Delete top element from the stack T} _ T{ \fBPOW\fP T} T{ 2 1 T} T{ A ^ B T} _ T{ \fBPPDF\fP T} T{ 2 1 T} T{ Poisson distribution P(x,lambda), with x = A and lambda = B T} _ T{ \fBPQUANT\fP T} T{ 2 1 T} T{ The B\(aqth Quantile (0\-100%) of A T} _ T{ \fBPQUANTW\fP T} T{ 3 1 T} T{ The C\(aqth weighted quantile (0\-100%) of A for weights in B T} _ T{ \fBPSI\fP T} T{ 1 1 T} T{ Psi (or Digamma) of A T} _ T{ \fBPV\fP T} T{ 3 1 T} T{ Legendre function Pv(A) of degree v = real(B) + imag(C) T} _ T{ \fBQV\fP T} T{ 3 1 T} T{ Legendre function Qv(A) of degree v = real(B) + imag(C) T} _ T{ \fBR2\fP T} T{ 2 1 T} T{ R2 = A^2 + B^2 T} _ T{ \fBR2D\fP T} T{ 1 1 T} T{ Convert Radians to Degrees T} _ T{ \fBRAND\fP T} T{ 2 1 T} T{ Uniform random values between A and B T} _ T{ \fBRCDF\fP T} T{ 1 1 T} T{ Rayleigh cumulative distribution function for z = A T} _ T{ \fBRCRIT\fP T} T{ 1 1 T} T{ Rayleigh distribution critical value for alpha = A T} _ T{ \fBRINT\fP T} T{ 1 1 T} T{ rint (A) (round to integral value nearest to A) T} _ T{ \fBRMS\fP T} T{ 1 1 T} T{ Root\-mean\-square of A T} _ T{ \fBRMSW\fP T} T{ 1 1 T} T{ Root\-mean\-square of A for weights in B T} _ T{ \fBRPDF\fP T} T{ 1 1 T} T{ Rayleigh probability density function for z = A T} _ T{ \fBROLL\fP T} T{ 2 0 T} T{ Cyclicly shifts the top A stack items by an amount B T} _ T{ \fBROTX\fP T} T{ 2 1 T} T{ Rotate A by the (constant) shift B in x\-direction T} _ T{ \fBROTY\fP T} T{ 2 1 T} T{ Rotate A by the (constant) shift B in y\-direction T} _ T{ \fBSDIST\fP T} T{ 2 1 T} T{ Spherical (Great circle|geodesic) distance (in km) between nodes and stack (A, B) T} _ T{ \fBSDIST2\fP T} T{ 2 1 T} T{ As SDIST but only to nodes that are != 0 T} _ T{ \fBSAZ\fP T} T{ 2 1 T} T{ Spherical azimuth from grid nodes to stack lon, lat (i.e., A, B) T} _ T{ \fBSBAZ\fP T} T{ 2 1 T} T{ Spherical back\-azimuth from grid nodes to stack lon, lat (i.e., A, B) T} _ T{ \fBSEC\fP T} T{ 1 1 T} T{ sec (A) (A in radians) T} _ T{ \fBSECD\fP T} T{ 1 1 T} T{ sec (A) (A in degrees) T} _ T{ \fBSIGN\fP T} T{ 1 1 T} T{ sign (+1 or \-1) of A T} _ T{ \fBSIN\fP T} T{ 1 1 T} T{ sin (A) (A in radians) T} _ T{ \fBSINC\fP T} T{ 1 1 T} T{ sinc (A) (sin (pi*A)/(pi*A)) T} _ T{ \fBSIND\fP T} T{ 1 1 T} T{ sin (A) (A in degrees) T} _ T{ \fBSINH\fP T} T{ 1 1 T} T{ sinh (A) T} _ T{ \fBSKEW\fP T} T{ 1 1 T} T{ Skewness of A T} _ T{ \fBSQR\fP T} T{ 1 1 T} T{ A^2 T} _ T{ \fBSQRT\fP T} T{ 1 1 T} T{ sqrt (A) T} _ T{ \fBSTD\fP T} T{ 1 1 T} T{ Standard deviation of A T} _ T{ \fBSTDW\fP T} T{ 2 1 T} T{ Weighted standard deviation of A for weights in B T} _ T{ \fBSTEP\fP T} T{ 1 1 T} T{ Heaviside step function: H(A) T} _ T{ \fBSTEPX\fP T} T{ 1 1 T} T{ Heaviside step function in x: H(x\-A) T} _ T{ \fBSTEPY\fP T} T{ 1 1 T} T{ Heaviside step function in y: H(y\-A) T} _ T{ \fBSUB\fP T} T{ 2 1 T} T{ A \- B T} _ T{ \fBSUM\fP T} T{ 1 1 T} T{ Sum of all values in A T} _ T{ \fBTAN\fP T} T{ 1 1 T} T{ tan (A) (A in radians) T} _ T{ \fBTAND\fP T} T{ 1 1 T} T{ tan (A) (A in degrees) T} _ T{ \fBTANH\fP T} T{ 1 1 T} T{ tanh (A) T} _ T{ \fBTAPER\fP T} T{ 2 1 T} T{ Unit weights cosine\-tapered to zero within A and B of x and y grid margins T} _ T{ \fBTCDF\fP T} T{ 2 1 T} T{ Student\(aqs t cumulative distribution function for t = A, and nu = B T} _ T{ \fBTCRIT\fP T} T{ 2 1 T} T{ Student\(aqs t distribution critical value for alpha = A and nu = B T} _ T{ \fBTN\fP T} T{ 2 1 T} T{ Chebyshev polynomial Tn(\-1 max.xyz .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To demonstrate the use of named variables, consider this radial wave where we store and recall the normalized radial arguments in radians: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdmath \-R0/10/0/10 \-I0.25 5 5 CDIST 2 MUL PI MUL 5 DIV STO@r COS @r SIN MUL = wave.nc .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To creat a dumb file saved as a 32 bits float GeoTiff using GDAL, run .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdmath \-Rd \-I10 X Y MUL = lixo.tiff=gd:GTiff .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH REFERENCES .sp Abramowitz, M., and I. A. Stegun, 1964, \fIHandbook of Mathematical Functions\fP, Applied Mathematics Series, vol. 55, Dover, New York. .sp Holmes, S. A., and W. E. Featherstone, 2002, A unified approach to the Clenshaw summation and the recursive computation of very high degree and order normalised associated Legendre functions. \fIJournal of Geodesy\fP, 76, 279\-299. .sp Press, W. H., S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, 1992, \fINumerical Recipes\fP, 2nd edition, Cambridge Univ., New York. .sp Spanier, J., and K. B. Oldman, 1987, \fIAn Atlas of Functions\fP, Hemisphere Publishing Corp. .SH SEE ALSO .sp gmt, gmtmath, grd2xyz, grdedit, grdinfo, xyz2grd .SH COPYRIGHT 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe .\" Generated by docutils manpage writer. .