grdbarb
Plot wind barb field from two component grids
Synopsis
grdbarb compx.nc compy.nc -Jparameters [ -A ] [ -B[p|s]parameters ] [ -Ccpt ] [ -Gfill ] [ -I[x]dx[/dy] ] [ -N ] [ -Qlength[+aangle][+g-|fill][+jb|c|e][+p-|pen][+sscale][+wwidth] ] [ -Rregion ] [ -T ] [ -U[stamp] ] [ -Wpen ] [ -X[a|c|f|r][xshift] ] [ -Y[a|c|f|r][yshift] ] [ -Z ] [ -fflags ] [ -pflags ] [ -ttransp ]
Note: No space is allowed between the option flag and the associated arguments.
Description
grdbarb reads two 2-D grid files which represents the x- and y-components of a wind field and produces a wind field plot by drawing wind barbs with orientation and barbs according to the information in the files. Alternatively, polar coordinate r, theta grids may be given instead.
Required Arguments
- compx.nc
Contains the x-components of the wind field. (See Grid File Formats).
- compy.nc
Contains the y-components of the wind field. (See Grid File Formats).
- -Jparameters
Specify the projection. (See full description) (See technical reference) (See projections table).
Optional Arguments
- -A
The grid files contain polar (speed, theta) wind components instead of Cartesian (u, v) components [Default is (u, v)].
- -B[p|s]parameters
Set map boundary frame and axes attributes. (See full description) (See technical reference).
- -C[cpt]
Use cpt to assign colors based on wind speed. Alternatively, supply the name of a GMT color master dynamic CPT [rainbow] to automatically determine a continuous CPT from the grid’s z-range. If the dynamic CPT has a default range then that range will be imposed instead. Yet another option is to specify -Ccolor1,color2[,color3,…] to build a linear continuous cpt from those colors automatically. In this case colorn can be a r/g/b triplet, a color name, or an HTML hexadecimal color (e.g. #aabbcc ).
- -Gfill
Sets color or shade for wind barb interiors [Default is no fill].
- -I[x]dx[/dy]
Only plot wind barbs at nodes every x_inc, y_inc apart (must be multiples of original grid spacing). Append m for arc minutes or s for arc seconds. Alternatively, use -Ix to specify the multiples multx[/multy] directly [Default plots every node].
- -K (more …)
Do not finalize the PostScript plot.
- -N
Do NOT clip wind barbs at map boundaries [Default will clip].
- -Qlength[+aangle][+g-|fill][+jb|c|e][+p-|pen][+sscale][+wwidth]
Modify wind barb parameters. Append wind barb length [Default is 0.5c]. Several modifiers may be appended to specify the placement of barbs, their shapes, and the justification of the wind barb. Below, left and right refers to the side of the wind barb line when viewed from the start point to the end point of the segment. Chose among these modifiers:
+a - Set the angle of the wind barb [120].
+g - Turn off fill (if -) or set the wind barb fill [Default fill is used, which may be no fill].
+p - Sets the wind barb pen attributes. If pen has a leading - then the outline is not drawn [Default pen is used, and outline is drawn].
+j - Determines how the input x,y point relates to the wind barb. Choose from beginning [default], end, or center.
+s - Set the wind speed which corresponds to a long barb [default 5].
+w - Set the width of wind barbs.
-Rwest/east/south/north[/zmin/zmax][+r][+uunit]
Specify the region of interest. Note: If using modern mode and -R is not provided, the region will be set based on previous plotting commands. If this is the first plotting command in the modern mode levels and -R is not provided, the region will be automatically determined based on the data in table (equivalent to using -Ra). (See full description) (See technical reference).
The region may be specified in one of several ways:
-Rwest/east/south/north. This is the standard way to specify geographic regions when using map projections where meridians and parallels are rectilinear. The coordinates may be specified in decimal degrees or in [±]dd:mm[:ss.xxx][W|E|S|N] format.
-Rwest/south/east/north+r. This form is useful for map projections that are oblique, making meridians and parallels poor choices for map boundaries. Here, we instead specify the lower left corner and upper right corner geographic coordinates, followed by the modifier +r. This form guarantees a rectangular map even though lines of equal longitude and latitude are not straight lines.
-Rg or -Rd. These forms can be used to quickly specify the global domain (0/360 for -Rg and -180/+180 for -Rd in longitude, with -90/+90 in latitude).
-Rcode1,code2,…[+e|r|Rincs]. This indirectly supplies the region by consulting the DCW (Digital Chart of the World) database and derives the bounding regions for one or more countries given by the codes. Simply append one or more comma-separated countries using either the two-character ISO 3166-1 alpha-2 convention (e.g., NO) or the full country name (e.g., Norway). To select a state within a country (if available), append .state (e.g, US.TX), or the full state name (e.g., Texas). To specify a whole continent, spell out the full continent name (e.g., -RAfrica). Finally, append any DCW collection abbreviations or full names for the extent of the collection or named region. All names are case-insensitive. The following modifiers can be appended:
+r to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no adjustment]. For example, -RFR+r1 will select the national bounding box of France rounded to nearest integer degree, where inc can be positive to expand the region or negative to shrink the region.
+R to adjust the region by adding the amounts specified by inc, xinc/yinc, or winc/einc/sinc/ninc [default is no extension], where inc can be positive to expand the region or negative to shrink the region.
+e to adjust the region boundaries to be multiples of the steps indicated by inc, xinc/yinc, or winc/einc/sinc/ninc, while ensuring that the bounding box is adjusted by at least 0.25 times the increment [default is no adjustment], where inc can be positive to expand the region or negative to shrink the region.
-Rxmin/xmax/ymin/ymax[+uunit] specifies a region in projected units (e.g., UTM meters) where xmin/xmax/ymin/ymax are Cartesian projected coordinates compatible with the chosen projection (-J) and unit is an allowable distance unit [e]; we inversely project to determine the actual rectangular geographic region. For projected regions centered on (0,0) you may use the short-hand -Rhalfwidth[/halfheight]+uunit, where halfheight defaults to halfwidth if not given. This short-hand requires the +u modifier.
-Rjustifylon0/lat0/nx/ny, where justify is a 2-character combination of L|C|R (for left, center, or right) and T|M|B (for top, middle, or bottom) (e.g., BL for lower left). The two character code justify indicates which point on a rectangular region region the lon0/lat0 coordinates refer to and the grid dimensions nx and ny are used with grid spacings given via -I to create the corresponding region. This method can be used when creating grids. For example, -RCM25/25/50/50 specifies a 50x50 grid centered on 25,25.
-Rgridfile. This will copy the domain settings found for the grid in specified file. Note that depending on the nature of the calling module, this mechanism will also set grid spacing and possibly the grid registration (see Grid registration: The -r option).
-Ra[uto] or -Re[xact]. Under modern mode, and for plotting modules only, you can automatically determine the region from the data used. You can either get the exact area using -Re [Default if no -R is given] or a slightly larger area sensibly rounded outwards to the next multiple of increments that depend on the data range using -Ra.
- -T
Means the azimuths of Cartesian data sets should be adjusted according to the signs of the scales in the x- and y-directions [Leave alone]. This option can be used to convert vector azimuths in cases when a negative scale is used in one of both directions (e.g., positive down).
- -U[label|+c][+jjustify][+odx[/dy]][+ttext]
Draw GMT time stamp logo on plot. (See full description) (See technical reference).
- -V[level]
Select verbosity level [w]. (See full description) (See technical reference).
- -Wpen
Set pen attributes used for wind barb outlines [Default: width = default, color = black, style = solid].
- -X[a|c|f|r][xshift]
Shift plot origin. (See full description) (See technical reference).
- -Y[a|c|f|r][yshift]
Shift plot origin. (See full description) (See technical reference).
- -Z
The theta grid provided contains azimuths rather than directions (implies -A).
- -f[i|o]colinfo (more …)
Specify data types of input and/or output columns.
- -p[x|y|z]azim[/elev[/zlevel]][+wlon0/lat0[/z0]][+vx0/y0] (more …)
Select perspective view.
- -ttransp[/transp2] (more …)
Set transparency level(s) in percent.
- -^ or just -
Print a short message about the syntax of the command, then exit (Note: on Windows just use -).
- -+ or just +
Print an extensive usage (help) message, including the explanation of any module-specific option (but not the GMT common options), then exit.
- -? or no arguments
Print a complete usage (help) message, including the explanation of all options, then exit.
- --PAR=value
Temporarily override a GMT default setting; repeatable. See gmt.conf for parameters.
Examples
Note: Below are some examples of valid syntax for this module.
The examples that use remote files (file names starting with @
)
can be cut and pasted into your terminal for testing.
Other commands requiring input files are just dummy examples of the types
of uses that are common but cannot be run verbatim as written.
Note: Since many GMT plot examples are very short (i.e., one module call between the gmt begin and gmt end commands), we will often present them using the quick modern mode GMT Modern Mode One-line Commands syntax, which simplifies such short scripts.
To draw the wind field given by the files r.nc and theta.nc on a barb plot with 0.1 inch length and centered on the node locations, run:
gmt grdbarb r.nc theta.nc -Jx5c -A -Q0.1i+jc -png gradient
To plot a geographic data sets given the files comp_x.nc and comp_y.nc, and only plot every 3rd node in either direction, try:
gmt grdbarb comp_x.nc comp_y.nc -Ix3 -JH0/20c -Q0.1i+jc -png globe