Provided by: gmt_4.5.11-1build1_amd64

**NAME**

filter1d - Time domain filtering of 1-D time series

**SYNOPSIS**

filter1d[infile]-F<type><width>[mode] [-Dincrement] [-E] [-H[i][nrec] ] [-Iignore_val] [-Llack_width] [-Nn_cols/t_col] [-Qq_factor] [-Ssymmetry_factor] [-Tstart/stop/int] [-V] [-b[i|o][s|S|d|D[ncol]|c[var1/...]] ] [-f[i|o]colinfo]

**DESCRIPTION**

filter1dis a general time domain filter for multiple column time series data. The user specifies the number of columns of input and which column is the time. (See-Noption below). The fastest operation occurs when the input time series are equally spaced and have no gaps or outliers and the special options are not needed.filter1dhas options-L,-Q, and-Sfor unevenly sampled data with gaps.infileMulti-column ASCII (or binary, see-b) file holding data values to be filtered.-FSets the filter type. Choose among convolution and non-convolution filters. Append the filter code followed by the full filterwidthin same units as time column. Available convolution filters are: (b) Boxcar: All weights are equal. (c) Cosine Arch: Weights follow a cosine arch curve. (g) Gaussian: Weights are given by the Gaussian function. (f) Custom: Instead ofwidthgive name of a one-column file with your own weight coefficients. Non-convolution filters are: (m) Median: Returns median value. (p) Maximum likelihood probability (a mode estimator): Return modal value. If more than one mode is found we return their average value. Append - or + to the filter width if you rather want to return the smallest or largest of the modal values. (l) Lower: Return the minimum of all values. (L) Lower: Return minimum of all positive values only. (u) Upper: Return maximum of all values. (U) Upper: Return maximum or all negative values only. Upper case typeB,C,G,M,P,Fwill use robust filter versions: i.e., replace outliers (2.5 L1 scale off median) with median during filtering. In the case ofL|Uit is possible that no data passes the initial sign test; in that case the filter will return 0.0.

**OPTIONS**

-Dincrementis used when series is NOT equidistantly sampled. Thenincrementwill be the abscissae resolution, i.e., all abscissae will be rounded off to a multiple ofincrement. Alternatively, resample data withsample1d.-EInclude Ends of time series in output. Default loses half the filter-width of data at each end.-HInput file(s) has header record(s). If used, the default number of header records isN_HEADER_RECS. Use-Hiif only input data should have header records [Default will write out header records if the input data have them]. Blank lines and lines starting with # are always skipped.-ITo ignore values; If an input value equalsignore_valit will be set to NaN.-LChecks for Lack of data condition. If input data has a gap exceedingwidththen no output will be given at that point [Default does not check Lack].-NSets number of columns in input and which column contains the independent variable (time). The left-most column is # 0, the right-most is # (n_cols- 1). [Default isn_cols= 2,t_col= 0; i.e., file has t, f(t) pairs].-Qassess Quality of output value by checking mean weight in convolution. Enterq_factorbetween 0 and 1. If mean weight <q_factor, output is suppressed at this point [Default does not check Quality].-SChecks symmetry of data about window center. Enter a factor between 0 and 1. If ( (abs(n_left - n_right)) / (n_left + n_right) ) >factor, then no output will be given at this point [Default does not check Symmetry].-TMake evenly spaced timesteps fromstarttostopbyint[Default uses input times].-VSelects verbose mode, which will send progress reports to stderr [Default runs "silently"].-biSelects binary input. Appendsfor single precision [Default isd(double)]. UppercaseSorDwill force byte-swapping. Optionally, appendncol, the number of columns in your binary input file if it exceeds the columns needed by the program. Or appendcif the input file is netCDF. Optionally, appendvar1/var2/...to specify the variables to be read.-boSelects binary output. Appendsfor single precision [Default isd(double)]. UppercaseSorDwill force byte-swapping. Optionally, appendncol, the number of desired columns in your binary output file. [Default is same as input].-fSpecial formatting of input and/or output columns (time or geographical data). Specifyioroto make this apply only to input or output [Default applies to both]. Give one or more columns (or column ranges) separated by commas. AppendT(absolute calendar time),t(relative time in chosenTIME_UNITsinceTIME_EPOCH),x(longitude),y(latitude), orf(floating point) to each column or column range item. Shorthand-f[i|o]gmeans-f[i|o]0x,1y(geographic coordinates).

**ASCII** **FORMAT** **PRECISION**

The ASCII output formats of numerical data are controlled by parameters in your .gmtdefaults4 file. Longitude and latitude are formatted according toOUTPUT_DEGREE_FORMAT, whereas other values are formatted according toD_FORMAT. Be aware that the format in effect can lead to loss of precision in the output, which can lead to various problems downstream. If you find the output is not written with enough precision, consider switching to binary output (-boif available) or specify more decimals using theD_FORMATsetting.

**EXAMPLES**

To filter the data set in the file cruise.gmtd containing evenly spaced gravity, magnetics, topography, and distance (in m) with a 10 km Gaussian filter, removing outliers, and output a filtered value every 2 km between 0 and 100 km:filter1dcruise.gmtd-T0/1.0e5/2000-FG10000-N4/3-V> filtered_cruise.gmtd Data along track often have uneven sampling and gaps which we do not want to interpolate usingsample1d. To find the median depth in a 50 km window every 25 km along the track of cruise v3312, stored in v3312.dt, checking for gaps of 10km and asymmetry of 0.3:filter1dv3312.dt-FM50-T0/100000/25-L10-S0.3 > v3312_filt.dt

**SEE** **ALSO**

GMT(1),sample1d(1)