.\" Man page generated from reStructuredText. . .TH "GRDBLEND" "1gmt" "Jan 10, 2019" "5.4.5" "GMT" .SH NAME grdblend \- Blend several partially over-lapping grids into one large grid . .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 \fBgrdblend\fP [ \fIblendfile\fP | \fIgrid1\fP \fIgrid2\fP ... ] \fB\-G\fP\fIoutgrid\fP [ \fB\-I\fP\fIincrement\fP ] [ \fB\-R\fP\fIregion\fP ] [ \fB\-C\fP\fBf\fP|\fBl\fP|\fBo\fP|\fBu\fP ] [ \fB\-N\fP\fInodata\fP ] [ \fB\-Q\fP ] [ \fB\-Z\fP\fIscale\fP ] [ \fB\-V\fP[\fIlevel\fP] ] [ \fB\-W\fP[\fBz\fP] ] [ \fB\-f\fPflags ] [ \fB\-n\fPflags ] [ \fB\-r\fP ] .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBgrdblend\fP reads a listing of grid files and blend parameters and creates a binary grid file by blending the other grids using cosine\-taper weights. \fBgrdblend\fP will report if some of the nodes are not filled in with data. Such unconstrained nodes are set to a value specified by the user [Default is NaN]. Nodes with more than one value will be set to the weighted average value. Any input grid that does not share the final output grid\(aqs node registration and grid spacing will automatically be resampled via calls to grdsample\&. Note: Due to the row\-by\-row i/o nature of operations in \fBgrdblend\fP we only support the netCDF and native binary grid formats for both input and output. .SH REQUIRED ARGUMENTS .INDENT 0.0 .TP \fB\-G\fP\fIoutgrid\fP \fIoutgrid\fP is the name of the binary output grid file. (See GRID FILE FORMATS below). Only netCDF and native binary grid formats are can be written directly. Other output format choices will be handled by reformatting the output once blending is complete. .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 \fIblendfile\fP ASCII file with one record per grid file to include in the blend. Each record may contain up to three items, separated by spaces or tabs: the gridfile name (required), the \fB\-R\fP\-setting for the interior region (optional), and the relative weight \fIwr\fP (optional). In the combined weighting scheme, this grid will be given zero weight outside its domain, weight = \fIwr\fP inside the interior region, and a 2\-D cosine\-tapered weight between those end\-members in the boundary strip. However, if a negative \fIwr\fP is given then the sense of tapering is inverted (i.e., zero weight inside its domain). If the inner region should instead exactly match the grid region then specify a \- instead of the \fB\-R\fP\-setting, or leave it off entirely. Likewise, if a weight \fIwr\fP is not specified we default to a weight of 1. If the ASCII \fIblendfile\fP file is not given \fBgrdblend\fP will read standard input. Alternatively, if you have more than one grid file to blend and you wish (a) all input grids to have the same weight (1) and (b) all grids should use their actual region as the interior region, then you may simply list all the grids on the command line instead of providing a \fIblendfile\fP\&. You must specify at least 2 input grids for this mechanism to work. Any grid that is not co\-registered with the desired output layout implied by \fB\-R\fP, \fB\-I\fP (and \fB\-r\fP) will first be resampled via grdsample\&. Also, grids that are not in netCDF or native binary format will first be reformatted via grdconvert\&. .UNINDENT .INDENT 0.0 .TP \fB\-C\fP Clobber mode: Instead of blending, simply pick the value of one of the grids that covers a node. Select from the following modes: \fBf\fP for the first grid to visit a node; \fBo\fP for the last grid to visit a node; \fBl\fP for the grid with the lowest value, and \fBu\fP for the grid with the uppermost value. For modes \fBf\fP and \fBo\fP the ordering of grids in the \fIblendfile\fP will dictate which grid contributes to the final result. Weights and cosine tapering are not considered when clobber mode is active. .UNINDENT .INDENT 0.0 .TP \fB\-N\fP\fInodata\fP No data. Set nodes with no input grid to this value [Default is NaN]. .UNINDENT .INDENT 0.0 .TP \fB\-Q\fP Create a header\-less grid file suitable for use with grdraster\&. Requires that the output grid file is a native format (i.e., not netCDF). .UNINDENT .INDENT 0.0 .TP \fB\-V\fP[\fIlevel\fP] (more ...) Select verbosity level [c]. .UNINDENT .INDENT 0.0 .TP \fB\-W\fP[\fBz\fP] Do not blend, just output the weights used for each node [Default makes the blend]. Append \fBz\fP to write the weight*z sum instead. .UNINDENT .INDENT 0.0 .TP \fB\-Z\fP\fIscale\fP Scale output values by \fIscale\fP before writing to file. [1]. .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\-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]. .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 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 TAPERING .sp While the weights computed are tapered from 1 to 0, we are computing weighted averages, so if there is only a single grid given then the weighted output will be identical to the input. If you are looking for a way to taper your data grid, see grdmath\(aqs TAPER operator. .SH EXAMPLES .sp To create a grid file from the four grid files piece_?.nc, giving them each the different weights, make the blendfile like this .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C piece_1.nc \-R 1 piece_2.nc \-R 1.5 piece_3.nc \-R 0.9 piece_4.nc \-R 1 .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp Then run .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdblend blend.job \-Gblend.nc \-R \-I \-V .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To blend all the grids called MB_*.nc given them all equal weight, try .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdblend MB_*.nc \-Gblend.nc \-R \-I \-V .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH WARNING ON LARGE FILE SETS .sp While \fBgrdblend\fP can process any number of files, it works by keeping those files open that are being blended, and close files as soon as they are finished. Depending on your session, many files may remain open at the same time. Some operating systems set fairly modest default limits on how many concurrent files can be open, e.g., 256. If you run into this problem then you can change this limit; see your operating system documentation for how to change system limits. .SH SEE ALSO .sp gmt, grd2xyz, grdconvert, grdedit, grdraster, grdsample .SH COPYRIGHT 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe .\" Generated by docutils manpage writer. .