casa
5.7.0-16
|
A simple deconvolver operating on images (no SkyEquation) More...
#include <Deconvolver.h>
Public Member Functions | |
Deconvolver () | |
"deconvolver" ctor More... | |
Deconvolver (const casacore::String &dirty, const casacore::String &psf) | |
Deconvolver (const Deconvolver &other) | |
Deconvolver & | operator= (const Deconvolver &other) |
~Deconvolver () | |
casacore::Bool | open (const casacore::String &dirty, const casacore::String &psf, casacore::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. More... | |
casacore::Bool | reopen () |
After some cleaning, the dirty image is replaced with the residual image in the deconvolver tool. More... | |
casacore::Bool | close () |
Flush the ms to disk and detach from the ms file. More... | |
casacore::String | dirtyname () const |
casacore::String | psfname () const |
casacore::Bool | summary () const |
Output a summary of the state of the object. More... | |
casacore::String | state () const |
Return the state of the object as a string. More... | |
casacore::IPosition | imageshape () const |
Return the image shape. More... | |
casacore::Bool | restore (const casacore::String &model, const casacore::String &image, casacore::GaussianBeam &mbeam) |
Restore. More... | |
casacore::Bool | residual (const casacore::String &model, const casacore::String &image) |
Residual. More... | |
casacore::Bool | smooth (const casacore::String &model, const casacore::String &image, casacore::GaussianBeam &mbeam, casacore::Bool normalizeVolume) |
Smooth. More... | |
casacore::Bool | clean (const casacore::String &algorithm, const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold, const casacore::Bool displayProgress, const casacore::String &model, const casacore::String &mask, casacore::Float &maxResidual, casacore::Int &iterationsDone) |
Clean algorithm maxResidual and iterationsDone are return values More... | |
casacore::Bool | naclean (const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold, const casacore::String &model, const casacore::String &mask, const casacore::Int masksupp, const casacore::Int memoryType, const casacore::Float numSigma, casacore::Float &maxResidual, casacore::Int &iterationsDone) |
casacore::Bool | clarkclean (const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold, const casacore::String &model, const casacore::String &maskName, casacore::Float &maxresid, casacore::Int &iterused, casacore::Float cycleFactor=1.5) |
Clark Clean but image, psf, mask has to be 4-axes in the canonical casa order. More... | |
casacore::Bool | clarkclean (const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold, const casacore::Bool displayProgress, const casacore::String &model, const casacore::String &mask, const casacore::Int histBins, const casacore::Vector< casacore::Int > &psfPatchSize, const casacore::Float maxExtPsf, const casacore::Float speedUp, casacore::Int maxNumPix, const casacore::Int maxNumMajorCycles, const casacore::Int maxNumMinorIterations) |
Clark Clean algorithm. More... | |
casacore::Bool | mem (const casacore::String &algorithm, const casacore::Int niter, const casacore::Quantity &sigma, const casacore::Quantity &targetFlux, casacore::Bool constrainTargetFlux, casacore::Bool displayprogress, const casacore::String &model, const casacore::String &prior="", const casacore::String &mask="", const casacore::Bool imagePlane=false) |
MEM algorithm add other inputs as required. More... | |
casacore::Bool | makeprior (const casacore::String &prior, const casacore::String &templateImage, const casacore::Quantity &lowClipfrom, const casacore::Quantity &lowClipto, const casacore::Quantity &highClipfrom, const casacore::Quantity &highClipto, const casacore::Vector< casacore::Int > &blc, const casacore::Vector< casacore::Int > &trc) |
make a prior image More... | |
casacore::Bool | setscales (const casacore::String &scaleMethod, const casacore::Int nscales, const casacore::Vector< casacore::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. More... | |
casacore::Bool | nnls (const casacore::String &algorithm, const casacore::Int niter, const casacore::Float tolerance, const casacore::String &model, const casacore::String &fluxMask, const casacore::String &dataMask) |
NNLS algorithm. More... | |
casacore::Bool | ft (const casacore::String &model, const casacore::String &transform) |
Fourier transform the model and componentlist. More... | |
casacore::Bool | make (const casacore::String &model) |
Make an empty image. More... | |
casacore::Bool | make1 (const casacore::String &imagename) |
Make an empty image with just one casacore::Stokes pixel (ie, for a mask) More... | |
casacore::Bool | make (const casacore::String &model, casacore::ImageInterface< casacore::Float > &templateImage) |
Make an empty image modeled after templateImage. More... | |
casacore::Bool | boxmask (const casacore::String &boxmask, const casacore::Vector< casacore::Int > blc, const casacore::Vector< casacore::Int > trc, const casacore::Quantity &fillValue=1.0, const casacore::Quantity &externalValue=0.0) |
Make a Box Mask. More... | |
casacore::Bool | regionmask (const casacore::String &maskimage, casacore::Record *imageRegRec, casacore::Matrix< casacore::Quantity > &blctrcs, const casacore::Float &value=1.0) |
make a mask image from regions More... | |
casacore::Bool | clipimage (const casacore::String &clippedImage, const casacore::String &inputImage, const casacore::Quantity &threshold) |
Clip an image below some casacore::Stokes I threshold. More... | |
casacore::Bool | fitpsf (const casacore::String &psf, casacore::GaussianBeam &beam) |
Fit the psf. More... | |
casacore::Bool | convolve (const casacore::String &convolvedmodel, const casacore::String &model) |
Convolve one image with another. More... | |
casacore::Bool | makegaussian (const casacore::String &gaussianimage, casacore::GaussianBeam &mbeam, casacore::Bool normalizeVolume) |
Make a Gaussian – you might want to use it for convolution, etc. More... | |
casacore::Bool | mtopen (const casacore::Int nTaylor, const casacore::Vector< casacore::Float > &userScaleSizes, const casacore::Vector< casacore::String > &psfs) |
---------------— Multi-Term Deconvolver functions - START -------------------— Initialize the Multi-Term casacore::Matrix Cleaners and compute Hessian elements. More... | |
casacore::Bool | mtclean (const casacore::Vector< casacore::String > &residuals, const casacore::Vector< casacore::String > &models, const casacore::Int niter, const casacore::Float gain, const casacore::Quantity &threshold, const casacore::Bool displayProgress, const casacore::String &mask, casacore::Float &maxResidual, casacore::Int &iterationsDone) |
Do component-finding iterations. More... | |
casacore::Bool | mtrestore (const casacore::Vector< casacore::String > &models, const casacore::Vector< casacore::String > &residuals, const casacore::Vector< casacore::String > &images, casacore::GaussianBeam &mbeam) |
Restore the output images. More... | |
casacore::Bool | mtcalcpowerlaw (const casacore::Vector< casacore::String > &images, const casacore::Vector< casacore::String > &residuals, const casacore::String &alphaname, const casacore::String &betaname, const casacore::Quantity &threshold, const casacore::Bool calcerror) |
Calculate alpha and beta from restored images. More... | |
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 132 of file Deconvolver.h.
casa::Deconvolver::Deconvolver | ( | ) |
"deconvolver" ctor
casa::Deconvolver::Deconvolver | ( | const casacore::String & | dirty, |
const casacore::String & | psf | ||
) |
casa::Deconvolver::Deconvolver | ( | const Deconvolver & | other | ) |
casa::Deconvolver::~Deconvolver | ( | ) |
|
private |
Return full image as a SubImage.
casacore::Bool casa::Deconvolver::boxmask | ( | const casacore::String & | boxmask, |
const casacore::Vector< casacore::Int > | blc, | ||
const casacore::Vector< casacore::Int > | trc, | ||
const casacore::Quantity & | fillValue = 1.0 , |
||
const casacore::Quantity & | externalValue = 0.0 |
||
) |
Make a Box Mask.
|
private |
check mask
casacore::Bool casa::Deconvolver::clarkclean | ( | const casacore::Int | niter, |
const casacore::Float | gain, | ||
const casacore::Quantity & | threshold, | ||
const casacore::String & | model, | ||
const casacore::String & | maskName, | ||
casacore::Float & | maxresid, | ||
casacore::Int & | iterused, | ||
casacore::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
casacore::Bool casa::Deconvolver::clarkclean | ( | const casacore::Int | niter, |
const casacore::Float | gain, | ||
const casacore::Quantity & | threshold, | ||
const casacore::Bool | displayProgress, | ||
const casacore::String & | model, | ||
const casacore::String & | mask, | ||
const casacore::Int | histBins, | ||
const casacore::Vector< casacore::Int > & | psfPatchSize, | ||
const casacore::Float | maxExtPsf, | ||
const casacore::Float | speedUp, | ||
casacore::Int | maxNumPix, | ||
const casacore::Int | maxNumMajorCycles, | ||
const casacore::Int | maxNumMinorIterations | ||
) |
Clark Clean algorithm.
casacore::Bool casa::Deconvolver::clean | ( | const casacore::String & | algorithm, |
const casacore::Int | niter, | ||
const casacore::Float | gain, | ||
const casacore::Quantity & | threshold, | ||
const casacore::Bool | displayProgress, | ||
const casacore::String & | model, | ||
const casacore::String & | mask, | ||
casacore::Float & | maxResidual, | ||
casacore::Int & | iterationsDone | ||
) |
Clean algorithm
maxResidual and iterationsDone are return values
casacore::Bool casa::Deconvolver::clipimage | ( | const casacore::String & | clippedImage, |
const casacore::String & | inputImage, | ||
const casacore::Quantity & | threshold | ||
) |
Clip an image below some casacore::Stokes I threshold.
|
private |
Clone an image.
casacore::Bool casa::Deconvolver::close | ( | ) |
Flush the ms to disk and detach from the ms file.
All function calls after this will be a no-op.
casacore::Bool casa::Deconvolver::convolve | ( | const casacore::String & | convolvedmodel, |
const casacore::String & | model | ||
) |
Convolve one image with another.
|
private |
Embed a mask into an image.
A convenience function.
|
private |
Set the defaults.
|
private |
Prints an error message if the deconvolver DO is detached and returns true.
casacore::String casa::Deconvolver::dirtyname | ( | ) | const |
|
private |
find which axes are the spectral and pol one
casacore::Bool casa::Deconvolver::fitpsf | ( | const casacore::String & | psf, |
casacore::GaussianBeam & | beam | ||
) |
Fit the psf.
casacore::Bool casa::Deconvolver::ft | ( | const casacore::String & | model, |
const casacore::String & | transform | ||
) |
Fourier transform the model and componentlist.
|
private |
casacore::IPosition casa::Deconvolver::imageshape | ( | ) | const |
Return the image shape.
|
private |
------------—— Multi-Term Deconvolver functions - END ----------------——
Cut the inner quarter out of an image
casacore::Bool casa::Deconvolver::make | ( | const casacore::String & | model | ) |
Make an empty image.
casacore::Bool casa::Deconvolver::make | ( | const casacore::String & | model, |
casacore::ImageInterface< casacore::Float > & | templateImage | ||
) |
Make an empty image modeled after templateImage.
casacore::Bool casa::Deconvolver::make1 | ( | const casacore::String & | imagename | ) |
Make an empty image with just one casacore::Stokes pixel (ie, for a mask)
casacore::Bool casa::Deconvolver::makegaussian | ( | const casacore::String & | gaussianimage, |
casacore::GaussianBeam & | mbeam, | ||
casacore::Bool | normalizeVolume | ||
) |
Make a Gaussian – you might want to use it for convolution, etc.
casacore::Bool casa::Deconvolver::makeprior | ( | const casacore::String & | prior, |
const casacore::String & | templateImage, | ||
const casacore::Quantity & | lowClipfrom, | ||
const casacore::Quantity & | lowClipto, | ||
const casacore::Quantity & | highClipfrom, | ||
const casacore::Quantity & | highClipto, | ||
const casacore::Vector< casacore::Int > & | blc, | ||
const casacore::Vector< casacore::Int > & | trc | ||
) |
make a prior image
casacore::Bool casa::Deconvolver::mem | ( | const casacore::String & | algorithm, |
const casacore::Int | niter, | ||
const casacore::Quantity & | sigma, | ||
const casacore::Quantity & | targetFlux, | ||
casacore::Bool | constrainTargetFlux, | ||
casacore::Bool | displayprogress, | ||
const casacore::String & | model, | ||
const casacore::String & | prior = "" , |
||
const casacore::String & | mask = "" , |
||
const casacore::Bool | imagePlane = false |
||
) |
MEM algorithm add other inputs as required.
casacore::Bool casa::Deconvolver::mtcalcpowerlaw | ( | const casacore::Vector< casacore::String > & | images, |
const casacore::Vector< casacore::String > & | residuals, | ||
const casacore::String & | alphaname, | ||
const casacore::String & | betaname, | ||
const casacore::Quantity & | threshold, | ||
const casacore::Bool | calcerror | ||
) |
Calculate alpha and beta from restored images.
casacore::Bool casa::Deconvolver::mtclean | ( | const casacore::Vector< casacore::String > & | residuals, |
const casacore::Vector< casacore::String > & | models, | ||
const casacore::Int | niter, | ||
const casacore::Float | gain, | ||
const casacore::Quantity & | threshold, | ||
const casacore::Bool | displayProgress, | ||
const casacore::String & | mask, | ||
casacore::Float & | maxResidual, | ||
casacore::Int & | iterationsDone | ||
) |
Do component-finding iterations.
casacore::Bool casa::Deconvolver::mtopen | ( | const casacore::Int | nTaylor, |
const casacore::Vector< casacore::Float > & | userScaleSizes, | ||
const casacore::Vector< casacore::String > & | psfs | ||
) |
---------------— Multi-Term Deconvolver functions - START -------------------— Initialize the Multi-Term casacore::Matrix Cleaners and compute Hessian elements.
casacore::Bool casa::Deconvolver::mtrestore | ( | const casacore::Vector< casacore::String > & | models, |
const casacore::Vector< casacore::String > & | residuals, | ||
const casacore::Vector< casacore::String > & | images, | ||
casacore::GaussianBeam & | mbeam | ||
) |
Restore the output images.
casacore::Bool casa::Deconvolver::naclean | ( | const casacore::Int | niter, |
const casacore::Float | gain, | ||
const casacore::Quantity & | threshold, | ||
const casacore::String & | model, | ||
const casacore::String & | mask, | ||
const casacore::Int | masksupp, | ||
const casacore::Int | memoryType, | ||
const casacore::Float | numSigma, | ||
casacore::Float & | maxResidual, | ||
casacore::Int & | iterationsDone | ||
) |
casacore::Bool casa::Deconvolver::nnls | ( | const casacore::String & | algorithm, |
const casacore::Int | niter, | ||
const casacore::Float | tolerance, | ||
const casacore::String & | model, | ||
const casacore::String & | fluxMask, | ||
const casacore::String & | dataMask | ||
) |
NNLS algorithm.
casacore::Bool casa::Deconvolver::open | ( | const casacore::String & | dirty, |
const casacore::String & | psf, | ||
casacore::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 | ) |
casacore::String casa::Deconvolver::psfname | ( | ) | const |
|
private |
Put a unit peak gaussian at centre.
casacore::Bool casa::Deconvolver::regionmask | ( | const casacore::String & | maskimage, |
casacore::Record * | imageRegRec, | ||
casacore::Matrix< casacore::Quantity > & | blctrcs, | ||
const casacore::Float & | value = 1.0 |
||
) |
make a mask image from regions
|
private |
casacore::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
casacore::Bool casa::Deconvolver::residual | ( | const casacore::String & | model, |
const casacore::String & | image | ||
) |
Residual.
casacore::Bool casa::Deconvolver::restore | ( | const casacore::String & | model, |
const casacore::String & | image, | ||
casacore::GaussianBeam & | mbeam | ||
) |
Restore.
casacore::Bool casa::Deconvolver::setscales | ( | const casacore::String & | scaleMethod, |
const casacore::Int | nscales, | ||
const casacore::Vector< casacore::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.
|
private |
setup lattice cleaner
casacore::Bool casa::Deconvolver::smooth | ( | const casacore::String & | model, |
const casacore::String & | image, | ||
casacore::GaussianBeam & | mbeam, | ||
casacore::Bool | normalizeVolume | ||
) |
Smooth.
casacore::String casa::Deconvolver::state | ( | ) | const |
Return the state of the object as a string.
casacore::Bool casa::Deconvolver::summary | ( | ) | const |
Output a summary of the state of the object.
|
private |
|
private |
Definition at line 364 of file Deconvolver.h.
|
private |
casacore::Quantity bmaj_p, bmin_p, bpa_p;
Definition at line 366 of file Deconvolver.h.
|
private |
Definition at line 362 of file Deconvolver.h.
|
private |
Definition at line 356 of file Deconvolver.h.
|
private |
Definition at line 353 of file Deconvolver.h.
|
private |
Definition at line 350 of file Deconvolver.h.
|
private |
Definition at line 367 of file Deconvolver.h.
|
private |
Definition at line 369 of file Deconvolver.h.
|
private |
Definition at line 372 of file Deconvolver.h.
|
private |
Definition at line 371 of file Deconvolver.h.
|
private |
Definition at line 355 of file Deconvolver.h.
|
private |
Definition at line 363 of file Deconvolver.h.
|
private |
Definition at line 377 of file Deconvolver.h.
|
private |
Multi-Term private variables.
Definition at line 376 of file Deconvolver.h.
|
private |
Definition at line 378 of file Deconvolver.h.
|
private |
Definition at line 357 of file Deconvolver.h.
|
private |
Definition at line 361 of file Deconvolver.h.
|
private |
Definition at line 361 of file Deconvolver.h.
|
private |
Definition at line 361 of file Deconvolver.h.
|
private |
Definition at line 361 of file Deconvolver.h.
|
private |
Definition at line 362 of file Deconvolver.h.
|
private |
Definition at line 351 of file Deconvolver.h.
|
private |
Definition at line 368 of file Deconvolver.h.
|
private |
Definition at line 354 of file Deconvolver.h.
|
private |
Definition at line 373 of file Deconvolver.h.
|
private |
Definition at line 359 of file Deconvolver.h.