fmode input output xwindow ywindow
input
List of input images.
output
List of filtered images. The number of input images must be the same as the
number of output images. If the input image name equals the output image name
the filtered images replaces the original image.
xwindow, ywindow
The size of the modal filter where both xwindow and ywindow are
odd integers. Even values for xwindow or ywindow will be rounded up to the
nearest odd integer.
hmin = -32768, hmax = 32767
The quantization parameters. Hmin and hmax define the minimum and maximum
permitted values for the integer representation of the IRAF image. The
default values are those suitable for the 16 bit twos complement data
produced by current CCDS. Hmin and hmax should be chosen so as to
minimize the space required to store the image histogram.
zmin = INDEF, zmax = INDEF
The quantization parameters. Zmin and zmax default to the minimum and
maximum values in the IRAF image. Pixel values from zmin to zmax are mapped
linearly to integers from hmin to hmax.
If zmin = hmin and zmax = hmax no
quantization will be performed. Image values less than or greater than
zmin or zmax will default to hmin and hmax respectively.
unmap = yes
Fmode rescales the integer values to numbers between zmin and zmax
by default. If the user wishes the mode of the quantized images unmap
must be set to no.
boundary = nearest
The type of boundary extension. The options are:
nearest
Use the value of the nearest pixel.
constant
Use a constant value.
reflect
Reflect pixel values around the boundary.
wrap
Wrap pixel values around the boundary.
constant = 0.
The value for constant valued boundary extension.
FMODE takes a set of IRAF images input and produces a set of filtered images output. The filter consists of a sliding rectangular xwindow by ywindow window in which the center pixel of the window is replaced by the mode of the pixels in the window, where the mode is defined as follows.
mode = 3. * median - 2. * mean
If zmin = hmin and zmax = hmax FMODE filters the image data directly. Otherwise the IRAF image is quantized before modal filtering. The IRAF image values from zmin to zmax are linearly mapped to integer values from hmin to hmax. The histogram, median and number of pixels less than the median are calculated for the first window position. These quantities are then updated as the median filter moves one position and the mode is computed. Note that the precision of the mode is (zmax - zmin) / (hmax - hmin). The unmap parameter may be unset in order to produce the mode of the quantized image.
1. Modal filter a 16 bit CCD image using a 5 by 5 window
cl> fmode input output 5 5 hmin=-32768 hmax=32767 zmin=-32768. >>> zmax=32767.
2. Modal filter a KPNO PDS image using a 3 by 3 window
cl> fmode input output 3 3 hmin=0 hmax=4095 zmin=0. zmax=4095.
3. Modal filter an 8 bit image using a 3 by 3 image
cl> fmode input output 3 3 hmin=0 hmax=255 zmin=0. zmax=255.
4. Modal filter an image with real values from 0.0 to 1.0 with a precision of .003.
cl> fmode input output 5 5 hmin=0 hmax=1000 zmin=0. >>> zmax=1.
It requires approximately 160 and 215 cpu seconds to modal filter a 512 by 512 square image with a 5 by 5 and 7 by 7 window respectively. (Vax 11/750 fpa).
This technique is most suitable for integer data and data which has not been calibrated. For non-integer data the calculated median is an approximation only.
Note that the default values of hmin and hmax correspond to the minimum and maximum values of a 16 bit twos complement integer. This can cause problems if the input image is of type short and unmap=no. The way around this problem is to reset the hmin and hmax limits to numbers well within the data range of a short.
If the dymamic range of the data defined by hmin and hmax is large the memory requirements can become very large.
mode,