casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AWConvFunc.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //# AWConvFunc.h: Definition of the AWConvFunc class
3 //# Copyright (C) 1997,1998,1999,2000,2001,2002,2003
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //# $Id$
28 //
29 #ifndef SYNTHESIS_TRANSFORM2_AWCONVFUNC_H
30 #define SYNTHESIS_TRANSFORM2_AWCONVFUNC_H
31 
44 #include <casa/Logging/LogIO.h>
45 #include <casa/Logging/LogSink.h>
46 #include <casa/Logging/LogOrigin.h>
47 #include <msvis/MSVis/VisBuffer2.h>
48 namespace casacore{
49 
50  template<class T> class ImageInterface;
51  template<class T> class Matrix;
52 }
53 
54 namespace casa { //# NAMESPACE CASA - BEGIN
55  using namespace vi;
56  // class VisBuffer2;
57  //
58  //-------------------------------------------------------------------------------------------
59  //
60  namespace refim{
62  {
63  public:
65  const casacore::CountedPtr<PSTerm> psTerm,
66  const casacore::CountedPtr<WTerm> wTerm,
67  const casacore::Bool wbAWP=false,
68  const casacore::Bool conjPB=casacore::True);
69 
71  AWConvFunc& operator=(const AWConvFunc& other);
72  virtual void makeConvFunction(const casacore::ImageInterface<casacore::Complex>& image,
73  const VisBuffer2& vb,
74  const casacore::Int wConvSize,
76  const casacore::Float pa,
77  const casacore::Float dpa,
79  const casacore::Matrix<casacore::Double>& vbFreqSelection,
80  CFStore2& cfs,
81  CFStore2& cfwts,
82  casacore::Bool fillCF=true);
83  virtual void fillConvFuncBuffer(CFBuffer& cfb, CFBuffer& cfWtb,
84  const casacore::Int& skyNX, const casacore::Int& skyNY,
86  const casacore::Int& nx, const casacore::Int& ny,
87  const casacore::Vector<casacore::Double>& freqValues,
89  const casacore::Double& wScale,
90  const casacore::Double& vbPA, const casacore::Double& freqHi,
91  const PolMapType& muellerElements,
92  const PolMapType& muellerElementsIndex,
93  const VisBuffer2& vb, const casacore::Float& psScale,
94  PSTerm& psTerm, WTerm& wTerm, ATerm& aTerm,
95  casacore::Bool isDryRun=false);
96  static void makeConvFunction2(const casacore::String& uvGridDiskimage,
98  const casacore::Matrix<casacore::Double>& vbFreqSelection,
99  CFStore2& cfs,
100  CFStore2& cfwts,
101  const casacore::Bool psTermOn,
102  const casacore::Bool aTermOn,
103  const casacore::Bool conjBeams);
104  static void fillConvFuncBuffer2(CFBuffer& cfb, CFBuffer& cfWtb,
105  const casacore::Int& nx, const casacore::Int& ny,
107  const CFCStruct& miscInfo,
108  PSTerm& psTerm, WTerm& wTerm, ATerm& aTerm,
109  casacore::Bool conjBeams);
110 
111  virtual casacore::Bool makeAverageResponse(const VisBuffer2& vb,
114  casacore::Bool reset=true);
115  virtual casacore::Bool makeAverageResponse(const VisBuffer2& vb,
118  casacore::Bool reset=true);
120  {return aTerm_p->getVisParams(vb,skyCoord);};
121  virtual void setPolMap(const casacore::Vector<casacore::Int>& polMap) {aTerm_p->setPolMap(polMap);};
122  // virtual void setFeedStokes(const casacore::Vector<casacore::Int>& feedStokes) {aTerm_p->setFeedStokes(feedStokes);};
125  const VisBuffer2& /*vb*/) {casacore::Vector<casacore::Double> tt(2); tt=0;return tt;};
126  //virtual void prepareConvFunction(const VisBuffer2& vb, VBRow2CFBMapType& cfs);
127  virtual void prepareConvFunction(const VisBuffer2& vb, VB2CFBMap& cfs);
128  casacore::Int mapAntIDToAntType(const casacore::Int& ant) {return aTerm_p->mapAntIDToAntType(ant);};
129 
130  virtual casacore::Vector<casacore::Double> makeFreqValList(casacore::Double& freqScale,
131  const VisBuffer2& vb,
134  virtual casacore::Vector<casacore::Double> makeWValList(const casacore::Double &dW, const casacore::Int &nW);
135 
136  virtual void setMiscInfo(const casacore::RecordInterface& params);
137  virtual casacore::Matrix<casacore::Double> getFreqRangePerSpw(const VisBuffer2& vb);
138 
139 
140 
141  //
142  // Global methods (services)
143  //
144  static void makeConjPolAxis(casacore::CoordinateSystem& cs, casacore::Int conjStokes_in=-1);
145  static casacore::Complex cfArea(casacore::Matrix<casacore::Complex>& cf, const casacore::Int& xSupport, const casacore::Int& ySupport, const casacore::Float& sampling);
146  static casacore::Bool awFindSupport(casacore::Array<casacore::Complex>& func, casacore::Float& threshold, casacore::Int& origin, casacore::Int& radius);
147  static casacore::Bool setUpCFSupport(casacore::Array<casacore::Complex>& func, casacore::Int& xSupport, casacore::Int& ySupport,
148  const casacore::Float& sampling, const casacore::Complex& peak);
149  static casacore::Bool resizeCF(casacore::Array<casacore::Complex>& func, casacore::Int& xSupport, casacore::Int& ySupport,
150  const casacore::Int& supportBuffer, const casacore::Float& sampling, const casacore::Complex& peak);
151  static int getOversampling(PSTerm& psTerm, WTerm& wTerm, ATerm& aTerm);
152  int getOversampling(){return getOversampling(*psTerm_p, *wTerm_p, *aTerm_p);}
153 
155  {if (name=="ATerm") return aTerm_p; else return NULL;}
156 
158  const VisBuffer2& /*vb*/, const casacore::Bool& doPointing);
159 
160 
161 
165 
166  protected:
167  void normalizeAvgPB(casacore::ImageInterface<casacore::Complex>& inImage,
169  casacore::Bool makeAverageResponse_org(const VisBuffer2& vb,
172  casacore::Bool reset=true);
173  void makePBSq(casacore::ImageInterface<casacore::Complex>& inImage);
174 
175 
181  };
182  //
183  //-------------------------------------------------------------------------------------------
184  //
185 };
186 };
187 #endif
int Int
Definition: aipstype.h:50
casacore::CountedPtr< ATerm > aTerm_p
Definition: AWConvFunc.h:162
virtual void reset()
Overrides PlotTool::reset().
The base class to compute convolution functions for convolutional gridding.
PtrHolder< T > & operator=(const PtrHolder< T > &other)
A class to apply the W-Term to the given image.
Definition: PSTerm.h:57
virtual casacore::Vector< casacore::Double > findPointingOffset(const casacore::ImageInterface< casacore::Complex > &, const VisBuffer2 &)
Definition: AWConvFunc.h:124
casacore::Vector< casacore::Vector< casacore::Double > > pixFieldGrad_p
Definition: AWConvFunc.h:177
A 2-D Specialization of the Array class.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
casacore::CountedPtr< WTerm > wTerm_p
Definition: AWConvFunc.h:164
virtual int getVisParams(const VisBuffer2 &vb, const casacore::CoordinateSystem &skyCoord=casacore::CoordinateSystem())
A support function which, for now, returns and integer ID corresponding to the on-sky frequency of th...
Definition: AWConvFunc.h:119
casacore::Bool wbAWP_p
Definition: AWConvFunc.h:179
virtual casacore::CountedPtr< CFTerms > getTerm(const casacore::String &name)
Definition: AWConvFunc.h:154
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
A base class for astronomical images.
casacore::Double imRefFreq_p
Definition: AWConvFunc.h:178
double Double
Definition: aipstype.h:55
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Int mapAntIDToAntType(const casacore::Int &ant)
Definition: AWConvFunc.h:128
float Float
Definition: aipstype.h:54
virtual void setPolMap(const casacore::Vector< casacore::Int > &polMap)
Definition: AWConvFunc.h:121
virtual Origin origin() const =0
ABSTRACT METHODS //.
A class to apply the W-Term to the given image.
Definition: WTerm.h:55
casacore::CountedPtr< PSTerm > psTerm_p
Definition: AWConvFunc.h:163
The base class to represent the Aperture-Term of the Measurement Equation.
Definition: ATerm.h:65
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Abstract base class for Record classes.
const Bool True
Definition: aipstype.h:43
casacore::Vector< casacore::Double > thePix_p
Definition: AWConvFunc.h:176
Interconvert pixel and world coordinates.
casacore::CountedPtr< CFBuffer > baseCFB_p
Definition: AWConvFunc.h:180
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42