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

NAME

6       grdview  - Create 3-D perspective grayshaded/colored image or mesh from
7       a 2-D grid file
8

SYNOPSIS

10       grdview relief_file -Jparameters [ -B[p|s]parameters ] [  -Ccptfile]  [
11       -Eview_az/view_el  ]  [ -Gdrapefile | -Ggrd_r,grd_g,grd_b ] [ -Iintens‐
12       file] [ -Jz|Zparameters ] [ -K ] [ -L[flags] ] [ -Nlevel[/color]] [  -O
13       ]  [  -P  ]  [ -Qtype[g] ] [ -Rwest/east/south/north[/zmin/zmax][r] ] [
14       -Ssmooth ] [ -T[s][o[pen]] ] [ -U[just/dx/dy/][c|label]  ]  [  -V  ]  [
15       -Wtype/pen  ]  [  -X[a|c|r][x-shift[u]]  ]  [ -Y[a|c|r][y-shift[u]] ] [
16       -Zzlevel ] [ -ccopies ]
17

DESCRIPTION

19       grdview reads a 2-D gridded file and produces a 3-D perspective plot by
20       drawing  a mesh, painting a colored/grayshaded surface made up of poly‐
21       gons, or by scanline conversion of these  polygons  to  a  rasterimage.
22       Options  include  draping  a  data set on top of a surface, plotting of
23       contours on top of the surface, and apply artificial illumination based
24       on intensities provided in a separate grid file.
25
26       relief_file
27              2-D  gridded  data set to be imaged (the relief of the surface).
28              (See GRID FILE FORMAT below.)
29
30       -J     Selects the map projection. Scale is  UNIT/degree,  1:xxxxx,  or
31              width  in  UNIT  (upper case modifier).  UNIT is cm, inch, or m,
32              depending on the MEASURE_UNIT setting in .gmtdefaults4, but this
33              can be overridden on the command line by appending c, i, or m to
34              the scale/width  value.   When  central  meridian  is  optional,
35              default  is  center  of  longitude  range on -R option.  Default
36              standard parallel is the equator.  For map  height,  max  dimen‐
37              sion,  or min dimension, append h, +, or - to the width, respec‐
38              tively.
39              More details can be found in the psbasemap man pages.
40
41              CYLINDRICAL PROJECTIONS:
42
43              -Jclon0/lat0/scale (Cassini)
44              -Jcyl_stere/[lon0/[lat0/]]scale (Cylindrical Stereographic)
45              -Jj[lon0/]scale (Miller)
46              -Jm[lon0/[lat0/]]scale (Mercator)
47              -Jmlon0/lat0/scale (Mercator - Give meridian and standard paral‐
48              lel)
49              -Jo[a]lon0/lat0/azimuth/scale  (Oblique  Mercator  -  point  and
50              azimuth)
51              -Jo[b]lon0/lat0/lon1/lat1/scale (Oblique Mercator - two points)
52              -Joclon0/lat0/lonp/latp/scale  (Oblique  Mercator  -  point  and
53              pole)
54              -Jq[lon0/[lat0/]]scale (Cylindrical Equidistant)
55              -Jtlon0/[lat0/]scale (TM - Transverse Mercator)
56              -Juzone/scale (UTM - Universal Transverse Mercator)
57              -Jy[lon0/[lat0/]]scale (Cylindrical Equal-Area)
58
59              CONIC PROJECTIONS:
60
61              -Jblon0/lat0/lat1/lat2/scale (Albers)
62              -Jdlon0/lat0/lat1/lat2/scale (Conic Equidistant)
63              -Jllon0/lat0/lat1/lat2/scale (Lambert Conic Conformal)
64
65              AZIMUTHAL PROJECTIONS:
66
67              -Jalon0/lat0[/horizon]/scale (Lambert Azimuthal Equal-Area)
68              -Jelon0/lat0[/horizon]/scale (Azimuthal Equidistant)
69              -Jflon0/lat0[/horizon]/scale (Gnomonic)
70              -Jglon0/lat0[/horizon]/scale (Orthographic)
71              -Jglon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale
72              (General Perspective).
73              -Jslon0/lat0[/horizon][/slat]/scale (General Stereographic)
74
75              MISCELLANEOUS PROJECTIONS:
76
77              -Jh[lon0/]scale (Hammer)
78              -Ji[lon0/]scale (Sinusoidal)
79              -Jkf[lon0/]scale (Eckert IV)
80              -Jk[s][lon0/]scale (Eckert IV)
81              -Jn[lon0/]scale (Robinson)
82              -Jr[lon0/]scale (Winkel Tripel)
83              -Jv[lon0/]scale (Van der Grinten)
84              -Jw[lon0/]scale (Mollweide)
85
86              NON-GEOGRAPHICAL PROJECTIONS:
87
88              -Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))
89              -Jxx-scale[d|l|ppow|t|T][/y-scale[d|l|ppow|t|T]]  (Linear,  log,
90              and power scaling)
91
92       -Jz    Sets the vertical scaling (for 3-D maps).  Same syntax as -Jx.
93

OPTIONS

95       No space between the option flag and the associated arguments.
96
97       -B     Sets  map  boundary  annotation  and tickmark intervals; see the
98              psbasemap man page for all the details.
99
100       -C     name of the color palette file.  Must be present if you want (1)
101              mesh plot with contours (-Qm), or (2) shaded/colored perspective
102              image (-Qs or -Qi).  For -Qs: You can specify that you  want  to
103              skip  a  z-slice by setting red = -; to use a pattern give red =
104              P|pdpi/pattern[:Fr/g/b[Br/g/b]].
105
106       -E     Sets the view point  by  specifying  azimuth  and  elevation  in
107              degrees. [Default is 180/90].
108
109       -G     Drape  the  image  in drapefile on top of the relief provided by
110              relief_file. [Default is relief_file].  Note  that  -Jz  and  -N
111              always  refers  to the relief_file.  The drapefile only provides
112              the information pertaining to colors, which is looked-up via the
113              cpt  file  (see -C).  Alternatively, give three grid files sepa‐
114              rated by commas.  These files must contain the red,  green,  and
115              blue colors directly (in 0-255 range) and no cpt file is needed.
116              The drapefile may be of higher resolution than the relief_file.
117
118       -I     Gives the name of a grid file with intensities  in  the  (-1,+1)
119              range. [Default is no illumination].
120
121       -K     More  PostScript code will be appended later [Default terminates
122              the plot system].
123
124       -L     Boundary condition flags may be x or y or xy indicating data  is
125              periodic  in range of x or y or both, or flags may be g indicat‐
126              ing geographical conditions (x and y are lon and lat).  [Default
127              uses  "natural"  conditions (second partial derivative normal to
128              edge is zero).]  If no flags are set, use bilinear  rather  than
129              the default bicubic resampling when draping is required.
130
131       -N     Draws  a  plane  at this z-level.  If the optional color is pro‐
132              vided, the frontal facade between the plane and the data perime‐
133              ter  is  colored.  See -Wf for setting the pen used for the out‐
134              line.  (See SPECIFYING COLOR below).
135
136       -O     Selects Overlay plot mode [Default initializes a new  plot  sys‐
137              tem].
138
139       -P     Selects Portrait plotting mode [Default is Landscape, see gmtde‐
140              faults to change this].
141
142       -Q     Select one  of  four  settings:  1.  Specify  m  for  mesh  plot
143              [Default],  and  optionally  append  /color for a different mesh
144              paint [white].  2. Specify s for surface  plot,  and  optionally
145              append m to have mesh lines drawn on top of surface.  3. Specify
146              i for image plot, and optionally append the effective dpi  reso‐
147              lution  for the rasterization [100].  4. Specify c.  Same as -Qi
148              but will make nodes with z = NaN transparent, using  the  color‐
149              masking  feature  in PostScript Level 3 (the PS device must sup‐
150              port PS Level 3).  For any of these choices,  you  may  force  a
151              monochrome  image  by appending g.  Colors are then converted to
152              shades of gray using the (television) YIQ transformation.
153
154       -R     xmin, xmax, ymin, and ymax specify the Region of interest.   For
155              geographic  regions,  these  limits  correspond  to  west, east,
156              south, and north and you may specify them in decimal degrees  or
157              in  [+-]dd:mm[:ss.xxx][W|E|S|N]  format.  Append r if lower left
158              and upper right map coordinates are given  instead  of  w/e/s/n.
159              The  two  shorthands  -Rg and -Rd stand for global domain (0/360
160              and -180/+180 in longitude respectively, with -90/+90  in  lati‐
161              tude).   For  calendar  time coordinates you may either give (a)
162              relative time (relative to the selected TIME_EPOCH  and  in  the
163              selected  TIME_UNIT; append t to -JX|x), or (b) absolute time of
164              the form [date]T[clock] (append T to -JX|x).  At  least  one  of
165              date  and  clock must be present; the T is always required.  The
166              date string must be of  the  form  [-]yyyy[-mm[-dd]]  (Gregorian
167              calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock
168              string must be of the form hh:mm:ss[.xxx].  The  use  of  delim‐
169              iters  and their type and positions must be exactly as indicated
170              (however, input, output and plot formats are  customizable;  see
171              gmtdefaults).   This  option  may  be used to indicate the range
172              used  for  the  3-D  axes  [Default  is  region  given  by   the
173              relief_file].   You  may ask for a larger w/e/s/n region to have
174              more room between the image and the axes.  A smaller region than
175              specified  in  the  relief_file  will  result in a subset of the
176              grid.
177
178       -S     Smooth the contours before plotting (see grdcontour) [Default is
179              no smoothing].
180
181       -T     Plot  image without any interpolation.  This involves converting
182              each node-centered bin into a polygon which is then painted sep‐
183              arately.   Append  s to skip nodes with z = NaN.  This option is
184              useful for categorical data where interpolating  between  values
185              is meaningless.  Optionally, append o to draw the tile outlines,
186              and specify a custom pen if the default pen is not to your  lik‐
187              ing.   As  this option produces a flat surface it cannot be com‐
188              bined with -JZ or -Jz.  (See SPECIFYING PENS below).
189
190       -U     Draw Unix System time stamp on plot.  By adding just/dx/dy/, the
191              user  may  specify  the justification of the stamp and where the
192              stamp should fall on the page relative to lower left  corner  of
193              the  plot.  For example, BL/0/0 will align the lower left corner
194              of the time stamp with  the  lower  left  corner  of  the  plot.
195              Optionally,  append  a  label, or c (which will plot the command
196              string.).  The  GMT  parameters  UNIX_TIME,  UNIX_TIME_POS,  and
197              UNIX_TIME_FORMAT  can affect the appearance; see the gmtdefaults
198              man page for details.  The time string will be in the locale set
199              by the environment variable TZ (generally local time).
200
201       -V     Selects verbose mode, which will send progress reports to stderr
202              [Default runs "silently"].
203
204       -Wc    Draw contour lines on  top  of  surface  or  mesh  (not  image).
205              Append  pen attributes used for the contours.  [Default: width =
206              3, color =  black,  texture  =  solid].   (See  SPECIFYING  PENS
207              below).
208
209       -Wm    Sets  the pen attributes used for the mesh. [Default: width = 1,
210              color = black, texture = solid].  You must also  select  -Qm  or
211              -Qsm for meshlines to be drawn.
212
213       -Wf    Sets  the  pen attributes used for the facade. [Default: width =
214              1, color = black, texture = solid].  You must also select -N for
215              the facade outline to be drawn.  (See SPECIFYING PENS below).
216
217       -X -Y  Shift  plot origin relative to the current origin by (x-shift,y-
218              shift) and optionally append the length unit (c, i, m, p).   You
219              can  prepend a to shift the origin back to the original position
220              after plotting, or prepend  r [Default]  to  reset  the  current
221              origin  to the new location.  If -O is used then the default (x-
222              shift,y-shift) is (0,0), otherwise it is (r1i, r1i)  or  (r2.5c,
223              r2.5c).  Alternatively, give c to align the center coordinate (x
224              or y) of the plot with the center of the page based  on  current
225              page size.
226
227       -Z     Sets the z-level of the basemap [0].
228
229       -c     Specifies the number of plot copies. [Default is 1].
230
231   SPECIFYING PENS
232       pen    The attributes of lines and symbol outlines as defined by pen is
233              a comma delimetered list of width, color and  texture,  each  of
234              which is optional.  width can be indicated as a measure (points,
235              centimeters, inches) or as faint, thin[ner|nest], thick[er|est],
236              fat[ter|test],  or obese.  color specifies a grey shade or color
237              (see SPECIFYING COLOR  below).   texture  is  a  combination  of
238              dashes `-' and dots `.'.
239
240   SPECIFYING COLOR
241       color  The  color  of  lines,  areas and patterns can be specified by a
242              valid color name; by a grey shade (in the  range  0-255);  by  a
243              decimal  color  code  (r/g/b, each in range 0-255; h-s-v, ranges
244              0-360, 0-1, 0-1; or c/m/y/k, each in range 0-1); or by  a  hexa‐
245              decimal  color code (#rrggbb, as used in HTML).  See the gmtcol‐
246              ors manpage for more information and a full list of color names.
247

GRID FILE FORMATS

249       GMT is able to recognize many of the commonly used grid  file  formats,
250       as  well  as the precision, scale and offset of the values contained in
251       the grid file. When GMT needs a little help with that, you can add  the
252       suffix =id[/scale/offset[/nan]], where id is a two-letter identifier of
253       the grid type and precision, and scale and offset  are  optional  scale
254       factor  and  offset  to  be  applied to all grid values, and nan is the
255       value used to indicate missing data.  See  grdreformat(1)  and  Section
256       4.17 of the GMT Technical Reference and Cookbook for more information.
257
258       When reading a netCDF file that contains multiple grids, GMT will read,
259       by default, the first 2-dimensional grid that can find in that file. To
260       coax  GMT  into  reading another multi-dimensional variable in the grid
261       file, append ?varname to the file name, where varname is  the  name  of
262       the variable. Note that you may need to escape the special meaning of ?
263       in your shell program by putting a backslash in  front  of  it,  or  by
264       placing  the  filename and suffix between quotes or double quotes.  See
265       grdreformat(1) and Section 4.18 of  the  GMT  Technical  Reference  and
266       Cookbook  for  more information, particularly on how to read splices of
267       3-, 4-, or 5-dimensional grids.
268

EXAMPLES

270       To make a mesh plot from the file hawaii_grav.grd and drawing the  con‐
271       tours  given  in  the color palette file hawaii.cpt on a Lambert map at
272       1.5 cm/degree along the standard parallels 18  and  24,  with  vertical
273       scale  20 mgal/cm, and looking at the surface from SW at 30 degree ele‐
274       vation, run
275
276       grdview hawaii_grav.grd -Jl18/24/1.5c -Chawaii.cpt -Jz0.05c -Qm  -N-100
277       -E225/30 -Wc > hawaii_grav_image.ps
278
279       To  create a illuminated color perspective plot of the gridded data set
280       image.grd, using the color palette file color.rgb, with linear  scaling
281       at  10 cm/x-unit and tickmarks every 5 units, with intensities provided
282       by the file intens.grd, and looking from the SE, use
283
284       grdview image.grd -Jx10.0c -Ccolor.rgb  -Qs  -E135/30  -Iintens.grd   >
285       image3D.ps
286
287       To make the same plot using the rastering option with dpi = 50, use
288
289       grdview  image.grd  -Jx10.0c -Ccolor.rgb -Qi50 -E135/30 -Iintens.grd  >
290       image3D.ps
291
292       To create a color PostScript perspective plot of the gridded  data  set
293       magnetics.grd, using the color palette file mag_intens.cpt, draped over
294       the relief given by the file topography.grd, with Mercator map width of
295       6  inch  and tickmarks every 1 degree, with intensities provided by the
296       file topo_intens.grd, and looking from the SE, run
297
298       grdview  topography.grd  -JM6i  -Gmagnetics.grd  -Cmag_intens.cpt   -Qs
299       -E140/30 -Itopo_intens.grd  > draped3D.ps
300
301       Given  topo.grd and the Landsat image veggies.ras, first run gmt2rgb to
302       get the red, green, and blue grids, and then drape this image over  the
303       topography and shade the result for good measure.  The commands are
304
305       gmt2rgb veggies.ras -Glayer_%c.grd
306       grdview     topo.grd     -JM6i     -Qi    -E140/30    -Itopo_intens.grd
307       -Glayer_r.grd,layer_g.grd,layer_b.grd > image.ps
308

REMARKS

310       For the -Qs option:  PostScript provides no  way  of  smoothly  varying
311       colors  within a polygon, so colors can only vary from polygon to poly‐
312       gon.  To obtain smooth images  this  way  you  may  resample  the  grid
313       file(s)  using grdsample or use a finer grid size when running gridding
314       programs like surface or nearneighbor.   Unfortunately,  this  produces
315       huge PostScript files.  The alternative is to use the -Qi option, which
316       computes bilinear or bicubic continuous color variations  within  poly‐
317       gons by using scanline conversion to image the polygons.
318

SEE ALSO

320       GMT(1),   gmt2rgb(1),   grdcontour(1),   grdimage(1),  nearneighbor(1),
321       psbasemap(1), pscontour(1), pstext(1), surface(1)
322
323
324
325GMT 4.3.1                         15 May 2008                       GRDVIEW(1)
Impressum