1SAMPLE1D(1) Generic Mapping Tools SAMPLE1D(1)
2
3
4
6 sample1d - Resampling of 1-D data sets
7
9 sample1d infile [ -Fl|a|c|n ] [ -H[i][nrec] ] [ -Ixinc ] [
10 -M[i|o][flag] ] [ -Nknotfile ] [ -Sxstart ] [ -Tx_col] [ -V ] [
11 -b[i|o][s|S|d|D[ncol]|c[var1/...]] ] [ -f[i|o]colinfo ]
12
14 sample1d reads a multi-column ASCII [or binary] data set from file [or
15 standard input] and interpolates the timeseries/profile at locations
16 where the user needs the values. The user must provide the column num‐
17 ber of the independent (monotonically increasing or decreasing) vari‐
18 able. Equidistant or arbitrary sampling can be selected. All columns
19 are resampled based on the new sampling interval. Several interpola‐
20 tion schemes are available. Extrapolation outside the range of the
21 input data is not supported.
22
23 infile This is a multi-column ASCII [of binary, see -b] file with one
24 column containing the independent variable (which must be mono‐
25 tonically in/de-creasing) and the remaining columns holding
26 misc. data values. If no file is provided, sample1d reads from
27 standard input.
28
30 No space between the option flag and the associated arguments.
31
32 -F Choose from l (Linear), a (Akima spline), c (natural cubic
33 spline), and n (no interpolation: nearest point) [Default is
34 -Fa]. You may change the default interpolant; see INTERPOLANT
35 in your .gmtdefaults4 file.
36
37 -H Input file(s) has Header record(s). Number of header records
38 can be changed by editing your .gmtdefaults4 file. If used, GMT
39 default is 1 header record. Use -Hi if only input data should
40 have header records [Default will write out header records if
41 the input data have them]. Blank lines and lines starting with #
42 are always skipped.
43
44 -I xinc defines the sampling interval. [Default is the separation
45 between the first and second abscissa point in the infile]
46
47 -M Multiple segment file. Segments are separated by a record whose
48 first character is flag. [Default is '>'].
49
50 -N knotfile is an optional ASCII file with the x locations where
51 the data set will be resampled in the first column. Note: if -H
52 is selected it applies to both infile and knotfile.
53
54 -S For equidistant sampling, xstart indicates the location of the
55 first output value. [Default is the smallest even multiple of
56 xinc inside the range of infile]
57
58 -T Sets the column number of the independent variable [Default is 0
59 (first)].
60
61 -V Selects verbose mode, which will send progress reports to stderr
62 [Default runs "silently"].
63
64 -bi Selects binary input. Append s for single precision [Default is
65 d (double)]. Uppercase S or D will force byte-swapping.
66 Optionally, append ncol, the number of columns in your binary
67 input file if it exceeds the columns needed by the program. Or
68 append c if the input file is netCDF. Optionally, append
69 var1/var2/... to specify the variables to be read. [Default is
70 2 (or at least the number of columns implied by -T)].
71
72 -bo Selects binary output. Append s for single precision [Default
73 is d (double)]. Uppercase S or D will force byte-swapping.
74 Optionally, append ncol, the number of desired columns in your
75 binary output file. [Default is same as input].
76
77 -f Special formatting of input and/or output columns (time or geo‐
78 graphical data). Specify i or o to make this apply only to
79 input or output [Default applies to both]. Give one or more
80 columns (or column ranges) separated by commas. Append T (abso‐
81 lute calendar time), t (relative time in chosen TIME_UNIT since
82 TIME_EPOCH), x (longitude), y (latitude), or f (floating point)
83 to each column or column range item. Shorthand -f[i|o]g means
84 -f[i|o]0x,1y (geographic coordinates).
85
87 The ASCII output formats of numerical data are controlled by parameters
88 in your .gmtdefaults4 file. Longitude and latitude are formatted
89 according to OUTPUT_DEGREE_FORMAT, whereas other values are formatted
90 according to D_FORMAT. Be aware that the format in effect can lead to
91 loss of precision in the output, which can lead to various problems
92 downstream. If you find the output is not written with enough preci‐
93 sion, consider switching to binary output (-bo if available) or specify
94 more decimals using the D_FORMAT setting.
95
97 If the abscissa are calendar times then you must use the -f option to
98 indicate this. Furthermore, -I then expects an increment in the cur‐
99 rent TIME_UNIT units. There is not yet support for variable intervals
100 such as months.
101
103 To resample the file profiles.tdgmb, which contains (time,dis‐
104 tance,gravity,magnetics,bathymetry) records, at 1km equidistant inter‐
105 vals using Akima's spline, use
106
107 sample1d profiles.tdgmb -I1 -Fa -T1 > profiles_equi_d.tdgmb
108
109 To resample the file depths.dt at positions listed in the file
110 grav_pos.dg, using a cubic spline for the interpolation, use
111
112 sample1d depths.dt -Ngrav_pos.dg -Fc > new_depths.dt
113
115 GMT(1), filter1d(1)
116
117
118
119GMT 4.3.1 15 May 2008 SAMPLE1D(1)