- H = 0
- Entropy
- C = 1
- Chi_sq
- F = 2
- Flux
- J = 3
- Objective function J
The deconvolution works like this. The user constructs a CEMemModel by specifying an initial model of the sky. This can by be one,two,three... dimensional depending on the dimension of the psf (see below). The user then constructs a class which implements the forward equation between the model and the dirty image. Typically this will be the ConvolutionEquation class, although any class which has a ResidualEquation interface will work (but perhaps very slowly, as the ConvolutionEquation class has member functions optimised for CLEAN and MEM)
The user then calls the solve() function (with the appropriate equation class as an arguement), and this class will perform the MEM deconvolution. The various MEM parameters are set (prior to calling solve) using the functions derived from the Iterate class, in particular setNumberIterations().
The solve() function does not return either the deconvolved model or the residuals. The solved model can be obtained using the getModel() function (derived from ArrayModel()) and the residual can be obtained using the residual() member function of the Convolution/Residual Equation Class.
The size and shape of the model used in this class MUST be the same as the convolved data (Dirty Image), stored in the companion ResidualEquation Class. However the model (and convolved data) can have more dimensions than the psf, as well as a different size (either larger or smaller). When the dimensionality is different the deconvolution is done independendtly in each "plane" of the model. (Note this has not been implemented yet but is relatively simple to do if necessary).
StokesVectors are not yet implemented.
A companion class to this one is MaskedCEMemModel. This provides the same functionality but is used with MaskedArrays which indicate which regions of the NewtonRaphson (residual) image to apply when forming the step image (MaskedCEMemModel is not yet implemented).
Matrix<Float> psf(12,12), dirty(10,10), initialModel(10,10); ...put appropriate values into psf, dirty, & initialModel.... CEMemModel<Float> deconvolvedModel(initialModel); ConvolutionEquation convEqn(psf, dirty); deconvolvedModel.setSigma(0.001); deconvolvedModel.setTargetFlux(-2.500); deconvolvedModel.setNumberIterations(30); Bool convWorked = deconvolvedModel.solve(convEqn); Array<Float> finalModel, residuals; if (convWorked){ finalModel = deconvolvedModel.getModel(); ConvEqn.residual(deconvolvedModel, finalResidual); }
Construct the CEMemModel object, initialise the model and Prior images.
Construct the CEMemModel object, initialise the model, Prior, and mask images.
destructor
solve the convolution equation returns True if converged
Gives information about the state of the CEMem (ie, using mask image, using prior image; more work here!)
This needs to be "ResidualEquation", using LatConvEquation as polymorphism is broken
Set and get various state images and classes
set or get the Entropy class
Set and get various state images and classes
set or get the Model image
Set and get various state images and classes
set or get the Prior image
Set and get various state images and classes
set or get the Mask image
Set and get various state images and classes
set and get alpha and beta
Set various controlling parameters (The most popular controlling parameters are set in the constructor)
The convergence can also be in terms of the maximum residual (ie, for use in stopping in a major cycle).
Thresh doubles in iter iterations
Set/get the progress display
return the number of iterations completed
if this MEMModel is constructed in a MF loop, we may need to increment the flux by the last iterations flux
Perform One Iteration
apply mask to a lattice; returns True if mask is available, False if not
Helper functions that interface with Entropy routines Access to the entropy should be through this interface; the points at which the Entropy is mentioned is then limited to these lines right here, and to the constructors which set the Entropy. The entropy should not ever change the private
protected generic constrcutor: DON'T USE IT!
Set entropy pointer to zero: called by Entropy's destructor
initialize itsStep and itsResidual and other stuff
controls how to change Alpha and Beta
initialize Alpha-Beta (called by changeAlphaBeta)
controls how to change Alpha and Beta
update Alpha-Beta (called by changeAlphaBeta)
controls how to change Alpha and Beta
Generic utility functions
check that the lattices and the underlying tile sizes are consistent
Generic utility functions
check that all is well in Denmark: ensure all images are the same size, ensure we have an entropy, ensure state variables have reasonable values
Generic utility functions
Helper functions for oneIteration:
take one step: clipped addition of wt1*itsModel + wt2*itsStep
Helper functions for oneIteration:
Calculate the flux, itsModMin, and itsModMax
Helper functions for oneIteration:
Determine if the peak residual is less than the getThreshold()
Enumerate the different Gradient subscript types