xdem.filters¶
Filters to remove outliers and reduce noise in DEMs.
Functions¶
distance_filter¶
- xdem.filters.distance_filter(array, radius, outlier_threshold)[source]¶
Filter out pixels whose value is distant more than a set threshold from the average value of all neighbor pixels within a given radius. Filtered pixels are set to NaN.
TO DO: Add an option on how the “average” value should be calculated, i.e. using a Gaussian, median etc filter.
- Parameters
array (
ndarray) – the input array to be filtered.radius (
float) – the radius in which the average value is calculated (for Gaussian filter, this is sigma).outlier_threshold (
float) – the minimum difference abs(array - mean) for a pixel to be considered an outlier.
- Return type
- Returns
the filtered array (same shape as input)