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_SIMPLEPBCONVFUNC_H
29 #define SYNTHESIS_SIMPLEPBCONVFUNC_H
30 
31 #include <casa/Arrays/Vector.h>
33 #include <casa/Containers/Block.h>
37 #include <wcslib/wcsconfig.h>
39 #if HAVE_SINCOS
40 #define SINCOS(a,s,c) sincos(a,&s,&c)
41 #else
42 #define SINCOS(a,s,c) \
43  s = sin(a); \
44  c = cos(a)
45 #endif
46 
47 
48 namespace casacore{
49 
50  template<class T> class ImageInterface;
51  template<class T> class Matrix;
52  class CoordinateSystem;
53  class DirectionCoordinate;
54 }
55 
56 namespace casa{
57 
58  // <summary> A class to support FTMachines get their convolution casacore::Function </summary>
59 
60  // <use visibility=export>
61  // <prerequisite>
62  // <li> <linkto class=VisBuffer>VisBuffer</linkto> module
63 // </prerequisite>
64  // <etymology>
65  // "Simple" for cases that does not need parallactic angle and or frequency
66  // dependence ...hence one convolution function per pointing
67  // "PB" for primary beam based convolution function
68  // </etymology>
69  //
70  // <synopsis>
71  // FTMachines like WProjection and MosaicFT need convolution functions to
72  // deal with directional dependent issues...
73  // this class and related ones provide and cache such functions for re-use
74  //</synopsis>
75  //Forward declarations
76  class VisBuffer;
77  class SkyJones;
78 
80  {
81  public:
84  SimplePBConvFunc(const casacore::RecordInterface& rec, casacore::Bool calcFlux_needed);
85  virtual ~SimplePBConvFunc();
86  // Inputs are the image, visbuffer, convSampling and skyjones
87  // findconv return a cached convvolution function appropriate for this
88  // visbuffer and skyjones ...this one should be superseded
89  // by the one below and call setSkyJones when necessary
91  const VisBuffer& ,const casacore::Int& ,
92  SkyJones& ,
95  casacore::Int& ){};
96 
98  // the vb.row and channel
99  //to the plane of the convfunc appropriate
100  //when conjugateFreqFuncs=True the the convFunc contains the conjugate frequency convFunctions
102  const VisBuffer& vb,
103  const casacore::Int& convSampling,
104  const casacore::Vector<casacore::Double>& visFreq,
106  casacore::Array<casacore::Complex>& weightConvFunc,
108  casacore::Vector<casacore::Int>& convSupport,
110 
112  // slice fluxscale image by npol
113  virtual void sliceFluxScale(casacore::Int npol);
114  //This is a function to just store the final weight image
115  //as FT machines will share this object ...they can get share this too
117 
118  virtual void setSkyJones(SkyJones* sj);
119 
121  {throw(casacore::AipsError("SimplePBConvFunc::findSupport() not implemented"));};
125  casacore::Bool /*reset=true*/)
126  {throw(casacore::AipsError("SimplePBConvFunc::makeAverageRes() called"));};
127 
128  //Serialization
130  //From record
131  //set calcfluxneeded to true if flux scale need to be computed
132  virtual casacore::Bool fromRecord(casacore::String& err, const casacore::RecordInterface& rec, casacore::Bool calcFluxneeded=false);
133  //give possibility to erase history
134  virtual void reset();
135  virtual casacore::String name() {return casacore::String("SimplePBConvFunc");}
136  protected:
156  std::map<casacore::String, casacore::Int> vbConvIndex_p;
157  virtual casacore::Int convIndex(const VisBuffer& vb);
158  std::map<casacore::String, casacore::Int> ant1PointVal_p;
161  virtual void storeImageParams(const casacore::ImageInterface<casacore::Complex>& iimage, const VisBuffer& vb);
163  //return the direction pixel corresponding to a direction
164  virtual void toPix(const VisBuffer& vb);
167  private:
169  void addPBToFlux(const VisBuffer& vb);
170  std::map <casacore::String, casacore::Int> convFunctionMap_p;
173 
180  //These are Arrays of 5 dimension (x, y, npol, nchan, nrow)
181  //Thus every baseline may have its own.
188 
189  };
190 };// end of namespace
191 #endif
casacore::Vector< casacore::MDirection > ant1PointingCache_p
casacore::Block< casacore::CountedPtr< casacore::Vector< casacore::Int > > > convSupportBlock_p
A Measure: astronomical direction.
Definition: MDirection.h:174
PBMathInterface::PBClass pbClass_p
casacore::MDirection::Convert pointToPix_p
int Int
Definition: aipstype.h:50
virtual void setSkyJones(SkyJones *sj)
casacore::DirectionCoordinate dc_p
virtual void sliceFluxScale(casacore::Int npol)
slice fluxscale image by npol
virtual void toPix(const VisBuffer &vb)
return the direction pixel corresponding to a direction
casacore::Vector< casacore::Bool > doneMainConv_p
casacore::Block< casacore::CountedPtr< casacore::Vector< casacore::Int > > > convSizes_p
Container for Measure frame.
Definition: MeasFrame.h:137
casacore::Vector< casacore::Double > thePix_p
casacore::CoordinateSystem csys_p
casacore::Matrix< casacore::Complex > weightConvFunc_p
PBClass
Allowed PBMath Classes.
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
const casacore::MDirection & pointingDirAnt1(const VisBuffer &vb)
casacore::MDirection direction1_p
casacore::Matrix< casacore::Complex > weightSave_p
casacore::Bool filledFluxScale_p
casacore::CountedPtr< casacore::TempImage< casacore::Float > > convWeightImage_p
defines physical units
Definition: Unit.h:189
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::Int actualConvIndex_p
casacore::MEpoch::Types timeMType_p
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
virtual void findUsefulChannels(casacore::Vector< casacore::Int > &chanMap, casacore::Vector< casacore::Double > &chanFreqs, const VisBuffer &vb, const casacore::Vector< casacore::Double > &visFreq)
Interconvert pixel positions and directions (e.g. RA/DEC).
casacore::Bool calcFluxScale_p
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...
virtual casacore::Bool toRecord(casacore::RecordInterface &outRec)
Serialization.
Returns the convfunctions in the Cubes the casacore::Matrix rowChanMap maps the vb row and channel to the plane of the convfunc appropriate when conjugateFreqFuncs
casacore::Bool findSupport(casacore::Array< casacore::Complex > &, casacore::Float &, casacore::Int &, casacore::Int &)
casacore::Matrix< casacore::Complex > convSave_p
casacore::TempImage< casacore::Float > fluxScale_p
virtual casacore::ImageInterface< casacore::Float > & getFluxScaleImage()
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Block< casacore::CountedPtr< casacore::Array< casacore::Complex > > > convWeights_p
casacore::Bool checkPBOfField(const VisBuffer &vb)
float Float
Definition: aipstype.h:54
casacore::MeasFrame pointFrame_p
casacore::Matrix< casacore::Complex > convFunc_p
virtual void findConvFunction(const casacore::ImageInterface< casacore::Complex > &, const VisBuffer &, 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...
void addPBToFlux(const VisBuffer &vb)
simple 1-D array
virtual casacore::String name()
virtual void reset()
give possibility to erase history
Sky Jones: Model sky-plane instrumental effects for the SkyEquation.
Definition: SkyJones.h:172
Base class for all Casacore library errors.
Definition: Error.h:134
std::map< casacore::String, casacore::Int > convFunctionMap_p
virtual casacore::Int convIndex(const VisBuffer &vb)
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
virtual void storeImageParams(const casacore::ImageInterface< casacore::Complex > &iimage, const VisBuffer &vb)
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
casacore::Int directionIndex_p
std::map< casacore::String, casacore::Int > vbConvIndex_p
virtual casacore::Bool makeAverageResponse(const VisBuffer &, const casacore::ImageInterface< casacore::Complex > &, casacore::ImageInterface< casacore::Float > &, casacore::Bool)
Interconvert pixel and world coordinates.
casacore::MDirection direction2_p
casacore::Matrix< casacore::Bool > pointingPix_p
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42