casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIImageStoreMultiTerm.h
Go to the documentation of this file.
1 //# SIImageStore.h: Imager functionality sits here;
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
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 addressed 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 //#
25 //# $Id$
26 
27 #ifndef SYNTHESIS_SIIMAGESTOREMULTITERM_H
28 #define SYNTHESIS_SIIMAGESTOREMULTITERM_H
29 
30 #include <casa/aips.h>
31 #include <casa/OS/Timer.h>
32 #include <casa/Containers/Record.h>
34 #include <casa/Arrays/IPosition.h>
35 #include <casa/Quanta/Quantum.h>
41 #include <images/Images/SubImage.h>
43 #include <casa/BasicSL/Constants.h>
44 
46 
47 namespace casa { //# NAMESPACE CASA - BEGIN
48 
49 
51 {
52  public:
53  // Default constructor
54 
56  SIImageStoreMultiTerm(const casacore::String &imagename, casacore::uInt ntaylorterms=1,
57  const casacore::Bool ignorefacets=false);
58 
59  SIImageStoreMultiTerm(const casacore::String &imagename,
60  const casacore::CoordinateSystem &imcoordsys,
61  const casacore::IPosition &imshape,
62  const casacore::String &objectname,
63  const casacore::Record &miscinfo,
64  const int nfacets,
65  const casacore::Bool overwrite=false,
66  casacore::uInt ntaylorterms=1,casacore::Bool useweightimage=false);
67 
68  /*
69  SIImageStoreMultiTerm(casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > >modelims,
70  casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > >residims,
71  casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > >psfims,
72  casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > >weightims,
73  casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > >restoredims,
74  casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > >sumwtims,
75  std::shared_ptr<casacore::ImageInterface<casacore::Float> > newmask,
76  std::shared_ptr<casacore::ImageInterface<casacore::Float> > newalpha,
77  std::shared_ptr<casacore::ImageInterface<casacore::Float> > newbeta);
78  */
79 
81  const casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > > &residims,
82  const casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > > &psfims,
83  const casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > > &weightims,
84  const casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > > &restoredims,
85  const casacore::Block<std::shared_ptr<casacore::ImageInterface<casacore::Float> > > &sumwtims,
86  const casacore::Block<std::shared_ptr<casacore::ImageInterface<float> > > &pbims,
87  const casacore::Block<std::shared_ptr<casacore::ImageInterface<float> > > &restoredpbcorims,
88  const std::shared_ptr<casacore::ImageInterface<casacore::Float> > &newmask,
89  const std::shared_ptr<casacore::ImageInterface<casacore::Float> > &newalpha,
90  const std::shared_ptr<casacore::ImageInterface<casacore::Float> > &newbeta,
91  const std::shared_ptr<casacore::ImageInterface<casacore::Float> > &newalphaerror,
92  const std::shared_ptr<casacore::ImageInterface<float> > &newalphapbcor,
93  const std::shared_ptr<casacore::ImageInterface<float> > &newbetapbcor,
94  const casacore::CoordinateSystem &csys,
95  const casacore::IPosition &imshape,
96  const casacore::String &imagename,
97  const casacore::String &objectname,
98  const casacore::Record &miscinfo,
99  const casacore::Int facet=0, const casacore::Int nfacets=1,
100  const casacore::Int chan=0, const casacore::Int nchanchunks=1,
101  const casacore::Int pol=0, const casacore::Int npolchunks=1);
102 
103  virtual void init();
104 
105  virtual ~SIImageStoreMultiTerm();
106 
107  virtual casacore::String getType(){return "multiterm";}
108 
109  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > psf(casacore::uInt term=0);
110  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > residual(casacore::uInt term=0);
111  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > weight(casacore::uInt term=0);
112  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > model(casacore::uInt term=0);
113  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > image(casacore::uInt term=0);
114  virtual std::shared_ptr<casacore::ImageInterface<float> > pb(casacore::uInt term=0);
115  virtual std::shared_ptr<casacore::ImageInterface<float> > imagepbcor(casacore::uInt term=0);
116  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > sumwt(casacore::uInt term=0);
118  virtual std::shared_ptr<casacore::ImageInterface<casacore::Complex> > forwardGrid(casacore::uInt term=0);
119  virtual std::shared_ptr<casacore::ImageInterface<casacore::Complex> > backwardGrid(casacore::uInt term=0);
120 
121  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > alpha();
122  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > beta();
123  virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > alphaerror();
124  virtual std::shared_ptr<casacore::ImageInterface<float> > alphapbcor();
125  virtual std::shared_ptr<casacore::ImageInterface<float> > betapbcor();
126 
127  // virtual std::shared_ptr<casacore::ImageInterface<casacore::Float> > gridwt(casacore::uInt term=0);
128 
131 
133 
134  void resetImages( casacore::Bool resetpsf, casacore::Bool resetresidual, casacore::Bool resetweight );
135  void addImages( std::shared_ptr<SIImageStore> imagestoadd,
136  casacore::Bool addpsf, casacore::Bool addresidual, casacore::Bool addweight, casacore::Bool adddensity);
137 
139  void normalizePrimaryBeam(const float pblimit=casacore::C::minfloat);
140 
141  void divideResidualByWeight(const casacore::Float pblimit=casacore::C::minfloat, const casacore::String normtype="flatnoise");
142  // void divideSensitivityPatternByWeight();
143  void divideModelByWeight(const casacore::Float pblimit=casacore::C::minfloat, const casacore::String normtype="flatnoise");
144  void multiplyModelByWeight(const casacore::Float pblimit=casacore::C::minfloat, const casacore::String normtype="flatnoise");
145 
146  /*
147  casacore::Bool checkValidity(const casacore::Bool ipsf, const casacore::Bool iresidual, const casacore::Bool iweight,
148  const casacore::Bool imodel, const casacore::Bool irestored, const casacore::Bool imask=false,
149  const casacore::Bool isumwt=true, const casacore::Bool ialpha=false, const casacore::Bool ibeta=false);
150  */
151 
154 
156 
157  casacore::uInt getNTaylorTerms(casacore::Bool dopsf=false); // {return dopsf ? (2*itsNTerms-1) : itsNTerms;};
158 
159  void restore(casacore::GaussianBeam& rbeam, casacore::String& usebeam,casacore::uInt term=0 );
161  void pbcor();
162 
163  /*
164  std::shared_ptr<SIImageStore> getFacetImageStore(const casacore::Int facet, const casacore::Int nfacets);
165  std::shared_ptr<SIImageStore> getSubImageStoreOld(const casacore::Int chan, const casacore::Bool onechan,
166  const casacore::Int pol, const casacore::Bool onepol);
167  */
168 
169  std::shared_ptr<SIImageStore> getSubImageStore(const casacore::Int facet=0, const casacore::Int nfacets=1,
170  const casacore::Int chan=0, const casacore::Int nchanchunks=1,
171  const casacore::Int pol=0, const casacore::Int npolchunks=1);
172 
173 
174  virtual casacore::Bool hasSensitivity(){return itsWeights.nelements()>0 && itsWeights[0];}
175  // virtual casacore::Bool hasModel() {return itsModels.nelements()>0 && itsModels[0];}
177  virtual casacore::Bool hasPsf(){return itsPsfs.nelements()>0 && itsPsfs[0];}
178  virtual casacore::Bool hasResidual() {return itsResiduals.nelements()>0 && itsResiduals[0];}
179  virtual casacore::Bool hasSumWt() {return itsSumWts.nelements()>0 && itsSumWts[0];}
180 
181 
182  // virtual Bool hasSensitivity() {return doesImageExist(itsImageName+imageExts(WEIGHT)+String(".tt0"));}
183  // virtual Bool hasModel() {return doesImageExist(itsImageName+imageExts(MODEL)+String(".tt0"));}
184  // virtual Bool hasMask() {return doesImageExist(itsImageName+imageExts(MASK)+String(".tt0"));}
185  // virtual Bool hasPsf() {return doesImageExist(itsImageName+imageExts(PSF)+String(".tt0"));}
187  // virtual Bool hasSumWt() {return doesImageExist(itsImageName+imageExts(SUMWT)+String(".tt0"));}
189  virtual bool hasPB() {return doesImageExist(itsImageName+imageExts(PB)+casacore::String(".tt0"));}
190 
191  // {return ( itsParentSumWts.nelements()==0 || itsParentSumWts[0].null() ) ? false : getUseWeightImage( *(itsParentSumWts[0]) ); };
192 
193  void calcSensitivity();
194  virtual casacore::Bool isModelEmpty();
195 
197 
198 protected:
199 
200  virtual void printImageStats();
201 
202 private:
203 
205 
208  std::shared_ptr<casacore::ImageInterface<casacore::Float> > itsAlpha, itsBeta, itsAlphaError, itsAlphaPBcor, itsBetaPBcor;
209 
211 
212 };
213 
214 
215 } //# NAMESPACE CASA - END
216 
217 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
virtual casacore::Double getReferenceFrequency()
std::shared_ptr< casacore::ImageInterface< casacore::Float > > itsBetaPBcor
virtual std::shared_ptr< casacore::ImageInterface< float > > betapbcor()
virtual casacore::Bool hasSensitivity()
virtual std::shared_ptr< casacore::ImageInterface< casacore::Complex > > backwardGrid(casacore::uInt term=0)
int Int
Definition: aipstype.h:50
virtual bool hasRestored()
virtual Bool hasSumWt() {return doesImageExist(itsImageName+imageExts(SUMWT)+String(&quot;.tt0&quot;));}
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsParentPBs
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > sumwt(casacore::uInt term=0)
casacore::Bool doesImageExist(casacore::String imagename)
virtual casacore::Bool hasSumWt()
std::shared_ptr< casacore::ImageInterface< casacore::Float > > itsAlphaError
void multiplyModelByWeight(const casacore::Float pblimit=casacore::C::minfloat, const casacore::String normtype="flatnoise")
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsParentModels
virtual casacore::Bool hasPsf()
std::shared_ptr< casacore::ImageInterface< casacore::Float > > itsAlphaPBcor
void setModelImage(casacore::Vector< casacore::String > modelnames)
virtual std::shared_ptr&lt;casacore::ImageInterface&lt;casacore::Float&gt; &gt; gridwt(casacore::uInt term=0); ...
casacore::Vector< casacore::String > getModelImageName()
virtual casacore::Bool hasModel()
virtual casacore::Bool hasModel() {return itsModels.nelements()&gt;0 &amp;&amp; itsModels[0];} ...
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > image(casacore::uInt term=0)
Represents a Gaussian restoring beam associated with an image.
Definition: GaussianBeam.h:68
void normalizePrimaryBeam(const float pblimit=casacore::C::minfloat)
virtual casacore::Bool hasResidual()
virtual casacore::Bool hasPsfImage() {return doesImageExist(itsImageName+imageExts(PSF));} ...
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Complex > > > itsForwardGrids
void calcSensitivity()
{return (itsParentSumWts.nelements()==0 || itsParentSumWts[0].null()) ? false : getUseWeightImage(*(i...
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > model(casacore::uInt term=0)
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsParentSumWts
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > psf(casacore::uInt term=0)
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > residual(casacore::uInt term=0)
SIImageStoreMultiTerm()
Default constructor.
virtual casacore::Bool isModelEmpty()
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsParentPsfs
void addImages(std::shared_ptr< SIImageStore > imagestoadd, casacore::Bool addpsf, casacore::Bool addresidual, casacore::Bool addweight, casacore::Bool adddensity)
void divideResidualByWeight(const casacore::Float pblimit=casacore::C::minfloat, const casacore::String normtype="flatnoise")
double Double
Definition: aipstype.h:55
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > alpha()
std::shared_ptr< casacore::ImageInterface< casacore::Float > > itsAlpha
void restore(casacore::GaussianBeam &rbeam, casacore::String &usebeam, casacore::uInt term=0)
virtual casacore::GaussianBeam restorePlane();
casacore::uInt getNTaylorTerms(casacore::Bool dopsf=false)
virtual casacore::String getType()
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > weight(casacore::uInt term=0)
virtual void printImageStats()
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsImages
casacore::Vector< casacore::String > imageExts
Non-persistent internal variables
Definition: SIImageStore.h:299
float Float
Definition: aipstype.h:54
std::shared_ptr< SIImageStore > getSubImageStore(const casacore::Int facet=0, const casacore::Int nfacets=1, const casacore::Int chan=0, const casacore::Int nchanchunks=1, const casacore::Int pol=0, const casacore::Int npolchunks=1)
The images internall will reference back to a given section of the main of this.
virtual std::shared_ptr< casacore::ImageInterface< float > > pb(casacore::uInt term=0)
void dividePSFByWeight(const casacore::Float pblimit=casacore::C::minfloat)
void divideModelByWeight(const casacore::Float pblimit=casacore::C::minfloat, const casacore::String normtype="flatnoise")
void divideSensitivityPatternByWeight();
virtual std::shared_ptr< casacore::ImageInterface< float > > imagepbcor(casacore::uInt term=0)
void resetImages(casacore::Bool resetpsf, casacore::Bool resetresidual, casacore::Bool resetweight)
virtual std::shared_ptr< casacore::ImageInterface< casacore::Complex > > forwardGrid(casacore::uInt term=0)
virtual std::shared_ptr&lt;casacore::ImageInterface&lt;casacore::Float&gt; &gt; mask(casacore::uInt term=0); // t...
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsPsfs
casacore::Double calcFractionalBandwidth()
simple 1-D array
virtual bool hasResidualImage()
virtual Bool hasSensitivity() {return doesImageExist(itsImageName+imageExts(WEIGHT)+String(&quot;.tt0&quot;));} virtual Bool hasModel() {return doesImageExist(itsImageName+imageExts(MODEL)+String(&quot;.tt0&quot;));} virtual Bool hasMask() {return doesImageExist(itsImageName+imageExts(MASK)+String(&quot;.tt0&quot;));} virtual Bool hasPsf() {return doesImageExist(itsImageName+imageExts(PSF)+String(&quot;.tt0&quot;));}
casacore::Bool releaseComplexGrids()
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsParentImages
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsParentResiduals
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Complex > > > itsBackwardGrids
void calculateAlphaBeta(casacore::String imtype)
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsParentImagePBcors
const Double minfloat
the minimum single precision floating point number, including denormalised numbers ...
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > alphaerror()
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool releaseLocks()
Other.
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsPBs
virtual std::shared_ptr< casacore::ImageInterface< casacore::Float > > beta()
std::shared_ptr< casacore::ImageInterface< casacore::Float > > itsBeta
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsWeights
virtual bool hasPB()
virtual casacore::Bool hasSensitivity(){return doesImageExist(itsImageName+imageExts(WEIGHT));} ...
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsParentWeights
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsResiduals
virtual std::shared_ptr< casacore::ImageInterface< float > > alphapbcor()
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsSumWts
casacore::String itsImageName
Definition: SIImageStore.h:275
Interconvert pixel and world coordinates.
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsImagePBcors
casacore::Block< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > itsModels
unsigned int uInt
Definition: aipstype.h:51