29 #ifndef LATTICES_LATTICECLEANER_H
30 #define LATTICES_LATTICECLEANER_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Quanta/Quantum.h>
35 #include <casacore/lattices/Lattices/TempLattice.h>
36 #include <casacore/casa/Arrays/IPosition.h>
37 #include <casacore/casa/Arrays/Vector.h>
38 #include <casacore/casa/Containers/Block.h>
43 class LatticeCleanProgress;
44 template <
class T>
class TempLattice;
335 #ifndef CASACORE_NO_AUTO_TEMPLATES
336 #include <casacore/lattices/LatticeMath/LatticeCleaner.tcc>
A class for doing multi-dimensional cleaning.
Bool findMaxAbsMaskLattice(const Lattice< T > &lattice, const Lattice< T > &mask, T &maxAbs, IPosition &posMax)
Find the Peak of the lattice, applying a mask.
PtrBlock< TempLattice< T > * > itsScales
T itsMaskThreshold
threshold for masks.
Vector< Float > itsScaleSizes
~LatticeCleaner()
The destructor does nothing special.
Bool itsChoose
Let the user choose whether to stop.
void stopPointMode(Int nStopPointMode)
Some algorithms require that the cycles be terminated when the image is dominated by point sources; i...
Int clean(Lattice< T > &model, LatticeCleanProgress *progress=0)
Clean an image.
Bool setscales(const Vector< Float > &scales)
Set a specific set of scales.
LatticeCleaner(const Lattice< T > &psf, const Lattice< T > &dirty)
Create a cleaner for a specific dirty image and PSF.
Double itsMemoryMB
Memory to be allocated per TempLattice.
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 cleanType - type of the cleaning algorithm to use (HOGBOM,...
IPosition itsPositionPeakPsf
static 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.
PtrBlock< TempLattice< T > * > itsDirtyConvScales
void setMask(Lattice< T > &mask, const T &maskThreshold=T(0.9))
Set the mask mask - input mask lattice maskThreshold - if positive, the value is treated as a thresho...
Quantum< Double > itsFracThreshold
Bool setcontrol(CleanEnums::CleanType cleanType, const Int niter, const Float gain, const Quantity &threshold, const Bool choose=True)
This version of the method disables stopping on fractional threshold.
Int numberIterations() const
static Bool findMaxAbsLattice(const Lattice< T > &lattice, T &maxAbs, IPosition &posMax)
Find the Peak of the Lattice.
Bool setscales(const Int nscales, const Float scaleInc=1.0)
Set a number of scale sizes.
Bool validatePsf(const Lattice< T > &psf)
Make sure that the peak of the Psf is within the image.
void speedup(const Float Ndouble)
speedup() will speed the clean iteration by raising the threshold.
PtrBlock< TempLattice< Complex > * > itsScaleXfrs
void ignoreCenterBox(Bool huh)
Tell the algorithm to NOT clean just the inner quarter (This is useful when multiscale clean is being...
Float threshold() const
Method to return threshold, including any speedup factors.
void startingIteration(const Int starting=0)
what iteration number to start on
TempLattice< T > * itsMask
LatticeCleaner< T > & operator=(const LatticeCleaner< T > &other)
The assignment operator also uses reference semantics.
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 ...
LatticeCleaner()
Create a cleaner : default constructor.
CleanEnums::CleanType itsCleanType
void update(const Lattice< T > &dirty)
Update the dirty image only.
Bool itsDoSpeedup
Threshold speedup factors:
Vector< Float > itsTotalFluxScale
T strengthOptimum() const
Method to return the strength optimum achieved at the last clean iteration The output of this method ...
Int index(const Int scale, const Int otherscale)
Calculate index into PsfConvScales.
Bool queryStopPointMode() const
After completion of cycle, querry this to find out if we stopped because of stopPointMode.
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
TempLattice< Complex > * itsXfr
Lattice< T > * residual()
Look at what WE think the residuals look like Assumes the first scale is zero-sized.
Float spheroidal(Float nu)
Make Spheroidal function for scale images.
Bool itsStopAtLargeScaleNegative
Int iteration() const
return how many iterations we did do
Quantum< Double > itsThreshold
TempLattice< T > * itsDirty
PtrBlock< TempLattice< T > * > itsPsfConvScales
PtrBlock< TempLattice< T > * > itsScaleMasks
LatticeCleaner(const LatticeCleaner< T > &other)
The copy constructor uses reference semantics.
void stopAtLargeScaleNegative()
During early iterations of a cycled MS Clean in mosaicing, it common to come across an ocsilatory pat...
A drop-in replacement for Block<T*>.
this file contains all the compiler specific defines
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
bool Bool
Define the standard types used by Casacore.