Deconvolve

Syntax

Document.Deconvolve ( Operation )

Parameters

DeconvOperation Operation - specifies the deconvolution operation to be performed

mxIterate (0) : Initiate an iteration of the selected deconvolution method

mxMaximumEntropy (1) : Initialize Deconvolve to perform Maximum Entropy deconvolution

mxLucyRichardson (2) : Initialize Deconvolve to perform Lucy-Richardson deconvolution

mxEndDeconvolution (99) : Finish deconvolution

Returns

Nothing

Remarks

Deconvolve is used to perform either Maximum Entropy or Lucy-Richardson deconvolution on an image. Because deconvolution can take a long time, it is performed asynchronously in the background. This means that Deconvolve must be used differently from other image processing MaxIm.Document methods. The client application or script calls it once to initialize the deconvolution, repeatedly for each iteration to be performed, and one last time to complete the processing. You may also call SetNoise and/or SetPSF between initialization and the first iteration to specify the noise statistics and point spread function to be used during deconvolution. Note that the result of an iteration is not immediately available and the client must wait for it to complete before beginning the next or finishing the overall deconvolution sequence. No image processing methods that actually change the image should be called from beginning to end of deconvolution, although it is safe to inspect the image data or its statistics, or check for convergence of Lucy-Richardson deconvolution by examining the chi-square value.

The detailed sequence of steps to perform follows. Steps 2 and 3 are both optional and may be performed in either order.

  1. First call Deconvolve with Operation set to either mxMaximumEntropy or mxLucyRichardson, depending on the type of deconvolution you wish to do. All subsequent calls to Deconvolve must reference the same document.

  2. Call SetNoise if it is necessary to specify the noise statistics of the image. The document for which SetNoise is called does not have to be the same as the subject image. If you do not call SetNoise at all, noise statistics are automatically measured from the background of the subject image and the electron gain is set from the EGAIN entry of the FITS header, if present.

  3. Call SetPSF if it is necessary to specify the point-spread function to be used. The document for which SetPSF is called does not have to be the same as the subject image. If you do not call SetPSF at all, a point spread function will be constructed automatically from area surrounding the brightest pixel in the subject image.

  4. Call Deconvolve with Operation set to mxIterate.

  5. At intervals, test the IterationComplete property. It is advisable to sleep or wait on a timer in the loop to avoid wasting CPU cycles that could otherwise be spent on the deconvolution itself. When IterationComplete is true, proceed to the next step. It is not possible to abort the iteration in progress; you must wait for it to complete on its own.

  6. If you are performing Lucy-Richardson deconvolution, you can test the ChiSquare property at this point. A sufficiently small value of this can be used as a criterion for finishing deconvolution.

  7. You can call CalcAreaInfo or CalcInformation to obtain other statistics that may be useful as completion criteria. FWHM and Half Flux Diameter are particularly useful in this regard. Alternatively, it may be possible to simply deconvolve for a fixed number of iterations, determined by experience with your particular images.

  8. If another iteration is deemed necessary, repeat from step 4.

  9. When no more iterations are needed, or if it is necessary to abandon the deconvolution, call Deconvolve with Operation set to mxEndDeconvolution. This is very important and should be done even if any of the preceding calls, other than that in step 1, reports an error.

Only one image can be deconvolved at a time. If you attempt to initialize a second before the first one has been completed, an exception will be returned to the client. Deconvolution is also automatically cancelled if a command dialog is opened in the GUI. In this case the client should still call Deconvolve(mxEndDeconvolution).

This method is equivalent to the Deconvolve tab of the Deconvolve command.