SkyModel.h
Classes
- SkyModel -- Sky Model: Model the Sky Brightness for the SkyEquation (full description)
Types
- 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()
Prerequisite
- Matrix module
- Vector module
- MeasurementComponents module
- VisSet module
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:
- Simple cleaning: one model. The gradient gives the
residual image. A special method gives a PSF.
- Cleaning with visibility-based subtraction: one model. The
gradient can be calculated as needed (using the SkyEquation)
to produce the correct residual image.
- Wide-field imaging: one model per patch of the sky
that is to be imaged.
- Non-coplanar baselines imaging: one model per facet of
the polyhedron. At the end of processing all facets are combined
into one overall image.
- Mosaicing: one model per primary beam pointing. Each model
is derived (as needed) by cutting out a patch from the full-field
mosaic.
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
- Multiple images in SkyModel
- ComponentModel
Member Description
SkyModel() : itsAlgorithm(""), itsSubAlgorithm(""), imageRegion_p(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?
Initialize for gradient search
Finalize for gradient search
Return the component list
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)
Solve for this SkyModel
virtual Bool isEmpty(Int model=0) = 0
Is this model empty
set Algorithm (e.g clean, mem, nnls)
get Algorithm
set Sub Algorithm
get Sub Algorithm
Set the imageregion that will be used for the next XFR generation
use the default shape
Set the imageregion that will be used for the next XFR generation