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

A simple deconvolver that masks by memory of previous peaks. More...

#include <MatrixNACleaner.h>

Public Member Functions

 MatrixNACleaner ()
 Create a cleaner : default constructor. More...
 
 MatrixNACleaner (const casacore::Matrix< casacore::Float > &psf, const casacore::Matrix< casacore::Float > &dirty, const casacore::Int memtype=2, const casacore::Float numSigma=5.0)
 Create a cleaner for a specific dirty image and PSF. More...
 
 MatrixNACleaner (const MatrixNACleaner &other)
 The copy constructor uses reference semantics. More...
 
MatrixNACleaneroperator= (const MatrixNACleaner &other)
 The assignment operator also uses reference semantics. More...
 
 ~MatrixNACleaner ()
 The destructor does nothing special. More...
 
void setDirty (const casacore::Matrix< casacore::Float > &dirty)
 Set the dirty image without calculating convolutions. More...
 
void setPsf (const casacore::Matrix< casacore::Float > &psf)
 change the psf don't forget to redo the setscales or run makePsfScales, followed by makeDirtyScales More...
 
void setcontrol (const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &aThresho, const casacore::Int masksupport=3, const casacore::Int memType=2, const casacore::Float numsigma=5.0)
 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 More...
 
casacore::Int iteration () const
 return how many iterations we did do More...
 
casacore::Float totalFlux () const
 Total flux accumulated so far. More...
 
casacore::Int clean (casacore::Matrix< casacore::Float > &model)
 Clean an image. More...
 
void setMask (casacore::Matrix< casacore::Float > &mask)
 Set the mask mask - input mask lattice. More...
 
void setPixFlag (const casacore::Matrix< casacore::Bool > &bitpix)
 
void unsetMask ()
 remove the mask; useful when keeping object and sending a new dirty image to clean one can set another mask then More...
 
void getMask (casacore::Matrix< casacore::Float > &mask)
 
casacore::Matrix< casacore::FloatgetResidual ()
 Look at what WE think the residuals look like. More...
 
casacore::Float threshold () const
 Method to return threshold. More...
 
casacore::Float maxResidual ()
 

Protected Member Functions

casacore::Bool validatePsf (const casacore::Matrix< casacore::Float > &psf)
 
Helper function to optimize adding

static void addTo(casacore::Matrix<casacore::Float>& to, const casacore::Matrix<casacore::Float> & add); More...

 
casacore::Bool findMaxAbsMask (const casacore::Matrix< casacore::Float > &lattice, casacore::Matrix< casacore::Float > &mask, casacore::Float &maxAbs, casacore::IPosition &posMax, const casacore::Int support=5)
 Find the Peak of the lattice, applying a mask. More...
 

Static Protected Member Functions

static void makeBoxesSameSize (casacore::IPosition &blc1, casacore::IPosition &trc1, casacore::IPosition &blc2, casacore::IPosition &trc2)
 Helper function to reduce the box sizes until the have the same size keeping the centers intact. More...
 

Protected Attributes

casacore::Float itsGain
 
casacore::Int itsMaxNiter
 
casacore::Quantum
< casacore::Double
itsThreshold
 

Private Member Functions

casacore::Float amnesiac (const casacore::Float &val)
 
casacore::Float weak (const casacore::Float &v)
 
casacore::Float medium (const casacore::Float &v)
 
casacore::Float strong (const casacore::Float &v)
 

Private Attributes

std::shared_ptr
< casacore::Matrix
< casacore::Float > > 
itsMask
 
std::shared_ptr
< casacore::Matrix
< casacore::Float > > 
itsDirty
 
std::shared_ptr
< casacore::Matrix
< casacore::Float > > 
itsPsf
 
std::shared_ptr
< casacore::Matrix
< casacore::Float > > 
itsResidual
 
std::shared_ptr
< casacore::Matrix
< casacore::Bool > > 
itsBitPix
 
casacore::Float itsMaximumResidual
 
casacore::Int itsIteration
 
casacore::Int itsStartingIter
 
casacore::Float itsTotalFlux
 
casacore::Int itsSupport
 
casacore::IPosition psfShape_p
 
casacore::IPosition itsPositionPeakPsf
 
casacore::Float itsRms
 
casacore::Int typeOfMemory_p
 
casacore::Float numSigma_p
 
std::function< casacore::Float(const
casacore::Float &)> 
f_p
 

Detailed Description

A simple deconvolver that masks by memory of previous peaks.

Synopsis

Evolution of a simple cleaner

A class for doing multi-dimensional cleaning

Intended use:

Public interface

Review Status

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

Prerequisite

Etymology

The MatrixNACleaner Uses the matrix class and cleaner is for deconvolver by CLEAN NA stands for Non Amnesiac...i.e remember where past peaks were to search in these region preferentially...i.e no need to mask

Synopsis

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

Example

Motivation

Thrown Exceptions

Definition at line 92 of file MatrixNACleaner.h.

Constructor & Destructor Documentation

casa::MatrixNACleaner::MatrixNACleaner ( )

Create a cleaner : default constructor.

casa::MatrixNACleaner::MatrixNACleaner ( const casacore::Matrix< casacore::Float > &  psf,
const casacore::Matrix< casacore::Float > &  dirty,
const casacore::Int  memtype = 2,
const casacore::Float  numSigma = 5.0 
)

Create a cleaner for a specific dirty image and PSF.

casa::MatrixNACleaner::MatrixNACleaner ( const MatrixNACleaner other)

The copy constructor uses reference semantics.

casa::MatrixNACleaner::~MatrixNACleaner ( )

The destructor does nothing special.

Member Function Documentation

casacore::Float casa::MatrixNACleaner::amnesiac ( const casacore::Float val)
private
casacore::Int casa::MatrixNACleaner::clean ( casacore::Matrix< casacore::Float > &  model)

Clean an image.

casacore::Bool casa::MatrixNACleaner::findMaxAbsMask ( const casacore::Matrix< casacore::Float > &  lattice,
casacore::Matrix< casacore::Float > &  mask,
casacore::Float maxAbs,
casacore::IPosition posMax,
const casacore::Int  support = 5 
)
protected

Find the Peak of the lattice, applying a mask.

void casa::MatrixNACleaner::getMask ( casacore::Matrix< casacore::Float > &  mask)
casacore::Matrix<casacore::Float> casa::MatrixNACleaner::getResidual ( )
inline

Look at what WE think the residuals look like.

Definition at line 168 of file MatrixNACleaner.h.

References itsResidual.

casacore::Int casa::MatrixNACleaner::iteration ( ) const
inline

return how many iterations we did do

Definition at line 138 of file MatrixNACleaner.h.

References itsIteration.

static void casa::MatrixNACleaner::makeBoxesSameSize ( casacore::IPosition blc1,
casacore::IPosition trc1,
casacore::IPosition blc2,
casacore::IPosition trc2 
)
staticprotected

Helper function to reduce the box sizes until the have the same size keeping the centers intact.

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

Definition at line 174 of file MatrixNACleaner.h.

References itsMaximumResidual.

casacore::Float casa::MatrixNACleaner::medium ( const casacore::Float v)
private
MatrixNACleaner& casa::MatrixNACleaner::operator= ( const MatrixNACleaner other)

The assignment operator also uses reference semantics.

void casa::MatrixNACleaner::setcontrol ( const casacore::Int  niter,
const casacore::Float  gain,
const casacore::Quantity aThresho,
const casacore::Int  masksupport = 3,
const casacore::Int  memType = 2,
const casacore::Float  numsigma = 5.0 
)

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

void casa::MatrixNACleaner::setDirty ( const casacore::Matrix< casacore::Float > &  dirty)

Set the dirty image without calculating convolutions.

can be done by calling makeDirtyScales or setscales if one want to redo the psfscales too.

void casa::MatrixNACleaner::setMask ( casacore::Matrix< casacore::Float > &  mask)

Set the mask mask - input mask lattice.

void casa::MatrixNACleaner::setPixFlag ( const casacore::Matrix< casacore::Bool > &  bitpix)
void casa::MatrixNACleaner::setPsf ( const casacore::Matrix< casacore::Float > &  psf)

change the psf don't forget to redo the setscales or run makePsfScales, followed by makeDirtyScales

casacore::Float casa::MatrixNACleaner::strong ( const casacore::Float v)
private
casacore::Float casa::MatrixNACleaner::threshold ( ) const

Method to return threshold.

casacore::Float casa::MatrixNACleaner::totalFlux ( ) const
inline

Total flux accumulated so far.

Definition at line 143 of file MatrixNACleaner.h.

References itsTotalFlux.

void casa::MatrixNACleaner::unsetMask ( )

remove the mask; useful when keeping object and sending a new dirty image to clean one can set another mask then

casacore::Bool casa::MatrixNACleaner::validatePsf ( const casacore::Matrix< casacore::Float > &  psf)
protected

Helper function to optimize adding

static void addTo(casacore::Matrix<casacore::Float>& to, const casacore::Matrix<casacore::Float> & add);

Make sure that the peak of the Psf is within the image

casacore::Float casa::MatrixNACleaner::weak ( const casacore::Float v)
private

Member Data Documentation

std::function<casacore::Float(const casacore::Float&)> casa::MatrixNACleaner::f_p
private

Definition at line 227 of file MatrixNACleaner.h.

std::shared_ptr<casacore::Matrix<casacore::Bool> > casa::MatrixNACleaner::itsBitPix
private

Definition at line 210 of file MatrixNACleaner.h.

std::shared_ptr<casacore::Matrix<casacore::Float> > casa::MatrixNACleaner::itsDirty
private

Definition at line 207 of file MatrixNACleaner.h.

casacore::Float casa::MatrixNACleaner::itsGain
protected

Definition at line 193 of file MatrixNACleaner.h.

casacore::Int casa::MatrixNACleaner::itsIteration
private

Definition at line 218 of file MatrixNACleaner.h.

Referenced by iteration().

std::shared_ptr<casacore::Matrix<casacore::Float> > casa::MatrixNACleaner::itsMask
private

Definition at line 206 of file MatrixNACleaner.h.

casacore::Float casa::MatrixNACleaner::itsMaximumResidual
private

Definition at line 217 of file MatrixNACleaner.h.

Referenced by maxResidual().

casacore::Int casa::MatrixNACleaner::itsMaxNiter
protected

Definition at line 194 of file MatrixNACleaner.h.

casacore::IPosition casa::MatrixNACleaner::itsPositionPeakPsf
private

Definition at line 223 of file MatrixNACleaner.h.

std::shared_ptr<casacore::Matrix<casacore::Float> > casa::MatrixNACleaner::itsPsf
private

Definition at line 208 of file MatrixNACleaner.h.

std::shared_ptr<casacore::Matrix<casacore::Float> > casa::MatrixNACleaner::itsResidual
private

Definition at line 209 of file MatrixNACleaner.h.

Referenced by getResidual().

casacore::Float casa::MatrixNACleaner::itsRms
private

Definition at line 224 of file MatrixNACleaner.h.

casacore::Int casa::MatrixNACleaner::itsStartingIter
private

Definition at line 219 of file MatrixNACleaner.h.

casacore::Int casa::MatrixNACleaner::itsSupport
private

Definition at line 221 of file MatrixNACleaner.h.

casacore::Quantum<casacore::Double> casa::MatrixNACleaner::itsThreshold
protected

Definition at line 195 of file MatrixNACleaner.h.

casacore::Float casa::MatrixNACleaner::itsTotalFlux
private

Definition at line 220 of file MatrixNACleaner.h.

Referenced by totalFlux().

casacore::Float casa::MatrixNACleaner::numSigma_p
private

Definition at line 226 of file MatrixNACleaner.h.

casacore::IPosition casa::MatrixNACleaner::psfShape_p
private

Definition at line 222 of file MatrixNACleaner.h.

casacore::Int casa::MatrixNACleaner::typeOfMemory_p
private

Definition at line 225 of file MatrixNACleaner.h.


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