Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

project.rst 12 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
  1. .. index:: ! project
  2. .. include:: module_core_purpose.rst_
  3. *******
  4. project
  5. *******
  6. |project_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt project** [ *table* ] |-C|\ *cx*/*cy* [ |-A|\ *azimuth* ]
  11. [ |-E|\ *bx*/*by* ] [ |-F|\ *flags* ]
  12. [ |-G|\ *dist*\ [/*colat*][**+c**\|\ **h**] ]
  13. [ |-L|\ [**w**\|\ *l\_min*/*l\_max*] ]
  14. [ |-N| ] [ |-Q| ] [ |-S| ]
  15. [ |-T|\ *px*/*py* ]
  16. [ |SYN_OPT-V| ]
  17. [ |-W|\ *w\_min*/*w\_max* ]
  18. [ |-Z|\ *major*/*minor*/*azimuth*\ [**+e**] ]
  19. [ |SYN_OPT-b| ]
  20. [ |SYN_OPT-d| ]
  21. [ |SYN_OPT-e| ]
  22. [ |SYN_OPT-f| ]
  23. [ |SYN_OPT-g| ]
  24. [ |SYN_OPT-h| ]
  25. [ |SYN_OPT-i| ]
  26. [ |SYN_OPT-o| ]
  27. [ |SYN_OPT-q| ]
  28. [ |SYN_OPT-s| ]
  29. [ |SYN_OPT-:| ]
  30. [ |SYN_OPT--| ]
  31. |No-spaces|
  32. Description
  33. -----------
  34. **project** reads arbitrary (*x*, *y*\ [,\ *z*]) data from standard input
  35. [or *table* ] and writes to standard output any combination of (*x*,
  36. *y*, *z*, *p*, *q*, *r*, *s*), where (*p*, *q*) are the coordinates in
  37. the projection, (*r*, *s*) is the position in the (*x*, *y*) coordinate
  38. system of the point on the profile (*q* = 0 path) closest to (*x*, *y*),
  39. and *z* is all remaining columns in the input (beyond the required *x*
  40. and *y* columns).
  41. Alternatively, **project** may be used to generate (*r*, *s*, *p*)
  42. triples at equal increments *dist* along a profile. In this case (
  43. **-G** option), no input is read.
  44. Projections are defined in any (but only) one of three ways:
  45. (Definition 1) By a Center **-C** and an Azimuth **-A** in degrees
  46. clockwise from North.
  47. (Definition 2) By a Center **-C** and end point E of the projection path **-E**.
  48. (Definition 3) By a Center **-C** and a roTation pole position **-T**.
  49. To spherically project data along a great circle path, an oblique
  50. coordinate system is created which has its equator along that path, and
  51. the zero meridian through the Center. Then the oblique longitude
  52. (*p*) corresponds to the distance from the Center
  53. along the great circle, and the oblique latitude (*q*) corresponds to
  54. the distance perpendicular to the great circle path. When moving in the
  55. increasing (*p*) direction, (toward *B* or in the
  56. *azimuth* direction), the positive (*q*) direction is to your left. If a
  57. Pole has been specified, then the positive (*q*) direction is toward the
  58. pole.
  59. To specify an oblique projection, use the **-T** option to set the Pole.
  60. Then the equator of the projection is already determined and the **-C**
  61. option is used to locate the *p* = 0 meridian. The Center *cx/cy* will
  62. be taken as a point through which the *p* = 0 meridian passes. If you do
  63. not care to choose a particular point, use the South pole (*ox* = 0,
  64. *oy* = -90).
  65. Data can be selectively windowed by using the **-L** and **-W** options.
  66. If **-W** is used, the projection Width is set to use only points with
  67. *w\_min* < q < *w\_max*. If **-L** is set, then the Length is set to use
  68. only those points with *l\_min* < p < *l\_max*. If the **-E** option has
  69. been used to define the projection, then **-Lw** may be selected to
  70. window the length of the projection to exactly the span from **O** to
  71. **B**.
  72. Flat Earth (Cartesian) coordinate transformations can also be made. Set
  73. **-N** and remember that *azimuth* is clockwise from North (the *y*
  74. axis), NOT the usual cartesian theta, which is counterclockwise from the
  75. *x* axis. *azimuth* = 90 - theta.
  76. No assumptions are made regarding the units for *x*, *y*, *r*, *s*, *p*,
  77. *q*, *dist*, *l\_min*, *l\_max*, *w\_min*, *w\_max*. If **-Q** is
  78. selected, map units are assumed and *x*, *y*, *r*, *s* must be in
  79. degrees and *p*, *q*, *dist*, *l\_min*, *l\_max*, *w\_min*, *w\_max*
  80. will be in km.
  81. Calculations of specific great-circle and geodesic distances or for
  82. back-azimuths or azimuths are better done using :doc:`mapproject` as
  83. **project** is strictly spherical.
  84. **project** is CASE SENSITIVE. Use UPPER CASE for all one-letter
  85. designators which begin optional arguments. Use lower case for the
  86. xyzpqrs letters in **F**\ *flags*.
  87. Required Arguments
  88. ------------------
  89. .. _-C:
  90. **-C**\ *cx*/*cy*
  91. *cx/cy* sets the origin of the projection, in Definition 1 or 2. If
  92. Definition 3 is used (**-T**), then *cx/cy* are the coordinates of a
  93. point through which the oblique zero meridian (*p* = 0) should pass.
  94. The *cx/cy* is not required to be 90 degrees from the pole.
  95. Optional Arguments
  96. ------------------
  97. .. |Add_intables| unicode:: 0x20 .. just an invisible code
  98. .. include:: explain_intables.rst_
  99. .. _-A:
  100. **-A**\ *azimuth*
  101. *azimuth* defines the azimuth of the projection (Definition 1).
  102. .. _-E:
  103. **-E**\ *bx*/*by*
  104. *bx/by* defines the end point of the projection path (Definition 2).
  105. .. _-F:
  106. **-F**\ *flags*
  107. Specify your desired output using any combination of **xyzpqrs**, in
  108. any order [Default is **xyzpqrs**]. Do not space between the letters.
  109. Use lower case. The output will be ASCII (or binary, see **-bo**)
  110. columns of values corresponding to your *flags*. The **z** flag is
  111. special and refers to all numerical columns beyond the leading **x** and **y** in
  112. your input record. If output format is ASCII then **z** also includes any
  113. trailing text (which is placed at the end of the record regardless
  114. of the order of **z** in *flags*). **Note**: If **-G** is selected, then the
  115. output order is hardwired to be **rsp** and **-F** is not allowed.
  116. .. _-G:
  117. **-G**\ *dist*\ [/*colat*][**+c**\|\ **h**]
  118. Generate mode. No input is read. Create (*r*, *s*, *p*) output
  119. points every *dist* units of *p*. See **-Q** option. Alternatively,
  120. append **/**\ *colat* for a small circle instead [Default is a
  121. colatitude of 90, i.e., a great circle]. If setting a pole with **-T**
  122. and you want the small circle to go through *cx*/*cy*, append **+c** to
  123. compute the required colatitude. Use **-C** and **-E** to
  124. generate a circle that goes through the center and end point. Note,
  125. in this case the center and end point cannot be farther apart than
  126. 2\*\|\ *colat*\|. Finally, if you append **+h** the we will report
  127. the position of the pole as part of the segment header [no header].
  128. .. _-L:
  129. **-L**\ [**w**\|\ *l\_min*/*l\_max*]
  130. Length controls. Project only those points whose *p* coordinate is
  131. within *l\_min* < *p* < *l\_max*. If **-E** has been set, then you
  132. may alternatively use **-Lw** to stay within the distance from **C** to **E**.
  133. .. _-N:
  134. **-N**
  135. Flat Earth. Make a Cartesian coordinate transformation in the plane.
  136. [Default uses spherical trigonometry.]
  137. .. _-Q:
  138. **-Q**
  139. Map type units, i.e., project assumes *x*, *y*, *r*, *s* are in
  140. degrees while *p*, *q*, *dist*, *l\_min*, *l\_max*, *w\_min*,
  141. *w\_max* are in km. If **-Q** is not set, then all these are assumed
  142. to be in the same units.
  143. .. _-S:
  144. **-S**
  145. Sort the output into increasing *p* order. Useful when projecting
  146. random data into a sequential profile.
  147. .. _-T:
  148. **-T**\ *px*/*py*
  149. *px/py* sets the position of the rotation pole of the projection.
  150. (Definition 3).
  151. .. _-V:
  152. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  153. .. include:: explain_-V.rst_
  154. .. _-W:
  155. **-W**\ *w\_min*/*w\_max*
  156. Width controls. Project only those points whose *q* coordinate is
  157. within *w\_min* < *q* < *w\_max*.
  158. **-Z**\ *major*/*minor*/*azimuth*\ [**+e**]
  159. Used in conjunction with **-C** (sets its center) and **-G** (sets the
  160. distance increment) to create the coordinates of an ellipse
  161. with *major* and *minor* axes given in km (unless **-N** is given) and the *azimuth* of the
  162. major axis in degrees. Append **+e** to adjust the increment set via
  163. **-G** so that the the ellipse has equal distance increments [Default
  164. uses the given increment and closes the ellipse].
  165. .. |Add_-bi| replace:: [Default is 2 input columns].
  166. .. include:: explain_-bi.rst_
  167. .. |Add_-bo| replace:: [Default is given by **-F** or **-G**].
  168. .. include:: explain_-bo.rst_
  169. .. |Add_-d| unicode:: 0x20 .. just an invisible code
  170. .. include:: explain_-d.rst_
  171. .. |Add_-e| unicode:: 0x20 .. just an invisible code
  172. .. include:: explain_-e.rst_
  173. .. |Add_-f| unicode:: 0x20 .. just an invisible code
  174. .. include:: explain_-f.rst_
  175. .. |Add_-g| unicode:: 0x20 .. just an invisible code
  176. .. include:: explain_-g.rst_
  177. .. |Add_-h| unicode:: 0x20 .. just an invisible code
  178. .. include:: explain_-h.rst_
  179. .. include:: explain_-icols.rst_
  180. .. include:: explain_-ocols.rst_
  181. .. include:: explain_-q.rst_
  182. .. include:: explain_-s.rst_
  183. .. include:: explain_colon.rst_
  184. .. include:: explain_help.rst_
  185. .. include:: explain_precision.rst_
  186. Examples
  187. --------
  188. .. include:: explain_example.rst_
  189. To project the remote data sets ship_03.txt (lon,lat,depth) onto a great circle specified by
  190. the two points (330,-18) and (53,21) and sort the records on the projected distances along
  191. that circle and only output the distance and the depths, try::
  192. gmt project @ship_03.txt -C330/-18 -T53/21 -S -Fpz -Q > ship_proj.txt
  193. To generate points every 10km along a great circle from 10N,50W to 30N,10W:
  194. ::
  195. gmt project -C-50/10 -E-10/30 -G10 -Q > great_circle_points.xyp
  196. (Note that great_circle_points.xyp could now be used as input for :doc:`grdtrack`, etc. ).
  197. To generate points every 1 degree along a great circle from 30N,10W with
  198. azimuth 30 and covering a full 360, try:
  199. ::
  200. gmt project -C10W/30N -A30 -G1 -L-180/180 > great_circle.txt
  201. To generate points every 10km along a small circle of colatitude 60 from 10N,50W to 30N,10W:
  202. ::
  203. gmt project -C-50/10 -E-10/30 -G10/60 -Q > small_circle_points.xyp
  204. To create a partial small circle of colatitude 80 about a pole at
  205. 40E,85N, with extent of 45 degrees to either side of the meridian
  206. defined by the great circle from the pole to a point 15E,15N, try
  207. ::
  208. gmt project -C15/15 -T40/85 -G1/80 -L-45/45 > some_circle.xyp
  209. To generate points approximately every 10km along an ellipse centered on (30W,70N) with
  210. major axis of 1500 km with azimuth of 30 degree and a minor axis of 600 km, try
  211. ::
  212. gmt project -C-30/70 -G10 -Z1500/600/30+e > ellipse.xyp
  213. To project the shiptrack gravity, magnetics, and bathymetry in
  214. c2610.xygmb along a great circle through an origin at 30S, 30W, the
  215. great circle having an azimuth of N20W at the origin, keeping only the
  216. data from NE of the profile and within ±\ 500 km of the origin, run:
  217. ::
  218. gmt project c2610.xygmb -C-30/-30 -A-20 -W-10000/0 -L-500/500 -Fpz -Q > c2610_projected.pgmb
  219. (Note in this example that **-W**-10000/0 is used to admit any value
  220. with a large negative *q* coordinate. This will take those points which
  221. are on our right as we walk along the great circle path, or to the NE in this example.)
  222. To make a Cartesian coordinate transformation of mydata.xy so that the
  223. new origin is at 5,3 and the new *x* axis (*p*) makes
  224. an angle of 20 degrees with the old *x* axis, use:
  225. ::
  226. gmt project mydata.xy -C5/3 -A70 -Fpq > mydata.pq
  227. To take data in the file pacific.lonlat and transform it into oblique
  228. coordinates using a pole from the hotspot reference frame and placing
  229. the oblique zero meridian (*p* = 0 line) through Tahiti, run:
  230. ::
  231. gmt project pacific.lonlat -T-75/68 -C-149:26/-17:37 -Fpq > pacific.pq
  232. Suppose that pacific_topo.nc is a grid file of bathymetry, and you want
  233. to make a file of flowlines in the hotspot reference frame. If you run:
  234. ::
  235. gmt grd2xyz pacific_topo.nc | gmt project -T-75/68 -C0/-90 -Fxyq | gmt xyz2grd -Retc -Ietc -Cflow.nc
  236. then flow.nc is a file in the same area as pacific_topo.nc, but flow
  237. contains the latitudes about the pole of the projection. You now can use
  238. grdcontour on flow.nc to draw lines of constant oblique latitude, which
  239. are flow lines in the hotspot frame.
  240. If you have an arbitrarily rotation pole *px/py* and you would like to
  241. draw an oblique small circle on a map, you will first need to make a
  242. file with the oblique coordinates for the small circle (i.e., lon =
  243. 0-360, lat is constant), then create a file with two records: the north
  244. pole (0/90) and the origin (0/0), and find what their oblique
  245. coordinates are using your rotation pole. Now, use the projected North
  246. pole and origin coordinates as the rotation pole and center,
  247. respectively, and project your file as in the pacific example above.
  248. This gives coordinates for an oblique small circle.
  249. See Also
  250. --------
  251. :doc:`fitcircle`,
  252. :doc:`gmt`,
  253. :doc:`gmtvector`,
  254. :doc:`grdtrack`,
  255. :doc:`mapproject`,
  256. :doc:`grdproject`,
  257. :doc:`grdtrack`
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...