casa
5.7.0-16
|
performs MEM algorithm incrementally More...
#include <IncCEMemModel.h>
Public Member Functions | |
IncCEMemModel (IncEntropy &ent, casacore::Lattice< casacore::Float > &model, casacore::Lattice< casacore::Float > &deltaModel, casacore::uInt nIntegrations=10, casacore::Float sigma=0.001, casacore::Float targetFlux=1.0, casacore::Bool useFluxConstraint=false, casacore::Bool initializeModel=true, casacore::Bool imagePlane=false) | |
Construct the CEMemModel object and initialise the model. More... | |
IncCEMemModel (IncEntropy &ent, casacore::Lattice< casacore::Float > &model, casacore::Lattice< casacore::Float > &deltaModel, casacore::Lattice< casacore::Float > &prior, casacore::uInt nIntegrations=10, casacore::Float sigma=0.001, casacore::Float targetFlux=1.0, casacore::Bool useFluxConstraint=false, casacore::Bool initializeModel=true, casacore::Bool imagePlane=false) | |
Construct the CEMemModel object, initialise the model and Prior images. More... | |
IncCEMemModel (IncEntropy &ent, casacore::Lattice< casacore::Float > &model, casacore::Lattice< casacore::Float > &deltaModel, casacore::uInt nIntegrations, casacore::Lattice< casacore::Float > &mask, casacore::Float sigma=0.001, casacore::Float targetFlux=1.0, casacore::Bool useFluxConstraint=false, casacore::Bool initializeModel=true, casacore::Bool imagePlane=false) | |
Construct the CEMemModel object, initialise the model and and mask images. More... | |
IncCEMemModel (IncEntropy &ent, casacore::Lattice< casacore::Float > &model, casacore::Lattice< casacore::Float > &deltaModel, casacore::Lattice< casacore::Float > &prior, casacore::Lattice< casacore::Float > &mask, casacore::uInt nIntegrations=10, casacore::Float sigma=0.001, casacore::Float targetFlux=1.0, casacore::Bool useFluxConstraint=false, casacore::Bool initializeModel=true, casacore::Bool imagePlane=false) | |
Construct the CEMemModel object, initialise the model, Prior, and mask images. More... | |
virtual | ~IncCEMemModel () |
destructor More... | |
void | state () |
solve the convolution equation returns true if converged More... | |
casacore::Bool | solve (ResidualEquation< casacore::Lattice< casacore::Float > > &eqn) |
This needs to be "ResidualEquation", using LatConvEquation as polymorphism is broken. More... | |
void | setEntropy (IncEntropy &myEntropy) |
Set and get various state images and classes. More... | |
void | getEntropy (IncEntropy &myEntropy) |
casacore::Lattice < casacore::Float > & | getModel () const |
set or get the Model image More... | |
void | setModel (const casacore::Lattice< casacore::Float > &model) |
Set the current model. More... | |
casacore::Lattice < casacore::Float > & | getPrior () const |
set or get the Prior image More... | |
void | setPrior (casacore::Lattice< casacore::Float > &prior) |
casacore::Lattice < casacore::Float > & | getMask () const |
set or get the Mask image More... | |
void | setMask (casacore::Lattice< casacore::Float > &mask) |
casacore::Float | getAlpha () const |
set and get alpha, beta, and Q More... | |
casacore::Float | getBeta () const |
void | setAlpha (casacore::Float alpha) |
void | setBeta (casacore::Float beta) |
casacore::Float | getTolerance () |
Set various controlling parameters (The most popular controlling parameters are set in the constructor) More... | |
void | setTolerance (casacore::Float x) |
casacore::Float | getQ () |
void | setQ (casacore::Float x) |
casacore::Float | getGain () |
void | setGain (casacore::Float x) |
casacore::Float | getMaxNormGrad () |
void | setMaxNormGrad (casacore::Float x) |
casacore::Int | getInitialNumberIterations () |
void | setInitialNumberIterations (casacore::Int x) |
void | setThreshold (const casacore::Float x) |
The convergence can also be in terms of the maximum residual (ie, for use in stopping in a major cycle). More... | |
void | setThresholdSpeedup (const casacore::Float iter) |
Thresh doubles in iter iterations. More... | |
casacore::Float | getThreshold () |
virtual void | setProgress (CEMemProgress &ccp) |
Set/get the progress display. More... | |
virtual CEMemProgress & | getProgress () |
casacore::Int | numberIterations () |
return the number of iterations completed More... | |
Public Member Functions inherited from casa::LinearModel< casacore::Lattice< casacore::Float > > | |
virtual | ~LinearModel () |
A virtual destructor is necessary. More... | |
Protected Types | |
enum | GradientType { H, C, F, J } |
Enumerate the different Gradient subscript types. More... | |
Protected Member Functions | |
void | oneIteration () |
Perform One Iteration. More... | |
casacore::Bool | applyMask (casacore::Lattice< casacore::Float > &lat) |
apply mask to a lattice; returns true if mask is available, false if not More... | |
void | formEntropy () |
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. More... | |
void | formGDG () |
void | formGDGStep () |
void | formGDS () |
void | entropyType (casacore::String &str) |
void | relaxMin () |
casacore::Bool | testConvergence () |
IncCEMemModel () | |
protected generic constrcutor: DON'T USE IT! More... | |
void | letEntropyDie () |
Set entropy pointer to zero: called by Entropy's destructor. More... | |
casacore::Bool | initStuff () |
initialize itsStep and itsResidual and other stuff More... | |
void | changeAlphaBeta () |
controls how to change Alpha and Beta More... | |
void | initializeAlphaBeta () |
initialize Alpha-Beta (called by changeAlphaBeta) More... | |
void | updateAlphaBeta () |
update Alpha-Beta (called by changeAlphaBeta) More... | |
casacore::Bool | checkImage (const casacore::Lattice< casacore::Float > *) |
Generic utility functions. More... | |
casacore::Bool | checkImages (const casacore::Lattice< casacore::Float > *one, const casacore::Lattice< casacore::Float > *other) |
check that the lattices and the underlying tile sizes are consistent More... | |
casacore::Bool | ok () |
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 More... | |
void | calculateStep () |
Helper functions for oneIteration: More... | |
void | takeStep (casacore::Float wt1, casacore::Float wt2) |
take one step: clipped addition of wt1*itsModel + wt2*itsStep More... | |
casacore::Float | formFlux () |
Calculate the flux, itsModMin, and itsModMax. More... | |
casacore::Bool | testConvergenceThreshold () |
Determine if the peak residual is less than the getThreshold() More... | |
Friends | |
class | IncEntropy |
Any new entropies derived from Entropy must sign the friend list: More... | |
class | IncEntropyI |
class | IncEntropyEmptiness |
performs MEM algorithm incrementally
Public interface
This class is called CEMemModel because it uses the Cornwell and Evans MEM algorithm to deconvolve the model. The "Inc" is from Incremental, as the gradient is calculated from an incremental dirty image, but the entropy is calculated from the previous model plus the deltaModel
This class is used to perform the Cornwell and Evans MEM Algorithm on an Array. Only the deconvolved model of the sky are directly stored by this class. The point spread function (psf) and convolved (dirty) image are stored in a companion class which is must be derived from ResidualEquation.
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).
This class is needed to deconvolve extended images. In time, the MEM algorithm will be a principle player in the mosaicing stuff.
testing: casacore::Float: lets try it first StokesVector: will require lots more work
Definition at line 148 of file IncCEMemModel.h.
|
protected |
Enumerate the different Gradient subscript types.
Enumerator | |
---|---|
H | |
C |
Chi_sq. |
F |
Flux. |
J |
Objective function J. |
Definition at line 460 of file IncCEMemModel.h.
casa::IncCEMemModel::IncCEMemModel | ( | IncEntropy & | ent, |
casacore::Lattice< casacore::Float > & | model, | ||
casacore::Lattice< casacore::Float > & | deltaModel, | ||
casacore::uInt | nIntegrations = 10 , |
||
casacore::Float | sigma = 0.001 , |
||
casacore::Float | targetFlux = 1.0 , |
||
casacore::Bool | useFluxConstraint = false , |
||
casacore::Bool | initializeModel = true , |
||
casacore::Bool | imagePlane = false |
||
) |
Construct the CEMemModel object and initialise the model.
casa::IncCEMemModel::IncCEMemModel | ( | IncEntropy & | ent, |
casacore::Lattice< casacore::Float > & | model, | ||
casacore::Lattice< casacore::Float > & | deltaModel, | ||
casacore::Lattice< casacore::Float > & | prior, | ||
casacore::uInt | nIntegrations = 10 , |
||
casacore::Float | sigma = 0.001 , |
||
casacore::Float | targetFlux = 1.0 , |
||
casacore::Bool | useFluxConstraint = false , |
||
casacore::Bool | initializeModel = true , |
||
casacore::Bool | imagePlane = false |
||
) |
Construct the CEMemModel object, initialise the model and Prior images.
casa::IncCEMemModel::IncCEMemModel | ( | IncEntropy & | ent, |
casacore::Lattice< casacore::Float > & | model, | ||
casacore::Lattice< casacore::Float > & | deltaModel, | ||
casacore::uInt | nIntegrations, | ||
casacore::Lattice< casacore::Float > & | mask, | ||
casacore::Float | sigma = 0.001 , |
||
casacore::Float | targetFlux = 1.0 , |
||
casacore::Bool | useFluxConstraint = false , |
||
casacore::Bool | initializeModel = true , |
||
casacore::Bool | imagePlane = false |
||
) |
Construct the CEMemModel object, initialise the model and and mask images.
casa::IncCEMemModel::IncCEMemModel | ( | IncEntropy & | ent, |
casacore::Lattice< casacore::Float > & | model, | ||
casacore::Lattice< casacore::Float > & | deltaModel, | ||
casacore::Lattice< casacore::Float > & | prior, | ||
casacore::Lattice< casacore::Float > & | mask, | ||
casacore::uInt | nIntegrations = 10 , |
||
casacore::Float | sigma = 0.001 , |
||
casacore::Float | targetFlux = 1.0 , |
||
casacore::Bool | useFluxConstraint = false , |
||
casacore::Bool | initializeModel = true , |
||
casacore::Bool | imagePlane = false |
||
) |
Construct the CEMemModel object, initialise the model, Prior, and mask images.
|
virtual |
destructor
|
protected |
protected generic constrcutor: DON'T USE IT!
|
protected |
apply mask to a lattice; returns true if mask is available, false if not
|
protected |
Helper functions for oneIteration:
calculate size of step
|
protected |
controls how to change Alpha and Beta
|
protected |
Generic utility functions.
check that a single image is onf plausible shape
|
protected |
check that the lattices and the underlying tile sizes are consistent
|
inlineprotected |
Definition at line 315 of file IncCEMemModel.h.
References casa::IncEntropy::entropyType(), and itsEntropy_ptr.
|
inlineprotected |
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
Definition at line 307 of file IncCEMemModel.h.
References casa::IncEntropy::formEntropy(), itsEntropy, and itsEntropy_ptr.
|
protected |
Calculate the flux, itsModMin, and itsModMax.
|
inlineprotected |
Definition at line 309 of file IncCEMemModel.h.
References casa::IncEntropy::formGDG(), itsEntropy_ptr, and itsGDG.
|
inlineprotected |
Definition at line 311 of file IncCEMemModel.h.
References casa::IncEntropy::formGDGStep(), itsEntropy_ptr, and itsGDG.
|
inlineprotected |
Definition at line 313 of file IncCEMemModel.h.
References casa::IncEntropy::formGDS(), itsEntropy_ptr, and itsGradDotStep1.
|
inline |
|
inline |
Definition at line 253 of file IncCEMemModel.h.
References itsBeta.
|
inline |
Definition at line 230 of file IncCEMemModel.h.
References itsEntropy_ptr.
|
inline |
Definition at line 266 of file IncCEMemModel.h.
References itsGain.
|
inline |
Definition at line 270 of file IncCEMemModel.h.
References itsFirstIteration.
|
inline |
set or get the Mask image
Definition at line 244 of file IncCEMemModel.h.
References casacore::Lattice< T >::clone(), and itsMask_ptr.
|
inline |
Definition at line 268 of file IncCEMemModel.h.
References itsMaxNormGrad.
|
inlinevirtual |
set or get the Model image
Implements casa::LinearModel< casacore::Lattice< casacore::Float > >.
Definition at line 233 of file IncCEMemModel.h.
References itsDeltaModel_ptr.
|
inline |
set or get the Prior image
Definition at line 239 of file IncCEMemModel.h.
References casacore::Lattice< T >::clone(), and itsPrior_ptr.
|
inlinevirtual |
Definition at line 284 of file IncCEMemModel.h.
References itsProgressPtr.
|
inline |
Definition at line 264 of file IncCEMemModel.h.
References itsQ.
casacore::Float casa::IncCEMemModel::getThreshold | ( | ) |
|
inline |
Set various controlling parameters (The most popular controlling parameters are set in the constructor)
Definition at line 262 of file IncCEMemModel.h.
References itsTolerance.
|
protected |
initialize Alpha-Beta (called by changeAlphaBeta)
|
protected |
initialize itsStep and itsResidual and other stuff
|
inlineprotected |
Set entropy pointer to zero: called by Entropy's destructor.
Definition at line 328 of file IncCEMemModel.h.
References itsEntropy_ptr.
|
inline |
return the number of iterations completed
Definition at line 288 of file IncCEMemModel.h.
References itsIteration.
|
protected |
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
|
protected |
Perform One Iteration.
|
inlineprotected |
Definition at line 317 of file IncCEMemModel.h.
References itsEntropy_ptr, itsRequiredModelMin, and casa::IncEntropy::relaxMin().
|
inline |
Definition at line 254 of file IncCEMemModel.h.
References itsAlpha.
|
inline |
Definition at line 255 of file IncCEMemModel.h.
References itsBeta.
|
inline |
Set and get various state images and classes.
set or get the Entropy class
Definition at line 229 of file IncCEMemModel.h.
References itsEntropy_ptr.
|
inline |
Definition at line 267 of file IncCEMemModel.h.
References itsGain.
|
inline |
Definition at line 271 of file IncCEMemModel.h.
References itsFirstIteration.
void casa::IncCEMemModel::setMask | ( | casacore::Lattice< casacore::Float > & | mask | ) |
|
inline |
Definition at line 269 of file IncCEMemModel.h.
References itsMaxNormGrad.
|
inlinevirtual |
Set the current model.
Implements casa::LinearModel< casacore::Lattice< casacore::Float > >.
Definition at line 235 of file IncCEMemModel.h.
References casacore::Lattice< T >::clone(), and itsDeltaModel_ptr.
void casa::IncCEMemModel::setPrior | ( | casacore::Lattice< casacore::Float > & | prior | ) |
|
inlinevirtual |
Set/get the progress display.
Definition at line 283 of file IncCEMemModel.h.
References itsProgressPtr.
|
inline |
Definition at line 265 of file IncCEMemModel.h.
References itsQ.
|
inline |
The convergence can also be in terms of the maximum residual (ie, for use in stopping in a major cycle).
Definition at line 276 of file IncCEMemModel.h.
References itsThreshold0.
|
inline |
Thresh doubles in iter iterations.
Definition at line 278 of file IncCEMemModel.h.
References itsThresholdSpeedup.
|
inline |
Definition at line 263 of file IncCEMemModel.h.
References itsTolerance.
casacore::Bool casa::IncCEMemModel::solve | ( | ResidualEquation< casacore::Lattice< casacore::Float > > & | eqn | ) |
This needs to be "ResidualEquation", using LatConvEquation as polymorphism is broken.
void casa::IncCEMemModel::state | ( | ) |
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!)
|
protected |
take one step: clipped addition of wt1*itsModel + wt2*itsStep
|
inlineprotected |
Definition at line 319 of file IncCEMemModel.h.
References itsEntropy_ptr, and casa::IncEntropy::testConvergence().
|
protected |
Determine if the peak residual is less than the getThreshold()
|
protected |
update Alpha-Beta (called by changeAlphaBeta)
|
friend |
Any new entropies derived from Entropy must sign the friend list:
Definition at line 152 of file IncCEMemModel.h.
|
friend |
Definition at line 154 of file IncCEMemModel.h.
|
friend |
Definition at line 153 of file IncCEMemModel.h.
|
protected |
sqrt(chi^2/ Npixels)
Definition at line 432 of file IncCEMemModel.h.
|
protected |
State variables.
Definition at line 421 of file IncCEMemModel.h.
Referenced by getAlpha(), and setAlpha().
|
protected |
Definition at line 422 of file IncCEMemModel.h.
|
protected |
Definition at line 428 of file IncCEMemModel.h.
|
protected |
Accesories.
Definition at line 455 of file IncCEMemModel.h.
|
protected |
Definition at line 448 of file IncCEMemModel.h.
|
protected |
Definition at line 402 of file IncCEMemModel.h.
|
protected |
Definition at line 427 of file IncCEMemModel.h.
|
protected |
Definition at line 387 of file IncCEMemModel.h.
Referenced by getModel(), and setModel().
|
protected |
is this an image plane problem (like Single Dish or Optical?)
Definition at line 414 of file IncCEMemModel.h.
|
protected |
Definition at line 399 of file IncCEMemModel.h.
|
protected |
numerical value of entropy
Definition at line 434 of file IncCEMemModel.h.
Referenced by formEntropy().
|
protected |
---------—Private Member casacore::Data------------------— functional form of the entropy
Definition at line 380 of file IncCEMemModel.h.
Referenced by entropyType(), formEntropy(), formGDG(), formGDGStep(), formGDS(), getEntropy(), letEntropyDie(), relaxMin(), setEntropy(), and testConvergence().
|
protected |
Definition at line 445 of file IncCEMemModel.h.
Referenced by getInitialNumberIterations(), and setInitialNumberIterations().
|
protected |
sqrt(chi^2/target_chi^2)
Definition at line 430 of file IncCEMemModel.h.
|
protected |
note that itsModelFlux + itsDeltaFlux = itsFlux
Definition at line 425 of file IncCEMemModel.h.
|
protected |
gain for adding step image
Definition at line 409 of file IncCEMemModel.h.
|
protected |
matrix of gradient dot products
Definition at line 447 of file IncCEMemModel.h.
Referenced by formGDG(), and formGDGStep().
|
protected |
Definition at line 442 of file IncCEMemModel.h.
|
protected |
Definition at line 443 of file IncCEMemModel.h.
Referenced by formGDS().
|
protected |
Controlling parameters.
Definition at line 397 of file IncCEMemModel.h.
|
protected |
Definition at line 444 of file IncCEMemModel.h.
Referenced by numberIterations().
|
protected |
Definition at line 441 of file IncCEMemModel.h.
|
protected |
Definition at line 456 of file IncCEMemModel.h.
|
protected |
Definition at line 389 of file IncCEMemModel.h.
Referenced by getMask().
|
protected |
Definition at line 410 of file IncCEMemModel.h.
Referenced by getMaxNormGrad(), and setMaxNormGrad().
|
protected |
Images:
Definition at line 386 of file IncCEMemModel.h.
|
protected |
Definition at line 426 of file IncCEMemModel.h.
|
protected |
maximum pixel value in model
Definition at line 438 of file IncCEMemModel.h.
|
protected |
minimum pixel value n model
Definition at line 440 of file IncCEMemModel.h.
|
protected |
Definition at line 423 of file IncCEMemModel.h.
|
protected |
Definition at line 398 of file IncCEMemModel.h.
|
protected |
Definition at line 450 of file IncCEMemModel.h.
|
protected |
Definition at line 388 of file IncCEMemModel.h.
Referenced by getPrior().
|
protected |
Definition at line 471 of file IncCEMemModel.h.
Referenced by getProgress(), and setProgress().
|
protected |
N points per beam.
Definition at line 407 of file IncCEMemModel.h.
|
protected |
Model is constrained to be >= itsNewMin.
Definition at line 436 of file IncCEMemModel.h.
Referenced by relaxMin().
|
protected |
Definition at line 392 of file IncCEMemModel.h.
|
protected |
form of the Residual method
Definition at line 383 of file IncCEMemModel.h.
|
protected |
Definition at line 400 of file IncCEMemModel.h.
|
protected |
Our OWN internal temp images; delete these upon destruction.
Definition at line 391 of file IncCEMemModel.h.
|
protected |
Definition at line 403 of file IncCEMemModel.h.
|
protected |
Definition at line 401 of file IncCEMemModel.h.
|
protected |
Definition at line 415 of file IncCEMemModel.h.
Referenced by setThreshold().
|
protected |
Definition at line 416 of file IncCEMemModel.h.
Referenced by setThresholdSpeedup().
|
protected |
tolerance for convergence
Definition at line 405 of file IncCEMemModel.h.
Referenced by getTolerance(), and setTolerance().
|
protected |
constrain flux or not?
Definition at line 412 of file IncCEMemModel.h.