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_CONVOLUTIONFUNCTION_H
30 #define SYNTHESIS_CONVOLUTIONFUNCTION_H
31 
39 #include <casa/Logging/LogOrigin.h>
40 #include <casa/Logging/LogSink.h>
41 #include <casa/Logging/LogIO.h>
42 #include <casa/Arrays/Vector.h>
43 #define CF_TYPE casacore::Double
44 
45 namespace casa{
46  // <summary>
47  // The base class to compute convolution functions for convolutional gridding.
48  // </summary>
49 
50  // <use visibility=export>
51  // <prerequisite>
52  // </prerequisite>
53  // <etymology>
54  // Class to encapsulate the convolution function for convolutional gridding.
55  // </etymology>
56  //
57  // <synopsis> Standard method of re-sampling data to or from a
58  //
59  // regular grid is done by convolutional gridding. This requires a
60  // convolution function which a finte support size and well behaved
61  // function in the Fourier domain. For standard gridding, the
62  // Prolate Spheroidal function are used. Convolution functions
63  // used in casacore::Projection algorithms (like W-casacore::Projection, A-casacore::Projection,
64  // etc. and their combinations) each require potentially different
65  // mechanisms to compute. These are implemented in separate
66  // classes in the Synthesis module. Since these are used in common
67  // framework for gridding and de-gridding, these are all derived
68  // from a common base class. ConvolutionFunction (this class) is
69  // that base class.
70  //
71  // Most of the methods in this base class are pure virtual. I.e.,
72  // only surviving offsprings (derived classes) of this class will
73  // be those that will have the wisdom that they methods represent.
74  //
75  // </synopsis>
76 
78  {
79  public:
82  virtual ~ConvolutionFunction();
83 
84  // Set the dimention of the convolution function.
85  virtual void setDimension(casacore::Int n){nDim = n;};
86 
87  // Given the pixel co-ordinates and an offset values, this returns
88  // the value of the convolution function. This is however not
89  // used anywhere yet (and is therefore also not a pure virtual
90  // function).
92 
93  // A support function which, for now, returns and integer ID
94  // corresponding to the on-sky frequency of the supplied VisBuffer.
95  virtual int getVisParams(const VisBuffer& vb,const casacore::CoordinateSystem& skyCoord=casacore::CoordinateSystem())=0;
96 
97  // This method computes the convolution function and the
98  // convolution function used for gridding the weights (typically
99  // these are the same) and returns them in the cfs and cfwts
100  // parameters. The required information about the image and
101  // visibility parameters is dervided from the given image and
102  // VisBuffer objects. wConvSize is the number of w-term planes
103  // and pa is the Parallactic Angle in radians for which the
104  // convolution function(s) are computed.
106  const VisBuffer& vb,
107  const casacore::Int wConvSize,
109  const casacore::Float pa,
110  const casacore::Float dpa,
112  const casacore::Matrix<casacore::Double>& vbFreqSelection,
113  CFStore2& cfs,
114  CFStore2& cfwts,
115  casacore::Bool fillCF=true) = 0;
116  // This method computes the average response function. This is
117  // typically image-plane equivalent of the convolution functions,
118  // averaged over various axis. The precise averaging will be
119  // implementation dependent in the derived classes.
120  virtual casacore::Bool makeAverageResponse(const VisBuffer& vb,
123  casacore::Bool reset=true) = 0;
124  virtual casacore::Bool makeAverageResponse(const VisBuffer& vb,
127  casacore::Bool reset=true) = 0;
128 
129  //
130  virtual void setPolMap(const casacore::Vector<casacore::Int>& polMap) = 0;
131  virtual void setSpwSelection(const casacore::Cube<casacore::Int>& spwChanSelFlag) {spwChanSelFlag_p.assign(spwChanSelFlag);}
133  virtual void setRotateCF(const casacore::Double& computeCFAngleRad, const casacore::Double& rotateOTF)
134  {computeCFAngleRad_p=computeCFAngleRad; rotateCFOTFAngleRad_p = rotateOTF;};
135 
136  // virtual void setFeedStokes(const casacore::Vector<casacore::Int>& feedStokes) = 0;
139  const VisBuffer& vb) = 0;
140 
141  // virtual void setParams(const casacore::Vector<casacore::Int>& polMap, const casacore::Vector<casacore::Int>& feedStokes)
142  // {setPolMap(polMap); setFeedStokes(feedStokes);};
143 
144  // virtual void prepareConvFunction(const VisBuffer& vb, CFStore2& cfs)=0;
145  virtual void prepareConvFunction(const VisBuffer& vb, VBRow2CFBMapType& theMap)=0;
147  virtual casacore::Int mapAntIDToAntType(const casacore::Int& /*ant*/) {return 0;};
148  virtual void setMiscInfo(const casacore::RecordInterface& /*params*/) {};
149  virtual casacore::CountedPtr<CFTerms> getTerm(const casacore::String& /*name*/) {return NULL;}
150  private:
152  protected:
158  };
159 
160 };
161 
162 #endif
virtual void setRotateCF(const casacore::Double &computeCFAngleRad, const casacore::Double &rotateOTF)
A 1-D Specialization of the Array class.
int Int
Definition: aipstype.h:50
virtual void setSpwFreqSelection(const casacore::Matrix< casacore::Double > &spwFreqSel)
casacore::Cube< casacore::Int > spwChanSelFlag_p
virtual int getVisParams(const VisBuffer &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 reset()
Overrides PlotTool::reset().
virtual void prepareConvFunction(const VisBuffer &vb, VBRow2CFBMapType &theMap)=0
virtual void setParams(const casacore::Vector&lt;casacore::Int&gt;&amp; polMap, const casacore::Vector&lt;casacore...
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; ...
virtual casacore::Vector< casacore::Double > findPointingOffset(const casacore::ImageInterface< casacore::Complex > &image, const VisBuffer &vb)=0
casacore::Double rotateCFOTFAngleRad_p
ostream-like interface to creating log messages.
Definition: LogIO.h:167
The base class to compute convolution functions for convolutional gridding.
virtual casacore::Matrix< casacore::Int > makeBaselineList(const casacore::Vector< casacore::Int > &antList)
casacore::Matrix< casacore::Double > spwFreqSelection_p
virtual void assign(const Array< T > &other)
Assign the other array (which must be dimension 2) to this matrix.
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
casacore::Double computeCFAngleRad_p
ConvolutionFunction(casacore::Int dim)
virtual void makeConvFunction(const casacore::ImageInterface< casacore::Complex > &image, const VisBuffer &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...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual casacore::CountedPtr< CFTerms > getTerm(const casacore::String &)
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 void setSpwSelection(const casacore::Cube< casacore::Int > &spwChanSelFlag)
virtual void setDimension(casacore::Int n)
Set the dimention of the convolution function.
virtual void setMiscInfo(const casacore::RecordInterface &)
virtual casacore::Int mapAntIDToAntType(const casacore::Int &)
virtual void setPolMap(const casacore::Vector< casacore::Int > &polMap)=0
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...
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
#define CF_TYPE
virtual casacore::Bool makeAverageResponse(const VisBuffer &vb, const casacore::ImageInterface< casacore::Complex > &image, casacore::ImageInterface< casacore::Float > &theavgPB, casacore::Bool reset=true)=0
This method computes the average response function.
Abstract base class for Record classes.
Interconvert pixel and world coordinates.