casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
casa::ImageSkyModel Class Reference

Image Sky Model: Image-based Model for the Sky Brightness. More...

#include <ImageSkyModel.h>

Inheritance diagram for casa::ImageSkyModel:
casa::SkyModel casa::Iterate casa::CleanImageSkyModel casa::CEMemImageSkyModel casa::ClarkCleanImageSkyModel casa::CSCleanImageSkyModel casa::HogbomCleanImageSkyModel casa::MFCleanImageSkyModel casa::MSCleanImageSkyModel casa::NNLSImageSkyModel casa::PClarkCleanImageSkyModel casa::WBCleanImageSkyModel

List of all members.

Public Member Functions

 ImageSkyModel (const Int maxNumModels=1)
 Empty constructor.
void setMaxNumberModels (const Int maxNumModels)
 ImageSkyModel (const ImageSkyModel &sm)
 Copy constructor.
virtual Bool add (ComponentList &compList)
 Add a componentlist.
virtual Bool updatemodel (ComponentList &compList)
 update componentlist
virtual Int add (ImageInterface< Float > &image, const Int maxNumXfr=100)
 Add an image.
virtual Bool updatemodel (const Int thismodel, ImageInterface< Float > &image)
 update model image...you have to have added it before...nmodels_p held has to be bigger that image here its left to the caller to make sure the image is conformant...otherwise you are in trouble.
virtual Bool addResidual (Int image, ImageInterface< Float > &residual)
 Add a residual image.
virtual ~ImageSkyModel ()
 Destructor.
ImageSkyModeloperator= (const ImageSkyModel &other)
 Assignment operator.
virtual Int numberOfModels ()
 Number of models contained.
virtual Int numberOfTaylorTerms ()
 MFS : Number of taylor terms per model.
virtual Bool calculateCoeffResiduals ()
 MFS : In-place coefficient residual calculations.
virtual Bool calculateAlphaBeta (const Vector< String > &, const Vector< String > &)
 MFS : Calculate restored alpha and beta.
virtual Double getReferenceFrequency ()
 MFS : Reference Frequency.
virtual Int getTaylorIndex (Int index)
 MFS : Index of Taylor term in array of nmodels x ntaylorterms virtual Int getTaylorIndex(Int index){return 0;}.
Bool isSolveable (Int model=0)
 Is this model solveable?
Bool free (Int model=0)
 Free and fix the model (returns previous status).
Bool fix (Int model=0)
virtual void initializeGradients ()
 Initialize for gradient search.
virtual void finalizeGradients ()
 Finalize for gradient search.
Bool hasComponentList ()
 Does this have a component list?
Bool isEmpty (Int model=0)
 Is this model empty.
virtual ComponentListcomponentList ()
 Return the component list.
ImageInterface< Float > & image (Int model=0)
 Return actual images to be used by SkyEquation.
ImageInterface< Complex > & cImage (Int model=0)
 Complex image (needed for e.g.
ImageInterface< Complex > & XFR (Int model=0, Int numXFR=0)
 Complex XFR.
ImageInterface< Float > & PSF (Int model=0)
 PSF.
ImageInterface< Float > & gS (Int model=0)
 Gradient of chi-squared wrt pixels.
ImageInterface< Float > & residual (Int model=0)
ImageInterface< Float > & ggS (Int model=0)
 Grad Grad chi-squared wrt pixels (diagonal elements only)
ImageInterface< Float > & fluxScale (Int model=0)
 if (doFluxScale(mod)) image(mod) * fluxScale(mod) gives actual brightness distribution
ImageInterface< Float > & work (Int model=0)
 Work image.
ImageInterface< Float > & deltaImage (Int model=0)
 Increment in the image.
Bool doFluxScale (Int model=0)
 tells if this model needs to be multiplied by a flux scale image
void mandateFluxScale (Int model=0)
 require use of flux scale image
Bool hasXFR (Int model=0)
void addStatistics (Float sumwt, Float chisq)
 Add to Sum weights, Chi-Squared.
Matrix< Float > & weight (Int model=0)
 Weight per model (channels, polarizations)
virtual Bool solve (SkyEquation &me)
 Solve for this SkyModel: This replaces the image with the residual image.
Bool solveResiduals (SkyEquation &me, Bool modelToMS=False)
 Solve explicitly for the residuals: same as solve for this class modelToMs determines if predicted vis is put in the MODEL_DATA column.
virtual void makeApproxPSFs (SkyEquation &se)
 Make the approximate PSFs needed for each model.
virtual ImageInterface< Float > & getResidual (Int model=0)
 Get current residual image: this is either that image specified via addResidual, or a scratch image.
ImageBeamSetbeam (Int model=0)
 Return the fitted beam for each model.
void setPGPlotter (PGPlotter &pgp)
 Set PGPlotter to be used.
void setCycleFactor (float x)
 This is the factor by which you multiply the worst outer sidelobe by to get the threshold for the current cycle.
void setCycleSpeedup (float x)
 Cycle threshold will double in this number of iterations (ie, use a large number if you don't want cycle threshold to inch up)
void setCycleMaxPsfFraction (float x)
 Yet another control for the minor cycle threshold.
void setDisplayProgress (const Bool display)
 Set the variable that switches on the progress display.
void setDataPolFrame (StokesImageUtil::PolRep datapolrep)
 Set a variable to indicate the polarization frame in the data (circular or linear).
virtual Int getModelIndex (uInt field, uInt)

Static Public Member Functions

template<class M >
static TempImage< M > * getTempImage (const TiledShape &imgShp, const CoordinateSystem &imgCoords, const uInt nMouthsToFeed=1)
 Tries to return a pointer to a TempImage (allocated with new, so remember to use delete) with the given shape and CoordinateSystem.

Protected Member Functions

Bool makeNewtonRaphsonStep (SkyEquation &se, Bool incremental=False, Bool modelToMS=False)
 Make Newton Raphson step internally.
PGPlottergetPGPlotter ()
 Get PGPlotter to be used.
LogSinklogSink ()
Long cacheSize (Int model)

Protected Attributes

Int maxnmodels_p
Int nmodels_p
Int nfields_p
 MFS.
Int maxNumXFR_p
Float sumwt_p
Float chisq_p
ComponentListcomponentList_p
 ComponentList.
Vector< StringimageNames_p
 Images.
PtrBlock< ImageInterface
< Float > * > 
image_p
 Everything here can be just interface.
PtrBlock< ImageInterface
< Float > * > 
residual_p
PtrBlock< ImageInterface
< Complex > * > 
cimage_p
 We actually create these.
PtrBlock< ImageInterface
< Complex > * > 
cxfr_p
PtrBlock< ImageInterface
< Float > * > 
residualImage_p
PtrBlock< ImageInterface
< Float > * > 
gS_p
PtrBlock< ImageInterface
< Float > * > 
psf_p
PtrBlock< ImageInterface
< Float > * > 
ggS_p
PtrBlock< ImageInterface
< Float > * > 
fluxScale_p
 if (doFluxScale_p), image_p * fluxScale_p gives the true brightness
PtrBlock< ImageInterface
< Float > * > 
work_p
PtrBlock< ImageInterface
< Float > * > 
deltaimage_p
Block< Boolsolve_p
Block< BooldoFluxScale_p
PtrBlock< Matrix< Float > * > weight_p
PtrBlock< ImageBeamSet * > beam_p
LogSink logSink_p
PGPlotterpgplotter_p
Bool displayProgress_p
Float cycleFactor_p
 This is the factor by which you multiply the worst outer sidelobe by to get the threshold for the current cycle.
Float cycleSpeedup_p
 Cycle threshold will double in this number of iterations (ie, use a large number if you don't want cycle threshold to inch up)
Float cycleMaxPsfFraction_p
 Cycle threshold = maxResidual x min(Max-Psf-Fraction , cyclefactor x maxpsfsidelobe)
Bool donePSF_p
 If PSF is done..should not redo it.
Bool modified_p
 check if model has been modified especially for continuing a deconvolution
StokesImageUtil::PolRep dataPolRep_p
 Parameter to indicate the polaraization type of the data (circular or linear) Required by cImage() to decide shapes.
Bool workDirOnNFS_p

Detailed Description

Image Sky Model: Image-based Model for the Sky Brightness.

Intended use:

Public interface

Prerequisite

Etymology

ImageSkyModel describes an interface for Models to be used in the SkyEquation. It is derived from SkyModel .

Synopsis

A ImageSkyModel contains a number of separate models. The interface to SkyEquation is via an image per model. SkyEquation uses this image to calculate Fourier transforms, etc. Some (most) SkyModels are solvable: the SkyEquation can be used by the SkyModel to return gradients with respect to itself (via the image interface). Thus for a SkyModel to solve for itself, it calls the SkyEquation methods to get gradients of chi-squared with respect to the image pixel values (thus returning an image: basically a residual image). The SkyModel then uses these gradients as appropriate to update itself.

Example

See the example for SkyModel .

Motivation

The properties of a model of the sky must be described for the SkyEquation .

To Do

Definition at line 93 of file ImageSkyModel.h.


Constructor & Destructor Documentation

casa::ImageSkyModel::ImageSkyModel ( const Int  maxNumModels = 1)

Empty constructor.

Copy constructor.

virtual casa::ImageSkyModel::~ImageSkyModel ( ) [virtual]

Destructor.


Member Function Documentation

virtual Bool casa::ImageSkyModel::add ( ComponentList compList) [virtual]

Add a componentlist.

Reimplemented in casa::CleanImageSkyModel.

virtual Int casa::ImageSkyModel::add ( ImageInterface< Float > &  image,
const Int  maxNumXfr = 100 
) [virtual]

Add an image.

maxNumXfr is the maximum Number of transfer functions that we might want to associate with this image.

Reimplemented in casa::CleanImageSkyModel, casa::WFCleanImageSkyModel, casa::MFCleanImageSkyModel, and casa::CSCleanImageSkyModel.

virtual Bool casa::ImageSkyModel::addResidual ( Int  image,
ImageInterface< Float > &  residual 
) [virtual]
void casa::ImageSkyModel::addStatistics ( Float  sumwt,
Float  chisq 
) [inline, virtual]

Add to Sum weights, Chi-Squared.

Implements casa::SkyModel.

Definition at line 190 of file ImageSkyModel.h.

References chisq_p, and sumwt_p.

Return the fitted beam for each model.

Long casa::ImageSkyModel::cacheSize ( Int  model) [protected]
virtual Bool casa::ImageSkyModel::calculateAlphaBeta ( const Vector< String > &  ,
const Vector< String > &   
) [inline, virtual]

MFS : Calculate restored alpha and beta.

Reimplemented in casa::WBCleanImageSkyModel.

Definition at line 135 of file ImageSkyModel.h.

References casa::False.

virtual Bool casa::ImageSkyModel::calculateCoeffResiduals ( ) [inline, virtual]

MFS : In-place coefficient residual calculations.

Reimplemented in casa::WBCleanImageSkyModel.

Definition at line 132 of file ImageSkyModel.h.

References casa::False.

ImageInterface<Complex>& casa::ImageSkyModel::cImage ( Int  model = 0) [virtual]

Complex image (needed for e.g.

RR,RL,LR,LL)

Implements casa::SkyModel.

Return the component list.

Implements casa::SkyModel.

Increment in the image.

Implements casa::SkyModel.

Bool casa::ImageSkyModel::doFluxScale ( Int  model = 0) [virtual]

tells if this model needs to be multiplied by a flux scale image

Implements casa::SkyModel.

virtual void casa::ImageSkyModel::finalizeGradients ( ) [inline, virtual]

Finalize for gradient search.

Implements casa::SkyModel.

Definition at line 156 of file ImageSkyModel.h.

if (doFluxScale(mod)) image(mod) * fluxScale(mod) gives actual brightness distribution

Implements casa::SkyModel.

Free and fix the model (returns previous status).

Free means that it will be solved for in any solution.

virtual Int casa::ImageSkyModel::getModelIndex ( uInt  field,
uInt   
) [inline, virtual]

Implements casa::SkyModel.

Reimplemented in casa::WBCleanImageSkyModel.

Definition at line 257 of file ImageSkyModel.h.

PGPlotter* casa::ImageSkyModel::getPGPlotter ( ) [inline, protected]

Get PGPlotter to be used.

Definition at line 271 of file ImageSkyModel.h.

References pgplotter_p.

virtual Double casa::ImageSkyModel::getReferenceFrequency ( ) [inline, virtual]

MFS : Reference Frequency.

Implements casa::SkyModel.

Reimplemented in casa::WBCleanImageSkyModel.

Definition at line 138 of file ImageSkyModel.h.

virtual ImageInterface<Float>& casa::ImageSkyModel::getResidual ( Int  model = 0) [virtual]

Get current residual image: this is either that image specified via addResidual, or a scratch image.

For example in WFImageSkyModel it might return the whole main image rather than facets

Reimplemented in casa::WFCleanImageSkyModel.

virtual Int casa::ImageSkyModel::getTaylorIndex ( Int  index) [inline, virtual]

MFS : Index of Taylor term in array of nmodels x ntaylorterms virtual Int getTaylorIndex(Int index){return 0;}.

Implements casa::SkyModel.

Definition at line 142 of file ImageSkyModel.h.

References nfields_p.

template<class M >
static TempImage<M>* casa::ImageSkyModel::getTempImage ( const TiledShape imgShp,
const CoordinateSystem imgCoords,
const uInt  nMouthsToFeed = 1 
) [static]

Tries to return a pointer to a TempImage (allocated with new, so remember to use delete) with the given shape and CoordinateSystem.

Parameters:
imgShp
imgCoords
nMouthsToFeed,:If > 1 it is taken as a hint that it should leave room for nMouthsToFeed - 1 more TempImages.

<throws> AipsError on memory allocation error. </throws>

ImageInterface<Float>& casa::ImageSkyModel::ggS ( Int  model = 0) [virtual]

Grad Grad chi-squared wrt pixels (diagonal elements only)

Implements casa::SkyModel.

ImageInterface<Float>& casa::ImageSkyModel::gS ( Int  model = 0) [virtual]

Gradient of chi-squared wrt pixels.

Implements casa::SkyModel.

Does this have a component list?

Implements casa::SkyModel.

Bool casa::ImageSkyModel::hasXFR ( Int  model = 0) [virtual]

Implements casa::SkyModel.

ImageInterface<Float>& casa::ImageSkyModel::image ( Int  model = 0) [virtual]

Return actual images to be used by SkyEquation.

Implements casa::SkyModel.

virtual void casa::ImageSkyModel::initializeGradients ( ) [virtual]

Initialize for gradient search.

Implements casa::SkyModel.

Bool casa::ImageSkyModel::isEmpty ( Int  model = 0) [virtual]

Is this model empty.

Implements casa::SkyModel.

Bool casa::ImageSkyModel::isSolveable ( Int  model = 0) [virtual]

Is this model solveable?

Implements casa::SkyModel.

LogSink& casa::ImageSkyModel::logSink ( ) [inline, protected]

Definition at line 311 of file ImageSkyModel.h.

References logSink_p.

virtual void casa::ImageSkyModel::makeApproxPSFs ( SkyEquation se) [virtual]

Make the approximate PSFs needed for each model.

Reimplemented in casa::PWFCleanImageSkyModel.

Bool casa::ImageSkyModel::makeNewtonRaphsonStep ( SkyEquation se,
Bool  incremental = False,
Bool  modelToMS = False 
) [protected]

Make Newton Raphson step internally.

This is really an implementation detail: it is useful for derived classes. The modelToMS parameter is for committing to MODEL_DATA column of the MS the predicted visibilities.

Reimplemented in casa::WBCleanImageSkyModel.

require use of flux scale image

virtual Int casa::ImageSkyModel::numberOfModels ( ) [inline, virtual]

Number of models contained.

Implements casa::SkyModel.

Definition at line 126 of file ImageSkyModel.h.

References nmodels_p.

virtual Int casa::ImageSkyModel::numberOfTaylorTerms ( ) [inline, virtual]

MFS : Number of taylor terms per model.

Implements casa::SkyModel.

Reimplemented in casa::WBCleanImageSkyModel.

Definition at line 129 of file ImageSkyModel.h.

ImageSkyModel& casa::ImageSkyModel::operator= ( const ImageSkyModel other)

Assignment operator.

ImageInterface<Float>& casa::ImageSkyModel::PSF ( Int  model = 0) [virtual]

PSF.

Implements casa::SkyModel.

void casa::ImageSkyModel::setCycleFactor ( float  x) [inline]

This is the factor by which you multiply the worst outer sidelobe by to get the threshold for the current cycle.

Definition at line 221 of file ImageSkyModel.h.

References cycleFactor_p.

void casa::ImageSkyModel::setCycleMaxPsfFraction ( float  x) [inline]

Yet another control for the minor cycle threshold.

This is in response to CAS-2673 This allows control similar to 'cyclefactor' - used in MFClarkCleanSkyModel

Definition at line 231 of file ImageSkyModel.h.

References cycleMaxPsfFraction_p.

void casa::ImageSkyModel::setCycleSpeedup ( float  x) [inline]

Cycle threshold will double in this number of iterations (ie, use a large number if you don't want cycle threshold to inch up)

Definition at line 226 of file ImageSkyModel.h.

References cycleSpeedup_p.

Set a variable to indicate the polarization frame in the data (circular or linear).

This is used along with the user's choice of output Stokes parameter to decide the stokesCoordinate of the temporary images "cImage".

Definition at line 239 of file ImageSkyModel.h.

References dataPolRep_p.

void casa::ImageSkyModel::setDisplayProgress ( const Bool  display) [inline]

Set the variable that switches on the progress display.

Reimplemented in casa::PClarkCleanImageSkyModel.

Definition at line 234 of file ImageSkyModel.h.

References displayProgress_p.

void casa::ImageSkyModel::setMaxNumberModels ( const Int  maxNumModels)
void casa::ImageSkyModel::setPGPlotter ( PGPlotter pgp) [inline]

Set PGPlotter to be used.

Definition at line 217 of file ImageSkyModel.h.

References pgplotter_p.

virtual Bool casa::ImageSkyModel::solve ( SkyEquation me) [virtual]

Solve explicitly for the residuals: same as solve for this class modelToMs determines if predicted vis is put in the MODEL_DATA column.

Reimplemented in casa::WBCleanImageSkyModel.

virtual Bool casa::ImageSkyModel::updatemodel ( ComponentList compList) [virtual]

update componentlist

virtual Bool casa::ImageSkyModel::updatemodel ( const Int  thismodel,
ImageInterface< Float > &  image 
) [virtual]

update model image...you have to have added it before...nmodels_p held has to be bigger that image here its left to the caller to make sure the image is conformant...otherwise you are in trouble.

Matrix<Float>& casa::ImageSkyModel::weight ( Int  model = 0) [virtual]

Weight per model (channels, polarizations)

Implements casa::SkyModel.

ImageInterface<Float>& casa::ImageSkyModel::work ( Int  model = 0) [virtual]

Work image.

Implements casa::SkyModel.

ImageInterface<Complex>& casa::ImageSkyModel::XFR ( Int  model = 0,
Int  numXFR = 0 
) [virtual]

Complex XFR.

Implements casa::SkyModel.


Member Data Documentation

Definition at line 308 of file ImageSkyModel.h.

Definition at line 281 of file ImageSkyModel.h.

Referenced by addStatistics().

We actually create these.

Definition at line 293 of file ImageSkyModel.h.

ComponentList.

Definition at line 284 of file ImageSkyModel.h.

Definition at line 294 of file ImageSkyModel.h.

This is the factor by which you multiply the worst outer sidelobe by to get the threshold for the current cycle.

Definition at line 319 of file ImageSkyModel.h.

Referenced by setCycleFactor().

Cycle threshold = maxResidual x min(Max-Psf-Fraction , cyclefactor x maxpsfsidelobe)

Definition at line 325 of file ImageSkyModel.h.

Referenced by setCycleMaxPsfFraction().

Cycle threshold will double in this number of iterations (ie, use a large number if you don't want cycle threshold to inch up)

Definition at line 323 of file ImageSkyModel.h.

Referenced by setCycleSpeedup().

Parameter to indicate the polaraization type of the data (circular or linear) Required by cImage() to decide shapes.

Definition at line 333 of file ImageSkyModel.h.

Referenced by setDataPolFrame().

Definition at line 302 of file ImageSkyModel.h.

Definition at line 316 of file ImageSkyModel.h.

Referenced by setDisplayProgress().

Definition at line 304 of file ImageSkyModel.h.

If PSF is done..should not redo it.

Reimplemented in casa::WBCleanImageSkyModel.

Definition at line 327 of file ImageSkyModel.h.

if (doFluxScale_p), image_p * fluxScale_p gives the true brightness

Definition at line 300 of file ImageSkyModel.h.

Definition at line 298 of file ImageSkyModel.h.

Definition at line 296 of file ImageSkyModel.h.

Everything here can be just interface.

Definition at line 289 of file ImageSkyModel.h.

Images.

Definition at line 287 of file ImageSkyModel.h.

Definition at line 310 of file ImageSkyModel.h.

Referenced by logSink().

Definition at line 273 of file ImageSkyModel.h.

Definition at line 278 of file ImageSkyModel.h.

check if model has been modified especially for continuing a deconvolution

Definition at line 330 of file ImageSkyModel.h.

Definition at line 274 of file ImageSkyModel.h.

Referenced by numberOfModels().

Definition at line 315 of file ImageSkyModel.h.

Referenced by getPGPlotter(), and setPGPlotter().

Definition at line 297 of file ImageSkyModel.h.

Definition at line 290 of file ImageSkyModel.h.

Reimplemented in casa::WFCleanImageSkyModel.

Definition at line 295 of file ImageSkyModel.h.

Definition at line 303 of file ImageSkyModel.h.

Definition at line 280 of file ImageSkyModel.h.

Referenced by addStatistics().

Definition at line 306 of file ImageSkyModel.h.

Definition at line 301 of file ImageSkyModel.h.

Definition at line 334 of file ImageSkyModel.h.


The documentation for this class was generated from the following file: