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 | Private Member Functions | Private Attributes
casa::PBMath Class Reference

Primary beam envelope class, derived from PBMathInterface. More...

#include <PBMath.h>

List of all members.

Public Types

enum  CommonPB {
  UNKNOWN,
  DEFAULT,
  ATCA_L1,
  ATCA_L2,
  ATCA_L3,
  ATCA_S,
  ATCA_C,
  ATCA_X,
  GBT,
  GMRT,
  HATCREEK,
  NRAO12M,
  NRAO140FT,
  OVRO,
  VLA,
  VLA_INVERSE,
  VLA_NVSS,
  VLA_2NULL,
  VLA_4,
  VLA_P,
  VLA_L,
  VLA_C,
  VLA_X,
  VLA_U,
  VLA_K,
  VLA_Q,
  WSRT,
  WSRT_LOW,
  ALMA,
  ALMASD,
  ACA,
  IRAMPDB,
  IRAM30M,
  SMA,
  ATA,
  NONE,
  ATCA_C_RI
}
 This enumeration provides a simple way to instantiate the common primary beam models. More...
enum  { NumberOfCommonPB }

Public Member Functions

 PBMath ()
 Default constructor, required for Block<PBMath>
 PBMath (PBMath::CommonPB myPBType, Bool useSymmetricBeam=False)
 Make a PB of common type.
 PBMath (String &telescopeName, Bool useSymmetricBeam=False, Quantity freq=Quantity(0.0,"Hz"))
 Make a PB from a telescopename and frequency.
 PBMath (Double dishDiam, Bool useSymmetricBeam, Quantity freq)
 Make a PB by dish diameter.
 PBMath (const RecordInterface &myrec)
 Make a PB from a RecordInterface.
 PBMath (PBMathInterface::PBClass theclass, Quantity halfWidth, Quantity maxRad, Quantity refFreq, Bool isThisVP=False, BeamSquint squint=BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")), Bool useSymmetricBeam=False)
 Make a Gaussian Primary beam.
 PBMath (PBMathInterface::PBClass theclass, const Vector< Double > &coeff, Quantity maxRad, Quantity refFreq, Bool isThisVP=False, BeamSquint squint=BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")), Bool useSymmetricBeam=False)
 Make a Polynomial, Inverse Polynomial, or Numeric Primary beam (These three have identical calling signatures, they can only be distinguished by the PBClass enumeration)
 PBMath (PBMathInterface::PBClass theclass, const Vector< Float > &coeff, Quantity maxRad, Quantity refFreq, Bool isThisVP=False, BeamSquint squint=BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")), Bool useSymmetricBeam=False)
 Make a Numeric Primary beam (FLOAT!)
 PBMath (PBMathInterface::PBClass theclass, const Vector< Double > &coeff, const Vector< Double > &scale, Quantity maxRad, Quantity refFreq, Bool isThisVP=False, BeamSquint squint=BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")), Bool useSymmetricBeam=False)
 Make a CosPolynomial beam type.
 PBMath (PBMathInterface::PBClass theclass, Quantity dishDiam, Quantity blockageDiam, Quantity maxRad, Quantity refFreq, BeamSquint squint=BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")), Bool useSymmetricBeam=False)
 Make an Airy beam type.
 PBMath (PBMathInterface::PBClass theclass, ImageInterface< Float > &reJones)
 Make an Image-based beam.
 PBMath (PBMathInterface::PBClass theclass, ImageInterface< Float > &reJones, ImageInterface< Float > &imJones)
 PBMath (const PBMath &other)
 Instantiate from a Table PBMath(const Table& theTable, Int row);.
 ~PBMath ()
 destructor
PBMathoperator= (const PBMath &other)
 operator= returns a reference to the PBMath; reference counted pointer
Bool operator== (const PBMath &other) const
 comparison operator: just checks that the objects are same (could have two different objects with identical data, these are treated as !=)
Bool operator!= (const PBMath &other) const
 comparison operator: just checks that the objects are different (could have two different objects with identical data, these are treated as !=)
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)
 copy() returns a copy of the PBMath PBMath copy() const;
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)
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)
void setUseSymmetric (Bool useSym=True)
 Fit an azimuthally symmetric beam to the squinted or otherwise 2-D beam for Stokes I?
Bool getUseSymmetric ()
 Get value of useSymmetric.
PBMathInterface::PBClass whichPBClass ()
 Get the type of PB this is.
void summary (Int nValues=0)
 Summarize the Voltage Pattern;.
Bool ok () const
 Is the state of the PBMath OK?
ImageRegionextent (const ImageInterface< Complex > &im, const MDirection &pointing, const Int row, const Float fPad, const Int iChan, const SkyJones::SizeType)
 Get the BLC, TRC of the primary beam on an Image for a given pointing Note: BLC and TRC are not necesarily constrained to lie within the image region (for example, if the pointing center is near the edge of the image).
ImageRegionextent (const ImageInterface< Float > &im, const MDirection &pointing, const Int row, const Float fPad, const Int iChan, const SkyJones::SizeType)
Int support (const CoordinateSystem &cs)
void namePBClass (String &name)
 gives the name of the PB Class that has been used

Static Public Member Functions

static void whichCommonPBtoUse (String &telescope, Quantity &freq, String &band, PBMath::CommonPB &whichPB, String &pbName)
 given the Telescope name and the frequency, guess the most approrpiate CommonPB primary beam type and the band
static void nameCommonPB (const PBMath::CommonPB iPB, String &str)
 converts the enumrated type into a string
static void enumerateCommonPB (const String &str, PBMath::CommonPB &ipb)
 converts the PB String into an enumrated type

Protected Member Functions

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=0.01, Bool forward=True)
 Gradient stuff: this needs more thought, as it is not really connected with the stuff in VPSkyJones and all.
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=0.01, Bool forward=True)

Private Member Functions

Bool getQuantity (const RecordInterface &rec, const String &item, Quantity &returnedQuantity) const
 These should probably move to RecordInterface when we are happy with their performance.
Bool getMDirection (const RecordInterface &rec, const String &item, MDirection &returnedMDirection) const
void initByTelescope (PBMath::CommonPB myPBType, Bool useSymmetricBeam=False, Double frequency=0.0)
 Function to initialize the state of the tool.
void initByDiameter (Double diam, Bool useSymmetricBeam, Double freq)
 Function to initialize the by dish diameter.

Private Attributes

CountedPtr< PBMathInterfacepb_pointer_p
 
      


Detailed Description

Primary beam envelope class, derived from PBMathInterface.

Intended use:

Public interface

Prerequisite

Etymology

PBMath types do the mathematical operations of the Primary Beamss or Voltage patterns. This envelope class's name was designed for simplicity.

Synopsis

PBMath is an envelope class for the various types of 1D and 2D primary beam/voltage pattern objects. They all have a common interface defined by PBMathInterface. The PBMath object has a counted pointer to the actual PB type; hence, the PBMath object is lightweight and can be passed around by value in other classes.

Construct a PBMath via PBMath's enumerated CommonPB type.

Example

    PBMath wsrtPB(PBMath::WSRT);
    PBMath vla_LPB(PBMath::VLA_L);  // has L band squint built in

A PBMath can also be constructed by the complete argument list for the type of PB it holds. Since different PB types can have the same argument list (PBMath1DPoly and PBMath1DIPoly, for example), the exact type also needs to be specified via the PBMathInterface::PBClass.

The main thing you want to do with a primary beam or voltage pattern is to apply it to an image. The PBMath object forwards its low level "apply" calls to the letter class's "apply" calls.

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

This Envelope class allows the user to create a PBMath object which can display all the polymorphic traits of PBMath1D classes or PBMath2D classes.

Definition at line 122 of file PBMath.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
NumberOfCommonPB 

Definition at line 144 of file PBMath.h.

This enumeration provides a simple way to instantiate the common primary beam models.

They are each represented by one of the more fundamental PBMath1D types

New CommonPB Types must go to the end

Enumerator:
UNKNOWN 
DEFAULT 
ATCA_L1 
ATCA_L2 
ATCA_L3 
ATCA_S 
ATCA_C 
ATCA_X 
GBT 
GMRT 
HATCREEK 
NRAO12M 
NRAO140FT 
OVRO 
VLA 
VLA_INVERSE 
VLA_NVSS 
VLA_2NULL 
VLA_4 
VLA_P 
VLA_L 
VLA_C 
VLA_X 
VLA_U 
VLA_K 
VLA_Q 
WSRT 
WSRT_LOW 
ALMA 
ALMASD 
ACA 
IRAMPDB 
IRAM30M 
SMA 
ATA 
NONE 
ATCA_C_RI 

Definition at line 130 of file PBMath.h.


Constructor & Destructor Documentation

Default constructor, required for Block<PBMath>

casa::PBMath::PBMath ( PBMath::CommonPB  myPBType,
Bool  useSymmetricBeam = False 
) [explicit]

Make a PB of common type.

casa::PBMath::PBMath ( String telescopeName,
Bool  useSymmetricBeam = False,
Quantity  freq = Quantity(0.0,"Hz") 
)

Make a PB from a telescopename and frequency.

casa::PBMath::PBMath ( Double  dishDiam,
Bool  useSymmetricBeam,
Quantity  freq 
)

Make a PB by dish diameter.

casa::PBMath::PBMath ( const RecordInterface myrec) [explicit]

Make a PB from a RecordInterface.

casa::PBMath::PBMath ( PBMathInterface::PBClass  theclass,
Quantity  halfWidth,
Quantity  maxRad,
Quantity  refFreq,
Bool  isThisVP = False,
BeamSquint  squint = BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")),
Bool  useSymmetricBeam = False 
)

Make a Gaussian Primary beam.

casa::PBMath::PBMath ( PBMathInterface::PBClass  theclass,
const Vector< Double > &  coeff,
Quantity  maxRad,
Quantity  refFreq,
Bool  isThisVP = False,
BeamSquint  squint = BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")),
Bool  useSymmetricBeam = False 
)

Make a Polynomial, Inverse Polynomial, or Numeric Primary beam (These three have identical calling signatures, they can only be distinguished by the PBClass enumeration)

casa::PBMath::PBMath ( PBMathInterface::PBClass  theclass,
const Vector< Float > &  coeff,
Quantity  maxRad,
Quantity  refFreq,
Bool  isThisVP = False,
BeamSquint  squint = BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")),
Bool  useSymmetricBeam = False 
)

Make a Numeric Primary beam (FLOAT!)

casa::PBMath::PBMath ( PBMathInterface::PBClass  theclass,
const Vector< Double > &  coeff,
const Vector< Double > &  scale,
Quantity  maxRad,
Quantity  refFreq,
Bool  isThisVP = False,
BeamSquint  squint = BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")),
Bool  useSymmetricBeam = False 
)

Make a CosPolynomial beam type.

casa::PBMath::PBMath ( PBMathInterface::PBClass  theclass,
Quantity  dishDiam,
Quantity  blockageDiam,
Quantity  maxRad,
Quantity  refFreq,
BeamSquint  squint = BeamSquint(MDirection(Quantity(0.0,"deg"), Quantity(0.0,"deg"), MDirection::Ref(MDirection::AZEL)), Quantity(1.0,"GHz")),
Bool  useSymmetricBeam = False 
)

Make an Airy beam type.

Make an Image-based beam.

casa::PBMath::PBMath ( PBMathInterface::PBClass  theclass,
ImageInterface< Float > &  reJones,
ImageInterface< Float > &  imJones 
)
casa::PBMath::PBMath ( const PBMath other)

Instantiate from a Table PBMath(const Table& theTable, Int row);.

copy ctor: copies the reference counted pointer

destructor


Member Function Documentation

ImageInterface<Complex>& casa::PBMath::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 = 0.01,
Bool  forward = True 
) [protected]

Gradient stuff: this needs more thought, as it is not really connected with the stuff in VPSkyJones and all.

This will return the partial derivatives of chi^2 w.r.t the beam model parameters, represented here as a vector. Not implemented yet. void parameterGradient(Vector<Float> grad);

Flush the construction parameters to disk This is a public method because this class doesn't know what Table it is to be stored in

virtual Bool flushToTable(Table& beamSubTable, Int iRow); polymorphic lower level helping apply methods

SkyComponent& casa::PBMath::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 = 0.01,
Bool  forward = True 
) [protected]
ImageInterface<Complex>& casa::PBMath::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::PBMath::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::PBMath::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::PBMath::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& casa::PBMath::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::PBMath::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 
)

copy() returns a copy of the PBMath PBMath copy() const;

Apply Jones matrix to an image (and adjoint)

SkyComponent& casa::PBMath::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 void casa::PBMath::enumerateCommonPB ( const String str,
PBMath::CommonPB ipb 
) [static]

converts the PB String into an enumrated type

ImageRegion* casa::PBMath::extent ( const ImageInterface< Complex > &  im,
const MDirection pointing,
const Int  row,
const Float  fPad,
const Int  iChan,
const SkyJones::SizeType   
)

Get the BLC, TRC of the primary beam on an Image for a given pointing Note: BLC and TRC are 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 above PB 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

ImageRegion* casa::PBMath::extent ( const ImageInterface< Float > &  im,
const MDirection pointing,
const Int  row,
const Float  fPad,
const Int  iChan,
const SkyJones::SizeType   
)
Bool casa::PBMath::getMDirection ( const RecordInterface rec,
const String item,
MDirection returnedMDirection 
) const [private]
Bool casa::PBMath::getQuantity ( const RecordInterface rec,
const String item,
Quantity returnedQuantity 
) const [private]

These should probably move to RecordInterface when we are happy with their performance.

   

Get value of useSymmetric.

Definition at line 334 of file PBMath.h.

References casa::PBMathInterface::getUseSymmetric(), and pb_pointer_p.

void casa::PBMath::initByDiameter ( Double  diam,
Bool  useSymmetricBeam,
Double  freq 
) [private]

Function to initialize the by dish diameter.

void casa::PBMath::initByTelescope ( PBMath::CommonPB  myPBType,
Bool  useSymmetricBeam = False,
Double  frequency = 0.0 
) [private]

Function to initialize the state of the tool.

static void casa::PBMath::nameCommonPB ( const PBMath::CommonPB  iPB,
String str 
) [static]

converts the enumrated type into a string

void casa::PBMath::namePBClass ( String name) [inline]

gives the name of the PB Class that has been used

Definition at line 379 of file PBMath.h.

References casa::PBMathInterface::namePBClass(), and pb_pointer_p.

Is the state of the PBMath OK?

Bool casa::PBMath::operator!= ( const PBMath other) const

comparison operator: just checks that the objects are different (could have two different objects with identical data, these are treated as !=)

PBMath& casa::PBMath::operator= ( const PBMath other)

operator= returns a reference to the PBMath; reference counted pointer

Bool casa::PBMath::operator== ( const PBMath other) const

comparison operator: just checks that the objects are same (could have two different objects with identical data, these are treated as !=)

void casa::PBMath::setUseSymmetric ( Bool  useSym = True) [inline]

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

Definition at line 331 of file PBMath.h.

References pb_pointer_p, and casa::PBMathInterface::setUseSymmetric().

void casa::PBMath::summary ( Int  nValues = 0)

Summarize the Voltage Pattern;.

static void casa::PBMath::whichCommonPBtoUse ( String telescope,
Quantity freq,
String band,
PBMath::CommonPB whichPB,
String pbName 
) [static]

given the Telescope name and the frequency, guess the most approrpiate CommonPB primary beam type and the band

Get the type of PB this is.

Definition at line 337 of file PBMath.h.

References pb_pointer_p, and casa::PBMathInterface::whichPBClass().


Member Data Documentation

      

Definition at line 427 of file PBMath.h.

Referenced by getUseSymmetric(), namePBClass(), setUseSymmetric(), and whichPBClass().


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