casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AWProjectWBFT.h
Go to the documentation of this file.
1 //# AWProjectWBFT.h: Definition for AWProjectWBFT
2 //# Copyright (C) 1996,1997,1998,1999,2000,2002
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_AWPROJECTWBFT_H
30 #define SYNTHESIS_AWPROJECTWBFT_H
31 #define DELTAPA 1.0
32 #define MAGICPAVALUE -999.0
33 
34 
36 
37 namespace casa { //# NAMESPACE CASA - BEGIN
38 
39  class EPJones;
40 
41  class AWProjectWBFT : public AWProjectFT {
42 
43  public:
44  //
45  // Constructor: cachesize is the size of the cache in words
46  // (e.g. a few million is a good number), tilesize is the size of
47  // the tile used in gridding (cannot be less than 12, 16 works in
48  // most cases).
49  // <group>
50  //
55  casacore::Bool applyPointingOffset=true,
56  casacore::Bool doPBCorr=true,
58  casacore::Float paSteps=5.0,
59  casacore::Float pbLimit=5e-4,
60  casacore::Bool usezero=false,
63  // </group>
64 
65  // Construct from a casacore::Record containing the AWProjectWBFT state
67 
68  // Copy constructor
69  AWProjectWBFT(const AWProjectWBFT &other):AWProjectFT() {operator=(other);};
70 
71  // Assignment operator
72  AWProjectWBFT &operator=(const AWProjectWBFT &other);
73 
75 
76  virtual casacore::String name() const {return "AWProjectWBFT";};
77 
78 
80  casacore::Bool Evaluate);
81  void normalizeAvgPB();
83  {throw(casacore::AipsError("AWPWBFT::normalizeAvgPB(Complex,Float)"));}
84 
85  //
86  // This method is called from AWProjectFT to compute the
87  // sensitivity image by accumulating in the image domain
88  // (i.e. directly accumulate the Primay Beam functions). This is
89  // called from findConvFunction() so that sensitivity pattern is
90  // also pre-computed along with the convolution functions. This
91  // in-turn calls the ATerm::makeAverageResponse().
92  //
93  // For AWProjectWBFT class of FTMachines, this just issues a log
94  // message indicating that this is only setting up things for
95  // accumulation of weight images in the first gridding cycle. The
96  // actual sensitivity patterns are computed by overloaded function
97  // below.
98  //
99  virtual void makeSensitivityImage(const VisBuffer& vb,
100  const casacore::ImageInterface<casacore::Complex>& imageTemplate,
102  //
103  // In AWProjectWBFT and its derivatives, sensitivity image is
104  // computed by accumulating weight functions (images) during the
105  // first gridding cycle. AWProjectFT::makeSensitivityImage() is
106  // overloaded in AWProjectWBFT and only issues a log message.
107  //
108  // The following method is used to Fourier transform normalize the
109  // accumulated weight images. doFFTNorm when true, the FFT
110  // normalization (by pixel volume) is also done.
111  //
115  const casacore::Bool& doFFTNorm=true);
119  const casacore::Bool& doFFTNorm=true);
120 
121  //
122  // Method used to make normalized image from gridded visibilites.
123  // This calls makeSensitivityImage() to make the sensitivity image
124  // and AWProjectFT::getImage() to make the image from gridded
125  // visibilites. AWProjectFT::getImage() internally calls
126  // normalizeImage() which uses the sensitivty image computed by
127  // makeSensitivtyImage().
128  //
130  //
131  // Method used to convert the pixel value of the PB image, passed
132  // as pbPixValue, to a value used for PB-normalization.
133  // Typically, this will depend on the units of the "PB image"
134  // constructed by the makeSensitivtyImage() methods. pbLimit is
135  // the fractional pb-gain below which imaging is not required
136  // (this value is typically the user-defined parameter in the
137  // private member variable pbLimit_p).
138  //
139  inline virtual casacore::Float pbFunc(const casacore::Float& /*pbPixValue*/, const casacore::Float& /*pbLimit*/)
140  {return 1.0;};
141  // {casacore::Float tt=(pbPixValue);return (abs(tt) >= pbLimit)?tt:1.0;};
142 
143 
144  // {casacore::Float tt=sqrt(pbPixValue);return (abs(tt) >= pbLimit)?tt:1.0;};
145 
146  virtual void finalizeToSky();
148  const VisBuffer& vb);
149 
150  void setObservatoryLocation(const casacore::MPosition& mLocation) {mLocation_p=mLocation;};
151 
153  {(void)shape0; (void)shape1;return false;};
154 
155  //
156  // Returns true if accumulation during gridding to compute the
157  // average PB must be done.
158  //
159  virtual casacore::Bool computeAvgPB(const casacore::Double& /*actualPA*/, const casacore::Double& /*lastPAUsedForWtImg*/)
160  {return (avgPBReady_p==false);};
161 
162  // virtual void setMiscInfo(const casacore::Int qualifier)
163  // {sensitivityPatternQualifier_p=qualifier;}
164  // {qualifier_p = qualifier;taylorQualifier_p = "_MFS_"+casacore::String::toString(qualifier_p)+"_";};
165 
166  // virtual void ComputeResiduals(VisBuffer&vb, casacore::Bool useCorrected) {};
167  virtual void setCFCache(casacore::CountedPtr<CFCache>& cfc, const casacore::Bool resetCFC=true);
168 
169  protected:
172  const casacore::Bool& doFFTNorm);
173 
175  const VisBuffer& vb, casacore::Bool& dopsf);
177  const VisBuffer& vb, casacore::Bool& dopsf);
178  // virtual void resampleGridToData(VBStore& vbs, const VisBuffer& vb);
180  VBStore& vbs, const VisBuffer& vb);
181 
183 
184  private:
190  // //
191  // // These ugly methods (ugly due to their flirtation with FORTRAN) should go!
192  // //
193  // virtual void runFortranGet(casacore::Matrix<casacore::Double>& uvw,casacore::Vector<casacore::Double>& dphase,
194  // casacore::Cube<casacore::Complex>& visdata,
195  // casacore::IPosition& s,
196  // casacore::Int& Conj,
197  // casacore::Cube<casacore::Int>& flags,casacore::Vector<casacore::Int>& rowFlags,
198  // casacore::Int& rownr,casacore::Vector<casacore::Double>& actualOffset,
199  // casacore::Array<casacore::Complex>* dataPtr,
200  // casacore::Int& aNx, casacore::Int& aNy, casacore::Int& npol, casacore::Int& nchan,
201  // VisBuffer& vb,casacore::Int& Nant_p, casacore::Int& scanNo,
202  // casacore::Double& sigma,
203  // casacore::Array<casacore::Float>& raoffsets,
204  // casacore::Array<casacore::Float>& decoffsets,
205  // casacore::Double area,
206  // casacore::Int& doGrad,casacore::Int paIndex);
207  // virtual void runFortranPut(casacore::Matrix<casacore::Double>& uvw,casacore::Vector<casacore::Double>& dphase,
208  // const casacore::Complex& visdata_p,
209  // casacore::IPosition& s,
210  // casacore::Int& Conj,
211  // casacore::Cube<casacore::Int>& flags,casacore::Vector<casacore::Int>& rowFlags,
212  // const casacore::Matrix<casacore::Float>& weight,
213  // casacore::Int& rownr,casacore::Vector<casacore::Double>& actualOffset,
214  // casacore::Array<casacore::Complex>& dataPtr,
215  // casacore::Int& aNx, casacore::Int& aNy, casacore::Int& npol, casacore::Int& nchan,
216  // const VisBuffer& vb,casacore::Int& Nant_p, casacore::Int& scanNo,
217  // casacore::Double& sigma,
218  // casacore::Array<casacore::Float>& raoffsets,
219  // casacore::Array<casacore::Float>& decoffsets,
220  // casacore::Matrix<casacore::Double>& sumWeight,
221  // casacore::Double& area,
222  // casacore::Int& doGrad,
223  // casacore::Int& doPSF,casacore::Int paIndex);
224  // virtual void runFortranGetGrad(casacore::Matrix<casacore::Double>& uvw,casacore::Vector<casacore::Double>& dphase,
225  // casacore::Cube<casacore::Complex>& visdata,
226  // casacore::IPosition& s,
227  // casacore::Cube<casacore::Complex>& gradVisAzData,
228  // casacore::Cube<casacore::Complex>& gradVisElData,
229  // casacore::Int& Conj,
230  // casacore::Cube<casacore::Int>& flags,casacore::Vector<casacore::Int>& rowFlags,
231  // casacore::Int& rownr,casacore::Vector<casacore::Double>& actualOffset,
232  // casacore::Array<casacore::Complex>* dataPtr,
233  // casacore::Int& aNx, casacore::Int& aNy, casacore::Int& npol, casacore::Int& nchan,
234  // VisBuffer& vb,casacore::Int& Nant_p, casacore::Int& scanNo,
235  // casacore::Double& sigma,
236  // casacore::Array<casacore::Float>& l_off,
237  // casacore::Array<casacore::Float>& m_off,
238  // casacore::Double area,
239  // casacore::Int& doGrad,
240  // casacore::Int paIndex);
242  };
243 } //# NAMESPACE CASA - END
244 
245 #endif
AWProjectWBFT(casacore::Int nFacets, casacore::Long cachesize, casacore::CountedPtr< CFCache > &cfcache, casacore::CountedPtr< ConvolutionFunction > &cf, casacore::CountedPtr< VisibilityResamplerBase > &visResampler, casacore::Bool applyPointingOffset=true, casacore::Bool doPBCorr=true, casacore::Int tilesize=16, casacore::Float paSteps=5.0, casacore::Float pbLimit=5e-4, casacore::Bool usezero=false, casacore::Bool conjBeams_p=true, casacore::Bool doublePrecGrid=false)
Constructor: cachesize is the size of the cache in words (e.g.
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
void setObservatoryLocation(const casacore::MPosition &mLocation)
A Measure: position on Earth.
Definition: MPosition.h:79
int Int
Definition: aipstype.h:50
casacore::TempImage< casacore::Complex > griddedWeights
casacore::TempImage< casacore::Complex > griddedConjWeights
virtual casacore::Bool verifyShapes(casacore::IPosition shape0, casacore::IPosition shape1)
casacore::Int findPointingOffsets(const VisBuffer &vb, casacore::Array< casacore::Float > &l_off, casacore::Array< casacore::Float > &m_off, casacore::Bool Evaluate)
casacore::Bool changed(const VisBuffer&amp; vb) {return vpSJ-&gt;changed(vb,1);}; casacore::Bool changed(con...
casacore::Bool resetPBs_p
casacore::Bool conjBeams_p
Definition: AWProjectFT.h:497
virtual void initializeToSky(casacore::ImageInterface< casacore::Complex > &image, casacore::Matrix< casacore::Float > &weight, const VisBuffer &vb)
Initialize transform to Sky plane: initializes the image.
virtual void resampleDataToGrid(casacore::Array< casacore::Complex > &griddedData, VBStore &vbs, const VisBuffer &vb, casacore::Bool &dopsf)
virtual casacore::Bool computeAvgPB(const casacore::Double &, const casacore::Double &)
Returns true if accumulation during gridding to compute the average PB must be done.
virtual casacore::ImageInterface< casacore::Complex > & getImage(casacore::Matrix< casacore::Float > &, casacore::Bool normalize=true)
Method used to make normalized image from gridded visibilites.
casacore::Int tilesize
Definition: AWProjectFT.h:439
casacore::Bool oneTimeMessage_p
// These ugly methods (ugly due to their flirtation with FORTRAN) should go!
casacore::ImageInterface< casacore::Complex > * image
Definition: FTMachine.h:409
virtual void ftWeightImage(casacore::Lattice< casacore::Complex > &wtImage, const casacore::Matrix< casacore::Float > &sumWt, const casacore::Bool &doFFTNorm)
casacore::Vector< casacore::Int > fieldIds_p
virtual void makeSensitivitySqImage(casacore::Lattice< casacore::Complex > &wtImage, casacore::ImageInterface< casacore::Complex > &sensitivitySqImage, const casacore::Matrix< casacore::Float > &sumWt=casacore::Matrix< casacore::Float >(), const casacore::Bool &doFFTNorm=true)
long Long
Definition: aipstype.h:52
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
casacore::String tt_pp
double Double
Definition: aipstype.h:55
virtual void finalizeToSky()
{casacore::Float tt=(pbPixValue);return (abs(tt) &gt;= pbLimit)?tt:1.0;};
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Bool wtImageFTDone_p
float Float
Definition: aipstype.h:54
virtual casacore::String name() const
Return the name of the machine.
Definition: AWProjectWBFT.h:76
virtual void makeSensitivityImage(const VisBuffer &vb, const casacore::ImageInterface< casacore::Complex > &imageTemplate, casacore::ImageInterface< casacore::Float > &sensitivityImage)
This method is called from AWProjectFT to compute the sensitivity image by accumulating in the image ...
virtual void setCFCache(casacore::CountedPtr< CFCache > &cfc, const casacore::Bool resetCFC=true)
virtual void setMiscInfo(const casacore::Int qualifier) {sensitivityPatternQualifier_p=qualifier;} {q...
Base class for all Casacore library errors.
Definition: Error.h:134
const Double e
e and functions thereof:
String: the storage and methods of handling collections of characters.
Definition: String.h:223
VisBuffers encapsulate one chunk of visibility data for processing.
Definition: VisBuffer.h:153
casacore::Array< casacore::Complex > griddedData
casacore::Array for non-tiled gridding These are common to most FTmachines
Definition: FTMachine.h:530
virtual casacore::Bool doublePrecGrid()
return whether the ftmachine is using a double precision grid
Abstract base class for Record classes.
casacore::Bool avgPBReady_p
casacore::Long cachesize
Sizes.
Definition: AWProjectFT.h:438
AWProjectWBFT(const AWProjectWBFT &other)
Copy constructor.
Definition: AWProjectWBFT.h:69
AWProjectWBFT & operator=(const AWProjectWBFT &other)
Assignment operator.
casacore::CountedPtr< VisibilityResamplerBase > visResamplerWt_p
casacore::MPosition mLocation_p
Default Position used for phase rotations.
Definition: FTMachine.h:455
void normalizeAvgPB(casacore::ImageInterface< casacore::Complex > &, casacore::ImageInterface< casacore::Float > &)
Definition: AWProjectWBFT.h:82
virtual casacore::Float pbFunc(const casacore::Float &, const casacore::Float &)
Method used to convert the pixel value of the PB image, passed as pbPixValue, to a value used for PB-...
void resampleCFToGrid(casacore::Array< casacore::Complex > &wtsGrid, VBStore &vbs, const VisBuffer &vb)
virtual void resampleGridToData(VBStore&amp; vbs, const VisBuffer&amp; vb);