[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Waldhäuser Str. 64, D-72076 Tübingen, Germany
[Uni logo]


SIGMA_FILTER Source code in sigma_filter.pro

SIGMA_FILTER

Name
       SIGMA_FILTER
Purpose
       Replace pixels more than a specified pixels deviant from its neighbors
Explanation
       Computes the mean and standard deviation of pixels in a box centered at
       each pixel of the image, but excluding the center pixel. If the center
       pixel value exceeds some # of standard deviations from the mean, it is
       replaced by the mean in box. Note option to process pixels on the edges.
Calling Sequence
       Result = sigma_filter( image, box_width, N_sigma=(#), /ALL,/MON )
Input Parameters
       image = 2-D image (matrix)
       box_width = width of square filter box, in # pixels (default = 3)
Keyword Parameters
       N_sigma = # standard deviations to define outliers, floating point,
                       recommend > 2, default = 3. For gaussian statistics:
                       N_sigma = 1 smooths 35% of pixels, 2 = 5%, 3 = 1%.
       RADIUS = alternative to specify box radius, so box_width = 2*radius+1.
      /ALL_PIXELS causes computation to include edges of image,
      /KEEP causes opposite effect: pixels with values outside of specified
               deviation are not changed, pixels within deviation are smoothed.
      /ITERATE causes sigma_filter to be applied recursively (max = 20 times)
               until no more pixels change (only allowed when N_sigma >= 2).
      /MONITOR prints information about % pixels replaced.
Optional Output
       N_CHANGE = # of pixels changed (replaced with neighborhood mean).
       VARIANCE = image of pixel neighborhood variances * (N_sigma)^2,
       DEVIATION = image of pixel deviations from neighborhood means, squared.
Procedures Used
       function filter_image( )
Procedure
       Compute mean over moving box-cars using smooth, subtract center values,
       compute variance using smooth on deviations from mean,
       check where pixel deviation from mean is within variance of box,
       replace those pixels in smoothed image (mean) with orignal values,
       return the resulting partial mean image.
Revision History
       Written, 1991, Frank Varosi and Dan Gezari NASA/GSFC
       F.V.1992, added optional keywords /ITER,/MON,VAR=,DEV=,N_CHANGE=.
       Converted to IDL V5.0   W. Landsman   September 1997

Last modified by pro2html on 2001 April 26 at 03:13 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically