LatticeCleaner.h

Classes

CleanEnums -- Lists the different types of Convolutions that can be done (full description)
LatticeCleaner -- A class for doing multi-dimensional cleaning (full description)

class CleanEnums

Types

enum CleanType

HOGBOM
Hogbom
MULTISCALE
Multi-scale
CLARK
Clark

Interface

Description

Synopsis

This enumerator is brought out as a separate class because g++ currently cannot handle enumerators in a templated class. When it can this class will go away and this enumerator moved into the Cleaner class

Member Description

enum CleanType


template<class T> class LatticeCleaner

Interface

Public Members
LatticeCleaner(const Lattice<T> & psf, const Lattice<T> & dirty)
LatticeCleaner(const LatticeCleaner<T> & other)
LatticeCleaner<T> & operator=(const LatticeCleaner<T> & other)
~LatticeCleaner()
void update(const Lattice<T> & dirty)
Bool setscales(const Int nscales, const Float scaleInc=1.0)
Bool setscales(const Vector<Float> & scales)
Bool setcontrol(CleanEnums::CleanType cleanType, const Int niter, const Float gain, const Quantity& aThreshold, const Quantity& fThreshold, const Bool choose=True)
Bool setcontrol(CleanEnums::CleanType cleanType, const Int niter, const Float gain, const Quantity& threshold, const Bool choose=True)
Int iteration()
Int numberIterations()
void startingIteration(const Int starting = 0)
Bool clean(Lattice<T> & model, LatticeCleanProgress* progress=0)
void setMask(Lattice<T> & mask)
void ignoreCenterBox(Bool huh)
void setSmallScaleBias(const Float x=0.5)
void stopAtLargeScaleNegative()
void stopPointMode(Int nStopPointMode)
Bool queryStopPointMode()
void speedup(const Float Ndouble)
Lattice<T>* residual()
Float threshold()
void addTo(Lattice<T>& to, const Lattice<T>& add)
Private Members
void makeScale(Lattice<T>& scale, const Float& scaleSize)
Float spheroidal(Float nu)
Int index(const Int scale, const Int otherscale)
Bool destroyScales()
Bool destroyMasks()
Bool findMaxAbsLattice(const Lattice<T>& lattice, T& maxAbs, IPosition& posMax)
Bool findMaxAbsMaskLattice(const Lattice<T>& lattice, const Lattice<T>& mask, T& maxAbs, IPosition& posMax)
Bool validatePsf(const Lattice<T> & psf)
Bool makeScaleMasks()

Description

Review Status

Date Reviewed:
yyyy/mm/dd
Programs:
Tests:

Prerequisite

Etymology

The LatticeCleaner class will deconvolve Lattices.

Synopsis

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

Example

 
 

Motivation

Thrown Exceptions

To Do

Member Description

LatticeCleaner(const Lattice<T> & psf, const Lattice<T> & dirty)

Create a cleaner for a specific dirty image and PSF

LatticeCleaner(const LatticeCleaner<T> & other)

The copy constructor uses reference semantics

LatticeCleaner<T> & operator=(const LatticeCleaner<T> & other)

The assignment operator also uses reference semantics

~LatticeCleaner()

The destructor does nothing special.

void update(const Lattice<T> & dirty)

Update the dirty image only

Bool setscales(const Int nscales, const Float scaleInc=1.0)

Set a number of scale sizes. The units of the scale are pixels.

Bool 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, const Bool choose=True)

Set up control parameters

Bool setcontrol(CleanEnums::CleanType cleanType, const Int niter, const Float gain, const Quantity& threshold, const Bool choose=True)

Int iteration()

return how many iterations we did do

Int numberIterations()

void startingIteration(const Int starting = 0)

what iteration number to start on

Bool clean(Lattice<T> & model, LatticeCleanProgress* progress=0)

Clean an image.

void setMask(Lattice<T> & mask)

Set the mask

void ignoreCenterBox(Bool huh)

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. 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.

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. If this is set, we stop at the first negative in the largest 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()

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. 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

Lattice<T>* residual()

Look at what WE think the residuals look like Assumes the first scale is zero-sized

Float threshold()

Method to return threshold, including any speedup factors

void addTo(Lattice<T>& to, const Lattice<T>& add)

Helper function to optimize adding

void makeScale(Lattice<T>& scale, const Float& scaleSize)

Make an lattice of the specified scale

Float spheroidal(Float nu)

Make Spheroidal function for scale images

Int index(const Int scale, const Int otherscale)

Calculate index into PsfConvScales

Bool destroyScales()

Bool destroyMasks()

Bool findMaxAbsLattice(const Lattice<T>& lattice, T& maxAbs, IPosition& posMax)

Bool findMaxAbsMaskLattice(const Lattice<T>& lattice, const Lattice<T>& mask, T& maxAbs, IPosition& posMax)

Bool validatePsf(const Lattice<T> & psf)

Bool makeScaleMasks()