Applies a Wiener filter to a one- or two-dimensional array
The Wiener filter attempts to minimise the mean squared difference between the undegraded image and the restored image. To do this it needs to know the power spectrum of the undegraded image (i.e. the power at each spatial frequency before the instrumental blurring and the addition of noise). Obviously, this is not usually available, and instead the power spectrum of some other image must be used (the ‘model’ image). The idea is that a model image should be chosen for which there is some a priori reason for believing it to have a power spectrum similar to the undegraded image. Many different suggestions have been made for the best way to make this choice and the literature should be consulted for a detailed discussion (for instance, see the paper Wiener Restoration of HST Images: Signal Models and Photometric Behavior by I.C. Busko in the proceedings of the first Annual Conference on Astronomical Data Analysis Software and Systems, Tucson). By default, this application uses a ‘white’ model image, i.e. one in which there is equal power at all spatial frequencies. The default value for this constant power is the mean power per pixel in the input image. There is also an option to use the power spectrum of a supplied model image.
The filter also depends on a model of the noise in the supplied image. This application assumes that the noise is ’white’ and is constant across the image. You can specify the noise power to use. If a noise power of zero is supplied, then the Wiener filter just becomes a normal inverse filter which will tend to amplify noise in the supplied image.
The filtering is done by multiplying the Fourier transform of the supplied image by the Fourier transform of the filter function. The output image is then created by taking the inverse Fourier transform of the product. The Fourier transform of the filter function is given by:
where H is the Fourier transform of the supplied Point-Spread Function, Pn is the noise power, Pg is the power in the model image, and H∗ is the complex conjugate of H. If the supplied model includes noise (as indicated by Parameter QUIET) then Pn is subtracted from Pg before evaluating the above expression.
[!]
!
) value is supplied, the value used is
the mean power per pixel in the input image. [!]
!
) value is supplied, the value used is
an estimate of the noise variance based on the difference between adjacent
pixel values in the observed data. [!]
TRUE
value should be supplied for QUIET. If there is any noise in the model then
QUIET should be supplied FALSE
. If a null (!
) value is supplied, the value
used is FALSE
, unless the image given for Parameter MODEL was created by a
previous run of WIENER (as indicated by the presence of a WIENER extension in the
NDF), in which case the run time default is TRUE
(i.e. the previous run of
WIENER is assumed to have removed the noise). [!]
[0.0625]
The numerical value given for WLIM specifies the minimum total weight associated with
the good pixels in a smoothing box required to generate a good output pixel (weights
for each pixel are defined by the normalised PSF). If this specified minimum
weight is not present, then a bad output pixel will result, otherwise a smoothed
output value will be calculated. The value of this parameter should lie between
0.0 and 1.0. WLIM=0
causes a good output value to be created even if there is
only one good input value, whereas WLIM=1
causes a good output value to be
created only if all input values are good. [0.001]
TRUE
value to indicate that the theoretical model contains no noise. The convolutions required by the Wiener filter are performed by the multiplication of Fourier transforms. The supplied input array is extended by a margin along each edge to avoid problems of wrap-around between opposite edges of the array. The width of this margin is about equal to the width of the significant part of the PSF (as determined by Parameter THRESH). The application displays the width of these margins. The margins are filled by replicating the edge pixels from the supplied input NDFs.
This routine correctly processes the AXIS, DATA, QUALITY, LABEL, TITLE, UNITS, WCS, and HISTORY components of the input NDF and propagates all extensions.
Processing of bad pixels and automatic quality masking are supported.
All non-complex numeric data types can be handled. Arithmetic is performed using single-precision floating point.