ImageSkyModel.h

Classes

ImageSkyModel -- Image Sky Model: Image-based Model for the Sky Brightness (full description)

class ImageSkyModel : public SkyModel

Interface

Public Members
ImageSkyModel(const Int maxNumModels=1)
void setMaxNumberModels(const Int maxNumModels)
ImageSkyModel(const ImageSkyModel& sm)
virtual Bool add(ComponentList& compList)
virtual Int add(ImageInterface<Float>& image, const Int maxNumXfr=100)
virtual Bool addResidual(Int image, ImageInterface<Float>& residual)
virtual ~ImageSkyModel()
ImageSkyModel& operator=(const ImageSkyModel& other)
virtual Int numberOfModels()
Bool isSolveable(Int model=0)
Bool free(Int model=0)
Bool fix(Int model=0)
virtual void initializeGradients()
virtual void finalizeGradients()
Bool hasComponentList()
Bool isEmpty(Int model=0)
virtual ComponentList& componentList()
ImageInterface<Float>& image(Int model=0)
ImageInterface<Complex>& cImage(Int model=0)
ImageInterface<Complex>& XFR(Int model=0, Int numXFR=0)
ImageInterface<Float>& PSF(Int model=0)
ImageInterface<Float>& gS(Int model=0)
ImageInterface<Float>& residual(Int model=0)
ImageInterface<Float>& ggS(Int model=0)
ImageInterface<Float>& fluxScale(Int model=0)
ImageInterface<Float>& work(Int model=0)
ImageInterface<Float>& deltaImage(Int model=0)
Bool doFluxScale(Int model=0)
void mandateFluxScale(Int model=0)
Bool hasXFR(Int model=0)
void addStatistics(Float sumwt, Float chisq)
Matrix<Float>& weight(Int model=0)
virtual Bool solve (SkyEquation& me)
Bool solveResiduals (SkyEquation& me)
virtual void makeApproxPSFs(SkyEquation& se)
ImageInterface<Float>& getResidual (Int model=0)
Vector<Float>& beam(Int model=0)
void setPGPlotter(PGPlotter& pgp)
void setCycleFactor(float x)
void setCycleSpeedup(float x)
void setDisplayProgress (const Bool display )
Protected Members
Bool makeNewtonRaphsonStep(SkyEquation& se, Bool incremental=False, Bool modelToMS=False)
PGPlotter* getPGPlotter()
LogSink& logSink()

Description

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

Member Description

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 Int add(ImageInterface<Float>& image, const Int maxNumXfr=100)

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

virtual Bool addResidual(Int image, ImageInterface<Float>& residual)

Add a residual image

virtual ~ImageSkyModel()

Destructor

ImageSkyModel& operator=(const ImageSkyModel& other)

Assignment operator

virtual Int numberOfModels()

Number of models contained

Bool isSolveable(Int model=0)

Is this model solveable?

Bool free(Int model=0)

Free and fix the model (returns previous status). Free means that it will be solved for in any solution.

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)

virtual ComponentList& componentList()

Return the component list

ImageInterface<Float>& fluxScale(Int model=0)

Return actual images to be used by SkyEquation.

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

ImageInterface<Float>& image(Int model=0)
ImageInterface<Complex>& cImage(Int model=0)
ImageInterface<Complex>& XFR(Int model=0, Int numXFR=0)
ImageInterface<Float>& PSF(Int model=0)
ImageInterface<Float>& gS(Int model=0)
ImageInterface<Float>& residual(Int model=0)
ImageInterface<Float>& ggS(Int model=0)
ImageInterface<Float>& work(Int model=0)
ImageInterface<Float>& deltaImage(Int model=0)

Return actual images to be used by SkyEquation.

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)

Solve explicitly for the residuals: same as solve for this class

virtual void makeApproxPSFs(SkyEquation& se)

Make the approximate PSFs needed for each model

ImageInterface<Float>& getResidual (Int model=0)

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

Vector<Float>& beam(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 setDisplayProgress (const Bool display )

Set the variable that switches on the progress display

Bool makeNewtonRaphsonStep(SkyEquation& se, Bool incremental=False, Bool modelToMS=False)

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.

PGPlotter* getPGPlotter()

Get PGPlotter to be used

LogSink& logSink()