29 #ifndef SYNTHESIS_MATRIXCLEANER_H
30 #define SYNTHESIS_MATRIXCLEANER_H
43 template <
class T>
class Matrix;
49 class MatrixNACleaner;
~MatrixCleaner()
The destructor does nothing special.
A Vector of integers, for indexing into Array<T> objects.
casacore::Int index(const casacore::Int scale, const casacore::Int otherscale)
Calculate index into PsfConvScales.
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 ...
casacore::Matrix< casacore::Float > residual()
Look at what WE think the residuals look like Assumes the first scale is zero-sized.
casacore::Float threshold() const
Method to return threshold, including any speedup factors.
casacore::Quantum< casacore::Double > itsThreshold
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
static casacore::Bool findPSFMaxAbs(const casacore::Matrix< casacore::Float > &lattice, casacore::Float &maxAbs, casacore::IPosition &posMax, const casacore::Int &supportSize=100)
This is made static since findMaxAbs is static(!).
casacore::Int itsIteration
casacore::Int itsStopPointMode
casacore::Int numberIterations() const
casacore::Float spheroidal(casacore::Float nu)
Make Spheroidal function for scale images.
casacore::Float itsMaximumResidual
casacore::Float itsMaskThreshold
void update(const casacore::Matrix< casacore::Float > &dirty)
Update the dirty image only (equiv of setDirty + makeDirtyScales)
void startingIteration(const casacore::Int starting=0)
what iteration number to start on
casacore::Int iteration() const
return how many iterations we did do
casacore::Bool setscales(const casacore::Int nscales, const casacore::Float scaleInc=1.0)
Set a number of scale sizes.
casacore::Quantum< casacore::Double > itsFracThreshold
casacore::Float totalFlux() const
Total flux accumulated so far.
void setPsf(const casacore::Matrix< casacore::Float > &psf)
change the psf don't forget to redo the setscales or run makePsfScales, followed by makeDirtyScales ...
casacore::CountedPtr< casacore::Matrix< casacore::Float > > itsMask
MatrixCleaner()
Create a cleaner : default constructor.
casacore::IPosition itsPositionPeakPsf
casacore::Vector< casacore::Float > itsScaleSizes
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.
casacore::Bool itsScalesValid
casacore::Float itsNDouble
casacore::Float strengthOptimum() const
Method to return the strength optimum achieved at the last clean iteration The output of this method ...
Referenced counted pointer for constant data.
static casacore::Bool findMaxAbs(const casacore::Matrix< casacore::Float > &lattice, casacore::Float &maxAbs, casacore::IPosition &posMax)
Find the Peak of the matrix.
void makeDirtyScales()
Calculate the convolutions for the dirt Obviously the.
casacore::Vector< casacore::Float > itsTotalFluxScale
void unsetMask()
remove the mask; useful when keeping object and sending a new dirty image to clean one can set anothe...
casacore::Bool itsStopAtLargeScaleNegative
casacore::Double itsMemoryMB
casacore::Memory to be allocated per TempLattice
casacore::Block< casacore::Matrix< casacore::Complex > > itsScaleXfrs
void ignoreCenterBox(casacore::Bool huh)
Tell the algorithm to NOT clean just the inner quarter (This is useful when multiscale clean is being...
casacore::Block< casacore::Matrix< casacore::Float > > itsPsfConvScales
casacore::Int findBeamPatch(const casacore::Float maxScaleSize, const casacore::Int &nx, const casacore::Int &ny, const casacore::Float psfBeam=4.0, const casacore::Float nBeams=20.0)
casacore::Bool itsDidStopPointMode
casacore::Bool itsJustStarting
bool Bool
Define the standard types used by Casacore.
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...
casacore::Float itsSmallScaleBias
casacore::Float itsTotalFlux
casacore::Bool validatePsf(const casacore::Matrix< casacore::Float > &psf)
Make sure that the peak of the Psf is within the image.
void setDirty(const casacore::Matrix< casacore::Float > &dirty)
Set the dirty image without calculating convolutions.
casacore::Bool makeScaleMasks()
Call the function below if the psf is changed..no need to setMask again.
casacore::Block< casacore::Matrix< casacore::Float > > itsScales
A copy of casacore::LatticeCleaner but just using 2-D matrices.
casacore::Float itsStrengthOptimum
A simple deconvolver that masks by memory of previous peaks.
void speedup(const casacore::Float Ndouble)
speedup() will speed the clean iteration by raising the threshold.
MatrixCleaner & operator=(const MatrixCleaner &other)
The assignment operator also uses reference semantics.
casacore::Int itsMaxNiter
casacore::IPosition psfShape_p
threshold for masks.
casacore::Int clean(casacore::Matrix< casacore::Float > &model, casacore::Bool doPlotProgress=false)
Clean an image.
casacore::Bool queryStopPointMode() const
After completion of cycle, querry this to find out if we stopped because of stopPointMode.
casacore::Bool destroyMasks()
casacore::Bool destroyScales()
casacore::Bool itsIgnoreCenterBox
void setMask(casacore::Matrix< 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 thresho...
casacore::CleanEnums::CleanType itsCleanType
void stopPointMode(casacore::Int nStopPointMode)
Some algorithms require that the cycles be terminated when the image is dominated by point sources; i...
void stopAtLargeScaleNegative()
During early iterations of a cycled casacore::MS Clean in mosaicing, it common to come across an ocsi...
casacore::Int itsStartingIter
void makeScale(casacore::Matrix< casacore::Float > &scale, const casacore::Float &scaleSize)
Make an array of the specified scale.
void defineScales(const casacore::Vector< casacore::Float > &scales)
just define the scales...nothing else is done the user will need to call setPsf+makePsfScales+setDirt...
casacore::Bool itsDoSpeedup
Threshold speedup factors:
void makePsfScales()
calculate the convolutions of the psf
casacore::Block< casacore::Matrix< casacore::Float > > itsDirtyConvScales
casacore::Bool findMaxAbsMask(const casacore::Matrix< casacore::Float > &lattice, const casacore::Matrix< casacore::Float > &mask, casacore::Float &maxAbs, casacore::IPosition &posMax)
Find the Peak of the lattice, applying a mask.
casacore::Bool itsChoose
Let the user choose whether to stop.
casacore::CountedPtr< casacore::Matrix< casacore::Float > > itsDirty
casacore::Block< casacore::Matrix< casacore::Float > > itsScaleMasks
casacore::CountedPtr< casacore::Matrix< casacore::Complex > > itsXfr
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.