cdffilter −− filter a field over a specified dimension
cdffilter -[l|h] [-c|r] sm_len filtered_field field dim_field
Cdffilter reads a Candis file from the standard input and writes a modified version to the standard output. The modification consists of adding a field that is the low or high pass filtered version of a specified field over a specified dimension. The dimension must have an associated index field. The "filtered_field" argument on the command line is the name of the filtered field to be added, while "field" the that field to be filtered. The index field name is specified by "dim_field" on the command line. The flag "-l" or "-h" specifies whether the filtering is to be low pass or high pass. An optional filter "-c" tells cdffilter to treat the filtering cyclically, so that the endpoints have no effect on the filtering. The option "-r" is like "-c" except that the end point is assumed to be a repeat of the first point. "Sm_len" is the smoothing length of the filtering operation. In Fourier space with wavenumber "k", the low pass filter is represented by 1/[1 + (k*sm_len)^2], while the high pass filter is the complement of the low pass filter. Filtering is symmetric, so that lags are not introduced.
Suppose that "infile" has a field named "u" that has "x" as a dimension. Further suppose that the values of "x" are represented in an index field of that name. The invocation
kestrel%cdffilter -lr 5 u_smooth u x < infile > outfile
adds a field "u_smooth" to "infile" and puts the result in "outfile". This is the low pass filtered version of the "u" field. The smoothing length is "5" in units of the index field. The field is assumed to be cyclic with the initial point repeated at the end.