A simple deconvolver operating on images (no SkyEquation). More...
#include <Deconvolver.h>
Public Member Functions | |
Deconvolver () | |
"deconvolver" ctor | |
Deconvolver (const String &dirty, const String &psf) | |
Deconvolver (const Deconvolver &other) | |
Deconvolver & | operator= (const Deconvolver &other) |
~Deconvolver () | |
Bool | open (const String &dirty, const String &psf, Bool warn=True) |
Open the given dirty image and psf If warn is true, print warnings about there being no psf if one is not supplied. | |
Bool | reopen () |
After some cleaning, the dirty image is replaced with the residual image in the deconvolver tool. | |
Bool | close () |
Flush the ms to disk and detach from the ms file. | |
String | dirtyname () const |
String | psfname () const |
Bool | summary () const |
Output a summary of the state of the object. | |
String | state () const |
Return the state of the object as a string. | |
IPosition | imageshape () const |
Return the image shape. | |
Bool | restore (const String &model, const String &image, GaussianBeam &mbeam) |
Restore. | |
Bool | residual (const String &model, const String &image) |
Residual. | |
Bool | smooth (const String &model, const String &image, GaussianBeam &mbeam, Bool normalizeVolume) |
Smooth. | |
Bool | clean (const String &algorithm, const Int niter, const Float gain, const Quantity &threshold, const Bool displayProgress, const String &model, const String &mask, Float &maxResidual, Int &iterationsDone) |
Clean algorithm maxResidual and iterationsDone are return values. | |
Bool | naclean (const Int niter, const Float gain, const Quantity &threshold, const String &model, const String &mask, const Int masksupp, const Int memoryType, const Float numSigma, Float &maxResidual, Int &iterationsDone) |
Bool | clarkclean (const Int niter, const Float gain, const Quantity &threshold, const String &model, const String &maskName, Float &maxresid, Int &iterused, Float cycleFactor=1.5) |
Clark Clean but image, psf, mask has to be 4-axes in the canonical casa order. | |
Bool | clarkclean (const Int niter, const Float gain, const Quantity &threshold, const Bool displayProgress, const String &model, const String &mask, const Int histBins, const Vector< Int > &psfPatchSize, const Float maxExtPsf, const Float speedUp, Int maxNumPix, const Int maxNumMajorCycles, const Int maxNumMinorIterations) |
Clark Clean algorithm. | |
Bool | mem (const String &algorithm, const Int niter, const Quantity &sigma, const Quantity &targetFlux, Bool constrainTargetFlux, Bool displayprogress, const String &model, const String &prior="", const String &mask="", const Bool imagePlane=False) |
MEM algorithm add other inputs as required. | |
Bool | makeprior (const String &prior, const String &templateImage, const Quantity &lowClipfrom, const Quantity &lowClipto, const Quantity &highClipfrom, const Quantity &highClipto, const Vector< Int > &blc, const Vector< Int > &trc) |
make a prior image | |
Bool | setscales (const String &scaleMethod, const Int nscales, const Vector< Float > &userScaleSizes) |
Set up scales: based on scaleMethod = "nscales" or "uservector", we will create the scale sizes in pixels via a power law or use the user specified scale sizes. | |
Bool | nnls (const String &algorithm, const Int niter, const Float tolerance, const String &model, const String &fluxMask, const String &dataMask) |
NNLS algorithm. | |
Bool | ft (const String &model, const String &transform) |
Fourier transform the model and componentlist. | |
Bool | make (const String &model) |
Make an empty image. | |
Bool | make1 (const String &imagename) |
Make an empty image with just one Stokes pixel (ie, for a mask). | |
Bool | make (const String &model, ImageInterface< Float > &templateImage) |
Make an empty image modeled after templateImage. | |
Bool | boxmask (const String &boxmask, const Vector< Int > blc, const Vector< Int > trc, const Quantity &fillValue=1.0, const Quantity &externalValue=0.0) |
Make a Box Mask. | |
Bool | regionmask (const String &maskimage, Record *imageRegRec, Matrix< Quantity > &blctrcs, const Float &value=1.0) |
make a mask image from regions | |
Bool | clipimage (const String &clippedImage, const String &inputImage, const Quantity &threshold) |
Clip an image below some Stokes I threshold. | |
Bool | fitpsf (const String &psf, GaussianBeam &beam) |
Fit the psf. | |
Bool | convolve (const String &convolvedmodel, const String &model) |
Convolve one image with another. | |
Bool | makegaussian (const String &gaussianimage, GaussianBeam &mbeam, Bool normalizeVolume) |
Make a Gaussian -- you might want to use it for convolution, etc. | |
Bool | mtopen (const Int nTaylor, const Vector< Float > &userScaleSizes, const Vector< String > &psfs) |
------------------ Multi-Term Deconvolver functions - START ---------------------- Initialize the Multi-Term Matrix Cleaners and compute Hessian elements. | |
Bool | mtclean (const Vector< String > &residuals, const Vector< String > &models, const Int niter, const Float gain, const Quantity &threshold, const Bool displayProgress, const String &mask, Float &maxResidual, Int &iterationsDone) |
Do component-finding iterations. | |
Bool | mtrestore (const Vector< String > &models, const Vector< String > &residuals, const Vector< String > &images, GaussianBeam &mbeam) |
Restore the output images. | |
Bool | mtcalcpowerlaw (const Vector< String > &images, const Vector< String > &residuals, const String &alphaname, const String &betaname, const Quantity &threshold, const Bool calcerror) |
Calculate alpha and beta from restored images. | |
Private Member Functions | |
SubImage< Float > * | innerQuarter (PagedImage< Float > &in) |
------------------ Multi-Term Deconvolver functions - END ---------------------- | |
SubImage< Float > * | allQuarters (PagedImage< Float > &in) |
Return full image as a SubImage. | |
Bool | clone (const String &imageName, const String &newImageName) |
Clone an image. | |
void | findAxes () |
find which axes are the spectral and pol one | |
void | checkMask (ImageInterface< Float > &maskimage, Int &xbeg, Int &xend, Int &ybeg, Int ¥d) |
check mask | |
Bool | setupLatCleaner (const String &algorithm, const Int niter, const Float gain, const Quantity &threshold, const Bool displayProgress) |
setup lattice cleaner | |
Bool | createMask (LatticeExpr< Bool > &lemask, ImageInterface< Float > &outimage) |
Embed a mask into an image. | |
Bool | putGaussian (ImageInterface< Float > &im, const GaussianBeam &beam) |
Put a unit peak gaussian at centre. | |
void | defaults () |
Set the defaults. | |
Bool | removeTable (const String &tablename) |
Bool | detached () const |
Prints an error message if the deconvolver DO is detached and returns True. | |
String | imageName () const |
Bool | valid () const |
Private Attributes | |
PagedImage< Float > * | dirty_p |
PagedImage< Float > * | psf_p |
LatticeConvolver< Float > * | convolver_p |
ResidualEquation< Lattice < Float > > * | residEqn_p |
LatConvEquation * | latConvEqn_p |
CountedPtr< ImageMSCleaner > | cleaner_p |
std::shared_ptr< ImageNACleaner > | naCleaner_p |
Bool | scalesValid_p |
Int | nx_p |
Int | ny_p |
Int | npol_p |
Int | nchan_p |
Int | chanAxis_p |
Int | polAxis_p |
String | mode_p |
GaussianBeam | beam_p |
Bool | beamValid_p |
Quantity bmaj_p, bmin_p, bpa_p;. | |
String | dirtyName_p |
String | psfName_p |
Bool | fullPlane_p |
Vector< Float > | itsTotalFluxScale |
Float | itsTotalFlux |
Vector< Float > | scaleSizes_p |
Int | mt_nterms_p |
Multi-Term private variables. | |
MultiTermMatrixCleaner | mt_cleaner_p |
Bool | mt_valid_p |
A simple deconvolver operating on images (no SkyEquation).
Public interface
Undo convolution or at least try to do it !
This class is a container that allows many SkyComponents to be grouped together and manipulated as a group. In this respect this class is identical to the ComponentList class. The user is encouraged to read the synopsis of that class for a general description of the capabilities of this class.
This class is differs from the ComponentList class in the following ways:
component(1)
rather than component(0)
in the ComponentList class. There is a one-to-one correspondence between the functions in the glish componentlist object (see the AIPS++ User Reference manual) and functions in this class. This is make simplify the porting from glish to C++ of a glish script using the componentlist distributed object.
These examples are coded in the tDOcomponentlist.h file.
In this example a ComponentList object is created and used to calculate the ..\.
This class was written to make the componentlist classes usable from glish
Definition at line 128 of file Deconvolver.h.
casa::Deconvolver::Deconvolver | ( | ) |
"deconvolver" ctor
casa::Deconvolver::Deconvolver | ( | const String & | dirty, | |
const String & | psf | |||
) |
casa::Deconvolver::Deconvolver | ( | const Deconvolver & | other | ) |
casa::Deconvolver::~Deconvolver | ( | ) |
SubImage<Float>* casa::Deconvolver::allQuarters | ( | PagedImage< Float > & | in | ) | [private] |
Return full image as a SubImage.
Bool casa::Deconvolver::boxmask | ( | const String & | boxmask, | |
const Vector< Int > | blc, | |||
const Vector< Int > | trc, | |||
const Quantity & | fillValue = 1.0 , |
|||
const Quantity & | externalValue = 0.0 | |||
) |
Make a Box Mask.
void casa::Deconvolver::checkMask | ( | ImageInterface< Float > & | maskimage, | |
Int & | xbeg, | |||
Int & | xend, | |||
Int & | ybeg, | |||
Int & | yend | |||
) | [private] |
check mask
Bool casa::Deconvolver::clarkclean | ( | const Int | niter, | |
const Float | gain, | |||
const Quantity & | threshold, | |||
const Bool | displayProgress, | |||
const String & | model, | |||
const String & | mask, | |||
const Int | histBins, | |||
const Vector< Int > & | psfPatchSize, | |||
const Float | maxExtPsf, | |||
const Float | speedUp, | |||
Int | maxNumPix, | |||
const Int | maxNumMajorCycles, | |||
const Int | maxNumMinorIterations | |||
) |
Clark Clean algorithm.
Bool casa::Deconvolver::clarkclean | ( | const Int | niter, | |
const Float | gain, | |||
const Quantity & | threshold, | |||
const String & | model, | |||
const String & | maskName, | |||
Float & | maxresid, | |||
Int & | iterused, | |||
Float | cycleFactor = 1.5 | |||
) |
Clark Clean but image, psf, mask has to be 4-axes in the canonical casa order.
Useful for cleaning dirty images made in CASA if mask is larger than a quarter of the image it will do a full image clean ...unlike the one below
Bool casa::Deconvolver::clean | ( | const String & | algorithm, | |
const Int | niter, | |||
const Float | gain, | |||
const Quantity & | threshold, | |||
const Bool | displayProgress, | |||
const String & | model, | |||
const String & | mask, | |||
Float & | maxResidual, | |||
Int & | iterationsDone | |||
) |
Clean algorithm maxResidual and iterationsDone are return values.
Bool casa::Deconvolver::clipimage | ( | const String & | clippedImage, | |
const String & | inputImage, | |||
const Quantity & | threshold | |||
) |
Clip an image below some Stokes I threshold.
Bool casa::Deconvolver::clone | ( | const String & | imageName, | |
const String & | newImageName | |||
) | [private] |
Clone an image.
Bool casa::Deconvolver::close | ( | ) |
Bool casa::Deconvolver::convolve | ( | const String & | convolvedmodel, | |
const String & | model | |||
) |
Convolve one image with another.
Bool casa::Deconvolver::createMask | ( | LatticeExpr< Bool > & | lemask, | |
ImageInterface< Float > & | outimage | |||
) | [private] |
Embed a mask into an image.
A convenience function.
void casa::Deconvolver::defaults | ( | ) | [private] |
Set the defaults.
Bool casa::Deconvolver::detached | ( | ) | const [private] |
Prints an error message if the deconvolver DO is detached and returns True.
String casa::Deconvolver::dirtyname | ( | ) | const |
void casa::Deconvolver::findAxes | ( | ) | [private] |
find which axes are the spectral and pol one
Bool casa::Deconvolver::fitpsf | ( | const String & | psf, | |
GaussianBeam & | beam | |||
) |
Fit the psf.
Bool casa::Deconvolver::ft | ( | const String & | model, | |
const String & | transform | |||
) |
Fourier transform the model and componentlist.
String casa::Deconvolver::imageName | ( | ) | const [private] |
IPosition casa::Deconvolver::imageshape | ( | ) | const |
Return the image shape.
SubImage<Float>* casa::Deconvolver::innerQuarter | ( | PagedImage< Float > & | in | ) | [private] |
------------------ Multi-Term Deconvolver functions - END ----------------------
Cut the inner quarter out of an image
Bool casa::Deconvolver::make | ( | const String & | model, | |
ImageInterface< Float > & | templateImage | |||
) |
Make an empty image modeled after templateImage.
Bool casa::Deconvolver::make | ( | const String & | model | ) |
Make an empty image.
Bool casa::Deconvolver::make1 | ( | const String & | imagename | ) |
Make an empty image with just one Stokes pixel (ie, for a mask).
Bool casa::Deconvolver::makegaussian | ( | const String & | gaussianimage, | |
GaussianBeam & | mbeam, | |||
Bool | normalizeVolume | |||
) |
Make a Gaussian -- you might want to use it for convolution, etc.
Bool casa::Deconvolver::makeprior | ( | const String & | prior, | |
const String & | templateImage, | |||
const Quantity & | lowClipfrom, | |||
const Quantity & | lowClipto, | |||
const Quantity & | highClipfrom, | |||
const Quantity & | highClipto, | |||
const Vector< Int > & | blc, | |||
const Vector< Int > & | trc | |||
) |
make a prior image
Bool casa::Deconvolver::mem | ( | const String & | algorithm, | |
const Int | niter, | |||
const Quantity & | sigma, | |||
const Quantity & | targetFlux, | |||
Bool | constrainTargetFlux, | |||
Bool | displayprogress, | |||
const String & | model, | |||
const String & | prior = "" , |
|||
const String & | mask = "" , |
|||
const Bool | imagePlane = False | |||
) |
MEM algorithm add other inputs as required.
Bool casa::Deconvolver::mtcalcpowerlaw | ( | const Vector< String > & | images, | |
const Vector< String > & | residuals, | |||
const String & | alphaname, | |||
const String & | betaname, | |||
const Quantity & | threshold, | |||
const Bool | calcerror | |||
) |
Calculate alpha and beta from restored images.
Bool casa::Deconvolver::mtclean | ( | const Vector< String > & | residuals, | |
const Vector< String > & | models, | |||
const Int | niter, | |||
const Float | gain, | |||
const Quantity & | threshold, | |||
const Bool | displayProgress, | |||
const String & | mask, | |||
Float & | maxResidual, | |||
Int & | iterationsDone | |||
) |
Do component-finding iterations.
Bool casa::Deconvolver::mtopen | ( | const Int | nTaylor, | |
const Vector< Float > & | userScaleSizes, | |||
const Vector< String > & | psfs | |||
) |
------------------ Multi-Term Deconvolver functions - START ---------------------- Initialize the Multi-Term Matrix Cleaners and compute Hessian elements.
Bool casa::Deconvolver::mtrestore | ( | const Vector< String > & | models, | |
const Vector< String > & | residuals, | |||
const Vector< String > & | images, | |||
GaussianBeam & | mbeam | |||
) |
Restore the output images.
Bool casa::Deconvolver::naclean | ( | const Int | niter, | |
const Float | gain, | |||
const Quantity & | threshold, | |||
const String & | model, | |||
const String & | mask, | |||
const Int | masksupp, | |||
const Int | memoryType, | |||
const Float | numSigma, | |||
Float & | maxResidual, | |||
Int & | iterationsDone | |||
) |
Bool casa::Deconvolver::nnls | ( | const String & | algorithm, | |
const Int | niter, | |||
const Float | tolerance, | |||
const String & | model, | |||
const String & | fluxMask, | |||
const String & | dataMask | |||
) |
NNLS algorithm.
Bool casa::Deconvolver::open | ( | const String & | dirty, | |
const String & | psf, | |||
Bool | warn = True | |||
) |
Open the given dirty image and psf If warn is true, print warnings about there being no psf if one is not supplied.
Deconvolver& casa::Deconvolver::operator= | ( | const Deconvolver & | other | ) |
String casa::Deconvolver::psfname | ( | ) | const |
Bool casa::Deconvolver::putGaussian | ( | ImageInterface< Float > & | im, | |
const GaussianBeam & | beam | |||
) | [private] |
Put a unit peak gaussian at centre.
Bool casa::Deconvolver::regionmask | ( | const String & | maskimage, | |
Record * | imageRegRec, | |||
Matrix< Quantity > & | blctrcs, | |||
const Float & | value = 1.0 | |||
) |
make a mask image from regions
Bool casa::Deconvolver::removeTable | ( | const String & | tablename | ) | [private] |
Bool casa::Deconvolver::reopen | ( | ) |
After some cleaning, the dirty image is replaced with the residual image in the deconvolver tool.
reopen reinstates that dirty image; cannot be invoked before open has been invoked
Bool casa::Deconvolver::residual | ( | const String & | model, | |
const String & | image | |||
) |
Residual.
Bool casa::Deconvolver::restore | ( | const String & | model, | |
const String & | image, | |||
GaussianBeam & | mbeam | |||
) |
Restore.
Bool casa::Deconvolver::setscales | ( | const String & | scaleMethod, | |
const Int | nscales, | |||
const Vector< Float > & | userScaleSizes | |||
) |
Set up scales: based on scaleMethod = "nscales" or "uservector", we will create the scale sizes in pixels via a power law or use the user specified scale sizes.
Bool casa::Deconvolver::setupLatCleaner | ( | const String & | algorithm, | |
const Int | niter, | |||
const Float | gain, | |||
const Quantity & | threshold, | |||
const Bool | displayProgress | |||
) | [private] |
setup lattice cleaner
Bool casa::Deconvolver::smooth | ( | const String & | model, | |
const String & | image, | |||
GaussianBeam & | mbeam, | |||
Bool | normalizeVolume | |||
) |
Smooth.
String casa::Deconvolver::state | ( | ) | const |
Return the state of the object as a string.
Bool casa::Deconvolver::summary | ( | ) | const |
Output a summary of the state of the object.
Bool casa::Deconvolver::valid | ( | ) | const [private] |
GaussianBeam casa::Deconvolver::beam_p [private] |
Definition at line 360 of file Deconvolver.h.
Bool casa::Deconvolver::beamValid_p [private] |
Quantity bmaj_p, bmin_p, bpa_p;.
Definition at line 362 of file Deconvolver.h.
Int casa::Deconvolver::chanAxis_p [private] |
Definition at line 358 of file Deconvolver.h.
CountedPtr<ImageMSCleaner> casa::Deconvolver::cleaner_p [private] |
Definition at line 352 of file Deconvolver.h.
LatticeConvolver<Float>* casa::Deconvolver::convolver_p [private] |
Definition at line 349 of file Deconvolver.h.
PagedImage<Float>* casa::Deconvolver::dirty_p [private] |
Definition at line 346 of file Deconvolver.h.
String casa::Deconvolver::dirtyName_p [private] |
Definition at line 363 of file Deconvolver.h.
Bool casa::Deconvolver::fullPlane_p [private] |
Definition at line 365 of file Deconvolver.h.
Float casa::Deconvolver::itsTotalFlux [private] |
Definition at line 368 of file Deconvolver.h.
Vector<Float> casa::Deconvolver::itsTotalFluxScale [private] |
Definition at line 367 of file Deconvolver.h.
LatConvEquation* casa::Deconvolver::latConvEqn_p [private] |
Definition at line 351 of file Deconvolver.h.
String casa::Deconvolver::mode_p [private] |
Definition at line 359 of file Deconvolver.h.
Definition at line 373 of file Deconvolver.h.
Int casa::Deconvolver::mt_nterms_p [private] |
Multi-Term private variables.
Definition at line 372 of file Deconvolver.h.
Bool casa::Deconvolver::mt_valid_p [private] |
Definition at line 374 of file Deconvolver.h.
std::shared_ptr<ImageNACleaner> casa::Deconvolver::naCleaner_p [private] |
Definition at line 353 of file Deconvolver.h.
Int casa::Deconvolver::nchan_p [private] |
Definition at line 357 of file Deconvolver.h.
Int casa::Deconvolver::npol_p [private] |
Definition at line 357 of file Deconvolver.h.
Int casa::Deconvolver::nx_p [private] |
Definition at line 357 of file Deconvolver.h.
Int casa::Deconvolver::ny_p [private] |
Definition at line 357 of file Deconvolver.h.
Int casa::Deconvolver::polAxis_p [private] |
Definition at line 358 of file Deconvolver.h.
PagedImage<Float>* casa::Deconvolver::psf_p [private] |
Definition at line 347 of file Deconvolver.h.
String casa::Deconvolver::psfName_p [private] |
Definition at line 364 of file Deconvolver.h.
ResidualEquation<Lattice<Float> >* casa::Deconvolver::residEqn_p [private] |
Definition at line 350 of file Deconvolver.h.
Vector<Float> casa::Deconvolver::scaleSizes_p [private] |
Definition at line 369 of file Deconvolver.h.
Bool casa::Deconvolver::scalesValid_p [private] |
Definition at line 355 of file Deconvolver.h.