casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
casa::PBMath1D Class Referenceabstract

base class for 1D PBMath objects More...

#include <PBMath1D.h>

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

Public Member Functions

 PBMath1D (casacore::Quantity maximumRadius, casacore::Quantity refFreq, casacore::Bool isThisVP, BeamSquint squint, casacore::Bool useSymmetricBeam)
 
virtual ~PBMath1D ()=0
 
void viewPB (casacore::Vector< casacore::Float > &r, casacore::Vector< casacore::Float > &PB, casacore::Int n_elements, const casacore::Double freq=1.0e9)
 Get the PB in a vector to look at Concerning n_elements: they are evenly spaced between 0 and maxradius. More...
 
virtual void summary (casacore::Int nValues=0)
 Summarize the Voltage Pattern; For PBMath1D, list nValues worth of the VP array. More...
 
virtual casacore::Bool ok ()
 Is state of PBMath OK? More...
 
casacore::ImageRegionextent (const casacore::ImageInterface< casacore::Complex > &in, const casacore::MDirection &pointing, const casacore::Int irow, const casacore::Float fPad, const casacore::Int iChan, const SkyJones::SizeType sizeType)
 Get the casacore::ImageRegion of the primary beam on an Image for a given pointing Note: casacore::ImageRegion is not necesarily constrained to lie within the image region (for example, if the pointing center is near the edge of the image). More...
 
casacore::ImageRegionextent (const casacore::ImageInterface< casacore::Float > &in, const casacore::MDirection &pointing, const casacore::Int irow, const casacore::Float fPad, const casacore::Int iChan, const SkyJones::SizeType sizeType)
 
virtual casacore::Int support (const casacore::CoordinateSystem &cs)
 
- Public Member Functions inherited from casa::PBMathInterface
 PBMathInterface (casacore::Bool isThisVP, BeamSquint squint, casacore::Bool useSymmetricBeam)
 Useful constructor. More...
 
virtual ~PBMathInterface ()=0
 virtual destructor More...
 
casacore::ImageInterface
< casacore::Complex > & 
applyVP (const casacore::ImageInterface< casacore::Complex > &in, casacore::ImageInterface< casacore::Complex > &out, const casacore::MDirection &sp, const casacore::Quantity parAngle=casacore::Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint=BeamSquint::NONE, casacore::Bool inverse=false, casacore::Bool conjugate=false, casacore::Float cutoff=0.01, casacore::Bool forward=true)
 Apply Jones matrix to an image (and adjoint) More...
 
casacore::ImageInterface
< casacore::Complex > & 
applyPB (const casacore::ImageInterface< casacore::Complex > &in, casacore::ImageInterface< casacore::Complex > &out, const casacore::MDirection &sp, const casacore::Quantity parAngle=casacore::Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint=BeamSquint::NONE, casacore::Bool inverse=false, casacore::Float cutoff=0.01, casacore::Bool forward=true)
 
casacore::ImageInterface
< casacore::Float > & 
applyPB (const casacore::ImageInterface< casacore::Float > &in, casacore::ImageInterface< casacore::Float > &out, const casacore::MDirection &sp, const casacore::Quantity parAngle=casacore::Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint=BeamSquint::NONE, casacore::Float cutoff=0.01)
 
casacore::ImageInterface
< casacore::Float > & 
applyPB2 (const casacore::ImageInterface< casacore::Float > &in, casacore::ImageInterface< casacore::Float > &out, const casacore::MDirection &sp, const casacore::Quantity parAngle=casacore::Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint=BeamSquint::NONE, casacore::Float cutoff=0.01)
 This has a very specialized role (in SkyEquation) and should not be used elsewhere. More...
 
SkyComponentapplyVP (SkyComponent &in, SkyComponent &out, const casacore::MDirection &sp, const casacore::Quantity frequency, const casacore::Quantity parAngle=casacore::Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint=BeamSquint::NONE, casacore::Bool inverse=false, casacore::Bool conjugate=false, casacore::Float cutoff=0.01, casacore::Bool forward=true)
 Apply Jones matrix to a sky component (and adjoint) More...
 
SkyComponentapplyPB (SkyComponent &in, SkyComponent &out, const casacore::MDirection &sp, const casacore::Quantity frequency, const casacore::Quantity parAngle=casacore::Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint=BeamSquint::NONE, casacore::Bool inverse=false, casacore::Float cutoff=0.01, casacore::Bool forward=true)
 
SkyComponentapplyPB2 (SkyComponent &in, SkyComponent &out, const casacore::MDirection &sp, const casacore::Quantity frequency, const casacore::Quantity parAngle=casacore::Quantity(0.0,"deg"), const BeamSquint::SquintType doSquint=BeamSquint::NONE)
 
virtual PBClass whichPBClass ()=0
 Which PBClass is this one? More...
 
void namePBClass (casacore::String &name)
 Convert PBClass enumeration into PBClass String. More...
 
virtual void setUseSymmetric (casacore::Bool useSym=true)
 Fit an azimuthally symmetric beam to the squinted or otherwise 2-D beam for casacore::Stokes I? More...
 
virtual casacore::Bool getUseSymmetric ()
 Get value of useSymmetric. More...
 
virtual void setBandOrFeedName (const casacore::String elnamo)
 

Protected Member Functions

 PBMath1D ()
 Protect default constructor: this will do you no good. More...
 
void extentguts (const casacore::CoordinateSystem &coords, const casacore::MDirection &pointing, const casacore::Float fPad, const casacore::Int iChan, casacore::Vector< casacore::Float > &blc, casacore::Vector< casacore::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 More...
 
void refineSize (casacore::Vector< casacore::Float > &blc, casacore::Vector< casacore::Float > &trc, const casacore::IPosition &shape, SkyJones::SizeType)
 push blc lower, trc higher such that they define an image which is a power of 2 in size. More...
 
casacore::ImageInterface
< casacore::Complex > & 
apply (const casacore::ImageInterface< casacore::Complex > &in, casacore::ImageInterface< casacore::Complex > &out, const casacore::MDirection &sp, const casacore::Quantity parAngle, const BeamSquint::SquintType doSquint, casacore::Bool inverse, casacore::Bool conjugate, casacore::Int ipower, casacore::Float cutoff, casacore::Bool forward)
 lower level helping apply methods More...
 
casacore::ImageInterface
< casacore::Float > & 
apply (const casacore::ImageInterface< casacore::Float > &in, casacore::ImageInterface< casacore::Float > &out, const casacore::MDirection &sp, const casacore::Quantity parAngle, const BeamSquint::SquintType doSquint, casacore::Float cutoff, const casacore::Int ipower=4)
 
SkyComponentapply (SkyComponent &in, SkyComponent &out, const casacore::MDirection &sp, const casacore::Quantity frequency, const casacore::Quantity parAngle, const BeamSquint::SquintType doSquint, casacore::Bool inverse, casacore::Bool conjugate, casacore::Int ipower, casacore::Float cutoff, casacore::Bool forward)
 PB and PB^2. More...
 
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. More...
 
For wideband beams fill the
tabulated vp_p by the
interpolated beam at the freq
*virtual void 
nearestVPArray (double freq, bool printINFO=true)
 
void symmetrizeSquintedBeam ()
 Helper method to fit a circularly symmetric beam to the squinted RR + LL beam. More...
 
void applyXLine (const casacore::Complex *&in, casacore::Complex *&out, casacore::Float *&rx2, casacore::Complex *&vp, const casacore::Float ry2, const casacore::Int ipower, const casacore::Bool conjugate, const casacore::Bool inverse, const casacore::Bool forward, const casacore::Int nx, const casacore::Int iy, const casacore::Double rmax2, const casacore::Double factor, const casacore::Double inverseIncrementRadius, const casacore::Float cutoff)
 
- Protected Member Functions inherited from casa::PBMathInterface
 PBMathInterface ()
 Dumb constructor: protected, as it won't do you any good! More...
 

Protected Attributes

casacore::Vector
< casacore::Complex > 
vp_p
 The parameterized representation is for the VP, not the PB. More...
 
casacore::Vector
< casacore::Complex > 
esvp_p
 Tabulated effective az-symmetrical voltage pattern (optional, depending upon useSymmetric_p) More...
 
casacore::Matrix
< casacore::Complex > 
wbvp_p
 Tabulated voltage pattern for wide band feed First axis is radius, 2nd axis is frequency. More...
 
casacore::Bool wideFit_p
 Switch to use wideband beam fits. More...
 
casacore::Vector
< casacore::Double
wFreqs_p
 Wideband beam fit frequencies. More...
 
casacore::Quantity maximumRadius_p
 Maximum radius allowed in tabulated model. More...
 
casacore::Quantity refFreq_p
 reference frequency: used for squint and other beam paramaters such as width, found in derived types. More...
 
casacore::Double fScale_p
 internal scaling from refFreq_p to 1GHz; used during construction More...
 
casacore::Double inverseIncrementRadius_p
 Increment in radius. More...
 
casacore::Double scale_p
 Scale to convert to tabulated units. More...
 
casacore::CompositeNumber composite_p
 casacore::CompositeNumber (for beam application and the like) More...
 
- Protected Attributes inherited from casa::PBMathInterface
casacore::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. More...
 
BeamSquint squint_p
 Beam squint: convention is AZ-EL offset of the casacore::Stokes RR beam w.r.t. More...
 
casacore::Bool useSymmetricBeam_p
 Should we use the effective az-symmetrical primary beam? Otherwise, use squinted beam; if no squint, no difference. More...
 
casacore::String bandOrFeedName_p
 

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; More...
 

Additional Inherited Members

- Public Types inherited from casa::PBMathInterface
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...
 
- Static Public Member Functions inherited from casa::PBMathInterface
static void namePBClass (const PBMathInterface::PBClass iPB, casacore::String &str)
 Convert enumeration into a string. More...
 
- Static Protected Member Functions inherited from casa::PBMathInterface
static casacore::Float asFloat (const casacore::Complex &value)
 Functions to deal with conversions to Float. More...
 
static casacore::Float asFloat (const casacore::DComplex &value)
 
static casacore::Float asFloat (const casacore::Float &value)
 
static casacore::Float asFloat (const casacore::Double &value)
 

Detailed Description

base class for 1D PBMath objects

Intended use:

Public interface

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

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.)

Example

PBMath1DGauss myPB (casacore::Quantity(1.0, "'"), casacore::Quantity(3.0, "'"), casacore::Quantity(1.0, "GHz"),
false, // these are PB parameters, not VP
casacore::Quantity(0.0, "\""),
casacore::Quantity(2.0, "GHz")),
false);
PBMath1DGauss myPB2 (casacore::Quantity(1.0, "'"), casacore::Quantity(3.0, "'"), casacore::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 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.

Example

casacore::MDirection pointingDir(casacore::Quantity(135.0, "deg"), casacore::Quantity(60.0, "deg"),
casacore::Quantity parallacticAngle(26.5, "deg");
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 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

Thrown Exceptions

To Do

Definition at line 154 of file PBMath1D.h.

Constructor & Destructor Documentation

casa::PBMath1D::PBMath1D ( casacore::Quantity  maximumRadius,
casacore::Quantity  refFreq,
casacore::Bool  isThisVP,
BeamSquint  squint,
casacore::Bool  useSymmetricBeam 
)
virtual casa::PBMath1D::~PBMath1D ( )
pure virtual
casa::PBMath1D::PBMath1D ( )
protected

Protect default constructor: this will do you no good.

Member Function Documentation

casacore::ImageInterface<casacore::Complex>& casa::PBMath1D::apply ( const casacore::ImageInterface< casacore::Complex > &  in,
casacore::ImageInterface< casacore::Complex > &  out,
const casacore::MDirection sp,
const casacore::Quantity  parAngle,
const BeamSquint::SquintType  doSquint,
casacore::Bool  Inverse,
casacore::Bool  Conjugate,
casacore::Int  ipower,
casacore::Float  cutoff,
casacore::Bool  forward 
)
protectedvirtual

lower level helping apply methods

Implements casa::PBMathInterface.

casacore::ImageInterface<casacore::Float>& casa::PBMath1D::apply ( const casacore::ImageInterface< casacore::Float > &  in,
casacore::ImageInterface< casacore::Float > &  out,
const casacore::MDirection sp,
const casacore::Quantity  parAngle,
const BeamSquint::SquintType  doSquint,
casacore::Float  cutoff,
const casacore::Int  ipower = 4 
)
protectedvirtual

Implements casa::PBMathInterface.

SkyComponent& casa::PBMath1D::apply ( SkyComponent in,
SkyComponent out,
const casacore::MDirection sp,
const casacore::Quantity  frequency,
const casacore::Quantity  parAngle,
const BeamSquint::SquintType  doSquint,
casacore::Bool  inverse,
casacore::Bool  conjugate,
casacore::Int  ipower,
casacore::Float  cutoff,
casacore::Bool  forward 
)
protectedvirtual

PB and PB^2.

Implements casa::PBMathInterface.

void casa::PBMath1D::applyXLine ( const casacore::Complex *&  in,
casacore::Complex *&  out,
casacore::Float *&  rx2,
casacore::Complex *&  vp,
const casacore::Float  ry2,
const casacore::Int  ipower,
const casacore::Bool  conjugate,
const casacore::Bool  inverse,
const casacore::Bool  forward,
const casacore::Int  nx,
const casacore::Int  iy,
const casacore::Double  rmax2,
const casacore::Double  factor,
const casacore::Double  inverseIncrementRadius,
const casacore::Float  cutoff 
)
protected
casacore::ImageRegion* casa::PBMath1D::extent ( const casacore::ImageInterface< casacore::Complex > &  in,
const casacore::MDirection pointing,
const casacore::Int  irow,
const casacore::Float  fPad,
const casacore::Int  iChan,
const SkyJones::SizeType  sizeType 
)
virtual

Get the casacore::ImageRegion of the primary beam on an Image for a given pointing Note: casacore::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 casacore::ImageRegion includes all casacore::Stokes and Frequency Channels present in the input image.

Implements casa::PBMathInterface.

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

Implements casa::PBMathInterface.

void casa::PBMath1D::extentguts ( const casacore::CoordinateSystem coords,
const casacore::MDirection pointing,
const casacore::Float  fPad,
const casacore::Int  iChan,
casacore::Vector< casacore::Float > &  blc,
casacore::Vector< casacore::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 ( )
protectedpure 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, casa::PBMath1DAiry, and casa::PBMath1DEVLA.

For wideband beams fill the tabulated vp_p by the interpolated beam at the freq* virtual void casa::PBMath1D::nearestVPArray ( double  freq,
bool  printINFO = true 
)
protectedvirtual

Reimplemented in casa::PBMath1DEVLA.

virtual casacore::Bool casa::PBMath1D::ok ( )
virtual

Is state of PBMath OK?

Implements casa::PBMathInterface.

void casa::PBMath1D::refineSize ( casacore::Vector< casacore::Float > &  blc,
casacore::Vector< casacore::Float > &  trc,
const casacore::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 ( casacore::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::PBMath1DGauss, casa::PBMath1DCosPoly, casa::PBMath1DPoly, and casa::PBMath1DAiry.

virtual casacore::Int casa::PBMath1D::support ( const casacore::CoordinateSystem cs)
virtual

Implements casa::PBMathInterface.

Reimplemented in casa::PBMath1DNumeric.

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')

void casa::PBMath1D::viewPB ( casacore::Vector< casacore::Float > &  r,
casacore::Vector< casacore::Float > &  PB,
casacore::Int  n_elements,
const casacore::Double  freq = 1.0e9 
)

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

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;

Definition at line 160 of file PBMath1D.h.

Member Data Documentation

casacore::CompositeNumber casa::PBMath1D::composite_p
protected

casacore::CompositeNumber (for beam application and the like)

Definition at line 330 of file PBMath1D.h.

casacore::Vector<casacore::Complex> casa::PBMath1D::esvp_p
protected

Tabulated effective az-symmetrical voltage pattern (optional, depending upon useSymmetric_p)

Definition at line 297 of file PBMath1D.h.

casacore::Double casa::PBMath1D::fScale_p
protected

internal scaling from refFreq_p to 1GHz; used during construction

Definition at line 321 of file PBMath1D.h.

casacore::Double casa::PBMath1D::inverseIncrementRadius_p
protected

Increment in radius.

Definition at line 324 of file PBMath1D.h.

casacore::Quantity casa::PBMath1D::maximumRadius_p
protected

Maximum radius allowed in tabulated model.

Definition at line 312 of file PBMath1D.h.

casacore::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 318 of file PBMath1D.h.

casacore::Double casa::PBMath1D::scale_p
protected

Scale to convert to tabulated units.

Definition at line 327 of file PBMath1D.h.

casacore::Vector<casacore::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 293 of file PBMath1D.h.

casacore::Matrix<casacore::Complex> casa::PBMath1D::wbvp_p
protected

Tabulated voltage pattern for wide band feed First axis is radius, 2nd axis is frequency.

Definition at line 302 of file PBMath1D.h.

casacore::Vector<casacore::Double> casa::PBMath1D::wFreqs_p
protected

Wideband beam fit frequencies.

Equally spaced beam fits across frequency range of the feed

Definition at line 309 of file PBMath1D.h.

casacore::Bool casa::PBMath1D::wideFit_p
protected

Switch to use wideband beam fits.

Definition at line 305 of file PBMath1D.h.


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