casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConvolutionFunction.h
Go to the documentation of this file.
1 //# ConvolutionFunction.h: Definition for ConvolutionFunction
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_TRANSFORM2_CONVOLUTIONFUNCTION_H
30 #define SYNTHESIS_TRANSFORM2_CONVOLUTIONFUNCTION_H
31 
41 #include <casa/Logging/LogOrigin.h>
42 #include <casa/Logging/LogSink.h>
43 #include <casa/Logging/LogIO.h>
44 #include <casa/Arrays/Vector.h>
45 #define CF_TYPE casacore::Double
46 
47 namespace casa{
48  namespace refim{
49  // <summary>
50  // The base class to compute convolution functions for convolutional gridding.
51  // </summary>
52 
53  // <use visibility=export>
54  // <prerequisite>
55  // </prerequisite>
56  // <etymology>
57  // Class to encapsulate the convolution function for convolutional gridding.
58  // </etymology>
59  //
60  // <synopsis> Standard method of re-sampling data to or from a
61  //
62  // regular grid is done by convolutional gridding. This requires a
63  // convolution function which a finte support size and well behaved
64  // function in the Fourier domain. For standard gridding, the
65  // Prolate Spheroidal function are used. Convolution functions
66  // used in casacore::Projection algorithms (like W-casacore::Projection, A-casacore::Projection,
67  // etc. and their combinations) each require potentially different
68  // mechanisms to compute. These are implemented in separate
69  // classes in the Synthesis module. Since these are used in common
70  // framework for gridding and de-gridding, these are all derived
71  // from a common base class. ConvolutionFunction (this class) is
72  // that base class.
73  //
74  // Most of the methods in this base class are pure virtual. I.e.,
75  // only surviving offsprings (derived classes) of this class will
76  // be those that will have the wisdom that they methods represent.
77  //
78  // </synopsis>
79 
81  {
82  public:
85  computeCFAngleRad_p(360.0*M_PI/180.0), rotateCFOTFAngleRad_p(0.1), po_p()
86  {};
89  computeCFAngleRad_p(360.0*M_PI/180.0), rotateCFOTFAngleRad_p(0.1), po_p()
90  {nDim=dim;};
91  virtual ~ConvolutionFunction();
92 
93  // Set the dimention of the convolution function.
94  virtual void setDimension(casacore::Int n){nDim = n;};
95 
96  // Given the pixel co-ordinates and an offset values, this returns
97  // the value of the convolution function. This is however not
98  // used anywhere yet (and is therefore also not a pure virtual
99  // function).
101 
102  // A support function which, for now, returns and integer ID
103  // corresponding to the on-sky frequency of the supplied VisBuffer.
104  virtual int getVisParams(const VisBuffer2& vb,const casacore::CoordinateSystem& skyCoord=casacore::CoordinateSystem())=0;
105 
106  // This method computes the convolution function and the
107  // convolution function used for gridding the weights (typically
108  // these are the same) and returns them in the cfs and cfwts
109  // parameters. The required information about the image and
110  // visibility parameters is dervided from the given image and
111  // VisBuffer objects. wConvSize is the number of w-term planes
112  // and pa is the Parallactic Angle in radians for which the
113  // convolution function(s) are computed.
115  const VisBuffer2& vb,
116  const casacore::Int wConvSize,
118  const casacore::Float pa,
119  const casacore::Float dpa,
121  const casacore::Matrix<casacore::Double>& vbFreqSelection,
122  CFStore2& cfs,
123  CFStore2& cfwts,
124  casacore::Bool fillCF=true) = 0;
125  // This method computes the average response function. This is
126  // typically image-plane equivalent of the convolution functions,
127  // averaged over various axis. The precise averaging will be
128  // implementation dependent in the derived classes.
129  virtual casacore::Bool makeAverageResponse(const VisBuffer2& vb,
132  casacore::Bool reset=true) = 0;
133  virtual casacore::Bool makeAverageResponse(const VisBuffer2& vb,
136  casacore::Bool reset=true) = 0;
137 
138  //
139  virtual void setPolMap(const casacore::Vector<casacore::Int>& polMap) = 0;
140  virtual void setSpwSelection(const casacore::Cube<casacore::Int>& spwChanSelFlag) {spwChanSelFlag_p.assign(spwChanSelFlag);}
142  virtual void setRotateCF(const casacore::Double& computeCFAngleRad, const casacore::Double& rotateOTF)
143  {computeCFAngleRad_p=computeCFAngleRad; rotateCFOTFAngleRad_p = rotateOTF;};
144 
145  // virtual void setFeedStokes(const casacore::Vector<casacore::Int>& feedStokes) = 0;
148  const VisBuffer2& vb) = 0;
149 
150  // virtual void setParams(const casacore::Vector<casacore::Int>& polMap, const casacore::Vector<casacore::Int>& feedStokes)
151  // {setPolMap(polMap); setFeedStokes(feedStokes);};
152 
153  // virtual void prepareConvFunction(const VisBuffer2& vb, CFStore2& cfs)=0;
154  //virtual void prepareConvFunction(const VisBuffer2& vb, VBRow2CFBMapType& theMap)=0;
155  virtual void prepareConvFunction(const VisBuffer2& vb, VB2CFBMap& theMap)=0;
157  virtual casacore::Int mapAntIDToAntType(const casacore::Int& /*ant*/) {return 0;};
158  virtual void setMiscInfo(const casacore::RecordInterface& /*params*/) {};
160  virtual casacore::CountedPtr<CFTerms> getTerm(const casacore::String& /*name*/) {return NULL;}
161  virtual int getOversampling(){return 1;};
162 
164  const VisBuffer2& vb, const casacore::Bool& doPointing) = 0;
165 
166 
167 
168  private:
170  protected:
177  };
178  } // end namespace refim
179 } // end namespace casa
180 
181 #endif
virtual void setDimension(casacore::Int n)
Set the dimention of the convolution function.
A 1-D Specialization of the Array class.
int Int
Definition: aipstype.h:50
virtual CF_TYPE getValue(casacore::Vector< CF_TYPE > &, casacore::Vector< CF_TYPE > &)
Given the pixel co-ordinates and an offset values, this returns the value of the convolution function...
virtual void reset()
Overrides PlotTool::reset().
#define CF_TYPE
The base class to compute convolution functions for convolutional gridding.
casacore::Cube< casacore::Int > spwChanSelFlag_p
ostream-like interface to creating log messages.
Definition: LogIO.h:167
virtual void assign(const Array< T > &other)
Assign the other array (which must be dimension 2) to this matrix.
virtual void setPolMap(const casacore::Vector< casacore::Int > &polMap)=0
virtual casacore::Bool makeAverageResponse(const VisBuffer2 &vb, const casacore::ImageInterface< casacore::Complex > &image, casacore::ImageInterface< casacore::Float > &theavgPB, casacore::Bool reset=true)=0
This method computes the average response function.
casacore::CountedPtr< PointingOffsets > po_p
virtual casacore::CountedPtr< CFTerms > getTerm(const casacore::String &)
virtual casacore::Bool findSupport(casacore::Array< casacore::Complex > &func, casacore::Float &threshold, casacore::Int &origin, casacore::Int &R)=0
virtual void setFeedStokes(const casacore::Vector&lt;casacore::Int&gt;&amp; feedStokes) = 0; ...
casacore::Matrix< casacore::Double > spwFreqSelection_p
virtual void setRotateCF(const casacore::Double &computeCFAngleRad, const casacore::Double &rotateOTF)
LatticeExprNode pa(const LatticeExprNode &left, const LatticeExprNode &right)
This function finds 180/pi*atan2(left,right)/2.
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
double Double
Definition: aipstype.h:55
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual void prepareConvFunction(const VisBuffer2 &vb, VB2CFBMap &theMap)=0
virtual void setParams(const casacore::Vector&lt;casacore::Int&gt;&amp; polMap, const casacore::Vector&lt;casacore...
virtual void assign(const Array< T > &other)
Assign the other array (which must be dimension 3) to this cube.
float Float
Definition: aipstype.h:54
virtual Origin origin() const =0
ABSTRACT METHODS //.
virtual casacore::Vector< casacore::Double > findPointingOffset(const casacore::ImageInterface< casacore::Complex > &image, const VisBuffer2 &vb)=0
virtual casacore::Int mapAntIDToAntType(const casacore::Int &)
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
virtual int getVisParams(const VisBuffer2 &vb, const casacore::CoordinateSystem &skyCoord=casacore::CoordinateSystem())=0
A support function which, for now, returns and integer ID corresponding to the on-sky frequency of th...
virtual void setSpwFreqSelection(const casacore::Matrix< casacore::Double > &spwFreqSel)
virtual void setMiscInfo(const casacore::RecordInterface &)
virtual void setPointingOffsets(const casacore::CountedPtr< refim::PointingOffsets > &po)
virtual void setSpwSelection(const casacore::Cube< casacore::Int > &spwChanSelFlag)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual casacore::Matrix< casacore::Int > makeBaselineList(const casacore::Vector< casacore::Int > &antList)
Abstract base class for Record classes.
Interconvert pixel and world coordinates.
virtual void makeConvFunction(const casacore::ImageInterface< casacore::Complex > &image, const VisBuffer2 &vb, const casacore::Int wConvSize, const casacore::CountedPtr< PolOuterProduct > &pop, const casacore::Float pa, const casacore::Float dpa, const casacore::Vector< casacore::Double > &uvScale, const casacore::Vector< casacore::Double > &uvOffset, const casacore::Matrix< casacore::Double > &vbFreqSelection, CFStore2 &cfs, CFStore2 &cfwts, casacore::Bool fillCF=true)=0
This method computes the convolution function and the convolution function used for gridding the weig...