1GMTVECTOR(1) GMT GMTVECTOR(1)
2
3
4
6 gmtvector - Basic manipulation of Cartesian vectors
7
9 gmtvector [ tables ] [ -Am[conf]|vector ] [ -C[i|o] ] [ -E ] [ -N ]
10 [ -Svector ] [ -Ta|d|D|paz|r[arg|R|s|x] ] [ -V[level] ] [ -bbinary ]
11 [ -dnodata ] [ -eregexp ] [ -fflags ] [ -ggaps ] [ -hheaders ] [
12 -iflags ] [ -oflags ] [ -:[i|o] ]
13
14 Note: No space is allowed between the option flag and the associated
15 arguments.
16
18 gmtvector reads either (x, y), (x, y, z), (r, theta) or (lon, lat) [or
19 (lat,lon); see -:] coordinates from the first 2-3 columns on standard
20 input [or one or more tables]. If -fg is selected and only two items
21 are read (i.e., lon, lat) then these coordinates are converted to
22 Cartesian three-vectors on the unit sphere. Otherwise we expect (r,
23 theta) unless -Ci is in effect. If no file is found we expect a single
24 vector to be given as argument to -A; this argument will also be inter‐
25 preted as an x/y[/z], lon/lat, or r/theta vector. The input vectors (or
26 the one provided via -A) are denoted the prime vector(s). Several stan‐
27 dard vector operations (angle between vectors, cross products, vector
28 sums, and vector rotations) can be selected; most require a single sec‐
29 ond vector, provided via -S. The output vectors will be converted back
30 to (lon, lat) or (r, theta) unless -Co is set which requests (x, y[,
31 z]) Cartesian coordinates.
32
34 None.
35
37 table One or more ASCII [or binary, see -bi] file containing lon,lat
38 [lat,lon if -:] values in the first 2 columns (if -fg is given)
39 or (r, theta), or perhaps (x, y[, z]) if -Ci is given). If no
40 file is specified, gmtvector, will read from standard input.
41
42 -Am[conf]|vector
43 Specify a single, primary vector instead of reading tables; see
44 tables for possible vector formats. Alternatively, append m to
45 read tables and set the single, primary vector to be the mean
46 resultant vector first. We also compute the confidence ellipse
47 for the mean vector (azimuth of major axis, major axis, and
48 minor axis; for geographic data the axes will be reported in
49 km). You may optionally append the confidence level in percent
50 [95]. These three parameters are reported in the final three
51 output columns.
52
53 -C[i|o]
54 Select Cartesian coordinates on input and output. Append i for
55 input only or o for output only; otherwise both input and output
56 will be assumed to be Cartesian [Default is polar r/theta for
57 2-D data and geographic lon/lat for 3-D].
58
59 -E Convert input geographic coordinates from geodetic to geocentric
60 and output geographic coordinates from geocentric to geodetic.
61 Ignored unless -fg is in effect, and is bypassed if -C is
62 selected.
63
64 -N Normalize the resultant vectors prior to reporting the output
65 [No normalization]. This only has an effect if -Co is selected.
66
67 -S[vector]
68 Specify a single, secondary vector in the same format as the
69 first vector. Required by operations in -T that need two vectors
70 (average, bisector, dot product, cross product, and sum).
71
72 -Ta|d|D|paz|s|r[arg|R|x]
73 Specify the vector transformation of interest. Append a for
74 average, b for the pole of the two points bisector, d for dot
75 product (use D to get angle in degrees between the two vectors),
76 paz for the pole to the great circle specified by input vector
77 and the circle's az (no second vector used), s for vector sum,
78 rpar for vector rotation (here, par is a single angle for 2-D
79 Cartesian data and lon/lat/angle for a 3-D rotation pole and
80 angle), R will instead rotate the fixed secondary vector by the
81 rotations implied by the input records, and x for cross-product.
82 If -T is not given then no transformation takes place; the out‐
83 put is determined by other options such as -A, -C, -E, and -N.
84
85 -V[level] (more ...)
86 Select verbosity level [c].
87
88 -bi[ncols][t] (more ...)
89 Select native binary input. [Default is 2 or 3 input columns].
90
91 -d[i|o]nodata (more ...)
92 Replace input columns that equal nodata with NaN and do the
93 reverse on output.
94
95 -e[~]"pattern" | -e[~]/regexp/[i] (more ...)
96 Only accept data records that match the given pattern.
97
98 -f[i|o]colinfo (more ...)
99 Specify data types of input and/or output columns.
100
101 -g[a]x|y|d|X|Y|D|[col]z[+|-]gap[u] (more ...)
102 Determine data gaps and line breaks.
103
104 -h[i|o][n][+c][+d][+rremark][+rtitle] (more ...)
105 Skip or produce header record(s).
106
107 -icols[+l][+sscale][+ooffset][,...] (more ...)
108 Select input columns and transformations (0 is first column).
109
110 -ocols[,...] (more ...)
111 Select output columns (0 is first column).
112
113 -:[i|o] (more ...)
114 Swap 1st and 2nd column on input and/or output.
115
116 -^ or just -
117 Print a short message about the syntax of the command, then
118 exits (NOTE: on Windows just use -).
119
120 -+ or just +
121 Print an extensive usage (help) message, including the explana‐
122 tion of any module-specific option (but not the GMT common
123 options), then exits.
124
125 -? or no arguments
126 Print a complete usage (help) message, including the explanation
127 of all options, then exits.
128
130 The ASCII output formats of numerical data are controlled by parameters
131 in your gmt.conf file. Longitude and latitude are formatted according
132 to FORMAT_GEO_OUT, absolute time is under the control of FOR‐
133 MAT_DATE_OUT and FORMAT_CLOCK_OUT, whereas general floating point val‐
134 ues are formatted according to FORMAT_FLOAT_OUT. Be aware that the for‐
135 mat in effect can lead to loss of precision in ASCII output, which can
136 lead to various problems downstream. If you find the output is not
137 written with enough precision, consider switching to binary output (-bo
138 if available) or specify more decimals using the FORMAT_FLOAT_OUT set‐
139 ting.
140
142 Suppose you have a file with lon, lat called points.txt. You want to
143 compute the spherical angle between each of these points and the loca‐
144 tion 133/34. Try
145
146 gmt vector points.txt -S133/34 -TD -fg > angles.txt
147
148 To rotate the same points 35 degrees around a pole at 133/34, and out‐
149 put Cartesian 3-D vectors, use
150
151 gmt vector points.txt -Tr133/34/35 -Co -fg > reconstructed.txt
152
153 To rotate the point 65/33 by all rotations given in file rots.txt, use
154
155 gmt vector rots.txt -TR -S64/33 -fg > reconstructed.txt
156
157 To compute the cross-product between the two Cartesian vectors 0.5/1/2
158 and 1/0/0.4, and normalizing the result, try
159
160 gmt vector -A0.5/1/2 -Tx -S1/0/0.4 -N -C > cross.txt
161
162 To rotate the 2-D vector, given in polar form as r = 2 and theta = 35,
163 by an angle of 120, try
164
165 gmt vector -A2/35 -Tr120 > rotated.txt
166
167 To find the mid-point along the great circle connecting the points
168 123/35 and -155/-30, use
169
170 gmt vector -A123/35 -S-155/-30 -Ta -fg > midpoint.txt
171
172 To find the mean location of the geographical points listed in
173 points.txt, with its 99% confidence ellipse, use
174
175 gmt vector points.txt -Am99 -fg > centroid.txt
176
177 To find the pole corresponding to the great circle that goes through
178 the point -30/60 at an azimuth of 105 degrees, use
179
180 gmt vector -A-30/60 -Tp105 -fg > pole.txt
181
183 For more advanced 3-D rotations as used in plate tectonic reconstruc‐
184 tions, see the GMT "spotter" supplement.
185
187 gmt, project, mapproject
188
190 2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
191
192
193
194
1955.4.5 Feb 24, 2019 GMTVECTOR(1)