28 #ifndef SYNTHESIS_MULTITERMLATTICECLEANER_H
29 #define SYNTHESIS_MULTITERMLATTICECLEANER_H
casacore::Bool initialise(casacore::Int nx, casacore::Int ny)
Initialize all the memory being used.
A Vector of integers, for indexing into Array<T> objects.
casacore::Int verifyScaleSizes()
Initial setup functions.
casacore::Bool getmodel(int order, casacore::Matrix< casacore::Float > &model)
Output : Model images.
casacore::FFTServer< casacore::Float, casacore::Complex > fftcomplex
FFTserver.
casacore::IPosition psfsupport_p
casacore::Int computeHessianPeak()
Calculate Hessian elements and check for invertibility Does not have to be called externally...
casacore::Int IND2(casacore::Int taylor, casacore::Int scale)
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
casacore::Block< casacore::Matrix< casacore::Complex > > vecScalesFT_p
casacore::Int maxscaleindex_p
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
casacore::Int solveMatrixEqn(casacore::Int ntaylor, casacore::Int scale, casacore::IPosition blc, casacore::IPosition trc)
Solver functions : minor-cycle iterations.
casacore::Vector< casacore::Float > scaleSizes_p
casacore::IPosition globalmaxpos_p
casacore::Bool setmask(casacore::Matrix< casacore::Float > &mask)
casacore::Input : mask
casacore::Bool doneCONV_p
casacore::Bool setmodel(int order, casacore::Matrix< casacore::Float > &model)
casacore::Input : model images
casacore::IPosition psfpeak_p
casacore::Matrix< casacore::Complex > dirtyFT_p
casacore::Float itsMaskThreshold
casacore::Bool setresidual(int order, casacore::Matrix< casacore::Float > &dirty)
casacore::Input : psfs and dirty images
casacore::Bool getresidual(int order, casacore::Matrix< casacore::Float > &residual)
Output : psfs and dirty images.
casacore::Int computeFluxLimit(casacore::Float &fluxlimit, casacore::Float threshold)
casacore::Int mtclean(casacore::Int maxniter, casacore::Float stopfraction, casacore::Float inputgain, casacore::Float userthreshold)
Run the minor cycle.
ostream-like interface to creating log messages.
casacore::Vector< casacore::Float > totalTaylorFlux_p
casacore::Block< casacore::Matrix< casacore::Float > > vecDirty_p
I_D : Residual/Dirty Images [nx,ny,ntaylor].
casacore::Bool setscales(const casacore::Vector< casacore::Float > &scales)
casacore::Input : scales
casacore::Block< casacore::Matrix< casacore::Double > > matA_p
Solve [A][Coeffs] = [I_D * B] Shape of A : [ntaylor,ntaylor].
casacore::Int itercount_p
casacore::Int computeRHS()
casacore::Int psfntaylor_p
casacore::CountedPtr< casacore::Matrix< casacore::Float > > itsMask
casacore::IPosition itsPositionPeakPsf
casacore::Int setupUserMask()
Setup per major cycle.
casacore::Float rmaxval_p
casacore::IPosition trcPsf_p
casacore::Bool computeprincipalsolution()
Compute principal solution - in-place on the residual images in vecDirty.
casacore::Int ntaylor_p
using MatrixCleaner::makeScaleMasks;
casacore::Int checkConvergence(casacore::Int updatetype, casacore::Float &fluxlimit, casacore::Float &loopgain)
static casacore::Bool findMaxAbs(const casacore::Matrix< casacore::Float > &lattice, casacore::Float &maxAbs, casacore::IPosition &posMax)
Find the Peak of the matrix.
casacore::Block< casacore::Matrix< casacore::Double > > invMatA_p
casacore::Float min_max_p
casacore::Block< casacore::Matrix< casacore::Float > > vecScaleMasks_p
casacore::Int setupScaleFunctions()
casacore::Float stopfraction_p
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::Int writeMatrixToDisk(casacore::String imagename, casacore::Matrix< casacore::Float > &themat)
Helper functions.
casacore::Float getpeakresidual()
Output : Peak residual computed from matR_p (residual convolved with PSF).
casacore::Block< casacore::Matrix< casacore::Float > > vecScales_p
h(s) [nx,ny,nscales]
casacore::Bool validatePsf(const casacore::Matrix< casacore::Float > &psf)
Make sure that the peak of the Psf is within the image.
casacore::Int totalIters_p
casacore::Float userthreshold_p
MultiTermMatrixCleaner()
Create a cleaner.
casacore::Vector< casacore::IPosition > maxScalePos_p
casacore::Bool setntaylorterms(const int &nterms)
casacore::Input : number of Taylor terms Reshapes PtrBlocks to hold the correct number of PSFs and Re...
casacore::Int IND4(casacore::Int taylor1, casacore::Int taylor2, casacore::Int scale1, casacore::Int scale2)
casacore::Matrix< casacore::Complex > cWork_p
A copy of casacore::LatticeCleaner but just using 2-D matrices.
casacore::Bool buildImagePatches()
casacore::IPosition blc_p
casacore::Vector< casacore::Float > scaleBias_p
casacore::IPosition trc_p
casacore::Float prev_max_p
casacore::Vector< casacore::Float > totalScaleFlux_p
casacore::Vector< casacore::Float > maxScaleVal_p
casacore::Block< casacore::Matrix< casacore::Float > > cubeA_p
casacore::Block <casacore::Matrix<casacore::Float> > vecScaleModel_p;
casacore::Int itsMaxNiter
casacore::Int updateModelAndRHS(casacore::Float loopgain)
casacore::Block< casacore::Matrix< casacore::Float > > vecWork_p
casacore::Int chooseComponent(casacore::Int ntaylor, casacore::Int scale, casacore::Int criterion, casacore::IPosition blc, casacore::IPosition trc)
casacore::Int allocateMemory()
~MultiTermMatrixCleaner()
The copy constructor uses reference semantics MultiTermMatrixCleaner(const MultiTermMatrixCleaner & o...
String: the storage and methods of handling collections of characters.
casacore::Block< casacore::Matrix< casacore::Float > > vecModel_p
I_M : Model Images [nx,ny,ntaylor].
casacore::Float inputgain_p
casacore::Block< casacore::Matrix< casacore::Complex > > vecPsfFT_p
B_k [nx,ny,ntaylor] casacore::Block<casacore::Matrix<casacore::Float> > vecPsf_p;.
casacore::Bool setpsf(int order, casacore::Matrix< casacore::Float > &psf)
casacore::Input : psfs and dirty images
casacore::CleanEnums::CleanType itsCleanType
casacore::Int updateRHS(casacore::Int ntaylor, casacore::Int scale, casacore::Float loopgain, casacore::Vector< casacore::Float > coeffs, casacore::IPosition blc, casacore::IPosition trc, casacore::IPosition blcPsf, casacore::IPosition trcPsf)
casacore::Block< casacore::Matrix< casacore::Float > > matCoeffs_p
a_{sk} = Solution vectors.
void makeScale(casacore::Matrix< casacore::Float > &scale, const casacore::Float &scaleSize)
Make an array of the specified scale.
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::Block< casacore::Matrix< casacore::Float > > matR_p
R_{sk} = I_D * B_{sk} [nx,ny,ntaylor,nscales].
casacore::Bool getinvhessian(casacore::Matrix< casacore::Double > &invhessian)
Output : Hessian matrix.
casacore::Bool donePSP_p
casacore::Int nx,ny;
casacore::Float globalmaxval_p
casacore::Double memoryMB_p
casacore::Memory to be allocated per Matrix
casacore::IPosition blcPsf_p