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       -Eazim/elev[+wlon/lat[/z]][+vx0/y0]      ]      [     -Gdrapefile     |
12       -Ggrd_r,grd_g,grd_b ] [ -Iintensfile ] [ -Jz|Zparameters ]  [  -K  ]  [
13       -L[flags]  ]  [  -Nlevel[/color]  ]  [  -O  ]  [  -P  ] [ -Qtype[g] ] [
14       -Rwest/east/south/north[/zmin/zmax][r] ] [ -Ssmooth ] [ -T[s][o[pen]] ]
15       [  -U[just/dx/dy/][c|label]  ]  [  -V  ]  [ -Wtype/pen ] [ -X[a|c|r][x-
16       shift[u]] ] [ -Y[a|c|r][y-shift[u]] ] [ -Zzlevel ] [ -ccopies ]
17

DESCRIPTION

19       grdview reads a 2-D grid 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              -Jpoly/[lon0/[lat0/]]scale ((American) Polyconic)
65
66              AZIMUTHAL PROJECTIONS:
67
68              -Jalon0/lat0[/horizon]/scale (Lambert Azimuthal Equal-Area)
69              -Jelon0/lat0[/horizon]/scale (Azimuthal Equidistant)
70              -Jflon0/lat0[/horizon]/scale (Gnomonic)
71              -Jglon0/lat0[/horizon]/scale (Orthographic)
72              -Jglon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale
73              (General Perspective).
74              -Jslon0/lat0[/horizon]/scale (General Stereographic)
75
76              MISCELLANEOUS PROJECTIONS:
77
78              -Jh[lon0/]scale (Hammer)
79              -Ji[lon0/]scale (Sinusoidal)
80              -Jkf[lon0/]scale (Eckert IV)
81              -Jk[s][lon0/]scale (Eckert VI)
82              -Jn[lon0/]scale (Robinson)
83              -Jr[lon0/]scale (Winkel Tripel)
84              -Jv[lon0/]scale (Van der Grinten)
85              -Jw[lon0/]scale (Mollweide)
86
87              NON-GEOGRAPHICAL PROJECTIONS:
88
89              -Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))
90              -Jxx-scale[d|l|ppow|t|T][/y-scale[d|l|ppow|t|T]]  (Linear,  log,
91              and power scaling)
92
93       -Jz    Sets the vertical scaling (for 3-D maps).  Same syntax as -Jx.
94

OPTIONS

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

GRID FILE FORMATS

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

EXAMPLES

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

REMARKS

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

SEE ALSO

328       GMT(1),   gmt2rgb(1),   gmtcolors(5),    grdcontour(1),    grdimage(1),
329       nearneighbor(1), psbasemap(1), pscontour(1), pstext(1), surface(1)
330
331
332
333GMT 4.5.6                         10 Mar 2011                       GRDVIEW(1)
Impressum