|
| 1 | +# windbarb |
| 2 | + |
| 3 | +```julia |
| 4 | +windbarbs(u, v; kwargs...) |
| 5 | +``` |
| 6 | + |
| 7 | +Plot wind barb field from two component grids with the *x* and *y* components of the wind field. |
| 8 | + |
| 9 | +--- |
| 10 | +or |
| 11 | + |
| 12 | +```julia |
| 13 | +windbarbs(arg1; kwargs...) |
| 14 | +``` |
| 15 | + |
| 16 | +Plot wind barb field from a data table with the *x* and *y* components of the wind field. |
| 17 | + |
| 18 | +Description |
| 19 | +----------- |
| 20 | + |
| 21 | +Read two 2-D grid files which represents the *x*- and *y*-components of a wind field and produces |
| 22 | +a wind field plot by drawing wind barbs with orientation and barbs according to the information in |
| 23 | +the files. Alternatively, polar coordinate *r*, *theta* grids may be given instead. Alternatively, |
| 24 | +a data table with the *x* and *y* components of the wind field may be given. |
| 25 | + |
| 26 | +Required Arguments |
| 27 | +------------------ |
| 28 | + |
| 29 | +- *compx* Contains the x-components of the wind field. |
| 30 | + |
| 31 | +- *compy* Contains the y-components of the wind field. |
| 32 | + |
| 33 | + |
| 34 | +Optional Arguments |
| 35 | +------------------ |
| 36 | + |
| 37 | +- **A** or **polar** : -- *polar=true*\ |
| 38 | + The grid files contain polar (r, theta) components instead of Cartesian (x, y) [Default is Cartesian components]. |
| 39 | + This option is valid only when the input files are 2-D grids. |
| 40 | + |
| 41 | +\textinput{common_opts/opt_B} |
| 42 | + |
| 43 | +\textinput{common_opts/use_cpt_grd} |
| 44 | + |
| 45 | +- **G** or **fill** : -- *fill=fill*\ |
| 46 | + Sets color or shade for wind barb interiors (see \myreflink{Fill color/pattern}) [Default is no fill]. |
| 47 | + |
| 48 | + |
| 49 | +- **I** or **inc** or **increment** or **spacing** : -- *inc=x_inc* **|** *inc=(x_inc, y_inc)* **|** *inc="x""multx"["/multy"]*\ |
| 50 | + Only plot wind barbs at nodes every *x\_inc*, *y\_inc* apart (must be multiples of original grid spacing). |
| 51 | + Append **m** for arc minutes or **s** for arc seconds. Alternatively, use **inc="x"** to specify the |
| 52 | + multiples *multx*[/*multy*] directly [Default plots every node]. Example **inc="x10/5"** to select every other |
| 53 | + 10 nodes in *x* and 5 nodes in *y*. **_NOTE_**: by default we estimate good values so that the arrows do no |
| 54 | + overlap so you may start by jumping this option unless some fine control is desired. |
| 55 | + |
| 56 | +\textinput{common_opts/opt_J} |
| 57 | + |
| 58 | +- **N** or **noclip** or **no\_clip** : *noclip=true*\ |
| 59 | + Do NOT clip wind barbs at map boundaries [Default will clip]. |
| 60 | + |
| 61 | +- **Q** or **barbs** : -- *barbs=(length=length, angle=angle, fill=fill, pen=pen, justify="b|e|c", scale=scale, width=width)*\ |
| 62 | + Modify wind barb parameters. Append wind barb *length* [Default is 0.5c]. Several modifiers may be |
| 63 | + appended to specify the placement of barbs, their shapes, and the justification of the wind barb. |
| 64 | + Below, left and right refers to the side of the wind barb line when viewed from the start point to |
| 65 | + the end point of the segment. Chose among these modifiers: |
| 66 | + |
| 67 | + - **angle** - Set the angle of the wind barb [120]. |
| 68 | + - **fill** - Turn off *fill* (if -) or set the wind barb fill [Default fill is used, which may be no fill]. |
| 69 | + - **pen** - Sets the wind barb pen attributes. If *pen* has a leading **-** then the outline is not drawn |
| 70 | + [Default pen is used, and outline is drawn]. |
| 71 | + - **justify** - Determines how the input *x*, *y* point relates to the wind barb. Choose from **b**eginning |
| 72 | + [default], **e**nd, or **c**enter. |
| 73 | + - **scale** - Set the wind speed which corresponds to a long barb [default 5]. |
| 74 | + - **width** - Set the *width* of wind barbs. |
| 75 | + |
| 76 | +\textinput{common_opts/opt_R} |
| 77 | + |
| 78 | +- **T** or **sign_scale** : -- *sign_scale=true*\ |
| 79 | + Means the azimuths of Cartesian data sets should be adjusted according to the |
| 80 | + signs of the scales in the x- and y-directions [Leave alone]. This option can |
| 81 | + be used to convert vector azimuths in cases when a negative scale is used in |
| 82 | + one of both directions (e.g., positive down). |
| 83 | + |
| 84 | +\textinput{common_opts/opt_U} |
| 85 | + |
| 86 | +\textinput{common_opts/opt_V} |
| 87 | + |
| 88 | +\textinput{common_opts/opt_pen} |
| 89 | + |
| 90 | +\textinput{common_opts/opt_X} |
| 91 | + |
| 92 | +\textinput{common_opts/opt_Y} |
| 93 | + |
| 94 | +- **Z** or **azimuth** : -- *azimuth=true*\ |
| 95 | + The theta grid provided contains azimuths rather than directions (implies `polar=true`). |
| 96 | + This option is valid only when the input files are 2-D grids. |
| 97 | + |
| 98 | +\textinput{common_opts/opt_f} |
| 99 | + |
| 100 | +\textinput{common_opts/opt_p} |
| 101 | + |
| 102 | +\textinput{common_opts/opt_t} |
| 103 | + |
| 104 | +Examples |
| 105 | +-------- |
| 106 | + |
| 107 | +To draw the wind field given by the files ``r.nc`` and ``theta.nc`` on a |
| 108 | +barb plot with 0.25 cm length and centered on the node locations, run: |
| 109 | + |
| 110 | +```julia |
| 111 | +windbarb("r.nc", "theta.nc", polar=true, barbs=(len=0.25, justify=:c), show=true) |
| 112 | +``` |
| 113 | + |
| 114 | +To plot a geographic data sets given the files comp_x.nc and comp_y.nc, |
| 115 | +and only plot every 3rd node in either direction, try: |
| 116 | + |
| 117 | +```julia |
| 118 | +windbarb("comp_x.nc", "comp_y.nc", inc="x3", proj=:guess, barbs=(len=0.25, justify=:c), show=true) |
| 119 | +``` |
| 120 | + |
| 121 | +\begin{examplefig}{} |
| 122 | +```julia |
| 123 | +using GMT |
| 124 | + |
| 125 | +ecmwf(:forecast, var=["10u", "10v"], R="IHO23", prefix="vel") |
| 126 | +windbarbs("10u_step0_ifs_oper_fc_20250517_00.grd", "10v_step0_ifs_oper_fc_20250517_00.grd", |
| 127 | + barbs=(length=0.25, width=0.15), inc="x10", coast=true, proj=:guess, show=true) |
| 128 | +``` |
| 129 | +\end{examplefig} |
| 130 | + |
| 131 | +See Also |
| 132 | +-------- |
| 133 | + |
| 134 | +\myreflink{grdcontour}, \myreflink{grdvector} |
0 commit comments