A simple deconvolver that masks by memory of previous peaks. More...
#include <MatrixNACleaner.h>
Public Member Functions | |
MatrixNACleaner () | |
Create a cleaner : default constructor. | |
MatrixNACleaner (const Matrix< Float > &psf, const Matrix< Float > &dirty, const Int memtype=2, const Float numSigma=5.0) | |
Create a cleaner for a specific dirty image and PSF. | |
MatrixNACleaner (const MatrixNACleaner &other) | |
The copy constructor uses reference semantics. | |
MatrixNACleaner & | operator= (const MatrixNACleaner &other) |
The assignment operator also uses reference semantics. | |
~MatrixNACleaner () | |
The destructor does nothing special. | |
void | setDirty (const Matrix< Float > &dirty) |
Set the dirty image without calculating convolutions. | |
void | setPsf (const Matrix< Float > &psf) |
change the psf don't forget to redo the setscales or run makePsfScales, followed by makeDirtyScales | |
void | setcontrol (const Int niter, const Float gain, const Quantity &aThresho, const Int masksupport=3, const Int memType=2, const 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 | |
Int | iteration () const |
return how many iterations we did do | |
Float | totalFlux () const |
Total flux accumulated so far. | |
Int | clean (Matrix< Float > &model) |
Clean an image. | |
void | setMask (Matrix< Float > &mask) |
Set the mask mask - input mask lattice. | |
void | setPixFlag (const Matrix< 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 | |
void | getMask (Matrix< Float > &mask) |
Matrix< Float > | getResidual () |
Look at what WE think the residuals look like. | |
Float | threshold () const |
Method to return threshold. | |
Float | maxResidual () |
Protected Member Functions | |
Bool | validatePsf (const Matrix< Float > &psf) |
Helper function to optimize adding static void addTo(Matrix<Float>& to, const Matrix<Float> & add);. | |
Bool | findMaxAbsMask (const Matrix< Float > &lattice, Matrix< Float > &mask, Float &maxAbs, IPosition &posMax, const Int support=5) |
Find the Peak of the lattice, applying a mask. | |
Static Protected Member Functions | |
static void | makeBoxesSameSize (IPosition &blc1, IPosition &trc1, IPosition &blc2, IPosition &trc2) |
Helper function to reduce the box sizes until the have the same size keeping the centers intact. | |
Protected Attributes | |
Float | itsGain |
Int | itsMaxNiter |
Quantum< Double > | itsThreshold |
Private Member Functions | |
Float | amnesiac (const Float &val) |
Float | weak (const Float &v) |
Float | medium (const Float &v) |
Float | strong (const Float &v) |
Private Attributes | |
std::shared_ptr< Matrix< Float > > | itsMask |
std::shared_ptr< Matrix< Float > > | itsDirty |
std::shared_ptr< Matrix< Float > > | itsPsf |
std::shared_ptr< Matrix< Float > > | itsResidual |
std::shared_ptr< Matrix< Bool > > | itsBitPix |
Float | itsMaximumResidual |
Int | itsIteration |
Int | itsStartingIter |
Float | itsTotalFlux |
Int | itsSupport |
IPosition | psfShape_p |
IPosition | itsPositionPeakPsf |
Float | itsRms |
Int | typeOfMemory_p |
Float | numSigma_p |
std::function< Float(const Float &)> | f_p |
A simple deconvolver that masks by memory of previous peaks.
Evolution of a simple cleaner
A class for doing multi-dimensional cleaning
Public interface
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
This class will perform various types of Clean deconvolution on Lattices.
Definition at line 88 of file MatrixNACleaner.h.
casa::MatrixNACleaner::MatrixNACleaner | ( | ) |
Create a cleaner : default constructor.
casa::MatrixNACleaner::MatrixNACleaner | ( | const Matrix< Float > & | psf, | |
const Matrix< Float > & | dirty, | |||
const Int | memtype = 2 , |
|||
const 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.
Float casa::MatrixNACleaner::amnesiac | ( | const Float & | val | ) | [private] |
Int casa::MatrixNACleaner::clean | ( | Matrix< Float > & | model | ) |
Clean an image.
Bool casa::MatrixNACleaner::findMaxAbsMask | ( | const Matrix< Float > & | lattice, | |
Matrix< Float > & | mask, | |||
Float & | maxAbs, | |||
IPosition & | posMax, | |||
const Int | support = 5 | |||
) | [protected] |
Find the Peak of the lattice, applying a mask.
void casa::MatrixNACleaner::getMask | ( | Matrix< Float > & | mask | ) |
Matrix<Float> casa::MatrixNACleaner::getResidual | ( | ) | [inline] |
Look at what WE think the residuals look like.
Definition at line 164 of file MatrixNACleaner.h.
References itsResidual.
Int casa::MatrixNACleaner::iteration | ( | ) | const [inline] |
return how many iterations we did do
Definition at line 134 of file MatrixNACleaner.h.
References itsIteration.
static void casa::MatrixNACleaner::makeBoxesSameSize | ( | IPosition & | blc1, | |
IPosition & | trc1, | |||
IPosition & | blc2, | |||
IPosition & | trc2 | |||
) | [static, protected] |
Helper function to reduce the box sizes until the have the same size keeping the centers intact.
Float casa::MatrixNACleaner::maxResidual | ( | ) | [inline] |
Definition at line 170 of file MatrixNACleaner.h.
References itsMaximumResidual.
Float casa::MatrixNACleaner::medium | ( | const Float & | v | ) | [private] |
MatrixNACleaner& casa::MatrixNACleaner::operator= | ( | const MatrixNACleaner & | other | ) |
The assignment operator also uses reference semantics.
void casa::MatrixNACleaner::setcontrol | ( | const Int | niter, | |
const Float | gain, | |||
const Quantity & | aThresho, | |||
const Int | masksupport = 3 , |
|||
const Int | memType = 2 , |
|||
const 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 Matrix< 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 | ( | Matrix< Float > & | mask | ) |
Set the mask mask - input mask lattice.
void casa::MatrixNACleaner::setPixFlag | ( | const Matrix< Bool > & | bitpix | ) |
void casa::MatrixNACleaner::setPsf | ( | const Matrix< Float > & | psf | ) |
change the psf don't forget to redo the setscales or run makePsfScales, followed by makeDirtyScales
Float casa::MatrixNACleaner::strong | ( | const Float & | v | ) | [private] |
Float casa::MatrixNACleaner::threshold | ( | ) | const |
Method to return threshold.
Float casa::MatrixNACleaner::totalFlux | ( | ) | const [inline] |
Total flux accumulated so far.
Definition at line 139 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
Bool casa::MatrixNACleaner::validatePsf | ( | const Matrix< Float > & | psf | ) | [protected] |
Helper function to optimize adding static void addTo(Matrix<Float>& to, const Matrix<Float> & add);.
Make sure that the peak of the Psf is within the image
Float casa::MatrixNACleaner::weak | ( | const Float & | v | ) | [private] |
std::function<Float(const Float&)> casa::MatrixNACleaner::f_p [private] |
Definition at line 223 of file MatrixNACleaner.h.
std::shared_ptr<Matrix<Bool> > casa::MatrixNACleaner::itsBitPix [private] |
Definition at line 206 of file MatrixNACleaner.h.
std::shared_ptr<Matrix<Float> > casa::MatrixNACleaner::itsDirty [private] |
Definition at line 203 of file MatrixNACleaner.h.
Float casa::MatrixNACleaner::itsGain [protected] |
Definition at line 189 of file MatrixNACleaner.h.
Int casa::MatrixNACleaner::itsIteration [private] |
Definition at line 214 of file MatrixNACleaner.h.
Referenced by iteration().
std::shared_ptr<Matrix<Float> > casa::MatrixNACleaner::itsMask [private] |
Definition at line 202 of file MatrixNACleaner.h.
Float casa::MatrixNACleaner::itsMaximumResidual [private] |
Definition at line 213 of file MatrixNACleaner.h.
Referenced by maxResidual().
Int casa::MatrixNACleaner::itsMaxNiter [protected] |
Definition at line 190 of file MatrixNACleaner.h.
IPosition casa::MatrixNACleaner::itsPositionPeakPsf [private] |
Definition at line 219 of file MatrixNACleaner.h.
std::shared_ptr<Matrix<Float> > casa::MatrixNACleaner::itsPsf [private] |
Definition at line 204 of file MatrixNACleaner.h.
std::shared_ptr<Matrix<Float> > casa::MatrixNACleaner::itsResidual [private] |
Definition at line 205 of file MatrixNACleaner.h.
Referenced by getResidual().
Float casa::MatrixNACleaner::itsRms [private] |
Definition at line 220 of file MatrixNACleaner.h.
Int casa::MatrixNACleaner::itsStartingIter [private] |
Definition at line 215 of file MatrixNACleaner.h.
Int casa::MatrixNACleaner::itsSupport [private] |
Definition at line 217 of file MatrixNACleaner.h.
Quantum<Double> casa::MatrixNACleaner::itsThreshold [protected] |
Definition at line 191 of file MatrixNACleaner.h.
Float casa::MatrixNACleaner::itsTotalFlux [private] |
Definition at line 216 of file MatrixNACleaner.h.
Referenced by totalFlux().
Float casa::MatrixNACleaner::numSigma_p [private] |
Definition at line 222 of file MatrixNACleaner.h.
IPosition casa::MatrixNACleaner::psfShape_p [private] |
Definition at line 218 of file MatrixNACleaner.h.
Int casa::MatrixNACleaner::typeOfMemory_p [private] |
Definition at line 221 of file MatrixNACleaner.h.