casa
$Rev:20696$
|
base class for 1D PBMath objects More...
#include <PBMath1D.h>
Public Member Functions | |
PBMath1D (Quantity maximumRadius, Quantity refFreq, Bool isThisVP, BeamSquint squint, Bool useSymmetricBeam) | |
virtual | ~PBMath1D ()=0 |
void | viewPB (Vector< Float > &r, Vector< Float > &PB, Int n_elements) |
Get the PB in a vector to look at Concerning n_elements: they are evenly spaced between 0 and maxradius. | |
virtual void | summary (Int nValues=0) |
Summarize the Voltage Pattern; For PBMath1D, list nValues worth of the VP array. | |
virtual Bool | ok () |
Is state of PBMath OK? | |
ImageRegion * | extent (const ImageInterface< Complex > &in, const MDirection &pointing, const Int irow, const Float fPad, const Int iChan, const SkyJones::SizeType sizeType) |
Get the ImageRegion of the primary beam on an Image for a given pointing Note: ImageRegion is not necesarily constrained to lie within the image region (for example, if the pointing center is near the edge of the image). | |
ImageRegion * | extent (const ImageInterface< Float > &in, const MDirection &pointing, const Int irow, const Float fPad, const Int iChan, const SkyJones::SizeType sizeType) |
virtual Int | support (const CoordinateSystem &cs) |
Protected Member Functions | |
PBMath1D () | |
Protect default constructor: this will do you no good. | |
void | extentguts (const CoordinateSystem &coords, const MDirection &pointing, const Float fPad, const Int iChan, Vector< Float > &blc, Vector< Float > &trc) |
calculate the limited box of the Primary Beam model's support, return in blc and trc (which are NOT contrained to be inside the image | |
void | refineSize (Vector< Float > &blc, Vector< Float > &trc, const IPosition &shape, SkyJones::SizeType) |
push blc lower, trc higher such that they define an image which is a power of 2 in size. | |
ImageInterface< Complex > & | apply (const ImageInterface< Complex > &in, ImageInterface< Complex > &out, const MDirection &sp, const Quantity parAngle, const BeamSquint::SquintType doSquint, Bool inverse, Bool conjugate, Int ipower, Float cutoff, Bool forward) |
lower level helping apply methods | |
ImageInterface< Float > & | apply (const ImageInterface< Float > &in, ImageInterface< Float > &out, const MDirection &sp, const Quantity parAngle, const BeamSquint::SquintType doSquint, Float cutoff, const Int ipower=4) |
SkyComponent & | apply (SkyComponent &in, SkyComponent &out, const MDirection &sp, const Quantity frequency, const Quantity parAngle, const BeamSquint::SquintType doSquint, Bool inverse, Bool conjugate, Int ipower, Float cutoff, Bool forward) |
PB and PB^2. | |
virtual void | fillPBArray ()=0 |
Fill in PB_p array from construction parameters, rescale construction parameters to the 1 GHz internal reference frequency Eventually: create it as its needed; we've got 4 arrays to fill; only create and store as they are required Right now: just construct all arrays. | |
void | symmetrizeSquintedBeam () |
Helper method to fit a circularly symmetric beam to the squinted RR + LL beam. | |
Protected Attributes | |
Vector< Complex > | vp_p |
The parameterized representation is for the VP, not the PB. | |
Vector< Complex > | esvp_p |
Tabulated effective az-symmetrical voltage pattern ( optional, depending upon useSymmetric_p ) | |
Quantity | maximumRadius_p |
Maximum radius allowed in tabulated model. | |
Quantity | refFreq_p |
reference frequency: used for squint and other beam paramaters such as width, found in derived types. | |
Double | fScale_p |
internal scaling from refFreq_p to 1GHz; used during construction | |
Double | inverseIncrementRadius_p |
Increment in radius. | |
Double | scale_p |
Scale to convert to tabulated units. | |
CompositeNumber | composite_p |
CompositeNumber (for beam application and the like) | |
Friends | |
class | PBMath |
required so PBMath can see the protected "apply" method Other derivatives of PBMathInterface, such as PBMath2D, will also require friend class PBMath; |
base class for 1D PBMath objects
Public interface
PBMath types do the mathematical operations of the PB's or VP's. This is the base class for the 1D (ie, rotationally symmetric) PB's.
PBMath1D, the virtual base class for 1D PBMath objects, is derived from PBMathInterface. Its cousin, PBMath2D, can deal with inherently 2D voltage patterns or primary beams. PBMath1D can deal with beam squint, (ie, the offset of the LL and RR beams on opposite sides of the pointing center) which rotates on the sky with parallactic angle.
The 1D PB philosophy is to specify the Voltage pattern or Primary Beam via a small number of parameters via one of the derived types (PBMath1DGauss, for example). The derived type knows how to instantiate itself from a row in a beam subTable, and how to convert itself into a lookup vector. The lookup vector is fine enough that no interpolation need be done when finding the nearest PB or VP value for a particular pixel (currently, there are 1e+4 elements in the lookup vector, so on average, an error on order of 1e-4 is made when applying the primary beam).
There are two ways of creating the derived PB types: 1) explicitly create one of the babies. You have control over the details such as PB size and total extent, the reference frequency at which this size is true (the size scales inversely with wavelength), the squint orientation, and whether a mean symmetrized beam will be calculated from the squinted beam. (Nice defaults can reduce the arguments in most cases.)
PBMath1DGauss myPB (Quantity(1.0, "'"), Quantity(3.0, "'"), Quantity(1.0, "GHz"), False, // these are PB parameters, not VP BeamSquint(MDirection(Quantity(2.0, "\""), Quantity(0.0, "\""), MDirection::Ref(MDirection::AZEL)), Quantity(2.0, "GHz")), False); PBMath1DGauss myPB2 (Quantity(1.0, "'"), Quantity(3.0, "'"), Quantity(1.0, "GHz"));
2) via the envelope class PBMath's enumerated CommonPB type. This is much simpler, and will deal with a majority of the cases required:
PBMath wsrtPB(PBMath::WSRT); PBMath vla_LPB(PBMath::VLA_L); // has L band squint built in
The main thing you want to do with a primary beam or voltage pattern is to apply it to an image. The top level "apply" methods are defined in PBMathInterface. They are applyPB, applyPB2, applyVP. These top level apply's then call a lower level private polymorphic apply, which are defined in PBMath1D and in PBMath2D. These two different apply's deal with the different details of 1D and 2D primary beam application.
PagedImage<Float> in; PagedImage<Complex> out; MDirection pointingDir(Quantity(135.0, "deg"), Quantity(60.0, "deg"), MDirection::Ref(MDirection::J2000)); Quantity parallacticAngle(26.5, "deg"); PBMath wsrtPB(PBMath::WSRT_LOW); wsrtPB.applyPB(in, out, pointingDir); // multiply by primary beam wsrtPB.applyPB(in, out, pointingDir, parallacticAngle, BeamSquint::GOFIGURE, True, 0.02); // divide by primary beam wsrtPB.applyVP(in, out, pointingDir); // multiply by voltage pattern
All of the 1-D PB types have everything in common except for the details of their parameterization.
lower level helping apply methods: reduce code by this bundling
Definition at line 150 of file PBMath1D.h.
casa::PBMath1D::PBMath1D | ( | Quantity | maximumRadius, |
Quantity | refFreq, | ||
Bool | isThisVP, | ||
BeamSquint | squint, | ||
Bool | useSymmetricBeam | ||
) |
virtual casa::PBMath1D::~PBMath1D | ( | ) | [pure virtual] |
casa::PBMath1D::PBMath1D | ( | ) | [protected] |
Protect default constructor: this will do you no good.
ImageInterface<Complex>& casa::PBMath1D::apply | ( | const ImageInterface< Complex > & | in, |
ImageInterface< Complex > & | out, | ||
const MDirection & | sp, | ||
const Quantity | parAngle, | ||
const BeamSquint::SquintType | doSquint, | ||
Bool | Inverse, | ||
Bool | Conjugate, | ||
Int | ipower, | ||
Float | cutoff, | ||
Bool | forward | ||
) | [protected, virtual] |
ImageInterface<Float>& casa::PBMath1D::apply | ( | const ImageInterface< Float > & | in, |
ImageInterface< Float > & | out, | ||
const MDirection & | sp, | ||
const Quantity | parAngle, | ||
const BeamSquint::SquintType | doSquint, | ||
Float | cutoff, | ||
const Int | ipower = 4 |
||
) | [protected, virtual] |
Implements casa::PBMathInterface.
SkyComponent& casa::PBMath1D::apply | ( | SkyComponent & | in, |
SkyComponent & | out, | ||
const MDirection & | sp, | ||
const Quantity | frequency, | ||
const Quantity | parAngle, | ||
const BeamSquint::SquintType | doSquint, | ||
Bool | inverse, | ||
Bool | conjugate, | ||
Int | ipower, | ||
Float | cutoff, | ||
Bool | forward | ||
) | [protected, virtual] |
PB and PB^2.
Implements casa::PBMathInterface.
ImageRegion* casa::PBMath1D::extent | ( | const ImageInterface< Complex > & | in, |
const MDirection & | pointing, | ||
const Int | irow, | ||
const Float | fPad, | ||
const Int | iChan, | ||
const SkyJones::SizeType | sizeType | ||
) | [virtual] |
Get the ImageRegion of the primary beam on an Image for a given pointing Note: ImageRegion is not necesarily constrained to lie within the image region (for example, if the pointing center is near the edge of the image).
fPad: extra fractional padding, beyond Primary Beam support (note: we do not properly treat squint yet, this will cover it for now) iChan: frequency channel to take: lowest frequency channel is safe for all
Potential problem: this ImageRegion includes all Stokes and Frequency Channels present in the input image.
Implements casa::PBMathInterface.
ImageRegion* casa::PBMath1D::extent | ( | const ImageInterface< Float > & | in, |
const MDirection & | pointing, | ||
const Int | irow, | ||
const Float | fPad, | ||
const Int | iChan, | ||
const SkyJones::SizeType | sizeType | ||
) | [virtual] |
Implements casa::PBMathInterface.
void casa::PBMath1D::extentguts | ( | const CoordinateSystem & | coords, |
const MDirection & | pointing, | ||
const Float | fPad, | ||
const Int | iChan, | ||
Vector< Float > & | blc, | ||
Vector< Float > & | trc | ||
) | [protected] |
calculate the limited box of the Primary Beam model's support, return in blc and trc (which are NOT contrained to be inside the image
virtual void casa::PBMath1D::fillPBArray | ( | ) | [protected, pure virtual] |
Fill in PB_p array from construction parameters, rescale construction parameters to the 1 GHz internal reference frequency Eventually: create it as its needed; we've got 4 arrays to fill; only create and store as they are required Right now: just construct all arrays.
Implemented in casa::PBMath1DIPoly, casa::PBMath1DNumeric, casa::PBMath1DCosPoly, casa::PBMath1DGauss, casa::PBMath1DPoly, and casa::PBMath1DAiry.
virtual Bool casa::PBMath1D::ok | ( | ) | [virtual] |
Is state of PBMath OK?
Implements casa::PBMathInterface.
void casa::PBMath1D::refineSize | ( | Vector< Float > & | blc, |
Vector< Float > & | trc, | ||
const IPosition & | shape, | ||
SkyJones::SizeType | |||
) | [protected] |
push blc lower, trc higher such that they define an image which is a power of 2 in size.
Adjust blc and trc such that they are within the image and such that they create an image with power of 2 (SkyJones::POWEROF2) shape or composite number (SkyJones::COMPOSITE) shape
virtual void casa::PBMath1D::summary | ( | Int | nValues = 0 | ) | [virtual] |
Summarize the Voltage Pattern; For PBMath1D, list nValues worth of the VP array.
Reimplemented from casa::PBMathInterface.
Reimplemented in casa::PBMath1DIPoly, casa::PBMath1DNumeric, casa::PBMath1DCosPoly, casa::PBMath1DGauss, casa::PBMath1DPoly, and casa::PBMath1DAiry.
virtual Int casa::PBMath1D::support | ( | const CoordinateSystem & | cs | ) | [virtual] |
Implements casa::PBMathInterface.
void casa::PBMath1D::symmetrizeSquintedBeam | ( | ) | [protected] |
Helper method to fit a circularly symmetric beam to the squinted RR + LL beam.
Called upon construction. Build this later. PB' = azimuthal fit to: ( VP(x+s)**2 + VP(x-s)**2 )/2 VP' = sqrt(PB')
Get the PB in a vector to look at Concerning n_elements: they are evenly spaced between 0 and maxradius.
r is in units of arcminutes at 1 GHz
friend class PBMath [friend] |
required so PBMath can see the protected "apply" method Other derivatives of PBMathInterface, such as PBMath2D, will also require friend class PBMath;
Reimplemented from casa::PBMathInterface.
Definition at line 156 of file PBMath1D.h.
CompositeNumber casa::PBMath1D::composite_p [protected] |
CompositeNumber (for beam application and the like)
Definition at line 308 of file PBMath1D.h.
Vector<Complex> casa::PBMath1D::esvp_p [protected] |
Tabulated effective az-symmetrical voltage pattern ( optional, depending upon useSymmetric_p )
Definition at line 286 of file PBMath1D.h.
Double casa::PBMath1D::fScale_p [protected] |
internal scaling from refFreq_p to 1GHz; used during construction
Definition at line 299 of file PBMath1D.h.
Double casa::PBMath1D::inverseIncrementRadius_p [protected] |
Increment in radius.
Definition at line 302 of file PBMath1D.h.
Quantity casa::PBMath1D::maximumRadius_p [protected] |
Maximum radius allowed in tabulated model.
Definition at line 290 of file PBMath1D.h.
Quantity casa::PBMath1D::refFreq_p [protected] |
reference frequency: used for squint and other beam paramaters such as width, found in derived types.
Internally, we rescale everything to a reference frequency of 1 GHz
Definition at line 296 of file PBMath1D.h.
Double casa::PBMath1D::scale_p [protected] |
Scale to convert to tabulated units.
Definition at line 305 of file PBMath1D.h.
Vector<Complex> casa::PBMath1D::vp_p [protected] |
The parameterized representation is for the VP, not the PB.
Internally, a reference frequency of 1 GHz is used, and the radius is in units of arcminutes. That said, you can specify the voltage pattern in any units, at any frequency, but they will be converted into (1 GHz * arcminutes) for storage and internal use. We fill in the lookup vectors VP, PB, esVP, esPB, as they are asked for
Tabulated voltage pattern
Definition at line 282 of file PBMath1D.h.