PBMath2D.h

Classes

PBMath2D -- base class for 1D PBMath objects (full description)

class PBMath2D : public PBMathInterface

Interface

Public Members
PBMath2D()
virtual ~PBMath2D() = 0
virtual void summary(Int nValues=0)
virtual Bool ok()
ImageRegion* extent (const ImageInterface<Complex>& in, const Complex& pointing, const Int irow, const Float fPad, const Int iChan, const MDirection::SizeType sizeType)
ImageRegion* extent (const ImageInterface<Float>& in, const MDirection& pointing, const Int irow, const Float fPad, const Int iChan, const MDirection::SizeType sizeType)

Description

Prerequisite

Etymology

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.

Synopsis

PBMath2D, 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. PBMath2D 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 (PBMath2DGauss, 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.)

Example

  PBMath2DGauss 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);
  PBMath2DGauss 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:

Example

    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 PBMath2D and in PBMath2D. These two different apply's deal with the different details of 1D and 2D primary beam application.

Example


    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

Motivation

All of the 2-D PB types have everything in common except for the details of their parameterization.

lower level helping apply methods: reduce code by this bundling

Thrown Exceptions

To Do

Member Description

PBMath2D()

virtual ~PBMath2D() = 0

virtual void summary(Int nValues=0)

Summarize the Voltage Pattern; For PBMath2D, list nValues worth of the VP array

virtual Bool ok()

Is state of PBMath OK?

ImageRegion* extent (const ImageInterface<Complex>& in, const Complex& pointing, const Int irow, const Float fPad, const Int iChan, const MDirection::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). 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.

ImageRegion* extent (const ImageInterface<Float>& in, const MDirection& pointing, const Int irow, const Float fPad, const Int iChan, const MDirection::SizeType sizeType)