.\" Man page generated from reStructuredText. . .TH "GRD2RGB" "1gmt" "Jan 10, 2019" "5.4.5" "GMT" .SH NAME grd2rgb \- Write r/g/b grid files from a grid file, a raw RGB file, or SUN rasterfile . .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 \fBgrd2rgb\fP \fIinfile\fP \fB\-G\fP\fItemplate\fP [ \fB\-C\fP\fIcpt\fP ] [ \fB\-I\fP\fIxinc\fP[\fBm\fP|\fBs\fP][/\fIyinc\fP[\fBm\fP|\fBs\fP]] ] [ \fB\-L\fP\fIlayer\fP ] \fB\-R\fP\fIregion\fP \fB\-V\fP[\fIlevel\fP] [ \fB\-W\fP\fIwidth\fP/\fIheight\fP[/\fIn_bytes\fP] ] [ \fB\-r\fP ] .sp \fBNote:\fP No space is allowed between the option flag and the associated arguments. .SH DESCRIPTION .sp \fBgrd2rgb\fP reads one of three types of input files: (1) A Sun 8\-, 24\-, or 32\-bit raster file; we the write out the red, green, and blue components (0\-255 range) to separate grid files. Since the raster file header is limited you may use the \fB\-R\fP, \fB\-I\fP, \fB\-r\fP options to set a complete header record [Default is simply based on the number of rows and columns]. (2) A binary 2\-D grid file; we then convert the z\-values to red, green, blue via the provided CPT. Optionally, only write out one of the r, g, b, layers. (3) A RGB or RGBA raw raster file. Since raw rasterfiles have no header, you have to give the image dimensions via the \fB\-W\fP option. .SH REQUIRED ARGUMENTS .INDENT 0.0 .TP .B \fIinfile\fP The (1) Sun raster file, (2) 2\-D binary grid file, or (3) raw raster file to be converted. .TP \fB\-G\fP\fItemplate\fP Provide an output name template for the three output grids. The template should be a regular grid file name except it must contain the string %c which on output will be replaced by r, g, or b. .UNINDENT .SH OPTIONAL ARGUMENTS .INDENT 0.0 .TP \fB\-C\fP\fIcpt\fP name of the color palette table (for 2\-D binary input grid only). .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\-L\fP\fIlayer\fP Output only the specified layer (r, g, or b). [Default outputs all 3 layers]. .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\-W\fP\fIwidth\fP/\fIheight\fP[/\fIn_bytes\fP] Sets the size of the raw raster file. By default an RGB file (which has 3 bytes/pixel) is assumed. For RGBA files use \fIn_bytes\fP = 4. Use \fB\-W\fP for guessing the image size of a RGB raw file, and \fB\-W\fP\fI=/=/4\fP if the raw image is of the RGBA type. Notice that this might be a bit slow because the guessing algorithm makes uses of FFTs. .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 EXAMPLES .sp To use the color palette topo.cpt to create r, g, b component grids from hawaii_grv.nc file, use .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grd2rgb hawaii_grv.nc \-Ctopo.cpt \-Ghawaii_grv_%c.nc .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To output the red component from the Sun raster radiation.ras file, use .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C gmt grd2rgb radiation.ras \-Lr \-Gcomp_%c.nc .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SH SEE ALSO .sp gmt, gmt.conf, grdedit, grdimage, grdmath , grdview .SH COPYRIGHT 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe .\" Generated by docutils manpage writer. .