casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PBMath2DImage.h
Go to the documentation of this file.
1 //# PBMath2DImage.h: Definitions of 2-D Image PBMath objects
2 //# Copyright (C) 1996,1997,1998,2000,2003
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_PBMATH2DIMAGE_H
30 #define SYNTHESIS_PBMATH2DIMAGE_H
31 
32 #include <casa/aips.h>
35 #include <measures/Measures.h>
36 
37 namespace casacore{
38 
39 template<class T> class TempImage;
40 }
41 
42 namespace casa { //# NAMESPACE CASA - BEGIN
43 
44 //#forward
45 
49 
50 // <summary> 2-D Image Primary Beam Model </summary>
51 
52 // <use visibility=export>
53 
54 // <reviewed reviewer="" date="" tests="" demos="">
55 
56 // <prerequisite>
57 // <li> <linkto class="PBMathInterface">PBMathInterface</linkto> class
58 // <li> <linkto class="PBMath2D">PBMath2D</linkto> class
59 // </prerequisite>
60 //
61 // <etymology>
62 // PBMath2DImage: derived from PBMath2D, implements PB and VP from sampled 2D VP
63 // </etymology>
64 //
65 // <synopsis>
66 // See PBMath2D for a general synopsis of the 2D PB types.
67 //
68 // The user supplies a vector which is a numerical representation
69 // of a voltage [attern (hey, if you have a PB, just take the square
70 // root, and look out for sidelobes which could be negative).
71 // The first element in the vector needs to be 1.0, the center of the
72 // voltage pattern. The last element of the vector is the value of the
73 // VP at the maximumRadius. The maximumRadius and the reference frequency at
74 // which the tabulated VP is intended are also required for construction.
75 // The PBMath2DImage constructor proceeds by performing SINC interpolation
76 // on the input vector to generate the highly oversampled lookup vector.
77 //
78 // </synopsis>
79 //
80 //
81 // <example>
82 // <srcblock>
83 
84 // numPB.applyPB( im1, im2, pointingDir);
85 // </srcblock>
86 // </example>
87 //
88 // <motivation>
89 // All of the 2-D PB types have everything in common except for the
90 // details of their parameterization. This lightweight class
91 // deals with those differences: construction, filling the PBArray
92 // from construction parameters, and flushing to disk.
93 // The Image type is very handy: someone can take a sample
94 // illumination pattern, FT, and take a slice of the resulting voltage
95 // pattern and construct a VP from that slice.
96 // </motivation>
97 //
98 // <todo asof="98/10/21">
99 // <li> constructor from a casacore::MS beam subtable
100 // <li> flush to casacore::MS beam subtable
101 // </todo>
102 
103 
104 class PBMath2DImage : public PBMath2D {
105 public:
106 
107  PBMath2DImage();
108 
109  // Instantiation from arguments; only an image is needed
113 
115 
116  // Copy constructor
117  // PBMath2DGImage(const PBMath2DImage& other);
118 
119  // Assignment operator, by reference
120  PBMath2DImage& operator=(const PBMath2DImage& other);
121 
122  //destructor
123  ~PBMath2DImage();
124 
125  // Get the type of PB this is
127 
128  // Summarize the construction data for this primary beam
129  void summary(casacore::Int nValues=0);
130 
131 protected:
132 
135  const casacore::MDirection& sp,
136  const casacore::Quantity parAngle,
137  const BeamSquint::SquintType doSquint,
140  casacore::Int ipower, // ie, 1=VP, 2=PB, 4=PB^2
141  casacore::Float cutoff,
142  casacore::Bool forward);
143 
146  const casacore::MDirection& sp,
147  const casacore::Quantity parAngle,
148  const BeamSquint::SquintType doSquint,
149  casacore::Float cutoff, casacore::Int ipower);
150 
151  virtual SkyComponent& apply(SkyComponent& in,
152  SkyComponent& out,
153  const casacore::MDirection& sp,
154  const casacore::Quantity frequency,
155  const casacore::Quantity parAngle,
156  const BeamSquint::SquintType doSquint,
159  casacore::Int ipower, // ie, 1=VP, 2=PB, 4=PB^2
160  casacore::Float cutoff,
161  casacore::Bool forward);
162 
164 
165 
166 
167 private:
168 
169  // Check for congruency
173 
174 
175  // Update the Jones Matrix
176  void updateJones(const casacore::CoordinateSystem& coords,
177  const casacore::IPosition& shape,
178  const casacore::MDirection& pc,
179  const casacore::Quantity& paAngle);
180 
181  // casacore::Complex to Complex
182  void applyJones(const casacore::Array<casacore::Float>* reJones,
183  const casacore::Array<casacore::Float>* imJones,
189  casacore::Int ipower, // ie, 1=VP, 2=PB
190  casacore::Float cutoff,
191  casacore::Bool circular=true,
192  casacore::Bool forward=true);
193 
194  void applyJonesFast(const casacore::Float*& reJones,
195  const casacore::Float*& imJones,
199  casacore::Bool /*inverse*/,
200  casacore::Bool /*conjugate*/,
201  casacore::Int ipower, // ie, 1=VP, 2=PB
202  casacore::Float /*cutoff*/,
203  casacore::Bool circular,
204  casacore::Bool forward);
205  void applyJonesFastX(const casacore::Float*& reJones,
206  const casacore::Float*& imJones,
207  const casacore::Complex*& in,
208  casacore::Complex*& outstor,
209  const casacore::Int*& polmap,
210  casacore::Bool /*inverse*/,
211  casacore::Bool /*conjugate*/,
212  casacore::Int ipower, // ie, 1=VP, 2=PB
213  casacore::Float /*cutoff*/,
214  casacore::Bool circular,
215  casacore::Bool forward,
216  const casacore::Int ix, const casacore::Int nx, const casacore::Int ny, const casacore::Int npol);
217 
218 
219  // casacore::Float to Float
220  void applyJones(const casacore::Array<casacore::Float>* reJones,
221  const casacore::Array<casacore::Float>* imJones,
225  casacore::Float cutoff,
226  casacore::Bool circular=true);
227 
228 
233 
236 
239 
241 };
242 
243 
244 } //# NAMESPACE CASA - END
245 
246 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
A Measure: astronomical direction.
Definition: MDirection.h:174
int Int
Definition: aipstype.h:50
virtual casacore::ImageInterface< casacore::Complex > & apply(const casacore::ImageInterface< casacore::Complex > &in, casacore::ImageInterface< casacore::Complex > &out, const casacore::MDirection &sp, const casacore::Quantity parAngle, const BeamSquint::SquintType doSquint, casacore::Bool inverse, casacore::Bool conjugate, casacore::Int ipower, casacore::Float cutoff, casacore::Bool forward)
lower level helping apply methods
casacore::Vector< casacore::Double > * referencePixelImJones_p
casacore::TempImage< casacore::Float > * reJonesImage_p
casacore::SquareMatrix< casacore::Complex, 2 > mjJones2
Definition: PBMath2DImage.h:46
void applyJones(const casacore::Array< casacore::Float > *reJones, const casacore::Array< casacore::Float > *imJones, const casacore::Array< casacore::Complex > &in, casacore::Array< casacore::Complex > &out, casacore::Vector< casacore::Int > &polmap, casacore::Bool inverse, casacore::Bool conjugate, casacore::Int ipower, casacore::Float cutoff, casacore::Bool circular=true, casacore::Bool forward=true)
casacore::Complex to Complex
SquintType
Allowed Squints: NONE = no squint: PB is centered on the pointing center RR = PB is shifted from poin...
Definition: BeamSquint.h:109
PBClass
Allowed PBMath Classes.
void updateJones(const casacore::CoordinateSystem &coords, const casacore::IPosition &shape, const casacore::MDirection &pc, const casacore::Quantity &paAngle)
Update the Jones Matrix.
~PBMath2DImage()
destructor
casacore::TempImage< casacore::Float > * imJonesImage_p
void checkJonesCongruent(casacore::ImageInterface< casacore::Float > &reJones, casacore::ImageInterface< casacore::Float > &imJones)
Check for congruency.
Fast Square Matrix class with fixed (templated) size.
casacore::Vector< casacore::Double > * incrementsImJones_p
virtual casacore::Int support(const casacore::CoordinateSystem &cs)
casacore::Matrix< T > inverse(const casacore::Matrix< T > &A)
base class for 1D PBMath objects
Definition: PBMath2D.h:154
casacore::TempImage< casacore::Float > * reRegridJonesImage_p
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Vector< casacore::Double > * incrementsReJones_p
casacore::SquareMatrix< casacore::Float, 2 > mjJones2F
Definition: PBMath2DImage.h:48
float Float
Definition: aipstype.h:54
void applyJonesFastX(const casacore::Float *&reJones, const casacore::Float *&imJones, const casacore::Complex *&in, casacore::Complex *&outstor, const casacore::Int *&polmap, casacore::Bool, casacore::Bool, casacore::Int ipower, casacore::Float, casacore::Bool circular, casacore::Bool forward, const casacore::Int ix, const casacore::Int nx, const casacore::Int ny, const casacore::Int npol)
PBMath2DImage & operator=(const PBMath2DImage &other)
Copy constructor PBMath2DGImage(const PBMath2DImage&amp; other);.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
Definition: ExprNode.h:1944
PBMathInterface::PBClass whichPBClass()
Get the type of PB this is.
void applyJonesFast(const casacore::Float *&reJones, const casacore::Float *&imJones, const casacore::Array< casacore::Complex > &in, casacore::Array< casacore::Complex > &out, casacore::Vector< casacore::Int > &polmap, casacore::Bool, casacore::Bool, casacore::Int ipower, casacore::Float, casacore::Bool circular, casacore::Bool forward)
void summary(casacore::Int nValues=0)
Summarize the construction data for this primary beam.
casacore::SquareMatrix< casacore::Complex, 4 > mjJones4
Definition: PBMath2DImage.h:47
A component of a model of the sky.
Definition: SkyComponent.h:130
2-D Image Primary Beam Model
casacore::Vector< casacore::Double > * referencePixelReJones_p
casacore::TempImage< casacore::Float > * imRegridJonesImage_p
void checkImageCongruent(casacore::ImageInterface< casacore::Float > &image)
Matrix< casacore::Complex > conjugate(const casacore::Matrix< casacore::Complex > &A)
complex space function specifications
casacore::Float pa_p
Interconvert pixel and world coordinates.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42