.TH GRDVECTOR 1gmt "15 Jul 2011" "GMT 4.5.7" "Generic Mapping Tools" .SH NAME grdvector \- Plot vector fields from grid files .SH SYNOPSIS \fBgrdvector\fP \fIcompx.grd\fP \fIcompy.grd\fP \fB\-J\fP\fIparameters\fP [ \fB\-A\fP ] [ \fB\-B\fP[\fBp\fP|\fBs\fP]\fIparameters\fP ] [ \fB\-C\fP\fIcptfile\fP ] [ \fB\-E\fP ] [ \fB\-G\fP\fIfill\fP ] [ \fB\-I\fP\fIxinc\fP[\fIunit\fP][\fB=\fP|\fB+\fP][/\fIyinc\fP[\fIunit\fP][\fB=\fP|\fB+\fP]] ] [ \fB\-K\fP ] [ \fB\-N\fP ] [ \fB\-O\fP ] [ \fB\-P\fP ] [ \fB\-Q\fP\fIparameters\fP ] [ \fB\-R\fP\fIwest\fP/\fIeast\fP/\fIsouth\fP/\fInorth\fP[\fBr\fP] ] [ \fB\-S\fP[\fBl\fP]\fIscale\fP ] [ \fB\-T\fP ] [ \fB\-U\fP[\fIjust\fP/\fIdx\fP/\fIdy\fP/][\fBc\fP|\fIlabel\fP] ] [ \fB\-V\fP ] [ \fB\-W\fP\fIpen\fP ] [ \fB\-X\fP[\fBa\fP|\fBc\fP|\fBr\fP][\fIx-shift\fP[\fBu\fP]] ] [ \fB\-Y\fP[\fBa\fP|\fBc\fP|\fBr\fP][\fIy-shift\fP[\fBu\fP]] ] [ \fB\-Z\fP ] [ \fB\-c\fP\fIcopies\fP ] [ \fB\-f\fP[\fBi\fP|\fBo\fP]\fIcolinfo\fP ] .SH DESCRIPTION \fBgrdvector\fP reads two 2-D grid files which represents the x- and y-components of a vector field and produces a vector field plot by drawing vectors with orientation and length according to the information in the files. Alternatively, polar coordinate components may be used (r, theta). \fBgrdvector\fP is basically a short-hand for using 2 calls to \fBgrd2xyz\fP and pasting the output through \fBpsxy \-SV\fP. .TP \fIcompx.grd\fP Contains the x-component of the vector field. .TP \fIcompy.grd\fP Contains the y-component of the vector field. (See GRID FILE FORMATS below.) .TP \fB\-J\fP Selects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier). UNIT is cm, inch, or m, depending on the \fBMEASURE_UNIT\fP setting in \.gmtdefaults4, but this can be overridden on the command line by appending \fBc\fP, \fBi\fP, or \fBm\fP to the scale/width value. When central meridian is optional, default is center of longitude range on \fB\-R\fP option. Default standard parallel is the equator. For map height, max dimension, or min dimension, append \fBh\fP, \fB+\fP, or \fB-\fP to the width, respectively. .br More details can be found in the \fBpsbasemap\fP man pages. .br .sp \fBCYLINDRICAL PROJECTIONS:\fP .br .sp \fB\-Jc\fP\fIlon0/lat0/scale\fP (Cassini) .br \fB\-Jcyl_stere\fP/[\fIlon0/\fP[\fIlat0/\fP]]\fIscale\fP (Cylindrical Stereographic) .br \fB\-Jj\fP[\fIlon0/\fP]\fIscale\fP (Miller) .br \fB\-Jm\fP[\fIlon0\fP/[\fIlat0/\fP]]\fIscale\fP (Mercator) .br \fB\-Jm\fP\fIlon0/lat0/scale\fP (Mercator - Give meridian and standard parallel) .br \fB\-Jo\fP[\fBa\fP]\fIlon0/lat0/azimuth/scale\fP (Oblique Mercator - point and azimuth) .br \fB\-Jo\fP[\fBb\fP]\fIlon0/lat0/lon1/lat1/scale\fP (Oblique Mercator - two points) .br \fB\-Joc\fP\fIlon0/lat0/lonp/latp/scale\fP (Oblique Mercator - point and pole) .br \fB\-Jq\fP[\fIlon0/\fP[\fIlat0/\fP]]\fIscale\fP (Cylindrical Equidistant) .br \fB\-Jt\fP\fIlon0/\fP[\fIlat0/\fP]\fIscale\fP (TM - Transverse Mercator) .br \fB\-Ju\fP\fIzone/scale\fP (UTM - Universal Transverse Mercator) .br \fB\-Jy\fP[\fIlon0/\fP[\fIlat0/\fP]]\fIscale\fP (Cylindrical Equal-Area) .br .sp \fBCONIC PROJECTIONS:\fP .br .sp \fB\-Jb\fP\fIlon0/lat0/lat1/lat2/scale\fP (Albers) .br \fB\-Jd\fP\fIlon0/lat0/lat1/lat2/scale\fP (Conic Equidistant) .br \fB\-Jl\fP\fIlon0/lat0/lat1/lat2/scale\fP (Lambert Conic Conformal) .br \fB\-Jpoly\fP/[\fIlon0/\fP[\fIlat0/\fP]]\fIscale\fP ((American) Polyconic) .br .sp \fBAZIMUTHAL PROJECTIONS:\fP .br .sp \fB\-Ja\fP\fIlon0/lat0\fP[\fI/horizon\fP]\fI/scale\fP (Lambert Azimuthal Equal-Area) .br \fB\-Je\fP\fIlon0/lat0\fP[\fI/horizon\fP]\fI/scale\fP (Azimuthal Equidistant) .br \fB\-Jf\fP\fIlon0/lat0\fP[\fI/horizon\fP]\fI/scale\fP (Gnomonic) .br \fB\-Jg\fP\fIlon0/lat0\fP[\fI/horizon\fP]\fI/scale\fP (Orthographic) .br \fB\-Jg\fP\fIlon0/lat0/altitude/azimuth/tilt/twist/Width/Height/scale\fP (General Perspective). .br \fB\-Js\fP\fIlon0/lat0\fP[\fI/horizon\fP]\fI/scale\fP (General Stereographic) .br .sp \fBMISCELLANEOUS PROJECTIONS:\fP .br .sp \fB\-Jh\fP[\fIlon0/\fP]\fIscale\fP (Hammer) .br \fB\-Ji\fP[\fIlon0/\fP]\fIscale\fP (Sinusoidal) .br \fB\-Jkf\fP[\fIlon0/\fP]\fIscale\fP (Eckert IV) .br \fB\-Jk\fP[\fBs\fP][\fIlon0/\fP]\fIscale\fP (Eckert VI) .br \fB\-Jn\fP[\fIlon0/\fP]\fIscale\fP (Robinson) .br \fB\-Jr\fP[\fIlon0/\fP]\fIscale\fP (Winkel Tripel) .br \fB\-Jv\fP[\fIlon0/\fP]\fIscale\fP (Van der Grinten) .br \fB\-Jw\fP[\fIlon0/\fP]\fIscale\fP (Mollweide) .br .sp \fBNON-GEOGRAPHICAL PROJECTIONS:\fP .br .sp \fB\-Jp\fP[\fBa\fP]\fIscale\fP[\fI/origin\fP][\fBr\fP|\fBz\fP] (Polar coordinates (theta,r)) .br \fB\-Jx\fP\fIx-scale\fP[\fBd\fP|\fBl\fP|\fBp\fP\fIpow\fP|\fBt\fP|\fBT\fP][\fI/y-scale\fP[\fBd\fP|\fBl\fP|\fBp\fP\fIpow\fP|\fBt\fP|\fBT\fP]] (Linear, log, and power scaling) .br .SH OPTIONS No space between the option flag and the associated arguments. .TP \fB\-A\fP Means grid files have polar (r, theta) components instead of Cartesian (x, y). .TP \fB\-B\fP Sets map boundary annotation and tickmark intervals; see the \fBpsbasemap\fP man page for all the details. .TP \fB\-C\fP Use \fIcptfile\fP to assign colors based on vector length. .TP \fB\-E\fP Center vectors on grid nodes [Default draws from grid node]. .TP \fB\-G\fP Sets color or shade for vector interiors [Default is no fill]. (See SPECIFYING FILL below). .TP \fB\-I\fP Only plot vectors at nodes every \fIx_inc, y_inc\fP apart (must be multiples of original grid spacing). Append \fBm\fP for minutes or \fBc\fP for seconds. [Default plots every node]. .TP \fB\-K\fP More \fIPostScript\fP code will be appended later [Default terminates the plot system]. .TP \fB\-N\fP Do NOT clip vectors at map boundaries [Default will clip]. .TP \fB\-O\fP Selects Overlay plot mode [Default initializes a new plot system]. .TP \fB\-P\fP Selects Portrait plotting mode [Default is Landscape, see \fBgmtdefaults\fP to change this]. .TP \fB\-Q\fP Select vector plot [Default is stick-plot]. Optionally, specify \fIparameters\fP which are \fIarrowwidth/headlength/headwidth\fP [Default is 0.075\fBc\fP/0.3\fBc\fP/0.25\fBc\fP (or 0.03\fBi\fP/0.12\fBi\fP/0.1\fBi\fP)]. Append \fBn\fP\fIsize\fP which will cause vectors shorter than \fIsize\fP to have their appearance scaled by length/\fIsize\fP. .TP \fB\-R\fP \fIxmin\fP, \fIxmax\fP, \fIymin\fP, and \fIymax\fP specify the Region of interest. For geographic regions, these limits correspond to \fIwest, east, south,\fP and \fInorth\fP and you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append \fBr\fP if lower left and upper right map coordinates are given instead of w/e/s/n. The two shorthands \fB\-Rg\fP and \fB\-Rd\fP stand for global domain (0/360 and -180/+180 in longitude respectively, with -90/+90 in latitude). Alternatively, specify the name of an existing grid file and the \fB\-R\fP settings (and grid spacing, if applicable) are copied from the grid. For calendar time coordinates you may either give (a) relative time (relative to the selected \fBTIME_EPOCH\fP and in the selected \fBTIME_UNIT\fP; append \fBt\fP to \fB\-JX\fP|\fBx\fP), or (b) absolute time of the form [\fIdate\fP]\fBT\fP[\fIclock\fP] (append \fBT\fP to \fB\-JX\fP|\fBx\fP). At least one of \fIdate\fP and \fIclock\fP must be present; the \fBT\fP is always required. The \fIdate\fP string must be of the form [-]yyyy[-mm[-dd]] (Gregorian calendar) or yyyy[-Www[-d]] (ISO week calendar), while the \fIclock\fP string must be of the form hh:mm:ss[.xxx]. The use of delimiters and their type and positions must be exactly as indicated (however, input, output and plot formats are customizable; see \fBgmtdefaults\fP). Specify a subset of the grid. .TP \fB\-S\fP Sets scale for vector length in data units per distance measurement unit [1]. Append \fBc\fP, \fBi\fP, \fBm\fP, \fBp\fP to indicate the measurement unit (cm, inch, m, point). Prepend \fBl\fP to indicate a fixed length for all vectors. .TP \fB\-T\fP Means azimuth should be converted to angles based on the selected map projection. .TP \fB\-U\fP Draw Unix System time stamp on plot. By adding \fIjust/dx/dy/\fP, the user may specify the justification of the stamp and where the stamp should fall on the page relative to lower left corner of the plot. For example, BL/0/0 will align the lower left corner of the time stamp with the lower left corner of the plot. Optionally, append a \fIlabel\fP, or \fBc\fP (which will plot the command string.). The \fBGMT\fP parameters \fBUNIX_TIME\fP, \fBUNIX_TIME_POS\fP, and \fBUNIX_TIME_FORMAT\fP can affect the appearance; see the \fBgmtdefaults\fP man page for details. The time string will be in the locale set by the environment variable \fBTZ\fP (generally local time). .TP \fB\-V\fP Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. .TP \fB\-W\fP Set pen attributes used for vector outlines [Default: width = 0.25p, color = black, texture = solid]. (See SPECIFYING PENS below). .TP \fB\-X\fP \fB\-Y\fP Shift plot origin relative to the current origin by (\fIx-shift,y-shift\fP) and optionally append the length unit (\fBc\fP, \fBi\fP, \fBm\fP, \fBp\fP). You can prepend \fBa\fP to shift the origin back to the original position after plotting, or prepend \fBr\fP [Default] to reset the current origin to the new location. If \fB\-O\fP is used then the default (\fIx-shift,y-shift\fP) is (0,0), otherwise it is (r1i, r1i) or (r2.5c, r2.5c). Alternatively, give \fBc\fP to align the center coordinate (x or y) of the plot with the center of the page based on current page size. .TP \fB\-Z\fP Means the angles provided are azimuths rather than direction (requires \fB\-A\fP). .TP \fB\-c\fP Specifies the number of plot copies. [Default is 1]. .TP \fB\-f\fP Special formatting of input and/or output columns (time or geographical data). Specify \fBi\fP or \fBo\fP to make this apply only to input or output [Default applies to both]. Give one or more columns (or column ranges) separated by commas. Append \fBT\fP (absolute calendar time), \fBt\fP (relative time in chosen \fBTIME_UNIT\fP since \fBTIME_EPOCH\fP), \fBx\fP (longitude), \fBy\fP (latitude), or \fBf\fP (floating point) to each column or column range item. Shorthand \fB\-f\fP[\fBi\fP|\fBo\fP]\fBg\fP means \fB\-f\fP[\fBi\fP|\fBo\fP]0\fBx\fP,1\fBy\fP (geographic coordinates). .SS SPECIFYING PENS .TP \fIpen\fP The attributes of lines and symbol outlines as defined by \fIpen\fP is a comma delimetered list of \fIwidth\fP, \fIcolor\fP and \fItexture\fP, each of which is optional. \fIwidth\fP can be indicated as a measure (points, centimeters, inches) or as \fBfaint\fP, \fBthin\fP[\fBner\fP|\fBnest\fP], \fBthick\fP[\fBer\fP|\fBest\fP], \fBfat\fP[\fBter\fP|\fBtest\fP], or \fBobese\fP. \fIcolor\fP specifies a gray shade or color (see SPECIFYING COLOR below). \fItexture\fP is a combination of dashes `-' and dots `.'. .SS SPECIFYING FILL .TP \fIfill\fP The attribute \fIfill\fP specifies the solid shade or solid \fIcolor\fP (see SPECIFYING COLOR below) or the pattern used for filling polygons. Patterns are specified as \fBp\fP\fIdpi/pattern\fP, where \fIpattern\fP gives the number of the built-in pattern (1-90) \fIor\fP the name of a Sun 1-, 8-, or 24-bit raster file. The \fIdpi\fP sets the resolution of the image. For 1-bit rasters: use \fBP\fP\fIdpi/pattern\fP for inverse video, or append \fB:F\fP\fIcolor\fP[\fBB\fP[\fIcolor\fP]] to specify fore- and background colors (use \fIcolor\fP = - for transparency). See \fBGMT\fP Cookbook & Technical Reference Appendix E for information on individual patterns. .SS SPECIFYING COLOR .TP \fIcolor\fP The \fIcolor\fP of lines, areas and patterns can be specified by a valid color name; by a gray shade (in the range 0\-255); by a decimal color code (r/g/b, each in range 0\-255; h-s-v, ranges 0\-360, 0\-1, 0\-1; or c/m/y/k, each in range 0\-1); or by a hexadecimal color code (#rrggbb, as used in HTML). See the \fBgmtcolors\fP manpage for more information and a full list of color names. .SH GRID FILE FORMATS \fBGMT\fP is able to recognize many of the commonly used grid file formats, as well as the precision, scale and offset of the values contained in the grid file. When \fBGMT\fP needs a little help with that, you can add the suffix \fB=\fP\fIid\fP[\fB/\fP\fIscale\fP\fB/\fP\fIoffset\fP[\fB/\fP\fInan\fP]], where \fIid\fP is a two-letter identifier of the grid type and precision, and \fIscale\fP and \fIoffset\fP are optional scale factor and offset to be applied to all grid values, and \fInan\fP is the value used to indicate missing data. See \fBgrdreformat\fP(1) and Section 4.17 of the GMT Technical Reference and Cookbook for more information. .P When reading a netCDF file that contains multiple grids, \fBGMT\fP will read, by default, the first 2-dimensional grid that can find in that file. To coax \fBGMT\fP into reading another multi-dimensional variable in the grid file, append \fB?\fP\fIvarname\fP to the file name, where \fIvarname\fP is the name of the variable. Note that you may need to escape the special meaning of \fB?\fP in your shell program by putting a backslash in front of it, or by placing the filename and suffix between quotes or double quotes. See \fBgrdreformat\fP(1) and Section 4.18 of the GMT Technical Reference and Cookbook for more information, particularly on how to read splices of 3-, 4-, or 5-dimensional grids. .SH EXAMPLES To draw the vector field given by the files r.grd and theta.grd on a linear plot with scale 5 cm per data unit, using vector rather than stick plot, and scale vector magnitudes so that 10 units equal 1 inch, run .br .sp \fBgrdvector\fP r.grd theta.grd \fB\-Jx\fP5\fBc\fP \fB\-A\fP \fB\-Q\fP \fB\-S\fP10\fBi\fP > gradient.ps .br .sp .SH "SEE ALSO" .IR GMT (1), .IR gmtcolors (5), .IR grdcontour (1), .IR psxy (1)