PBMathInterface.h

Classes

PBMathInterface -- Virtual base class defining the Primary Beam interface (full description)

class PBMathInterface

Types

enum PBClass

NONE
COMMONPB
AIRY
GAUSS
POLY
IPOLY
COSPOLY
NUMERIC
IMAGE
ZERNIKE

enum

NumberOfPBClasses = 10

Interface

Public Members
PBMathInterface(Bool isThisVP, BeamSquint squint, Bool useSymmetricBeam)
virtual ~PBMathInterface() = 0
ImageInterface<Complex>& applyVP(const ImageInterface<Complex>& in, ImageInterface<Complex>& out, const in& sp, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Bool inverse = False, Bool conjugate = False, Float cutoff = 0.01, Bool forward=True)
ImageInterface<Complex>& applyPB(const ImageInterface<Complex>& in, ImageInterface<Complex>& out, const in& sp, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Bool inverse = False, Float cutoff = 0.01, Bool forward=True)
ImageInterface<Float>& applyPB2(const ImageInterface<Float>& in, ImageInterface<Float>& out, const MDirection& sp, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Float cutoff=0.01)
SkyComponent& applyVP(SkyComponent& in, SkyComponent& out, const out& sp, const Quantity frequency, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Bool inverse = False, Bool conjugate = False, Float cutoff = 0.01, Bool forward = True)
SkyComponent& applyPB(SkyComponent& in, SkyComponent& out, const out& sp, const Quantity frequency, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Bool inverse = False, Float cutoff = 0.01, Bool forward = True)
SkyComponent& applyPB2(SkyComponent& in, SkyComponent& out, const out& sp, const Quantity frequency, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE)
virtual PBClass whichPBClass() = 0
void namePBClass(String & name)
static void namePBClass(const PBMathInterface::PBClass iPB, String & str)
virtual void setUseSymmetric(Bool useSym=True)
virtual Bool getUseSymmetric()
virtual ImageRegion* extent (const ImageInterface<Complex>& im, const Complex& pointing, const Int row, const Float fPad, const Int iChan, const MDirection::SizeType) = 0
virtual ImageRegion* extent (const ImageInterface<Float>& im, const MDirection& pointing, const Int row, const Float fPad, const Int iChan, const MDirection::SizeType) = 0
virtual void summary(Int nValues=0)
virtual Bool ok()=0
Protected Members
PBMathInterface()
virtual ImageInterface<Float>& apply(const ImageInterface<Float>& in, ImageInterface<Float>& out, const MDirection& sp, const Quantity parAngle, const BeamSquint::SquintType doSquint, Float cutoff) =0
static Float asFloat(const Complex & value)
static Float asFloat(const DComplex & value)
static Float asFloat(const Float & value)
static Float asFloat(const Double & value)

Description

Prerequisite

Etymology

PBMathInterface defines the interface to PB Math objects, the encapsulations of the PB mathematical functioning

Synopsis

PBMathInterface is a virtual base class that defines the PBMath interface. The big thing that it does is to define the applyPB, applyVP, and applyPB2 methods, which call a polymorphic low level apply method depending upon whether the PBMath type is a 1D or 2D type.

PBMathInterface - there are many forms the primary beam can take, each of which will be derived from this virtual class which defines the generic interface to the multitude of PBMath objects. The main part of that interface is application of the PB to images, which is defined by PBMathInterface.

PBMathInterface is the virtual base class, and PBMath is an envelope type which is derived from PBMathInterface. The two letter classes currently envisioned are PBMath1D and PBMath2D.

PBMath can function independent of MeasurementSets. PBMath is used by the BeamSkyJones classes VPSkyJones and DBeamSkyJones.

Example


Motivation

The SkyJones classes are all tied up with the MS or VisBuffers. This class encapsulates the raw mathematical functionality of the PB from the BeamSkyJones-derived classes which deal with the MS/VisBuff's. Also, several different BeamSkyJones objects and effects can be treated with the same PBMath heirarchy objects.

To Do

Member Description

enum PBClass

Allowed PBMath Classes. Currently, COMMONPB, Airy, Gauss, Poly, Ipoly, CosPoly, Numerical are all implemented; Image and Zernike (2D PB's) are not. This enumeration order becomes locked in when we get permanent PB's in the MeasurementSet Tables.

COMMPNPB is not really a PB Class, but is here for consistency with glish code in vpmanager

enum

Number of different classes in PBClass enumeration

PBMathInterface(Bool isThisVP, BeamSquint squint, Bool useSymmetricBeam)

Useful constructor

virtual ~PBMathInterface() = 0

virtual destructor

ImageInterface<Float>& applyPB2(const ImageInterface<Float>& in, ImageInterface<Float>& out, const MDirection& sp, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Float cutoff=0.01)

Apply Jones matrix to an image (and adjoint)

This has a very specialized role (in SkyEquation) and should not be used elsewhere

ImageInterface<Complex>& applyVP(const ImageInterface<Complex>& in, ImageInterface<Complex>& out, const in& sp, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Bool inverse = False, Bool conjugate = False, Float cutoff = 0.01, Bool forward=True)
ImageInterface<Complex>& applyPB(const ImageInterface<Complex>& in, ImageInterface<Complex>& out, const in& sp, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Bool inverse = False, Float cutoff = 0.01, Bool forward=True)

Apply Jones matrix to an image (and adjoint)

SkyComponent& applyVP(SkyComponent& in, SkyComponent& out, const out& sp, const Quantity frequency, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Bool inverse = False, Bool conjugate = False, Float cutoff = 0.01, Bool forward = True)
SkyComponent& applyPB(SkyComponent& in, SkyComponent& out, const out& sp, const Quantity frequency, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE, Bool inverse = False, Float cutoff = 0.01, Bool forward = True)
SkyComponent& applyPB2(SkyComponent& in, SkyComponent& out, const out& sp, const Quantity frequency, const Quantity parAngle = Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint = BeamSquint::NONE)

Apply Jones matrix to a sky component (and adjoint)

virtual PBClass whichPBClass() = 0

Which PBClass is this one?

void namePBClass(String & name)

Convert PBClass enumeration into PBClass String

static void namePBClass(const PBMathInterface::PBClass iPB, String & str)

Convert enumeration into a string

virtual void setUseSymmetric(Bool useSym=True)

Fit an azimuthally symmetric beam to the squinted or otherwise 2-D beam for Stokes I?

virtual Bool getUseSymmetric()

Get value of useSymmetric

virtual ImageRegion* extent (const ImageInterface<Complex>& im, const Complex& pointing, const Int row, const Float fPad, const Int iChan, const MDirection::SizeType) = 0

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: fractional padding for extra support beyond PB. (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.

virtual ImageRegion* extent (const ImageInterface<Float>& im, const MDirection& pointing, const Int row, const Float fPad, const Int iChan, const MDirection::SizeType) = 0

virtual void summary(Int nValues=0)

Summarize the Voltage Pattern; For PBMath1D, list nValues worth of the PB array

virtual Bool ok()=0

Is state of PBMath object OK?

PBMathInterface()

Dumb constructor: protected, as it won't do you any good!

virtual ImageInterface<Float>& apply(const ImageInterface<Float>& in, ImageInterface<Float>& out, const MDirection& sp, const Quantity parAngle, const BeamSquint::SquintType doSquint, Float cutoff) =0

lower level helping apply methods

static Float asFloat(const Complex & value)
static Float asFloat(const DComplex & value)
static Float asFloat(const Float & value)
static Float asFloat(const Double & value)

Functions to deal with conversions to Float