SkyModel.h

Classes

SkyModel -- Sky Model: Model the Sky Brightness for the SkyEquation (full description)

class SkyModel : public Iterate

Types

enum PolRep

CIRCULAR = 0
LINEAR

Interface

Public Members
SkyModel() : itsAlgorithm(""), itsSubAlgorithm(""), imageRegion_p(0)
virtual Int numberOfModels() = 0
virtual Bool isSolveable(Int model=0) = 0
virtual Bool doFluxScale(Int model=0) = 0
virtual void initializeGradients() = 0
virtual void finalizeGradients() = 0
virtual ComponentList& componentList() = 0
virtual Bool hasComponentList() = 0
virtual ImageInterface<Float>& image(Int model=0) = 0
virtual ImageInterface<Float>& deltaImage(Int model=0) = 0
virtual ImageInterface<Complex>& cImage(Int model=0) = 0
virtual ImageInterface<Complex>& XFR(Int model=0, Int numXFR=0) = 0
virtual Bool hasXFR(Int model=0) = 0
virtual ImageInterface<Float>& PSF(Int model=0) = 0
virtual ImageInterface<Float>& gS(Int model=0) = 0
virtual ImageInterface<Float>& ggS(Int model=0) = 0
virtual ImageInterface<Float>& fluxScale(Int model=0) = 0
virtual ImageInterface<Float>& work(Int model=0) = 0
virtual void addStatistics(Float sumwt, Float chisq) = 0
virtual Matrix<Float>& weight(Int model=0) = 0
virtual Bool solve (SkyEquation& se) = 0
virtual Bool isEmpty(Int model=0) = 0
void setAlgorithm(const String& alg)
const String getAlgorithm()
void setSubAlgorithm(const String& alg)
const String getSubAlgorithm()
void setImageRegion( ImageRegion& ir )
void unsetImageRegion()

Description

Prerequisite

Etymology

SkyModel describes an interface for Models to be used in the SkyEquation. It is an Abstract Base Class: most methods must be defined in derived classes.

Synopsis

A SkyModel 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.

The following examples illustrate how a SkyModel can be used:

Example

      // Read the VisSet from disk
      VisSet vs("3c84.MS");

      // Create an ImageSkyModel from an image on disk
      ImageSkyModel ism(PagedImage<Float>("3c84.modelImage"));

      // Make an FTMachine: here we use a simple Grid and FT.
      GridFT ft;

      SkyEquation se(ism, vs, ft);

      // Predict the visibility set
      se.predict();

      // Make a Clean Image and write it out
      HogbomCleanImageSkyModel csm(ism);
      if (csm.solve()) {
        PagedImage<Float> cleanImage=csm.image(0);
        cleanImage.setName("3c84.cleanImage");
      }

Motivation

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

To Do

Member Description

enum PolRep

SkyModel() : itsAlgorithm(""), itsSubAlgorithm(""), imageRegion_p(0)

virtual Int numberOfModels() = 0

Number of models contained

virtual Bool isSolveable(Int model=0) = 0

Is this SkyModel solveable?

virtual Bool doFluxScale(Int model=0) = 0

Is there a flux scale image associated with this model?

virtual void initializeGradients() = 0

Initialize for gradient search

virtual void finalizeGradients() = 0

Finalize for gradient search

virtual ComponentList& componentList() = 0

Return the component list

virtual Bool hasComponentList() = 0

Return the component list

virtual ImageInterface<Float>& image(Int model=0) = 0

Image interface for this model (Stokes representation)

virtual ImageInterface<Float>& deltaImage(Int model=0) = 0

Increment in the image

virtual ImageInterface<Complex>& cImage(Int model=0) = 0

Complex image (needed for e.g. RR,RL,LR,LL)

virtual ImageInterface<Complex>& XFR(Int model=0, Int numXFR=0) = 0

Complex XFR

virtual Bool hasXFR(Int model=0) = 0

virtual ImageInterface<Float>& PSF(Int model=0) = 0

PSF

virtual ImageInterface<Float>& gS(Int model=0) = 0

Gradient of chi-squared wrt pixels

virtual ImageInterface<Float>& ggS(Int model=0) = 0

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

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

FluxScale image: image * fluxScale => true brightness distribution

virtual ImageInterface<Float>& work(Int model=0) = 0

Work image

virtual void addStatistics(Float sumwt, Float chisq) = 0

Add to Sum weights, Chi-Squared

virtual Matrix<Float>& weight(Int model=0) = 0

Weight per model (channels, polarizations)

virtual Bool solve (SkyEquation& se) = 0

Solve for this SkyModel

virtual Bool isEmpty(Int model=0) = 0

Is this model empty

void setAlgorithm(const String& alg)

set Algorithm (e.g clean, mem, nnls)

const String getAlgorithm()

get Algorithm

void setSubAlgorithm(const String& alg)

set Sub Algorithm

const String getSubAlgorithm()

get Sub Algorithm

void unsetImageRegion()

Set the imageregion that will be used for the next XFR generation

use the default shape

void setImageRegion( ImageRegion& ir )

Set the imageregion that will be used for the next XFR generation