casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::ImageMSCleaner Class Reference

A class interfacing images to MatrixCleaner. More...

#include <ImageMSCleaner.h>

List of all members.

Public Member Functions

 ImageMSCleaner ()
 Default.
 ImageMSCleaner (ImageInterface< Float > &psf, ImageInterface< Float > &dirty)
 Create a cleaner with a psf and dirty image.
 ImageMSCleaner (const ImageMSCleaner &other)
 assignmemnt constructor
ImageMSCleaneroperator= (const ImageMSCleaner &other)
 assignment operator
 ~ImageMSCleaner ()
 The destructor.
void update (ImageInterface< Float > &dirty)
 Update the dirty image only.
void setPsf (ImageInterface< Float > &psf)
 Change the psf image.
Set a number of scale sizes
The units of the scale are
pixels *void 
setscales (const Int nscales, const Float scaleInc=1.0)
void setscales (const Vector< Float > &scales)
 Set a specific set of scales.
Bool setcontrol (CleanEnums::CleanType cleanType, const Int niter, const Float gain, const Quantity &aThreshold, const Quantity &fThreshold)
 Set up control parameters cleanType - type of the cleaning algorithm to use (HOGBOM, MULTISCALE) niter - number of iterations gain - loop gain used in cleaning (a fraction of the maximum subtracted at every iteration) aThreshold - absolute threshold to stop iterations fThreshold - fractional threshold (i.e.
Bool setcontrol (CleanEnums::CleanType cleanType, const Int niter, const Float gain, const Quantity &threshold)
 This version of the method disables stopping on fractional threshold.
Int iteration () const
 return how many iterations we did do
Int numberIterations () const
void startingIteration (const Int starting=0)
 what iteration number to start on
Int clean (ImageInterface< Float > &model, const String &algorithm, const Int niter, const Float gain, const Quantity &threshold, const Quantity &fthresh=Quantity(0.0,"%"), Bool doPlotProgress=False)
 Clean an image.
void setMask (ImageInterface< Float > &mask, const Float &maskThreshold=0.9)
 Set the mask mask - input mask lattice maskThreshold - if positive, the value is treated as a threshold value to determine whether a pixel is good (mask value is greater than the threshold) or has to be masked (mask value is below the threshold).
void ignoreCenterBox (Bool ign)
 Tell the algorithm to NOT clean just the inner quarter (This is useful when multiscale clean is being used inside a major cycle for MF or WF algorithms) if True, the full image deconvolution will be attempted.
void setSmallScaleBias (const Float x=0.5)
 Consider the case of a point source: the flux on all scales is the same, and the first scale will be chosen.
void stopAtLargeScaleNegative ()
 During early iterations of a cycled MS Clean in mosaicing, it common to come across an ocsilatory pattern going between positive and negative in the large scale.
void stopPointMode (Int nStopPointMode)
 Some algorithms require that the cycles be terminated when the image is dominated by point sources; if we get nStopPointMode of the smallest scale components in a row, we terminate the cycles.
Bool queryStopPointMode () const
 After completion of cycle, querry this to find out if we stopped because of stopPointMode.
void speedup (const Float Ndouble)
 speedup() will speed the clean iteration by raising the threshold.
Float maxResidual ()
 Max residual after last clean.

Private Member Functions

Bool setupMatCleaner (const String &alg, const Int niter, const Float gain, const Quantity &threshold, const Quantity &fthresh=Quantity(0.0,"%"))
 Helper function to setup some param.

Private Attributes

MatrixCleaner matClean_p
ImageInterface< Float > * psf_p
ImageInterface< Float > * dirty_p
ImageInterface< Float > * mask_p
Int nPsfChan_p
Int nImChan_p
Int nPsfPol_p
Int nImPol_p
Int chanAxis_p
Int polAxis_p
Int nMaskChan_p
Int nMaskPol_p
Vector< Floatscales_p
Float maskThresh_p
Float maxResidual_p

Detailed Description

A class interfacing images to MatrixCleaner.

Intended use:

Public interface

 <h3>Review Status</h3><dl><dt>Date Reviewed:<dd>yyyy/mm/dd<dt>Test programs:<dd>tLatticeCleaner</dl> 

Prerequisite

Etymology

The ImageCleaner class will use MSClean on Images.

Synopsis

This class will perform various types of Clean deconvolution on Lattices.

Example

Motivation

Thrown Exceptions

Definition at line 80 of file ImageMSCleaner.h.


Constructor & Destructor Documentation

Default.

Create a cleaner with a psf and dirty image.

assignmemnt constructor

The destructor.


Member Function Documentation

Int casa::ImageMSCleaner::clean ( ImageInterface< Float > &  model,
const String algorithm,
const Int  niter,
const Float  gain,
const Quantity threshold,
const Quantity fthresh = Quantity(0.0,"%"),
Bool  doPlotProgress = False 
)

Clean an image.

return value gives you a hint of what's happening 1 = converged 0 = not converged but behaving normally -1 = not converged and stopped on cleaning consecutive smallest scale -2 = not converged and either large scale hit negative or diverging -3 = clean is diverging rather than converging

Tell the algorithm to NOT clean just the inner quarter (This is useful when multiscale clean is being used inside a major cycle for MF or WF algorithms) if True, the full image deconvolution will be attempted.

return how many iterations we did do

Max residual after last clean.

Definition at line 189 of file ImageMSCleaner.h.

References maxResidual_p.

ImageMSCleaner& casa::ImageMSCleaner::operator= ( const ImageMSCleaner other)

assignment operator

After completion of cycle, querry this to find out if we stopped because of stopPointMode.

Bool casa::ImageMSCleaner::setcontrol ( CleanEnums::CleanType  cleanType,
const Int  niter,
const Float  gain,
const Quantity aThreshold,
const Quantity fThreshold 
)

Set up control parameters cleanType - type of the cleaning algorithm to use (HOGBOM, MULTISCALE) niter - number of iterations gain - loop gain used in cleaning (a fraction of the maximum subtracted at every iteration) aThreshold - absolute threshold to stop iterations fThreshold - fractional threshold (i.e.

given w.r.t. maximum residual) to stop iterations. This parameter is specified as Quantity so it can be given in per cents.

Bool casa::ImageMSCleaner::setcontrol ( CleanEnums::CleanType  cleanType,
const Int  niter,
const Float  gain,
const Quantity threshold 
)

This version of the method disables stopping on fractional threshold.

void casa::ImageMSCleaner::setMask ( ImageInterface< Float > &  mask,
const Float maskThreshold = 0.9 
)

Set the mask mask - input mask lattice maskThreshold - if positive, the value is treated as a threshold value to determine whether a pixel is good (mask value is greater than the threshold) or has to be masked (mask value is below the threshold).

Negative threshold switches mask clipping off. The mask value is used to weight the flux during cleaning. This mode is used to implement cleaning based on the signal-to-noise as opposed to the standard cleaning based on the flux. The default threshold value is 0.9, which ensures the behavior of the code is exactly the same as before this parameter has been introduced.

Change the psf image.

Set a number of scale sizes The units of the scale are pixels* void casa::ImageMSCleaner::setscales ( const Int  nscales,
const Float  scaleInc = 1.0 
)
void casa::ImageMSCleaner::setscales ( const Vector< Float > &  scales)

Set a specific set of scales.

Consider the case of a point source: the flux on all scales is the same, and the first scale will be chosen.

Now, consider the case of a point source with a little bit of extended structure: thats right, the largest scale will be chosen. In this case, we should provide some bias towards the small scales, or against the large scales. We do this in an ad hoc manner, multiplying the maxima found at each scale by 1.0 - itsSmallScaleBias * itsScaleSizes(scale)/itsScaleSizes(nScalesToClean-1); Typical bias values range from 0.2 to 1.0.

Bool casa::ImageMSCleaner::setupMatCleaner ( const String alg,
const Int  niter,
const Float  gain,
const Quantity threshold,
const Quantity fthresh = Quantity(0.0,"%") 
) [private]

Helper function to setup some param.

void casa::ImageMSCleaner::speedup ( const Float  Ndouble)

speedup() will speed the clean iteration by raising the threshold.

This may be required if the threshold is accidentally set too low (ie, lower than can be achieved given errors in the approximate PSF).

threshold(iteration) = threshold(0) ( exp( (iteration - startingiteration)/Ndouble )/ 2.718 ) If speedup() is NOT invoked, no effect on threshold

void casa::ImageMSCleaner::startingIteration ( const Int  starting = 0)

what iteration number to start on

During early iterations of a cycled MS Clean in mosaicing, it common to come across an ocsilatory pattern going between positive and negative in the large scale.

If this is set, we stop at the first negative in the largest scale.

void casa::ImageMSCleaner::stopPointMode ( Int  nStopPointMode)

Some algorithms require that the cycles be terminated when the image is dominated by point sources; if we get nStopPointMode of the smallest scale components in a row, we terminate the cycles.

Update the dirty image only.


Member Data Documentation

Definition at line 203 of file ImageMSCleaner.h.

Definition at line 197 of file ImageMSCleaner.h.

Definition at line 198 of file ImageMSCleaner.h.

Definition at line 208 of file ImageMSCleaner.h.

Definition at line 195 of file ImageMSCleaner.h.

Definition at line 209 of file ImageMSCleaner.h.

Referenced by maxResidual().

Definition at line 200 of file ImageMSCleaner.h.

Definition at line 202 of file ImageMSCleaner.h.

Definition at line 205 of file ImageMSCleaner.h.

Definition at line 206 of file ImageMSCleaner.h.

Definition at line 199 of file ImageMSCleaner.h.

Definition at line 201 of file ImageMSCleaner.h.

Definition at line 204 of file ImageMSCleaner.h.

Definition at line 196 of file ImageMSCleaner.h.

Definition at line 207 of file ImageMSCleaner.h.


The documentation for this class was generated from the following file: