1GMT2RGB(1)                   Generic Mapping Tools                  GMT2RGB(1)
2
3
4

NAME

6       gmt2rgb  - Converting a grid file, a raw, or a Sun raster file to r/g/b
7       grids
8

SYNOPSIS

10       gmt2rgb   infile   -Gtemplate   [   -Ccptfile    ]    [    -F    ]    [
11       -Ixinc[m|c][/yinc[m|c]] ] [ -Llayer ] [ -Rxmin/xmax/ymin/ymax[r] ] [ -V
12       ] [ -Wwidth/height[/n_bytes]
13

DESCRIPTION

15       gmt2rgb reads one of three types of input files: (1) A Sun 8-, 24-,  or
16       32-bit  raster  file;  we the write out the red, green, and blue compo‐
17       nents (0-255 range) to separate grid  files.   Since  the  raster  file
18       header  is limited you may use the -R, -F, -I options to set a complete
19       header record [Default is simply based on the number of rows  and  col‐
20       umns]. (2) A binary 2-D grid file; we then convert the z-values to red,
21       green, blue via the provided cpt file.  Optionally, only write out  one
22       of  the r, g, b, layers.  (3) A RGB or RGBA raw raster file.  Since raw
23       rastefiles have no header, you have to give the  image  dimensions  via
24       the -W option.
25
26       infile The  (1)  Sun  raster file, (2) 2-D binary grid file, or (3) raw
27              raster file to be converted.
28
29       -G     Provide an output name template for the three output grids.  The
30              template  should be a regular grid file name except it must con‐
31              tain the string %c which on output will be replaced by r, g,  or
32              b.
33

OPTIONS

35       -C     name  of  the  color  palette  table  (for 2-D binary input grid
36              only).
37
38       -F     Force pixel node registration  [Default  is  gridline  registra‐
39              tion].  (Node registrations are defined in GMT Cookbook Appendix
40              B on grid file formats.)
41
42       -I     x_inc [and optionally y_inc] is the  grid  spacing.  Optionally,
43              append  a  suffix modifier.  Geographical (degrees) coordinates:
44              Append m to indicate arc minutes or c to indicate  arc  seconds.
45              If  one  of  the  units  e,  k, i, or n is appended instead, the
46              increment is assumed to be given in meter, km, miles, or  nauti‐
47              cal miles, respectively, and will be converted to the equivalent
48              degrees longitude at the middle latitude of the region (the con‐
49              version  depends on ELLIPSOID).  If /y_inc is given but set to 0
50              it will be reset equal to x_inc; otherwise it will be  converted
51              to degrees latitude.  All coordinates: If = is appended then the
52              corresponding max x (east) or y (north) may be slightly adjusted
53              to fit exactly the given increment [by default the increment may
54              be adjusted slightly to fit the given domain].  Finally, instead
55              of  giving  an  increment  you  may  specify the number of nodes
56              desired by appending + to the  supplied  integer  argument;  the
57              increment  is then recalculated from the number of nodes and the
58              domain.  The resulting increment value depends  on  whether  you
59              have  selected  a  gridline-registered or pixel-registered grid;
60              see Appendix B for details.
61
62       -L     Output only the specified layer (r, g, or b).  [Default  outputs
63              all 3 layers].
64
65       -R     xmin,  xmax, ymin, and ymax specify the Region of interest.  For
66              geographic regions,  these  limits  correspond  to  west,  east,
67              south,  and north and you may specify them in decimal degrees or
68              in [+-]dd:mm[:ss.xxx][W|E|S|N] format.  Append r if  lower  left
69              and  upper  right  map coordinates are given instead of w/e/s/n.
70              The two shorthands -Rg and -Rd stand for  global  domain  (0/360
71              and  -180/+180  in longitude respectively, with -90/+90 in lati‐
72              tude).  For calendar time coordinates you may  either  give  (a)
73              relative  time  (relative  to the selected TIME_EPOCH and in the
74              selected TIME_UNIT; append t to -JX|x), or (b) absolute time  of
75              the  form  [date]T[clock]  (append T to -JX|x).  At least one of
76              date and clock must be present; the T is always  required.   The
77              date  string  must  be  of the form [-]yyyy[-mm[-dd]] (Gregorian
78              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
79              string  must  be  of the form hh:mm:ss[.xxx].  The use of delim‐
80              iters and their type and positions must be exactly as  indicated
81              (however,  input,  output and plot formats are customizable; see
82              gmtdefaults).
83
84       -V     Selects verbose mode, which will send progress reports to stderr
85              [Default runs "silently"].
86
87       -W     Sets  the  size  of the raw raster file.  By default an RGB file
88              (which has 3  bytes/pixel)  is  assumed.   For  RGBA  files  use
89              n_bytes  =  4.   Use -W for guessing the image size of a RGB raw
90              file, and -W=/=/4 if the raw image is of the RGBA type.   Notice
91              that  this  might  be  a bit slow because the guessing algorithm
92              makes uses of FFTs.
93

EXAMPLES

95       To use the color palette topo.cpt to create r,  g,  b  component  grids
96       from hawaii_grv.grd file, use
97
98       gmt2rgb hawaii_grv.grd -Ctopo.cpt -Ghawaii_grv_%c.grd
99
100       To output the red component from the Sun raster radiation.ras file, use
101
102       gmt2rgb radiation.ras -Lr -Gcomp_%c.grd
103

SEE ALSO

105       gmtdefaults(1), GMT(1), grdedit(1), grdimage(1), grdmath(1), grdview(1)
106
107
108
109GMT 4.3.1                         15 May 2008                       GMT2RGB(1)
Impressum