casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WBCleanImageSkyModel.h
Go to the documentation of this file.
1 //# WBCleanImageSkyModel.h: Definition for WBCleanImageSkyModel
2 //# Copyright (C) 1996,1997,1998,1999,2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be adressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 
29 #ifndef SYNTHESIS_WBCLEANIMAGESKYMODEL_H
30 #define SYNTHESIS_WBCLEANIMAGESKYMODEL_H
31 
37 #include <casa/OS/Timer.h>
38 
39 namespace casa { //# NAMESPACE CASA - BEGIN
40 
41 //forward
42 class SkyEquation;
43 
44 // <summary>
45 // WB Clean Image Sky Model: Image Sky Model implementing a Wide-Band
46 // multi frequency synthesis algorithm
47 // </summary>
48 
49 // <use visibility=export>
50 
51 // <reviewed reviewer="" date="" tests="" demos="">
52 
53 // <prerequisite>
54 // <li> <linkto class=casacore::LatticeCleaner>LatticeCleaner</linkto> module
55 // <li> <linkto class=ImageSkyModel>ImageSkyModel</linkto> module
56 // <li> <linkto class=LinearModel>LinearModel</linkto> module
57 // </prerequisite>
58 //
59 // <etymology>
60 // WBCleanImageSkyModel implements the Wide Band Clean algorithm.
61 // It is derived from <linkto class=SkyModel>SkyModel</linkto>.
62 // </etymology>
63 //
64 // <synopsis>
65 // The WB Clean is the multi-frequency synthesis deconvolution
66 // algorithm. It decomposes an image into a linear compbination
67 // of models convolved with spectral dirty beams of various
68 // order. A multiscale variant can be invoked by supplying a
69 // user vector of scale sizes. Default is 1, corresponding to a
70 // scale insensitive mfs deconvolution.
71 //
72 // Masking is optionally performed using a mask image: only points
73 // where the mask is non-zero are searched for Gaussian components.
74 // This can cause some difficulty, as the different Gaussian scale
75 // sizes will extend beyond the mask by different amounts.
76 // If no mask is specified
77 // all points in the inner quarter of the image are cleaned.
78 // </synopsis>
79 //
80 // <example>
81 // See the example for <linkto class=SkyModel>SkyModel</linkto>.
82 // </example>
83 //
84 // <motivation>
85 // </motivation>
86 //
87 // <todo asof="99/04/07">
88 // <ul> Improve the masking.
89 // </todo>
90 
92 public:
93 
94  // Create a WBCleanImageSkyModel - default scale size = 1 pixel
96  WBCleanImageSkyModel(const casacore::Int ntaylor,const casacore::Int nscales,const casacore::Double reffreq);
97  WBCleanImageSkyModel(const casacore::Int ntaylor,const casacore::Vector<casacore::Float>& userScaleSizes, const casacore::Double reffreq);
98 
99  // destructor
101 
102  // Solve for this SkyModel
104  // casacore::Bool copyLatToImInt(casacore::TempLattice<casacore::Float>& lat, casacore::ImageInterface<casacore::Float>& im);
105  // casacore::Bool copyImIntToLat(casacore::TempLattice<casacore::Float>& lat, casacore::ImageInterface<casacore::Float>& im);
106 
107 // casacore::Int nmodels_p; // Number of image models = nfields * ntaylor
108  casacore::Int ntaylor_p; // Number of terms in the Taylor expansion to use.
109 // casacore::Int nfields_p; // Number of image fields/pointings.
110  casacore::Int nscales_p; // Number of scales to use for the multiscale part.
111 
113 
114 // casacore::Int add(casacore::ImageInterface<casacore::Float>& iimage, const casacore::Int maxNumXfr=100);
115 // casacore::Bool addResidual(casacore::Int thismodel, casacore::ImageInterface<casacore::Float>& iresidual);
116 // void initializeGradients();
118  casacore::Bool makeNewtonRaphsonStep(SkyEquation& se, casacore::Bool incremental=false, casacore::Bool modelToMS=false);
119 
122 
123  // Major axis for ordering : Taylor
124  casacore::Int getModelIndex(casacore::uInt model, casacore::uInt taylor){return taylor * (nfields_p) + (model);};
127 
130  const casacore::Vector<casacore::String> &residualNames);
131 
132  // Major axis for ordering : Models
133  //inline casacore::Int getModelIndex(casacore::uInt model, casacore::uInt taylor){return model * (ntaylor_p) + (taylor);};
134  //inline casacore::Int getPSFModelIndex(casacore::uInt model, casacore::uInt taylor){return model * (2*ntaylor_p-1) + (taylor);};
135  //inline casacore::Int getTaylorIndex(casacore::uInt index){return index%ntaylor_p;};
136  //inline casacore::Int getFieldIndex(casacore::uInt index){return index/ntaylor_p;};
137 
139 
140 private:
141 
142  // casacore::PtrBlock<casacore::MultiTermLatticeCleaner<casacore::Float>* > lc_p;
144 
145  casacore::Vector<casacore::Float> scaleSizes_p; // casacore::Vector of scale sizes in pixels.
146  casacore::Vector<casacore::Float> scaleBias_p; // casacore::Vector of scale biases !!
147  //casacore::Float maxPsf_p;
148 
153 
156 
157  // casacore::Memory to be allocated per TempLattice
159 
161 
162  void initVars();
164 
166  //casacore::Int storeTLAsImg(casacore::String fileName, casacore::TempLattice<casacore::Float> &TL, casacore::ImageInterface<casacore::Float>& theImg);
167  //casacore::Int storeTLAsImg(casacore::String fileName, casacore::TempLattice<casacore::Complex> &TL, casacore::ImageInterface<casacore::Float>& theImg);
168 
170 
172 
174 
176  //casacore::Int addTo(casacore::Lattice<casacore::Float>& to, const casacore::Lattice<casacore::Float>& add, casacore::Float multiplier);
179 
180  void blankOverlappingModels();
182 
183  void saveCurrentModels();
184 
189  // Put in some progress metre here...
190 
191 
192 };
193 
194 
195 } //# NAMESPACE CASA - END
196 
197 #endif
198 
199 
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
casacore::Int ntaylor_p
casacore::Bool copyLatToImInt(casacore::TempLattice&lt;casacore::Float&gt;&amp; lat, casacore::ImageInterface&lt;c...
int Int
Definition: aipstype.h:50
casacore::Int makeSpectralPSFs(SkyEquation &se, casacore::Bool writeToDisk)
casacore::Vector< casacore::String > imageNames
Major axis for ordering : Models inline casacore::Int getModelIndex(casacore::uInt model...
casacore::Int getModelIndex(casacore::uInt model, casacore::uInt taylor)
Major axis for ordering : Taylor.
casacore::IPosition gip
casacore::Float maxPsf_p;
casacore::Double getReferenceFrequency()
MFS : Reference Frequency.
casacore::Bool checkParameters()
ostream-like interface to creating log messages.
Definition: LogIO.h:167
casacore::Int getFieldIndex(casacore::uInt index)
casacore::Int nscales_p
casacore::Int nfields_p; // Number of image fields/pointings.
casacore::Bool mergeDataError(casacore::ImageInterface< casacore::Float > &data, casacore::ImageInterface< casacore::Float > &error, const casacore::String &outImg)
casacore::Int storeTLAsImg(casacore::String fileName, casacore::TempLattice&lt;casacore::Float&gt; &amp;TL...
casacore::Bool solveResiduals(SkyEquation &se, casacore::Bool modelToMS=false)
casacore::Int add(casacore::ImageInterface&lt;casacore::Float&gt;&amp; iimage, const casacore::Int maxNumXfr=10...
casacore::Bool calculateAlphaBeta(const casacore::Vector< casacore::String > &restoredNames, const casacore::Vector< casacore::String > &residualNames)
MFS : Calculate restored alpha and beta.
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Definition: PlotData.h:48
casacore::Bool solve(SkyEquation &se)
Solve for this SkyModel.
WBCleanImageSkyModel()
Create a WBCleanImageSkyModel - default scale size = 1 pixel.
casacore::Bool createMask(casacore::LatticeExpr< casacore::Bool > &lemask, casacore::ImageInterface< casacore::Float > &outimage)
casacore::Int writeResultsToDisk()
casacore::Int addTo(casacore::Lattice&lt;casacore::Float&gt;&amp; to, const casacore::Lattice&lt;casacore::Float&gt;&amp;...
~WBCleanImageSkyModel()
destructor
casacore::Vector< casacore::Float > scaleBias_p
casacore::Float computeFluxLimit(casacore::Float &fractionOfPsf)
double Double
Definition: aipstype.h:55
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
casacore::Int numberOfTaylorTerms()
MFS : Number of taylor terms per model.
casacore::Int storeAsImg(casacore::String fileName, casacore::ImageInterface< casacore::Float > &theImg)
casacore::Vector< casacore::Float > scaleSizes_p
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
measure the time it takes to execute parts of a program
Definition: Timer.h:127
float Float
Definition: aipstype.h:54
casacore::Block< MultiTermMatrixCleaner > lc_p
casacore::PtrBlock&lt;casacore::MultiTermLatticeCleaner&lt;casacore::Float&gt;* &gt; lc_p;
casacore::Bool makeNewtonRaphsonStep(SkyEquation &se, casacore::Bool incremental=false, casacore::Bool modelToMS=false)
simple 1-D array
casacore::Int nfields_p
MFS.
casacore::Int getTaylorIndex(casacore::uInt index)
WB Clean Image Sky Model: Image Sky Model implementing a Wide-Band multi frequency synthesis algorith...
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Image Sky Model: Image-based Model for the Sky Brightness.
casacore::Bool resizeWorkArrays(casacore::Int length)
casacore::Bool calculateCoeffResiduals()
MFS : In-place coefficient residual calculations.
casacore::Double memoryMB_p
casacore::Memory to be allocated per TempLattice
Class to allow C++ expressions involving lattices.
Definition: LatticeExpr.h:142
unsigned int uInt
Definition: aipstype.h:51