General Data Analysis Facilities

In this section we will describe:

- A general overview of image restoration
- Algorithms and tasks in the STSDAS
restore package (page 87)
- How to prepare images for restoration (page 90)
- How to find and use PSF images (page 92)

All restoration methods are likely to produce better results given higher S/N data. There is no magic number that can be given, however, to say what S/N ratio is adequate. The quality of a restoration depends not only on the S/N ratio, but also on the nature of the object (extended or point-like), the background (strong DC or complicated background structure present vs. empty background), and the quality of the point spread function.

- Richardson-Lucy algorithm: the lucy task
- Maximum Entropy Method: the mem task
- s-CLEAN algorithm: the sclean task
- Wiener filter and Fourier inverse filter: the wiener task
- Adaptive filters: the hfilter and
adaptive tasks

One common question about the R-L method is when to stop the iterations. The usual rule of thumb is to run the R-L iterations until the c2 per degree of freedom (c2 / number of pixels) reaches 1.0. This only provides a global measure of the quality of the fit, however, since the rate of convergence varies for objects of different brightness and different spatial scales. For stellar fields with little or no background the R-L iterations can (and should) be run a long time--many hundreds or even thousands of iterations are appropriate. It would be possible to run the iterations to true convergence, i.e., such that the differences between successive image estimates are smaller than the numerical accuracy of the computation.

- The degraded HST image
- A point spread function image
- A model image

Generally speaking, R-L is more robust than MEM--that is, even though in some cases MEM methods may give better results, the R-L method is more stable. In some cases MEM will not converge to a solution. MEM tends to give the best spatial resolution but somewhat less reliable photometry (although recent tests comparing the STSDAS mem and lucy tasks show very comparable photometric linearity). MEM implementations are often more computationally intensive.

Our experience is that the s-CLEAN method (the sclean task) requires substantial computing time and often does not have photometric linearity as good as the R-L method, most likely because iterations are stopped prematurely.

The adaptive task reduces the noise in parts of the image without reducing resolution of sharp features. The local S/N ratio as a function of decreasing resolution is evaluated as follows: at any given point, mean gradients and curvatures over different scale lengths are compared to expected noise values. The order for which the S/N ratio exceeds a specified level indicates the local resolution scale length of the signal, which determines the size of the filter applied at that point.

- Cosmic ray removal and bad pixel masking
- Saturated pixel removal or masking
- Image boundary or edge considerations
- Combining images of different resolutions

The best approach is to generate a mask for each image which flags the cosmic rays so that they are ignored by the restoration algorithm. The lucy task accepts such a mask and will give flagged pixels zero weight. If the algorithm does not accept input masks, replace the bad pixel with an interpolated value. This gives a statistical significance to the pixel that is not warranted, but cannot be avoided for simple algorithms such as the Wiener filter.

If CR-SPLIT images are not registered the cosmic ray removal routines will not perform well. Moreover, it is dangerous to resample the data in order to align the images given the undersampling of the WF/PC--a single bad pixel in the image can end up affecting a number of adjacent pixels after rebinning, and the accuracy of the rebinning is poor under-sampled data in general. Registration within 0.2 pixel is generally acceptable.

Another approach is to mask out the saturated pixels and treat them as totally unknown. The lucy task in STSDAS will fill in the saturated pixels as best it can, given that the wings of the PSF appear in the data and are not saturated. The restoration will have some difficulty in restoring the full intensity of the saturated object, and a third approach is to use the result from, say, 100 R-L iterations as an input model, and restart the restoration ignoring the mask used initially. We have done some experiments along these lines but have not completed this work.

Another approach is to estimate or fit a PSF model to the region that is saturated using the wings of the PSF to determine the fit. Subtract the fit from the data, then restore the residual using your fit as a sky model (see the input parameters and help file for the lucy task). Note that this approach requires a very good model for the PSF.

The STSDAS implementation of the R-L algorithm handles image edges slightly differently. The restored image can be chosen to be larger than the original data, and the padding region is simply given zero weight in the iteration. The restored image is allowed to have flux in the padding region, but the flux is based only on the known pixel values (e.g., a partial PSF pattern from a star just outside the image boundary).

TIM and TinyTIM model PSFs are reasonably good in the optical part of the spectrum, but disagree with observed PSFs more and more as you go further into the UV. If possible, you should try using both an observed and a model PSF and compare the results, looking carefully for artifacts (especially features that resemble the PSF structure) in the restored images.

The best source for an observed PSF is in the same image if the PSF star is not too far from the object you want to restore (i.e., for WF/PC, within ~100-200 pixels). A PSF star near the edge of the image will not be suitable for restoring an object at the center of the image since vignetting causes serious distortions of the PSF at the field edge.

Either TIM or TinyTIM may be used to generate model PSFs. TinyTIM is easier to use. TinyTIM is available on all STScI science computer systems, and is available via anonymous FTP on stsci.edu (software/tinytim).

- Overview of Image Restoration
- Algorithms and Methods in STSDAS
- Richardson-Lucy Algorithm
- Maximum Entropy Method
- s-CLEAN
- Wiener Filter
- Adaptive Filters
- Image Preparation
- Cosmic Ray Removal and Bad Pixel Masking
- Saturated Pixels
- Boundary Extension
- Combining Images of Different Resolution
- PSF Preparation

Generated with WebMaker