casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends
casa::PBMathInterface Class Reference

Virtual base class defining the Primary Beam interface. More...

#include <PBMathInterface.h>

Inheritance diagram for casa::PBMathInterface:
casa::PBMath1D casa::PBMath2D casa::PBMath1DAiry casa::PBMath1DCosPoly casa::PBMath1DGauss casa::PBMath1DIPoly casa::PBMath1DNumeric casa::PBMath1DPoly casa::PBMath2DImage

List of all members.

Public Types

enum  PBClass {
  NONE,
  COMMONPB,
  AIRY,
  GAUSS,
  POLY,
  IPOLY,
  COSPOLY,
  NUMERIC,
  IMAGE,
  ZERNIKE
}
 Allowed PBMath Classes. More...
enum  { NumberOfPBClasses }
 Number of different classes in PBClass enumeration. More...

Public Member Functions

 PBMathInterface (Bool isThisVP, BeamSquint squint, Bool useSymmetricBeam)
 Useful constructor.
virtual ~PBMathInterface ()=0
 virtual destructor
ImageInterface< Complex > & applyVP (const ImageInterface< Complex > &in, ImageInterface< Complex > &out, const MDirection &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)
 Apply Jones matrix to an image (and adjoint)
ImageInterface< Complex > & applyPB (const ImageInterface< Complex > &in, ImageInterface< Complex > &out, const MDirection &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 > & applyPB (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)
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)
 This has a very specialized role (in SkyEquation) and should not be used elsewhere.
SkyComponentapplyVP (SkyComponent &in, SkyComponent &out, const MDirection &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)
 Apply Jones matrix to a sky component (and adjoint)
SkyComponentapplyPB (SkyComponent &in, SkyComponent &out, const MDirection &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)
SkyComponentapplyPB2 (SkyComponent &in, SkyComponent &out, const MDirection &sp, const Quantity frequency, const Quantity parAngle=Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint=BeamSquint::NONE)
virtual PBClass whichPBClass ()=0
 Which PBClass is this one?
void namePBClass (String &name)
 Convert PBClass enumeration into PBClass 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 ImageRegionextent (const ImageInterface< Complex > &im, const MDirection &pointing, const Int row, const Float fPad, const Int iChan, const SkyJones::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).
virtual ImageRegionextent (const ImageInterface< Float > &im, const MDirection &pointing, const Int row, const Float fPad, const Int iChan, const SkyJones::SizeType)=0
virtual Int support (const CoordinateSystem &cs)=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?

Static Public Member Functions

static void namePBClass (const PBMathInterface::PBClass iPB, String &str)
 Convert enumeration into a string.

Protected Member Functions

 PBMathInterface ()
 Dumb constructor: protected, as it won't do you any good!
virtual 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)=0
 lower level helping apply methods
virtual 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)=0
virtual SkyComponentapply (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)=0

Static Protected Member Functions

static Float asFloat (const Complex &value)
 Functions to deal with conversions to Float.
static Float asFloat (const DComplex &value)
static Float asFloat (const Float &value)
static Float asFloat (const Double &value)

Protected Attributes

Bool isThisVP_p
 Are the parameters being provided in the derived class constructor describing a Voltage Pattern or a Primary Beam? The default is Voltage Pattern, and we keep it internally as a voltage pattern.
BeamSquint squint_p
 Beam squint: convention is AZ-EL offset of the Stokes RR beam w.r.t.
Bool useSymmetricBeam_p
 Should we use the effective az-symmetrical primary beam? Otherwise, use squinted beam; if no squint, no difference.

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;

Detailed Description

Virtual base class defining the Primary Beam interface.

Intended use:

Public interface

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

Definition at line 110 of file PBMathInterface.h.


Member Enumeration Documentation

anonymous enum

Number of different classes in PBClass enumeration.

Enumerator:
NumberOfPBClasses 

Definition at line 130 of file PBMathInterface.h.

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

Enumerator:
NONE 
COMMONPB 
AIRY 
GAUSS 
POLY 
IPOLY 
COSPOLY 
NUMERIC 
IMAGE 
ZERNIKE 

Definition at line 126 of file PBMathInterface.h.


Constructor & Destructor Documentation

casa::PBMathInterface::PBMathInterface ( Bool  isThisVP,
BeamSquint  squint,
Bool  useSymmetricBeam 
)

Useful constructor.

virtual casa::PBMathInterface::~PBMathInterface ( ) [pure virtual]

virtual destructor

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


Member Function Documentation

virtual ImageInterface<Complex>& casa::PBMathInterface::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, pure virtual]

lower level helping apply methods

   

Implemented in casa::PBMath1D, and casa::PBMath2DImage.

virtual ImageInterface<Float>& casa::PBMathInterface::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, pure virtual]

Implemented in casa::PBMath1D, and casa::PBMath2DImage.

virtual SkyComponent& casa::PBMathInterface::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, pure virtual]

Implemented in casa::PBMath1D, and casa::PBMath2DImage.

ImageInterface<Complex>& casa::PBMathInterface::applyPB ( const ImageInterface< Complex > &  in,
ImageInterface< Complex > &  out,
const MDirection 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>& casa::PBMathInterface::applyPB ( 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& casa::PBMathInterface::applyPB ( SkyComponent in,
SkyComponent out,
const MDirection 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 
)
ImageInterface<Float>& casa::PBMathInterface::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 
)

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

SkyComponent& casa::PBMathInterface::applyPB2 ( SkyComponent in,
SkyComponent out,
const MDirection sp,
const Quantity  frequency,
const Quantity  parAngle = Quantity(0.0,"deg"),
const BeamSquint::SquintType  doSquint = BeamSquint::NONE 
)
ImageInterface<Complex>& casa::PBMathInterface::applyVP ( const ImageInterface< Complex > &  in,
ImageInterface< Complex > &  out,
const MDirection 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 
)

Apply Jones matrix to an image (and adjoint)

   
SkyComponent& casa::PBMathInterface::applyVP ( SkyComponent in,
SkyComponent out,
const MDirection 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 
)

Apply Jones matrix to a sky component (and adjoint)

static Float casa::PBMathInterface::asFloat ( const Complex &  value) [inline, static, protected]

Functions to deal with conversions to Float.

Definition at line 300 of file PBMathInterface.h.

static Float casa::PBMathInterface::asFloat ( const DComplex &  value) [inline, static, protected]

Definition at line 301 of file PBMathInterface.h.

static Float casa::PBMathInterface::asFloat ( const Float value) [inline, static, protected]

Definition at line 302 of file PBMathInterface.h.

References casa::value().

static Float casa::PBMathInterface::asFloat ( const Double value) [inline, static, protected]

Definition at line 303 of file PBMathInterface.h.

References casa::value().

virtual ImageRegion* casa::PBMathInterface::extent ( const ImageInterface< Complex > &  im,
const MDirection pointing,
const Int  row,
const Float  fPad,
const Int  iChan,
const SkyJones::SizeType   
) [pure 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: 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.

Implemented in casa::PBMath1D, and casa::PBMath2D.

virtual ImageRegion* casa::PBMathInterface::extent ( const ImageInterface< Float > &  im,
const MDirection pointing,
const Int  row,
const Float  fPad,
const Int  iChan,
const SkyJones::SizeType   
) [pure virtual]

Implemented in casa::PBMath1D, and casa::PBMath2D.

virtual Bool casa::PBMathInterface::getUseSymmetric ( ) [inline, virtual]

Get value of useSymmetric.

Definition at line 224 of file PBMathInterface.h.

References useSymmetricBeam_p.

Referenced by casa::PBMath::getUseSymmetric().

Convert PBClass enumeration into PBClass String.

Referenced by casa::PBMath::namePBClass().

static void casa::PBMathInterface::namePBClass ( const PBMathInterface::PBClass  iPB,
String str 
) [static]

Convert enumeration into a string.

virtual Bool casa::PBMathInterface::ok ( ) [pure virtual]

Is state of PBMath object OK?

Implemented in casa::PBMath1D, and casa::PBMath2D.

virtual void casa::PBMathInterface::setUseSymmetric ( Bool  useSym = True) [inline, virtual]

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

Definition at line 221 of file PBMathInterface.h.

References useSymmetricBeam_p.

Referenced by casa::PBMath::setUseSymmetric().

virtual void casa::PBMathInterface::summary ( Int  nValues = 0) [virtual]
virtual Int casa::PBMathInterface::support ( const CoordinateSystem cs) [pure virtual]
virtual PBClass casa::PBMathInterface::whichPBClass ( ) [pure virtual]

Friends And Related Function Documentation

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 in casa::PBMath1D, and casa::PBMath2D.

Definition at line 116 of file PBMathInterface.h.


Member Data Documentation

Are the parameters being provided in the derived class constructor describing a Voltage Pattern or a Primary Beam? The default is Voltage Pattern, and we keep it internally as a voltage pattern.

Definition at line 311 of file PBMathInterface.h.

Beam squint: convention is AZ-EL offset of the Stokes RR beam w.r.t.

pointing position Stokes LL will be at -squint_p Southern observatories have the same AZ-EL and PA definitions as Northern

Definition at line 317 of file PBMathInterface.h.

Should we use the effective az-symmetrical primary beam? Otherwise, use squinted beam; if no squint, no difference.

Definition at line 321 of file PBMathInterface.h.

Referenced by getUseSymmetric(), and setUseSymmetric().


The documentation for this class was generated from the following file: