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

splitxyz.rst 7.1 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
  1. .. index:: ! splitxyz
  2. .. include:: module_core_purpose.rst_
  3. ********
  4. splitxyz
  5. ********
  6. |splitxyz_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt splitxyz** [ *table* ]
  11. [ |-A|\ *azimuth*/*tolerance* ]
  12. [ |-C|\ *course_change*]
  13. [ |-D|\ *minimum_distance* ]
  14. [ |-F|\ *xy\_filter*/*z\_filter* ]
  15. [ |-N|\ *template* ]
  16. [ |-Q|\ *flags* ]
  17. [ |-S| ]
  18. [ |SYN_OPT-V| ]
  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-q| ]
  27. [ |SYN_OPT-:| ]
  28. [ |SYN_OPT--| ]
  29. |No-spaces|
  30. Description
  31. -----------
  32. **splitxyz** reads a series of (x,y[,z]) records [or optionally
  33. (x,y,z,d,h); see **-S** option] from standard input [or *xyz[dh]file*]
  34. and splits this into separate lists of (x,y[,z]) series, such that each
  35. series has a nearly constant azimuth through the x,y plane. There are
  36. options to choose only those series which have a certain orientation, to
  37. set a minimum length for series, and to high- or low-pass filter the z
  38. values and/or the x,y values. **splitxyz** is a useful filter between
  39. data extraction and :doc:`wiggle` plotting, and can also be used to
  40. divide a large x,y[,z] dataset into segments.
  41. Required Arguments
  42. ------------------
  43. none.
  44. Optional Arguments
  45. ------------------
  46. *table*
  47. One or more ASCII [or binary, see **-bi**]
  48. files with 2, 3, or 5 columns holding (x,y,[z[,d,h]])
  49. data values. To use (x,y,z,d,h) input, sorted so that d is
  50. non-decreasing, specify the **-S** option; default expects (x,y,z)
  51. only. If no files are specified, **splitxyz** will read from
  52. standard input.
  53. .. _-A:
  54. **-A**\ *azimuth*/*tolerance*
  55. Write out only those segments which are within ±\ *tolerance*
  56. degrees of *azimuth* in heading, measured clockwise from North, [0 -
  57. 360]. [Default writes all acceptable segments, regardless of
  58. orientation].
  59. .. _-C:
  60. **-C**\ *course\_change*
  61. Terminate a segment when a course change exceeding *course\_change*
  62. degrees of heading is detected [ignore course changes].
  63. .. _-D:
  64. **-D**\ *minimum\_distance*
  65. Do not write a segment out unless it is at least *minimum\_distance*
  66. units long [0]
  67. .. _-F:
  68. **-F**\ *xy\_filter*/*z\_filter*
  69. Filter the z values and/or the x,y values, assuming these are
  70. functions of d coordinate. *xy\_filter* and *z\_filter* are filter
  71. widths in distance units. If a filter width is zero, the filtering
  72. is not performed. The absolute value of the width is the full width
  73. of a cosine-arch low-pass filter. If the width is positive, the data
  74. are low-pass filtered; if negative, the data are high-pass filtered
  75. by subtracting the low-pass value from the observed value. If
  76. *z\_filter* is non-zero, the entire series of input z values is
  77. filtered before any segmentation is performed, so that the only edge
  78. effects in the filtering will happen at the beginning and end of the
  79. complete data stream. If *xy\_filter* is non-zero, the data is first
  80. divided into segments and then the x,y values of each segment are
  81. filtered separately. This may introduce edge effects at the ends of
  82. each segment, but prevents a low-pass x,y filter from rounding off
  83. the corners of track segments. [Default = no filtering].
  84. .. _-N:
  85. **-N**\ *template*
  86. Write each segment to a separate output file [Default writes a
  87. multiple segment file to stdout]. Append a format template for the
  88. individual file names; this template **must** contain a C format
  89. specifier that can format an integer argument (the running segment
  90. number across all tables); this is usually %d but could be %08d
  91. which gives leading zeros, etc. [Default is
  92. splitxyz\_segment\_%d.{txt\|bin}, depending on
  93. **-bo**]. Alternatively, give a template with
  94. two C format specifiers and we will supply the table number and the
  95. segment number within the table to build the file name.
  96. .. _-Q:
  97. **-Q**\ *flags*
  98. Specify your desired output using any combination of *xyzdh*, in any
  99. order. Do not space between the letters. Use lower case. The output
  100. will be ASCII (or binary, see **-bo**)
  101. columns of values corresponding to *xyzdh* [Default is
  102. **-Q**\ *xyzdh* (**-Q**\ *xydh* if only 2 input columns)].
  103. .. _-S:
  104. **-S**
  105. Both d and h are supplied. In this case, input contains x,y,z,d,h.
  106. [Default expects (x,y,z) input, and d,h are computed from delta x,
  107. delta y. Use **-fg** to indicate map data; then x,y are assumed to
  108. be in degrees of longitude, latitude, distances are considered to be
  109. in kilometers, and angles are actually azimuths. Otherwise,
  110. distances are Cartesian in same units as x,y and angles are
  111. counter-clockwise from horizontal].
  112. .. _-V:
  113. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  114. .. include:: explain_-V.rst_
  115. .. |Add_-bi| replace:: [Default is 2, 3, or 5 input columns as set by **-S**].
  116. .. include:: explain_-bi.rst_
  117. .. |Add_-bo| replace:: [Default is 1-5 output columns as set by **-Q**].
  118. .. include:: explain_-bo.rst_
  119. .. |Add_-d| unicode:: 0x20 .. just an invisible code
  120. .. include:: explain_-d.rst_
  121. .. |Add_-e| unicode:: 0x20 .. just an invisible code
  122. .. include:: explain_-e.rst_
  123. .. |Add_-f| unicode:: 0x20 .. just an invisible code
  124. .. include:: explain_-f.rst_
  125. .. |Add_-g| replace:: Do not let a segment have a gap exceeding *gap*; instead, split it into two segments. [Default ignores gaps].
  126. .. include:: explain_-g.rst_
  127. .. |Add_-h| unicode:: 0x20 .. just an invisible code
  128. .. include:: explain_-h.rst_
  129. .. include:: explain_-icols.rst_
  130. .. include:: explain_-q.rst_
  131. .. include:: explain_colon.rst_
  132. .. include:: explain_help.rst_
  133. .. include:: explain_precision.rst_
  134. Distance Calculations
  135. ---------------------
  136. The type of input data is dictated by the **-f** option. If **-fg** is
  137. given then x,y are in degrees of longitude, latitude, distances are in
  138. kilometers, and angles are azimuths. Otherwise, distances are Cartesian
  139. in same units as x,y and angles are counter-clockwise from horizontal.
  140. Examples
  141. --------
  142. .. include:: explain_example.rst_
  143. .. include:: oneliner_info.rst_
  144. Suppose you want to make a wiggle plot of magnetic anomalies on segments
  145. oriented approximately east-west from a NCEI-supplied cruise called JA020015 in the
  146. region **-R**\ 300/315/12/20. You want to use a 100 km low-pass filter to
  147. smooth the tracks and a 500km high-pass filter to detrend the magnetic
  148. anomalies. Try this:
  149. ::
  150. gmt mgd77list JA020015 -R300/315/12/20 -Flon,lat,mag,dist,azim | gmt splitxyz -A90/15 -F100/-500 \
  151. -D100 -S -V -fg | gmt wiggle -R300/315/12/20 -Jm0.6i -Baf -B+tJA020015 -T1 \
  152. -W0.75p -Ggray -Z200 -pdf JA020015_wiggles
  153. MGD-77 users: For this application we recommend that you extract dist,azim
  154. from :doc:`mgd77list <supplements/mgd77/mgd77list>` rather than have
  155. **splitxyz** compute them separately.
  156. Suppose you have been given a binary, double-precision file containing
  157. lat, lon, gravity values from a survey, and you want to split it into
  158. profiles named *survey*\ \_\ *###.txt* (when gap exceeds 100 km). Try this:
  159. ::
  160. gmt splitxyz survey.bin -Nsurvey_%03d.txt -V -gd100k -D100 -: -fg -bi3d
  161. See Also
  162. --------
  163. :doc:`gmt`,
  164. :doc:`filter1d`,
  165. :doc:`mgd77list <supplements/mgd77/mgd77list>`,
  166. :doc:`wiggle`
Tip!

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

Comments

Loading...