Performs a Richardson-Lucy deconvolution of a one- or two-dimensional array
Before the first iteration, the restored array is initialised either to the array given by Parameter START, or, if no array is given, to the difference between the mean value in the input data array and the mean value in the background (specified by Parameters BACK and BACKVAL). Simulated data are then created from this trial array by smoothing it with the supplied PSF, and then adding the background on. The χ2 value describing the deviation of this simulated data from the observed data are then found and displayed. If the required χ2 is not reached by this simulated data, the first iteration commences, which consists of creating a new version of the restored array and then creating new simulated data from this new restored array (the corresponding χ2 value is displayed). Repeated iterations are performed until the required χ2 is reached, or the iteration limit is reached. The new version of the restored array is created as follows.
For further background to the algorithm, see L.B. Lucy, Astron.J. 1974, Vol 79, No. 6.
[1.0]
[!]
[0.0]
χ2=1N.∑(d−s)2(CHIFAC.s−σ2)
where the sum is taken over the entire input array (excluding the
margins used to pad the input array), n is the number of values summed,
d is the observed
data value, s
is the simulated data value based on the current version of the restored array,
σ2 is the variance of the
error associated with d,
and CHIFAC is
the value of Parameter CHIFAC. Using 0 for CHIFAC results in the standard expression for
χ2. However, the
algorithm sometimes has difficulty fitting bright features and so may not reach the required
normalised χ2
value. Setting CHIFAC to 1 (as is done by the LUCY program in the STSDAS
package within IRAF) causes larger data values to be given less weight in the
χ2 calculation, and so
encourages lower χ2
values. [1.0]
[50]
FALSE
. If a null (!
) value is supplied, the value used
is an estimate of the noise based on the difference between adjacent pixel
values in the observed data. [!]
[!]
TRUE
then the variance of the observed data sample is
added to both the numerator and denominator when evaluating the correction
factor for each data sample. This is the modified form of the R-L algorithm
used by the LUCY program in the STSDAS package within IRAF. [TRUE]
[0.0625]
TRUE
, then the variance of each input data sample will be obtained from the
VARIANCE component of the input NDF. An error is reported if this option is
selected and the NDF has no VARIANCE component. If FALSE
, then a constant variance
equal to the square of the value given for Parameter SIGMA is used for all data
samples. If a null (!
) value is supplied, the value used is TRUE
if the input NDF
has a VARIANCE component, and FALSE
otherwise. [!]
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. Values less than 0.5 will tend to reduce the number of bad pixels, whereas values larger than 0.5 will tend to increase the number of bad pixels.
This threshold is applied each time a smoothing operation is performed. Many
smoothing operations are typically performed in a run of LUCY, and if WLIM
is larger than 0.5 the effects of bad pixels will propagate further through
the array at each iteration. After several iterations this could result in
there being no good data left. An error is reported if this happens. [0.001]
!
) value is supplied, the value used is the middle
pixel (rounded down if there are an even number of pixels per line). [!]
!
) value is supplied, the value used is
the middle line (rounded down if there are an even number of lines). [!]
The convolutions required by the R-L algorithm 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.
The R-L algorithm works best for arrays which have zero background. Non-zero backgrounds cause dark rings to appear around bright, compact sources. To avoid this a background array should be created before running LUCY and assigned to the Parameter BACK. The SEGMENT and SURFIT applications within Kappa can be used to create such a background array.
This routine correctly processes the AXIS, DATA, QUALITY, VARIANCE, 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.