casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PBMath2D.h
Go to the documentation of this file.
1 //# PBMath2D.h: Definitions of interface for 2-D PBMath objects
2 //# Copyright (C) 1996,1997,1998,1999,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_PBMATH2D_H
30 #define SYNTHESIS_PBMATH2D_H
31 
32 #include <casa/aips.h>
34 
35 namespace casacore{
36 
37 class Table;
38 class ImageRegion;
39 class CoordinateSystem;
40 }
41 
42 namespace casa { //# NAMESPACE CASA - BEGIN
43 
44 //#forward
45 class SkyComponent;
46 
47 // <summary> base class for 1D PBMath objects </summary>
48 
49 
50 // <use visibility=export>
51 
52 // <reviewed reviewer="" date="" tests="" demos="">
53 
54 // <prerequisite>
55 // <li> <linkto class="SkyJones">SkyJones</linkto> class
56 // <li> <linkto class="BeamSkyJones">BeamSkyJones</linkto> class
57 // <li> <linkto class="PBMathInterface">PBMathInterface</linkto> class
58 // </prerequisite>
59 //
60 // <etymology>
61 // PBMath types do the mathematical operations of the PB's or VP's.
62 // This is the base class for the 1D (ie, rotationally symmetric) PB's.
63 // </etymology>
64 //
65 // <synopsis>
66 // PBMath2D, the virtual base class for 1D PBMath objects, is
67 // derived from PBMathInterface. Its cousin, PBMath2D, can deal with
68 // inherently 2D voltage patterns or primary beams. PBMath2D can deal
69 // with beam squint, (ie, the offset of the LL and RR beams on opposite
70 // sides of the pointing center) which rotates on the sky with parallactic angle.
71 //
72 // The 1D PB philosophy is to specify the Voltage pattern or Primary Beam
73 // via a small number of
74 // parameters via one of the derived types (PBMath2DGauss, for example). The
75 // derived type knows how to instantiate itself from a row in a beam subTable,
76 // and how to convert itself into a lookup vector. The lookup vector is
77 // fine enough that no interpolation need be done when finding the nearest
78 // PB or VP value for a particular pixel (currently, there are 1e+4 elements
79 // in the lookup vector, so on average, an error on order of 1e-4 is made
80 // when applying the primary beam).
81 //
82 // There are two ways of creating the derived PB types:
83 // 1) explicitly create one of the babies. You have control
84 // over the details such as PB size and total extent, the reference
85 // frequency at which this size is true (the size scales inversely
86 // with wavelength), the squint orientation, and whether a mean
87 // symmetrized beam will be calculated from the squinted beam.
88 // (Nice defaults can reduce the arguments in most cases.)
89 // <example>
90 // <srcblock>
91 // PBMath2DGauss myPB (casacore::Quantity(1.0, "'"), casacore::Quantity(3.0, "'"), casacore::Quantity(1.0, "GHz"),
92 // false, // these are PB parameters, not VP
93 // BeamSquint(casacore::MDirection(casacore::Quantity(2.0, "\""),
94 // casacore::Quantity(0.0, "\""),
95 // casacore::MDirection::Ref(casacore::MDirection::AZEL)),
96 // casacore::Quantity(2.0, "GHz")),
97 // false);
98 // PBMath2DGauss myPB2 (casacore::Quantity(1.0, "'"), casacore::Quantity(3.0, "'"), casacore::Quantity(1.0, "GHz"));
99 //
100 // </srcblock>
101 // </example>
102 // 2) via the envelope class PBMath's enumerated CommonPB type. This is much simpler,
103 // and will deal with a majority of the cases required:
104 // <example>
105 // <srcblock>
106 // PBMath wsrtPB(PBMath::WSRT);
107 // PBMath vla_LPB(PBMath::VLA_L); // has L band squint built in
108 // </srcblock>
109 // </example>
110 //
111 // The main thing you want to do with a primary beam or voltage pattern is
112 // to apply it to an image. The top level "apply" methods are defined in
113 // PBMathInterface. They are applyPB, applyPB2, applyVP. These top level
114 // apply's then call a lower level private polymorphic apply, which are defined
115 // in PBMath2D and in PBMath2D. These two different apply's deal with the
116 // different details of 1D and 2D primary beam application.
117 // <example>
118 // <srcblock>
119 //
120 // casacore::PagedImage<casacore::Float> in;
121 // casacore::PagedImage<casacore::Complex> out;
122 // casacore::MDirection pointingDir(casacore::Quantity(135.0, "deg"), casacore::Quantity(60.0, "deg"),
123 // casacore::MDirection::Ref(casacore::MDirection::J2000));
124 // casacore::Quantity parallacticAngle(26.5, "deg");
125 // PBMath wsrtPB(PBMath::WSRT_LOW);
126 // wsrtPB.applyPB(in, out, pointingDir); // multiply by primary beam
127 // wsrtPB.applyPB(in, out, pointingDir, parallacticAngle, BeamSquint::GOFIGURE,
128 // true, 0.02); // divide by primary beam
129 // wsrtPB.applyVP(in, out, pointingDir); // multiply by voltage pattern
130 //
131 // </srcblock>
132 // </example>
133 // </synopsis>
134 //
135 // <motivation>
136 // All of the 2-D PB types have everything in common except for the
137 // details of their parameterization.
138 // </motivation>
139 //
140 // lower level helping apply methods: reduce code by this bundling
141 // <thrown>
142 // <li> casacore::AipsError - in apply(Image...), if in and out images are
143 // inconsistent in shape or coordinates
144 // <li> casacore::AipsError - in apply(SkyComponent...), if doSqiont==RR or LL
145 // </thrown>
146 // <todo asof="98/010/21">
147 // <li> SymmetrizeBeam doesn't do anything yet. (It should calculate
148 // the mean symmetric beam about the pointing center when
149 // squint is present, slightly larger than the symmetric beam
150 // about the squint position.
151 // </todo>
152 
153 
154 class PBMath2D : public PBMathInterface {
155 public:
156 
157  // required so PBMath can see the protected "apply" method
158  // Other derivatives of PBMathInterface, such as PBMath2D, will
159  // also require friend class PBMath;
160  friend class PBMath;
161 
162  PBMath2D();
163 
164  virtual ~PBMath2D();
165 
166  // Summarize the Voltage Pattern;
167  // For PBMath2D, list nValues worth of the VP array
168  virtual void summary(casacore::Int nValues=0);
169 
170  // Is state of PBMath OK?
171  virtual casacore::Bool ok();
172 
173  // Get the casacore::ImageRegion of the primary beam on an Image for a given pointing
174  // Note: casacore::ImageRegion is not necesarily constrained to lie within the
175  // image region (for example, if the pointing center is near the edge of the
176  // image). fPad: extra fractional padding, beyond Primary Beam support
177  // (note: we do not properly treat squint yet, this will cover it for now)
178  // iChan: frequency channel to take: lowest frequency channel is safe for all
179  //
180  // Potential problem: this casacore::ImageRegion includes all casacore::Stokes and Frequency Channels
181  // present in the input image.
183  const casacore::MDirection& pointing,
184  const casacore::Int irow,
185  const casacore::Float fPad,
186  const casacore::Int iChan,
187  const SkyJones::SizeType sizeType);
189  const casacore::MDirection& pointing,
190  const casacore::Int irow,
191  const casacore::Float fPad,
192  const casacore::Int iChan,
193  const SkyJones::SizeType sizeType);
194 
196 
197 protected:
198 
199 private:
200 
201 };
202 
203 
204 } //# NAMESPACE CASA - END
205 
206 #endif
A Measure: astronomical direction.
Definition: MDirection.h:174
int Int
Definition: aipstype.h:50
virtual ~PBMath2D()
Primary beam envelope class, derived from PBMathInterface.
Definition: PBMath.h:126
virtual casacore::Bool ok()
Is state of PBMath OK?
casacore::ImageRegion * extent(const casacore::ImageInterface< casacore::Complex > &in, const casacore::MDirection &pointing, const casacore::Int irow, const casacore::Float fPad, const casacore::Int iChan, const SkyJones::SizeType sizeType)
Get the casacore::ImageRegion of the primary beam on an Image for a given pointing Note: casacore::Im...
base class for 1D PBMath objects
Definition: PBMath2D.h:154
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
Class to hold a region of interest in an image.
Definition: ImageRegion.h:86
virtual void summary(casacore::Int nValues=0)
Summarize the Voltage Pattern; For PBMath2D, list nValues worth of the VP array.
Virtual base class defining the Primary Beam interface.
virtual casacore::Int support(const casacore::CoordinateSystem &cs)
Interconvert pixel and world coordinates.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42