.\" Man page generated from reStructuredText. . .TH "GRDRASTER" "1gmt" "May 21, 2019" "5.4.5" "GMT" .SH NAME grdraster \- Extract subregion from a binary raster and save as a GMT 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 \fBgrdraster\fP [ \fIfilenumber\fP | \fI"text pattern"\fP ] \fB\-R\fP\fIregion\fP [ \fB\-G\fP\fIgrdfile\fP ] [ \fB\-I\fP\fIincrement\fP ] [ \fB\-J\fP\fIparameters\fP ] [ \fB\-V\fP[\fIlevel\fP] ] [ \fB\-bo\fPbinary ] [ \fB\-do\fPnodata ] [ \fB\-o\fPflags ] .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBgrdraster\fP reads a file called \fIgrdraster.info\fP from the current working directory, the directories pointed to by the environment variables \fB$GMT_USERDIR\fP and \fB$GMT_DATADIR\fP, or in \fB$GMT_SHAREDIR\fP/dbase (in that order). The file \fIgrdraster.info\fP defines binary arrays of data stored in scan\-line format in data files. Each file is given a \fIfilenumber\fP in the info file. \fBgrdraster\fP figures out how to load the raster data into a grid file spanning a region defined by \fB\-R\fP\&. By default the grid spacing equals the raster spacing. The \fB\-I\fP option may be used to sub\-sample the raster data. No filtering or interpolating is done, however; the \fIx_inc\fP and \fIy_inc\fP of the grid must be multiples of the increments of the raster file and \fBgrdraster\fP simply takes every n\(aqth point. The output of \fBgrdraster\fP is either grid or pixel registered depending on the registration of the raster used. It is up to the GMT system person to maintain the \fIgrdraster.info\fP file in accordance with the available rasters at each site. Raster data sets are not supplied with GMT but can be obtained by anonymous ftp and on CD\-ROM (see README page in dbase directory). \fBgrdraster\fP will list the available files if no arguments are given. Finally, \fBgrdraster\fP will write xyz\-triplets to stdout if no output gridfile name is given .SH REQUIRED ARGUMENTS .INDENT 0.0 .TP .B \fIfilenumber\fP If an integer matching one of the files listed in the \fIgrdraster.info\fP file is given we will use that data set, else we will match the given text pattern with the data set description in order to determine the data set. .UNINDENT .INDENT 0.0 .TP \fB\-R\fP\fIwest\fP/\fIeast\fP/\fIsouth\fP/\fInorth\fP[/\fIzmin\fP/\fIzmax\fP][\fB+r\fP][\fB+u\fP\fIunit\fP] \fIwest\fP, \fIeast\fP, \fIsouth\fP, and \fInorth\fP specify the region of interest, and you may specify them in decimal degrees or in [±]dd:mm[:ss.xxx][\fBW\fP|\fBE\fP|\fBS\fP|\fBN\fP] format Append \fB+r\fP if lower left and upper right map coordinates are given instead of w/e/s/n. The two shorthands \fB\-Rg\fP and \fB\-Rd\fP stand for global domain (0/360 and \-180/+180 in longitude respectively, with \-90/+90 in latitude). Alternatively for grid creation, give \fBR\fP\fIcode\fP\fIlon\fP/\fIlat\fP/\fInx\fP/\fIny\fP, where \fIcode\fP is 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 the \fIlon\fP/\fIlat\fP coordinate refers to, and the grid dimensions \fInx\fP and \fIny\fP with grid spacings via \fB\-I\fP is used to create the corresponding region. Alternatively, specify the name of an existing grid file and the \fB\-R\fP settings (and grid spacing, if applicable) are copied from the grid. Appending \fB+u\fP\fIunit\fP expects projected (Cartesian) coordinates compatible with chosen \fB\-J\fP and we inversely project to determine actual rectangular geographic region. For perspective view (\fB\-p\fP), optionally append /\fIzmin\fP/\fIzmax\fP\&. In case of perspective view (\fB\-p\fP), a z\-range (\fIzmin\fP, \fIzmax\fP) can be appended to indicate the third dimension. This needs to be done only when using the \fB\-Jz\fP option, not when using only the \fB\-p\fP option. In the latter case a perspective view of the plane is plotted, with no third dimension. If \fBr\fP is appended, you may also specify a map projection to define the shape of your region. The output region will be rounded off to the nearest whole grid\-step in both dimensions. .UNINDENT .SH OPTIONAL ARGUMENTS .INDENT 0.0 .TP \fB\-G\fP\fIgrdfile\fP Name of output grid file. If not set, the grid will be written as ASCII (or binary; see \fB\-bo\fP) xyz\-triplets to stdout instead. .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\-J\fP\fIparameters\fP (more ...) Select map projection. .UNINDENT .INDENT 0.0 .TP \fB\-V\fP[\fIlevel\fP] (more ...) Select verbosity level [c]. .UNINDENT .INDENT 0.0 .TP \fB\-bo\fP[\fIncols\fP][\fItype\fP] (more ...) Select native binary output. .UNINDENT .INDENT 0.0 .TP \fB\-do\fP\fInodata\fP (more ...) Replace output columns that equal NaN with \fInodata\fP\&. .UNINDENT .INDENT 0.0 .TP \fB\-o\fP\fIcols\fP[,...] (more ...) Select output columns (0 is first column). .UNINDENT .nf .in +2 This option applies only if no \fB\-G\fP option has been set. .in -2 .fi .sp .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 EXAMPLES .sp To extract data from raster 1, taking one point every 30 minutes, in an area extended beyond 360 degrees to allow later filtering, run .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdraster 1 \-R\-4/364/\-62/62 \-I30m \-Gdata.nc .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To obtain data for an oblique Mercator projection we need to extract more data that is actually used. This is necessary because the output of \fBgrdraster\fP has edges defined by parallels and meridians, while the oblique map in general does not. Hence, to get all the data from the ETOPO2 data needed to make a contour map for the region defined by its lower left and upper right corners and the desired projection, use .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdraster ETOPO2 \-R160/20/220/30r \-Joc190/25.5/292/69/1 \-Gdata.nc .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To extract data from the 2 min Geoware relief blend and write it as binary double precision xyz\-triplets to standard output: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grdraster "2 min Geoware" \-R20/25/\-10/5 \-bo > triplets.b .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH SEE ALSO .sp gmtdefaults, gmt, grdsample, grdfilter .SH COPYRIGHT 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe .\" Generated by docutils manpage writer. .