1SPLITXYZ(1)                           GMT                          SPLITXYZ(1)
2
3
4

NAME

6       splitxyz - Split xyz[dh] data tables into individual segments
7

SYNOPSIS

9       splitxyz  [  table  ]  [   -Aazimuth/tolerance  ] [  -Ccourse_change] [
10       -Dminimum_distance ]  [   -Fxy_filter/z_filter  ]  [   -Ntemplate  ]  [
11       -Qflags ] [  -S ] [  -V[level] ] [ -bbinary ] [ -dnodata ] [ -eregexp ]
12       [ -fflags ] [ -ggaps ] [ -hheaders ] [ -iflags ] [ -:[i|o] ]
13
14       Note: No space is allowed between the option flag  and  the  associated
15       arguments.
16

DESCRIPTION

18       splitxyz   reads   a   series   of  (x,y[,z])  records  [or  optionally
19       (x,y,z,d,h); see -S option] from standard input  [or  xyz[dh]file]  and
20       splits  this  into  separate  lists of (x,y[,z]) series, such that each
21       series has a nearly constant azimuth through the x,y plane.  There  are
22       options  to  choose only those series which have a certain orientation,
23       to set a minimum length for series, and to high- or low-pass filter the
24       z  values  and/or  the  x,y values. splitxyz is a useful filter between
25       data extraction and pswiggle plotting, and can also be used to divide a
26       large x,y[,z] dataset into segments.
27

REQUIRED ARGUMENTS

29       none.
30

OPTIONAL ARGUMENTS

32       table  One  or  more  ASCII  [or binary, see -bi] files with 2, 3, or 5
33              columns holding (x,y,[z[,d,h]]) data values. To use  (x,y,z,d,h)
34              input,  sorted  so  that  d  is  non-decreasing,  specify the -S
35              option; default expects (x,y,z) only. If no files are specified,
36              splitxyz will read from standard input.
37
38       -Aazimuth/tolerance
39              Write  out  only  those  segments which are within +/- tolerance
40              degrees of azimuth in heading, measured clockwise from North, [0
41              -  360].  [Default writes all acceptable segments, regardless of
42              orientation].
43
44       -Ccourse_change
45              Terminate a segment when a course change exceeding course_change
46              degrees of heading is detected [ignore course changes].
47
48       -Dminimum_distance
49              Do  not  write  a segment out unless it is at least minimum_dis‐
50              tance units long [0]
51
52       -Fxy_filter/z_filter
53              Filter the z values and/or the x,y values,  assuming  these  are
54              functions  of  d  coordinate.  xy_filter and z_filter are filter
55              widths in distance units. If a filter width is zero, the filter‐
56              ing  is  not  performed.  The absolute value of the width is the
57              full width of a cosine-arch low-pass filter.  If  the  width  is
58              positive,  the data are low-pass filtered; if negative, the data
59              are high-pass filtered by subtracting the  low-pass  value  from
60              the  observed  value. If z_filter is non-zero, the entire series
61              of input z values is filtered before any  segmentation  is  per‐
62              formed, so that the only edge effects in the filtering will hap‐
63              pen at the beginning and end of the  complete  data  stream.  If
64              xy_filter  is  non-zero, the data is first divided into segments
65              and then the x,y values of each segment are filtered separately.
66              This may introduce edge effects at the ends of each segment, but
67              prevents a low-pass x,y filter from rounding off the corners  of
68              track segments. [Default = no filtering].
69
70       -Ntemplate
71              Write  each  segment to a separate output file [Default writes a
72              multiple segment file to stdout]. Append a format  template  for
73              the individual file names; this template must contain a C format
74              specifier that can format an integer argument (the running  seg‐
75              ment  number across all tables); this is usually %d but could be
76              %08d which gives leading zeros, etc. [Default  is  splitxyz_seg‐
77              ment_%d.{txt|bin}, depending on -bo]. Alternatively, give a tem‐
78              plate with two C format specifiers and we will supply the  table
79              number and the segment number within the table to build the file
80              name.
81
82       -Qflags
83              Specify your desired output using any combination of  xyzdh,  in
84              any order. Do not space between the letters. Use lower case. The
85              output will be ASCII (or binary, see -bo) columns of values cor‐
86              responding  to xyzdh [Default is -Qxyzdh (-Qxydh if only 2 input
87              columns)].
88
89       -S     Both d  and  h  are  supplied.  In  this  case,  input  contains
90              x,y,z,d,h.  [Default expects (x,y,z) input, and d,h are computed
91              from delta x, delta y. Use -fg to indicate map  data;  then  x,y
92              are  assumed  to be in degrees of longitude, latitude, distances
93              are considered to be in  kilometers,  and  angles  are  actually
94              azimuths.  Otherwise,  distances  are Cartesian in same units as
95              x,y and angles are counter-clockwise from horizontal].
96
97       -V[level] (more ...)
98              Select verbosity level [c].
99
100       -bi[ncols][t] (more ...)
101              Select native binary input. [Default is 2, 3, or 5 input columns
102              as set by -S].
103
104       -bo[ncols][type] (more ...)
105              Select  native  binary output. [Default is 1-5 output columns as
106              set by -Q].
107
108       -d[i|o]nodata (more ...)
109              Replace input columns that equal nodata  with  NaN  and  do  the
110              reverse on output.
111
112       -e[~]"pattern" | -e[~]/regexp/[i] (more ...)
113              Only accept data records that match the given pattern.
114
115       -f[i|o]colinfo (more ...)
116              Specify data types of input and/or output columns.
117
118       -g[a]x|y|d|X|Y|D|[col]z[+|-]gap[u] (more ...)
119              Determine data gaps and line breaks. Do not let a segment have a
120              gap exceeding gap; instead, split it into two segments. [Default
121              ignores gaps].
122
123       -h[i|o][n][+c][+d][+rremark][+rtitle] (more ...)
124              Skip or produce header record(s).
125
126       -icols[+l][+sscale][+ooffset][,...] (more ...)
127              Select input columns and transformations (0 is first column).
128
129       -:[i|o] (more ...)
130              Swap 1st and 2nd column on input and/or output.
131
132       -^ or just -
133              Print  a  short  message  about  the syntax of the command, then
134              exits (NOTE: on Windows just use -).
135
136       -+ or just +
137              Print an extensive usage (help) message, including the  explana‐
138              tion  of  any  module-specific  option  (but  not the GMT common
139              options), then exits.
140
141       -? or no arguments
142              Print a complete usage (help) message, including the explanation
143              of all options, then exits.
144

ASCII FORMAT PRECISION

146       The ASCII output formats of numerical data are controlled by parameters
147       in your gmt.conf file. Longitude and latitude are  formatted  according
148       to   FORMAT_GEO_OUT,  absolute  time  is  under  the  control  of  FOR‐
149       MAT_DATE_OUT and FORMAT_CLOCK_OUT, whereas general floating point  val‐
150       ues are formatted according to FORMAT_FLOAT_OUT. Be aware that the for‐
151       mat in effect can lead to loss of precision in ASCII output, which  can
152       lead  to  various  problems  downstream.  If you find the output is not
153       written with enough precision, consider switching to binary output (-bo
154       if  available) or specify more decimals using the FORMAT_FLOAT_OUT set‐
155       ting.
156

DISTANCE CALCULATIONS

158       The type of input data is dictated by the -f option. If  -fg  is  given
159       then  x,y are in degrees of longitude, latitude, distances are in kilo‐
160       meters, and angles are azimuths. Otherwise, distances are Cartesian  in
161       same units as x,y and angles are counter-clockwise from horizontal.
162

EXAMPLES

164       Suppose  you  want  to make a wiggle plot of magnetic anomalies on seg‐
165       ments oriented approximately  east-west  from  a  NGDC-supplied  cruise
166       called JA020015 in the region -R300/315/12/20. You want to use a 100 km
167       low-pass filter to smooth the tracks and a 500km  high-pass  filter  to
168       detrend the magnetic anomalies. Try this:
169
170              gmt mgd77list JA020015 -R300/315/12/20 -Flon,lat,mag,dist,azim | gmt splitxyz -A90/15 -F100/-500 \
171                  -D100 -S -V -fg | gmt pswiggle -R300/315/12/20 -Jm0.6i -Baf -B+tJA020015 -T1 \
172                  -W0.75p -Ggray -Z200 > JA020015_wiggles.ps
173
174       MGD-77  users:  For  this  application  we  recommend  that you extract
175       dist,azim from mgd77list rather than have splitxyz compute  them  sepa‐
176       rately.
177
178       Suppose  you have been given a binary, double-precision file containing
179       lat, lon, gravity values from a survey, and you want to split  it  into
180       profiles named survey_###.txt (when gap exceeds 100 km). Try this:
181
182              gmt splitxyz survey.bin -Nsurvey_%03d.txt -V -gd100k -D100 -: -fg -bi3d
183

SEE ALSO

185       gmt, filter1d, mgd77list, pswiggle
186
188       2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
189
190
191
192
1935.4.5                            Feb 24, 2019                      SPLITXYZ(1)
Impressum