1FILTER1D(1) Generic Mapping Tools FILTER1D(1)
2
3
4
6 filter1d - Time domain filtering of 1-D time series
7
9 filter1d [ infile ] -F<type><width>[mode] [ -Dincrement ] [ -E ] [
10 -H[i][nrec] ] [ -Iignore_val ] [ -Llack_width ] [ -Nn_cols/t_col ] [
11 -Qq_factor ] [ -Ssymmetry_factor ] [ -Tstart/stop/int ] [ -V ] [
12 -b[i|o][s|S|d|D[ncol]|c[var1/...]] ] [ -f[i|o]colinfo ]
13
15 filter1d is a general time domain filter for multiple column time
16 series data. The user specifies the number of columns of input and
17 which column is the time. (See -N option below). The fastest opera‐
18 tion occurs when the input time series are equally spaced and have no
19 gaps or outliers and the special options are not needed. filter1d has
20 options -L, -Q, and -S for unevenly sampled data with gaps.
21
22 infile Multi-column ASCII (or binary, see -b) file holding data values
23 to be filtered.
24
25 -F Sets the filter type. Choose among convolution and non-convolu‐
26 tion filters. Append the filter code followed by the full fil‐
27 ter width in same units as time column. Available convolution
28 filters are:
29 (b) Boxcar: All weights are equal.
30 (c) Cosine Arch: Weights follow a cosine arch curve.
31 (g) Gaussian: Weights are given by the Gaussian function.
32 (f) Custom: Instead of width give name of a one-column file with
33 your own weight coefficients.
34 Non-convolution filters are:
35 (m) Median: Returns median value.
36 (p) Maximum likelihood probability (a mode estimator): Return
37 modal value. If more than one mode is found we return their
38 average value. Append - or + to the filter width if you rather
39 want to return the smallest or largest of the modal values.
40 (l) Lower: Return the minimum of all values.
41 (L) Lower: Return minimum of all positive values only.
42 (u) Upper: Return maximum of all values.
43 (U) Upper: Return maximum or all negative values only.
44 Upper case type B, C, G, M, P, F will use robust filter ver‐
45 sions: i.e., replace outliers (2.5 L1 scale off median) with
46 median during filtering.
47 In the case of L|U it is possible that no data passes the ini‐
48 tial sign test; in that case the filter will return 0.0.
49
51 -D increment is used when series is NOT equidistantly sampled.
52 Then increment will be the abscissae resolution, i.e., all
53 abscissae will be rounded off to a multiple of increment.
54 Alternatively, resample data with sample1d.
55
56 -E Include Ends of time series in output. Default loses half the
57 filter-width of data at each end.
58
59 -H Input file(s) has Header record(s). Number of header records
60 can be changed by editing your .gmtdefaults4 file. If used, GMT
61 default is 1 header record. Use -Hi if only input data should
62 have header records [Default will write out header records if
63 the input data have them]. Blank lines and lines starting with #
64 are always skipped.
65
66 -I To ignore values; If an input value equals ignore_val it will be
67 set to NaN.
68
69 -L Checks for Lack of data condition. If input data has a gap
70 exceeding width then no output will be given at that point
71 [Default does not check Lack].
72
73 -N Sets number of columns in input and which column contains the
74 independent variable (time). The left-most column is # 0, the
75 right-most is # (n_cols - 1). [Default is n_cols = 2, t_col =
76 0; i.e., file has t, f(t) pairs].
77
78 -Q assess Quality of output value by checking mean weight in convo‐
79 lution. Enter q_factor between 0 and 1. If mean weight <
80 q_factor, output is suppressed at this point [Default does not
81 check Quality].
82
83 -S Checks symmetry of data about window center. Enter a factor
84 between 0 and 1. If ( (abs(n_left - n_right)) / (n_left +
85 n_right) ) > factor, then no output will be given at this point
86 [Default does not check Symmetry].
87
88 -T Make evenly spaced timesteps from start to stop by int [Default
89 uses input times].
90
91 -V Selects verbose mode, which will send progress reports to stderr
92 [Default runs "silently"].
93
94 -bi Selects binary input. Append s for single precision [Default is
95 d (double)]. Uppercase S or D will force byte-swapping.
96 Optionally, append ncol, the number of columns in your binary
97 input file if it exceeds the columns needed by the program. Or
98 append c if the input file is netCDF. Optionally, append
99 var1/var2/... to specify the variables to be read.
100
101 -bo Selects binary output. Append s for single precision [Default
102 is d (double)]. Uppercase S or D will force byte-swapping.
103 Optionally, append ncol, the number of desired columns in your
104 binary output file. [Default is same as input].
105
106 -f Special formatting of input and/or output columns (time or geo‐
107 graphical data). Specify i or o to make this apply only to
108 input or output [Default applies to both]. Give one or more
109 columns (or column ranges) separated by commas. Append T (abso‐
110 lute calendar time), t (relative time in chosen TIME_UNIT since
111 TIME_EPOCH), x (longitude), y (latitude), or f (floating point)
112 to each column or column range item. Shorthand -f[i|o]g means
113 -f[i|o]0x,1y (geographic coordinates).
114
116 The ASCII output formats of numerical data are controlled by parameters
117 in your .gmtdefaults4 file. Longitude and latitude are formatted
118 according to OUTPUT_DEGREE_FORMAT, whereas other values are formatted
119 according to D_FORMAT. Be aware that the format in effect can lead to
120 loss of precision in the output, which can lead to various problems
121 downstream. If you find the output is not written with enough preci‐
122 sion, consider switching to binary output (-bo if available) or specify
123 more decimals using the D_FORMAT setting.
124
126 To filter the data set in the file cruise.gmtd containing evenly spaced
127 gravity, magnetics, topography, and distance (in m) with a 10 km Gauss‐
128 ian filter, removing outliers, and output a filtered value every 2 km
129 between 0 and 100 km:
130
131 filter1d cruise.gmtd -T0/1.0e5/2000 -FG10000 -N4/3 -V > fil‐
132 tered_cruise.gmtd
133
134 Data along track often have uneven sampling and gaps which we do not
135 want to interpolate using sample1d. To find the median depth in a 50
136 km window every 25 km along the track of cruise v3312, stored in
137 v3312.dt, checking for gaps of 10km and asymmetry of 0.3:
138
139 filter1d v3312.dt -FM50 -T0/100000/25 -L10 -S0.3 > v3312_filt.dt
140
142 GMT(1), sample1d(1)
143
144
145
146GMT 4.3.1 15 May 2008 FILTER1D(1)