casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::ImageMSCleaner Class Reference

A class interfacing images to MatrixCleaner. More...

#include <ImageMSCleaner.h>

Public Member Functions

 ImageMSCleaner ()
 Default. More...
 
 ImageMSCleaner (casacore::ImageInterface< casacore::Float > &psf, casacore::ImageInterface< casacore::Float > &dirty)
 Create a cleaner with a psf and dirty image. More...
 
 ImageMSCleaner (const ImageMSCleaner &other)
 assignmemnt constructor More...
 
ImageMSCleaneroperator= (const ImageMSCleaner &other)
 assignment operator More...
 
 ~ImageMSCleaner ()
 The destructor. More...
 
void update (casacore::ImageInterface< casacore::Float > &dirty)
 Update the dirty image only. More...
 
void setPsf (casacore::ImageInterface< casacore::Float > &psf)
 Change the psf image. More...
 
Set a number of scale sizes
The units of the scale are
pixels *void 
setscales (const casacore::Int nscales, const casacore::Float scaleInc=1.0)
 
void setscales (const casacore::Vector< casacore::Float > &scales)
 Set a specific set of scales. More...
 
casacore::Bool setcontrol (casacore::CleanEnums::CleanType cleanType, const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &aThreshold, const casacore::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. More...
 
casacore::Bool setcontrol (casacore::CleanEnums::CleanType cleanType, const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold)
 This version of the method disables stopping on fractional threshold. More...
 
casacore::Int iteration () const
 return how many iterations we did do More...
 
casacore::Int numberIterations () const
 
void startingIteration (const casacore::Int starting=0)
 what iteration number to start on More...
 
casacore::Int clean (casacore::ImageInterface< casacore::Float > &model, const casacore::String &algorithm, const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold, const casacore::Quantity &fthresh=casacore::Quantity(0.0,"%"), casacore::Bool doPlotProgress=false)
 Clean an image. More...
 
void setMask (casacore::ImageInterface< casacore::Float > &mask, const casacore::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). More...
 
void ignoreCenterBox (casacore::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. More...
 
void setSmallScaleBias (const casacore::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. More...
 
void stopAtLargeScaleNegative ()
 During early iterations of a cycled casacore::MS Clean in mosaicing, it common to come across an ocsilatory pattern going between positive and negative in the large scale. More...
 
void stopPointMode (casacore::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. More...
 
casacore::Bool queryStopPointMode () const
 After completion of cycle, querry this to find out if we stopped because of stopPointMode. More...
 
void speedup (const casacore::Float Ndouble)
 speedup() will speed the clean iteration by raising the threshold. More...
 
casacore::Float maxResidual ()
 Max residual after last clean. More...
 

Private Member Functions

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

Private Attributes

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

Detailed Description

A class interfacing images to MatrixCleaner.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
tLatticeCleaner

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 84 of file ImageMSCleaner.h.

Constructor & Destructor Documentation

casa::ImageMSCleaner::ImageMSCleaner ( )

Default.

casa::ImageMSCleaner::ImageMSCleaner ( casacore::ImageInterface< casacore::Float > &  psf,
casacore::ImageInterface< casacore::Float > &  dirty 
)

Create a cleaner with a psf and dirty image.

casa::ImageMSCleaner::ImageMSCleaner ( const ImageMSCleaner other)

assignmemnt constructor

casa::ImageMSCleaner::~ImageMSCleaner ( )

The destructor.

Member Function Documentation

casacore::Int casa::ImageMSCleaner::clean ( casacore::ImageInterface< casacore::Float > &  model,
const casacore::String algorithm,
const casacore::Int  niter,
const casacore::Float  gain,
const casacore::Quantity threshold,
const casacore::Quantity fthresh = casacore::Quantity(0.0,"%"),
casacore::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

void casa::ImageMSCleaner::ignoreCenterBox ( casacore::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.

casacore::Int casa::ImageMSCleaner::iteration ( ) const

return how many iterations we did do

casacore::Float casa::ImageMSCleaner::maxResidual ( )
inline

Max residual after last clean.

Definition at line 193 of file ImageMSCleaner.h.

References maxResidual_p.

casacore::Int casa::ImageMSCleaner::numberIterations ( ) const
ImageMSCleaner& casa::ImageMSCleaner::operator= ( const ImageMSCleaner other)

assignment operator

casacore::Bool casa::ImageMSCleaner::queryStopPointMode ( ) const

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

casacore::Bool casa::ImageMSCleaner::setcontrol ( casacore::CleanEnums::CleanType  cleanType,
const casacore::Int  niter,
const casacore::Float  gain,
const casacore::Quantity aThreshold,
const casacore::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 casacore::Quantity so it can be given in per cents.

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

This version of the method disables stopping on fractional threshold.

void casa::ImageMSCleaner::setMask ( casacore::ImageInterface< casacore::Float > &  mask,
const casacore::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.

void casa::ImageMSCleaner::setPsf ( casacore::ImageInterface< casacore::Float > &  psf)

Change the psf image.

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

Set a specific set of scales.

void casa::ImageMSCleaner::setSmallScaleBias ( const casacore::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.

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

Helper function to setup some param.

void casa::ImageMSCleaner::speedup ( const casacore::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 casacore::Int  starting = 0)

what iteration number to start on

void casa::ImageMSCleaner::stopAtLargeScaleNegative ( )

During early iterations of a cycled casacore::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 ( casacore::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.

void casa::ImageMSCleaner::update ( casacore::ImageInterface< casacore::Float > &  dirty)

Update the dirty image only.

Member Data Documentation

casacore::Int casa::ImageMSCleaner::chanAxis_p
private

Definition at line 207 of file ImageMSCleaner.h.

casacore::ImageInterface<casacore::Float>* casa::ImageMSCleaner::dirty_p
private

Definition at line 201 of file ImageMSCleaner.h.

casacore::ImageInterface<casacore::Float>* casa::ImageMSCleaner::mask_p
private

Definition at line 202 of file ImageMSCleaner.h.

casacore::Float casa::ImageMSCleaner::maskThresh_p
private

Definition at line 212 of file ImageMSCleaner.h.

MatrixCleaner casa::ImageMSCleaner::matClean_p
private

Definition at line 199 of file ImageMSCleaner.h.

casacore::Float casa::ImageMSCleaner::maxResidual_p
private

Definition at line 213 of file ImageMSCleaner.h.

Referenced by maxResidual().

casacore::Int casa::ImageMSCleaner::nImChan_p
private

Definition at line 204 of file ImageMSCleaner.h.

casacore::Int casa::ImageMSCleaner::nImPol_p
private

Definition at line 206 of file ImageMSCleaner.h.

casacore::Int casa::ImageMSCleaner::nMaskChan_p
private

Definition at line 209 of file ImageMSCleaner.h.

casacore::Int casa::ImageMSCleaner::nMaskPol_p
private

Definition at line 210 of file ImageMSCleaner.h.

casacore::Int casa::ImageMSCleaner::nPsfChan_p
private

Definition at line 203 of file ImageMSCleaner.h.

casacore::Int casa::ImageMSCleaner::nPsfPol_p
private

Definition at line 205 of file ImageMSCleaner.h.

casacore::Int casa::ImageMSCleaner::polAxis_p
private

Definition at line 208 of file ImageMSCleaner.h.

casacore::ImageInterface<casacore::Float>* casa::ImageMSCleaner::psf_p
private

Definition at line 200 of file ImageMSCleaner.h.

casacore::Vector<casacore::Float> casa::ImageMSCleaner::scales_p
private

Definition at line 211 of file ImageMSCleaner.h.


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