casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimplePBConvFunc.h
Go to the documentation of this file.
1 //# SimplePBConvFunc.h: Definition for PixelatedConvFunc
2 //# Copyright (C) 2007
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 #ifndef SYNTHESIS_TRANSFORM2_SIMPLEPBCONVFUNC_H
29 #define SYNTHESIS_TRANSFORM2_SIMPLEPBCONVFUNC_H
30 
31 #include <casa/Arrays/Vector.h>
33 #include <casa/Containers/Block.h>
37 
38 #include <wcslib/wcsconfig.h>
40 #if HAVE_SINCOS
41 #define SINCOS(a,s,c) sincos(a,&s,&c)
42 #else
43 #define SINCOS(a,s,c) \
44  s = sin(a); \
45  c = cos(a)
46 #endif
47 
48 
49 namespace casacore{
50 
51  template<class T> class ImageInterface;
52  template<class T> class Matrix;
53  class CoordinateSystem;
54  class DirectionCoordinate;
55 }
56 
57 namespace casa{
58 
59  // <summary> A class to support FTMachines get their convolution casacore::Function </summary>
60 
61  // <use visibility=export>
62  // <prerequisite>
63  // <li> <linkto class=VisBuffer>VisBuffer</linkto> module
64 // </prerequisite>
65  // <etymology>
66  // "Simple" for cases that does not need parallactic angle and or frequency
67  // dependence ...hence one convolution function per pointing
68  // "PB" for primary beam based convolution function
69  // </etymology>
70  //
71  // <synopsis>
72  // FTMachines like WProjection and MosaicFT need convolution functions to
73  // deal with directional dependent issues...
74  // this class and related ones provide and cache such functions for re-use
75  //</synopsis>
76  //Forward declarations
77 
78 
79  namespace vi{class VisBuffer2;}
80 
81 
82 namespace refim{ //namespace for imaging refactor
83  class SkyJones;
84 
85 
87 
88  {
89  public:
92  SimplePBConvFunc(const casacore::RecordInterface& rec, casacore::Bool calcFlux_needed);
93  virtual ~SimplePBConvFunc();
94  // Inputs are the image, visbuffer, convSampling and skyjones
95  // findconv return a cached convvolution function appropriate for this
96  // visbuffer and skyjones ...this one should be superseded
97  // by the one below and call setSkyJones when necessary
99  const vi::VisBuffer2& ,const casacore::Int& ,
100  SkyJones& ,
103  casacore::Int& ){};
104 
106  // the vb.row and channel
107  //to the plane of the convfunc appropriate
108 
110  const vi::VisBuffer2& vb,
111  const casacore::Int& convSampling,
112  const casacore::Vector<casacore::Double>& visFreq,
114  casacore::Array<casacore::Complex>& weightConvFunc,
116  casacore::Vector<casacore::Int>& convSupport,
117  casacore::Vector<casacore::Int>& polMap, casacore::Vector<casacore::Int>& chanMap, casacore::Vector<casacore::Int>& rowMap, const casacore::Bool getConjFreqConvFunc=false, const casacore::MVDirection& extraShift=casacore::MVDirection(0.0), const casacore::Bool useExtraShift=casacore::False);
119  // slice fluxscale image by npol
120  virtual void sliceFluxScale(casacore::Int npol);
121  //This is a function to just store the final weight image
122  //as FT machines will share this object ...they can get share this too
124 
125  virtual void setSkyJones(SkyJones* sj);
129  {throw(casacore::AipsError("SimplePBConvFunc::findSupport() not implemented"));};
133  casacore::Bool /*reset=true*/)
134  {throw(casacore::AipsError("SimplePBConvFunc::makeAverageRes() called"));};
135 
136  //Serialization
138  //From record
139  //set calcfluxneeded to true if flux scale need to be computed
140  virtual casacore::Bool fromRecord(casacore::String& err, const casacore::RecordInterface& rec, casacore::Bool calcFluxneeded=false);
141  //give possibility to erase history
142  virtual void reset();
143  virtual casacore::String name() {return casacore::String("SimplePBConvFunc");};
144  void setUsePointing(casacore::Bool usepointing){usePointingTable_p=usepointing;};
145  protected:
146  SkyJones* sj_p;
165  std::map<casacore::String, casacore::Int> vbConvIndex_p;
166  virtual casacore::Int convIndex(const vi::VisBuffer2& vb);
167  std::map<casacore::String, casacore::Int> ant1PointVal_p;
170  virtual void storeImageParams(const casacore::ImageInterface<casacore::Complex>& iimage, const vi::VisBuffer2& vb);
172  //return the direction pixel corresponding to a direction
173  virtual void toPix(const vi::VisBuffer2& vb, const casacore::MVDirection& extraShift=casacore::MVDirection(0.0), const casacore::Bool useExtraShift=casacore::False);
179  private:
181  void addPBToFlux(const vi::VisBuffer2& vb);
182  std::map <casacore::String, casacore::Int> convFunctionMap_p;
185 
192  //These are Arrays of 5 dimension (x, y, npol, nchan, nrow)
193  //Thus every baseline may have its own.
199 
200  };
201  }; //end of refim namespace
202 };// end of namespace
203 #endif
virtual casacore::Int convIndex(const vi::VisBuffer2 &vb)
casacore::Vector< casacore::Bool > doneMainConv_p
A Measure: astronomical direction.
Definition: MDirection.h:174
casacore::CountedPtr< casacore::TempImage< casacore::Float > > convWeightImage_p
int Int
Definition: aipstype.h:50
virtual void findUsefulChannels(casacore::Vector< casacore::Int > &chanMap, casacore::Vector< casacore::Double > &chanFreqs, const vi::VisBuffer2 &vb, const casacore::Vector< casacore::Double > &visFreq)
casacore::Block< casacore::CountedPtr< casacore::Array< casacore::Complex > > > convWeights_p
casacore::Vector< casacore::MDirection > ant1PointingCache_p
void setUsePointing(casacore::Bool usepointing)
virtual void findConvFunction(const casacore::ImageInterface< casacore::Complex > &, const vi::VisBuffer2 &, const casacore::Int &, SkyJones &, casacore::Matrix< casacore::Complex > &, casacore::Matrix< casacore::Complex > &, casacore::Int &, casacore::Int &)
Inputs are the image, visbuffer, convSampling and skyjones findconv return a cached convvolution func...
casacore::Matrix< casacore::Complex > weightConvFunc_p
casacore::Matrix< casacore::Complex > convSave_p
Container for Measure frame.
Definition: MeasFrame.h:137
PBClass
Allowed PBMath Classes.
std::map< casacore::String, casacore::Int > convFunctionMap_p
virtual void storeImageParams(const casacore::ImageInterface< casacore::Complex > &iimage, const vi::VisBuffer2 &vb)
PBMathInterface::PBClass pbClass_p
casacore::MeasFrame pointFrame_p
casacore::MDirection::Convert pointToPix_p
defines physical units
Definition: Unit.h:189
casacore::MDirection direction1_p
virtual casacore::Bool makeAverageResponse(const vi::VisBuffer2 &, const casacore::ImageInterface< casacore::Complex > &, casacore::ImageInterface< casacore::Float > &, casacore::Bool)
casacore::DirectionCoordinate dc_p
virtual casacore::Bool toRecord(casacore::RecordInterface &outRec)
Serialization.
virtual casacore::CountedPtr< VisBufferUtil > getVBUtil()
casacore::Matrix< casacore::Bool > pointingPix_p
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
virtual casacore::String name()
virtual casacore::Bool fromRecord(casacore::String &err, const casacore::RecordInterface &rec, casacore::Bool calcFluxneeded=false)
From record set calcfluxneeded to true if flux scale need to be computed.
casacore::Block< casacore::CountedPtr< casacore::Vector< casacore::Int > > > convSupportBlock_p
std::map< casacore::String, casacore::Int > vbConvIndex_p
Interconvert pixel positions and directions (e.g. RA/DEC).
virtual void setWeightImage(casacore::CountedPtr< casacore::TempImage< casacore::Float > > &wgtimage)
This is a function to just store the final weight image as FT machines will share this object...
casacore::CoordinateSystem csys_p
casacore::Bool findSupport(casacore::Array< casacore::Complex > &, casacore::Float &, casacore::Int &, casacore::Int &)
const casacore::MDirection & pointingDirAnt1(const vi::VisBuffer2 &vb)
casacore::Matrix< casacore::Complex > convFunc_p
casacore::Block< casacore::CountedPtr< casacore::Array< casacore::Complex > > > convFunctions_p
These are Arrays of 5 dimension (x, y, npol, nchan, nrow) Thus every baseline may have its own...
std::map< casacore::String, casacore::Int > ant1PointVal_p
casacore::Bool checkPBOfField(const vi::VisBuffer2 &vb)
casacore::CountedPtr< VisBufferUtil > vbutil_p
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual void reset()
give possibility to erase history
casacore::TempImage< casacore::Float > fluxScale_p
casacore::MEpoch::Types timeMType_p
virtual casacore::ImageInterface< casacore::Float > & getFluxScaleImage()
float Float
Definition: aipstype.h:54
const Bool False
Definition: aipstype.h:44
casacore::Vector< casacore::Double > thePix_p
Sky Jones: Model sky-plane instrumental effects for the SkyEquation.
Definition: SkyJones.h:174
virtual void toPix(const vi::VisBuffer2 &vb, const casacore::MVDirection &extraShift=casacore::MVDirection(0.0), const casacore::Bool useExtraShift=casacore::False)
return the direction pixel corresponding to a direction
simple 1-D array
casacore::Block< casacore::CountedPtr< casacore::Vector< casacore::Int > > > convSizes_p
virtual void setVBUtil(casacore::CountedPtr< VisBufferUtil > vbutil)
virtual void sliceFluxScale(casacore::Int npol)
slice fluxscale image by npol
void addPBToFlux(const vi::VisBuffer2 &vb)
VisBuffer2s encapsulate one chunk of visibility data for processing.
Definition: VisBuffer2.h:141
Base class for all Casacore library errors.
Definition: Error.h:134
casacore::MDirection direction2_p
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Matrix< casacore::Complex > weightSave_p
Vector of three direction cosines.
Definition: MVDirection.h:106
virtual void setSkyJones(SkyJones *sj)
Abstract base class for Record classes.
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
Interconvert pixel and world coordinates.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42