FILTER_ND Name
FILTER_ND
Purpose
This function returns a smoothed version of an N-dimensional input
array. Category
Time Series Analysis
Calling Sequence
Result = FILTER_ND( X, Width, Window ) Inputs
X: An array of type floating point.
Width: The width, of type integer, of the smoothing window. Note
that if Width is even, FILTER_ND uses Width+1.
Window: A string containing the name of the smoothing window to
return. Options are 'boxcar', 'gaussian', 'hanning',
'triangle'. The default is a boxcar window.
Keyword Parameters
EDGE_TRUNCATE: Set this keyword to apply the smoothing to all points.
If the neighbourhood around a point includes a point outside
the array, the nearest edge point is used to compute the
smoothed result. If EDGE_TRUNCATE is not set, the points near
the edge are replaced with NaNs.
FILTER: An array containing the filter window to use. This overrides
the window requested in the Window input. This also returns
the filter after use.
NAN: Set this keyword to ignore NaN values in the input array,
provided there is at least one defined value nearby. The
default is to return NaNs wherever they occur.
NO_NAN: Obsolete version of NAN keyword retained for compatibility
but no longer used.
WRAP_EDGES: If set, the array is treated as being cyclic and the
edges are joined together when smoothing.
Outputs
Result: Returns the smoothed version of the input array.
Uses
CONSTANTS.pro
DIMENSION.pro
FILTER_WINDOW.pro Procedure
This function manually convolves the input array with the filter.
Example
Create a vector of daily data and a sinusoid for a year.
x = randomn( seed, 365 ) + sin( 6.28 * findgen( 365 ) / 365. )
Smooth x with a boxcar filter of 7 days, wrapping the edges together.
result = filter( x, 7, 'boxcar', /wrap_edges )
Modification History
Written by: Daithi A. Stone (stoned@atm.ox.ac.uk), 2003-11-19.
Modified: DAS, 2005-08-05 (replaced SUM.PRO use with TOTAL;
added NAN keyword for consistency with other routines;
removed functionality of NO_NAN keyword)