GRASS logo

NAME

d.barb - Draws flow barbs.

KEYWORDS

SYNOPSIS

d.barb
d.barb help
d.barb [-r] [direction=name] [magnitude=name] [u=name] [v=name] [input=name] [layer=integer] [style=string] [color=name] [skip=integer] [scale=float] [peak=float] [aspect_type=string] [legend_at=x,y[,x,y,...]] [legend_velo=float[,float,...]] [legend_fontsize=float] [--verbose] [--quiet]

Flags:

-r
Rotate direction 180 degrees
Useful for switching between atmospheric and oceanographic conventions
--verbose
Verbose module output
--quiet
Quiet module output

Parameters:

direction=name
Raster map (or attribute column) containing velocity direction
magnitude=name
Raster map (or attribute column) containing velocity magnitude
u=name
Raster map (or attribute column) containing u-component of velocity
v=name
Raster map (or attribute column) containing v-component of velocity
input=name
Name of input vector map
layer=integer
Layer number
A single vector map can be connected to multiple database tables. This number determines which table to use.
Default: 1
style=string
Style
Options: arrow,barb,small_barb,straw
Default: arrow
color=name
Color
Either a standard color name or R:G:B triplet
Default: black
skip=integer
Draw arrow every Nth grid cell
Default: 10
scale=float
Scale factor for arrow rendering
Default: 1.0
peak=float
Maximum value for scaling (overrides map's maximum)
aspect_type=string
Direction map aspect type
Options: cartesian,compass
Default: cartesian
legend_at=x,y[,x,y,...]
Screen percentage for legend barb ([0,0] is bottom-left)
Draws a single barb and exits
Options: 0-100
Default: 10.0,10.0
legend_velo=float[,float,...]
Velocity for legend key arrow
legend_fontsize=float
Font size used in legend
Default: 14

DESCRIPTION

Draws arrows, straws, or wind barbs. Can use either raster or vector input maps, and either u,v velocity component or direction and magnitude input data.

NOTES

Cartesian aspect is measured in degrees CCW from the positive x-axis (east). Compass aspect is measured in degrees CW from north.

Wind barbs are all of equal length, but that length may be adjusted by the scale parameter.

Wind barbs assume velocity data is given in knots. Actually it doesn't care, but effectively maxes out at velo=150. When the style is set to wind barbs, the scale parameter becomes a magnitude multiplier instead of changing the size of the barb. In this way scale=1.9438 can be used to convert data stored in m/s to knots without altering the data.

EXAMPLES

Sparse station data from vector maps

First prepare some dummy data, then plot it.
# Spearfish dataset
g.copy vect=bugsites,dummy_map
v.db.addcol map=dummy_map \
    columns='direction DOUBLE PRECISION, magnitude DOUBLE PRECISION'
v.db.update dummy_map column=direction value='cat * 4.0'
v.db.update dummy_map column=magnitude value='cat / 2.0'

g.region n=4918590 s=4914780 w=591510 e=595650
d.erase
d.barb input=dummy_map direction=direction magnitude=magnitude \
   aspect=compass style=barb

Eulerian field from raster grid

# r.surf.volcano module from GRASS-addons
g.region -d
r.surf.volcano output=gauss method=gaussian sigma=1
r.colors -ne gauss color=bcyr
r.slope.aspect elev=gauss slope=gauss.slope aspect=gauss.aspect
d.barb dir=gauss.aspect mag=gauss.slope scale=20 color=aqua

Create a legend

d.graph << EOF
 color 230:230:210
 polygon
  80 5
  80 35
  97 35
  97 5
 color black
 polyline
  80 5
  80 35
  97 35
  97 5
  80 5
EOF

d.barb legend_velo=5,10,15,20,25 \
   legend_at=90,30,90,25,90,20,90,15,90,10 \
   color=black legend_fontsize=20 style=arrow

TODO

SEE ALSO

d.rast.arrow, d.graph, d.vect

AUTHOR

Hamish Bowman
Department of Marine Science
University of Otago
New Zealand


Last changed: $Date$


Main index - display index - Full index

© 2003-2016 GRASS Development Team