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

beam-like sky-plane effects for the SkyEquation More...

#include <BeamSkyJones.h>

Inheritance diagram for casa::BeamSkyJones:
casa::SkyJones casa::DBeamSkyJones casa::VPSkyJones

List of all members.

Public Member Functions

 BeamSkyJones (const Quantity &parallacticAngleIncrement=Quantity(720.0,"deg"), BeamSquint::SquintType doSquint=BeamSquint::NONE, const Quantity &skyPositionThreshold=Quantity(180,"deg"))
 Eventually, the MS will have all the beam information in its Beam Subtable.
virtual ~BeamSkyJones ()=0
 this operator due to position offset
virtual void showState (LogIO &os)
 Print out information concerning the state of this object.
ImageInterface< Complex > & apply (const ImageInterface< Complex > &in, ImageInterface< Complex > &out, const VisBuffer &vb, Int row, Bool forward=True)
 Apply Jones matrix to an image (and adjoint) No "applyInverse" is available from the SkyJones classes, you can get them directly from PBMath or you can get the equivalent effect by dividing by grad grad Chi^2 in ImageSkyModel.
ImageInterface< Float > & apply (const ImageInterface< Float > &in, ImageInterface< Float > &out, const VisBuffer &vb, Int row)
ImageInterface< Float > & applySquare (const ImageInterface< Float > &in, ImageInterface< Float > &out, const VisBuffer &vb, Int row)
SkyComponentapply (SkyComponent &in, SkyComponent &out, const VisBuffer &vb, Int row, Bool forward=True)
 Apply Jones matrix to a sky component (and adjoint)
SkyComponentapplySquare (SkyComponent &in, SkyComponent &out, const VisBuffer &vb, Int row)
virtual void reset ()
 Understand if things have changed since last PB application.
virtual Bool changed (const VisBuffer &vb, Int row)
 Has this operator changed since the last Application? (or more properly, since the last update() )
virtual Bool change (const VisBuffer &vb)
 Does the operator change in this visbuffer or since the last call? May not be useful -- check it out: m.a.h.
virtual Bool changedBuffer (const VisBuffer &vb, Int row1, Int &row2)
 Does this operator changed in this VisBuffer, starting with row1? If yes, we return in row2, the last row that has the same SkyJones as row1.
void update (const VisBuffer &vb, Int row)
 Update the FieldID, Telescope, pointingDirection, Parallactic angle info.
virtual void assure (const VisBuffer &vb, Int row)
 if (changed) {update()}
virtual Type type ()
 Return the type of this Jones matrix (actual type of derived class).
virtual ImageInterface< Complex > & applyGradient (ImageInterface< Complex > &result, const VisBuffer &vb, Int row)
 Apply gradient.
virtual SkyComponentapplyGradient (SkyComponent &result, const VisBuffer &vb, Int row)
virtual Bool isSolveable ()
 Is this solveable?
virtual void initializeGradients ()
 Initialize for gradient search.
virtual void finalizeGradients ()
 Finalize for gradient search.
virtual void addGradients (const VisBuffer &vb, Int row, const Float sumwt, const Float chisq, const Matrix< Complex > &c, const Matrix< Float > &f)
 Add to Gradient Chisq.
virtual Bool solve (SkyEquation &se)
 Solve.
void setPBMath (const String &telescope, PBMath &myPBmath, const Int &antennaID=-1, const Int &feedID=-1)
 Manage the PBMath objects.
Bool getPBMath (uInt whichAnt, PBMath &myPBMath) const
 get the PBMath object; returns False if that one doesn't exist, True if it does exist and is OK whichAnt is an index into an array of PBMaths, which is different for all telescope/antenna/feed combinations Not sure why we need such a low-level method declared as public, retained to preserve old interface
Bool getPBMath (const String &telescope, PBMath &myPBMath, const Int &antennaID=-1, const Int &feedID=-1) const
 get the PBMath object; returns False if that one doesn't exist, True if it does exist and is OK antennaID and feedID default to -1 to preserve the old interface TODO: change the interface and make antennaID and feedID the second and third parameter respectively to have a better looking code
Quantity getPAIncrement ()
Quantity getSkyPositionThreshold ()
Bool isHomogeneous () const
 Return true if all antennas share a common VP.
ImageRegionextent (const ImageInterface< Complex > &im, const VisBuffer &vb, const Int irow=-1, const Float fPad=1.2, const Int iChan=0, const SkyJones::SizeType sizeType=SkyJones::COMPOSITE)
 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).
ImageRegionextent (const ImageInterface< Float > &im, const VisBuffer &vb, const Int irow=-1, const Float fPad=1.2, const Int iChan=0, const SkyJones::SizeType sizeType=SkyJones::COMPOSITE)
virtual void summary (Int n=0)
 summarize the PBMaths contained here.
String telescope ()
 return the telescope it is on at this state
virtual Int support (const VisBuffer &vb, const CoordinateSystem &cs)
 Get an idea of the support of the PB in number of pixels.

Protected Member Functions

Bool directionsCloseEnough (const MDirection &dir1, const MDirection &dir2) const throw (AipsError)
 return True if two directions are close enough to consider the operator unchanged, False otherwise
Int indexTelescope (const String &compareTelescope, const Int &compareAntenna=-1, const Int &compareFeed=-1) const
 return index of compareTelescope, compareAntenna and compareFeed in myTelescopes_p, myAntennaIDs and myFeedIDs; -1 if not found if compareAntenna or compareTelescope is -1, this means that the PBMath class is the same for all antennae/feeds.

Private Member Functions

void updatePBMathIndices (const VisBuffer &vb, Int row) const
 update the indices cache.

Private Attributes

String telescope_p
Int lastFieldId_p
Int lastArrayId_p
Int lastMSId_p
BeamSquint::SquintType doSquint_p
Double parallacticAngleIncrement_p
Double skyPositionThreshold_p
 beyond which the operator is considered to be changed (in radians)
Block< DoublelastParallacticAngles_p
 which the operator is considered to be changed (in radians)
Block< MDirectionlastDirections_p
 used when the operator was applied last time.
Block< PBMathmyPBMaths_p
 used when the operator was applied last time.
Block< StringmyTelescopes_p
 Names of telescopes (parralel with PBMaths.
Block< IntmyAntennaIDs_p
 Antenna IDs (parallel with PBMaths)
Block< IntmyFeedIDs_p
 Feed IDs (parallel with PBMaths)
const VisBufferlastUpdateVisBuffer_p
 cache of the indices to the PBMaths container for antenna/feed 1 and 2
Int lastUpdateRow_p
 is filled for the correct VisBuffer.
Int lastUpdateIndex1_p
 correct row in the VisBuffer
Int lastUpdateIndex2_p
Bool hasBeenApplied
 
   


Detailed Description

beam-like sky-plane effects for the SkyEquation

Intended use:

Public interface

Prerequisite

Etymology

BeamSkyJones, derived from SkyJones, describes an interface to beam-based SkyJones objects. Like SkyJones, it too is an Abstract Base Class, but implements the beam-related methods.

Synopsis

Motivation

The properties of sky-plane based calibration effects must be described for the SkyEquation ; this class encapsulates the antenna beam-based aspects which are present in at least a few other specific SkyJones (VPSkyJones and DBeamSkyJones).

To Do

Definition at line 87 of file BeamSkyJones.h.


Constructor & Destructor Documentation

casa::BeamSkyJones::BeamSkyJones ( const Quantity parallacticAngleIncrement = Quantity(720.0,"deg"),
BeamSquint::SquintType  doSquint = BeamSquint::NONE,
const Quantity skyPositionThreshold = Quantity(180,"deg") 
)

Eventually, the MS will have all the beam information in its Beam Subtable.

Till then, we either guess the PB to use or explicitly define it upon construction. Construct from a Measurement Set, figure out the most appropriate PBMath object from MS information

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

this operator due to position offset

Virtual destructor (this is a virtual base class)


Member Function Documentation

virtual void casa::BeamSkyJones::addGradients ( const VisBuffer vb,
Int  row,
const Float  sumwt,
const Float  chisq,
const Matrix< Complex > &  c,
const Matrix< Float > &  f 
) [virtual]

Add to Gradient Chisq.

Implements casa::SkyJones.

ImageInterface<Complex>& casa::BeamSkyJones::apply ( const ImageInterface< Complex > &  in,
ImageInterface< Complex > &  out,
const VisBuffer vb,
Int  row,
Bool  forward = True 
) [virtual]

Apply Jones matrix to an image (and adjoint) No "applyInverse" is available from the SkyJones classes, you can get them directly from PBMath or you can get the equivalent effect by dividing by grad grad Chi^2 in ImageSkyModel.

Implements casa::SkyJones.

ImageInterface<Float>& casa::BeamSkyJones::apply ( const ImageInterface< Float > &  in,
ImageInterface< Float > &  out,
const VisBuffer vb,
Int  row 
) [virtual]

Implements casa::SkyJones.

SkyComponent& casa::BeamSkyJones::apply ( SkyComponent in,
SkyComponent out,
const VisBuffer vb,
Int  row,
Bool  forward = True 
) [virtual]

Apply Jones matrix to a sky component (and adjoint)

Implements casa::SkyJones.

virtual ImageInterface<Complex>& casa::BeamSkyJones::applyGradient ( ImageInterface< Complex > &  result,
const VisBuffer vb,
Int  row 
) [virtual]

Apply gradient.

Implements casa::SkyJones.

virtual SkyComponent& casa::BeamSkyJones::applyGradient ( SkyComponent result,
const VisBuffer vb,
Int  row 
) [virtual]

Implements casa::SkyJones.

ImageInterface<Float>& casa::BeamSkyJones::applySquare ( const ImageInterface< Float > &  in,
ImageInterface< Float > &  out,
const VisBuffer vb,
Int  row 
) [virtual]

Implements casa::SkyJones.

SkyComponent& casa::BeamSkyJones::applySquare ( SkyComponent in,
SkyComponent out,
const VisBuffer vb,
Int  row 
) [virtual]

Implements casa::SkyJones.

virtual void casa::BeamSkyJones::assure ( const VisBuffer vb,
Int  row 
) [virtual]

if (changed) {update()}

Implements casa::SkyJones.

virtual Bool casa::BeamSkyJones::change ( const VisBuffer vb) [virtual]

Does the operator change in this visbuffer or since the last call? May not be useful -- check it out: m.a.h.

Dec 30 1999

Implements casa::SkyJones.

virtual Bool casa::BeamSkyJones::changed ( const VisBuffer vb,
Int  row 
) [virtual]

Has this operator changed since the last Application? (or more properly, since the last update() )

Implements casa::SkyJones.

virtual Bool casa::BeamSkyJones::changedBuffer ( const VisBuffer vb,
Int  row1,
Int row2 
) [virtual]

Does this operator changed in this VisBuffer, starting with row1? If yes, we return in row2, the last row that has the same SkyJones as row1.

NOTE: need to first call changed(const VisBuffer& vb, Int row) and shield the user from the case where the fieldID has changed (which only changes in blocks)

Implements casa::SkyJones.

Bool casa::BeamSkyJones::directionsCloseEnough ( const MDirection dir1,
const MDirection dir2 
) const throw (AipsError) [protected]

return True if two directions are close enough to consider the operator unchanged, False otherwise

ImageRegion* casa::BeamSkyJones::extent ( const ImageInterface< Complex > &  im,
const VisBuffer vb,
const Int  irow = -1,
const Float  fPad = 1.2,
const Int  iChan = 0,
const SkyJones::SizeType  sizeType = SkyJones::COMPOSITE 
) [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: extra padding over the primary beam supporrt, fractional (ie, 1.2 for 20% padding), in all directions. (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.

Implements casa::SkyJones.

ImageRegion* casa::BeamSkyJones::extent ( const ImageInterface< Float > &  im,
const VisBuffer vb,
const Int  irow = -1,
const Float  fPad = 1.2,
const Int  iChan = 0,
const SkyJones::SizeType  sizeType = SkyJones::COMPOSITE 
) [virtual]

Implements casa::SkyJones.

virtual void casa::BeamSkyJones::finalizeGradients ( ) [virtual]

Finalize for gradient search.

Implements casa::SkyJones.

Definition at line 224 of file BeamSkyJones.h.

References parallacticAngleIncrement_p.

Bool casa::BeamSkyJones::getPBMath ( uInt  whichAnt,
PBMath myPBMath 
) const

get the PBMath object; returns False if that one doesn't exist, True if it does exist and is OK whichAnt is an index into an array of PBMaths, which is different for all telescope/antenna/feed combinations Not sure why we need such a low-level method declared as public, retained to preserve old interface

Bool casa::BeamSkyJones::getPBMath ( const String telescope,
PBMath myPBMath,
const Int antennaID = -1,
const Int feedID = -1 
) const

get the PBMath object; returns False if that one doesn't exist, True if it does exist and is OK antennaID and feedID default to -1 to preserve the old interface TODO: change the interface and make antennaID and feedID the second and third parameter respectively to have a better looking code

Definition at line 226 of file BeamSkyJones.h.

References skyPositionThreshold_p.

Int casa::BeamSkyJones::indexTelescope ( const String compareTelescope,
const Int compareAntenna = -1,
const Int compareFeed = -1 
) const [protected]

return index of compareTelescope, compareAntenna and compareFeed in myTelescopes_p, myAntennaIDs and myFeedIDs; -1 if not found if compareAntenna or compareTelescope is -1, this means that the PBMath class is the same for all antennae/feeds.

An exception will be raised, if separate PBMath objects have been assigned by setPBMath for different feeds/antennae but -1 is used for query.

It would be good to rename this function to indexBeams as this name is more appropriate.

virtual void casa::BeamSkyJones::initializeGradients ( ) [virtual]

Initialize for gradient search.

Implements casa::SkyJones.

Return true if all antennas share a common VP.

virtual Bool casa::BeamSkyJones::isSolveable ( ) [inline, virtual]

Is this solveable?

Implements casa::SkyJones.

Reimplemented in casa::VPSkyJones, and casa::DBeamSkyJones.

Definition at line 180 of file BeamSkyJones.h.

References casa::False.

virtual void casa::BeamSkyJones::reset ( ) [virtual]

Understand if things have changed since last PB application.

Reset to pristine state

Implements casa::SkyJones.

void casa::BeamSkyJones::setPBMath ( const String telescope,
PBMath myPBmath,
const Int antennaID = -1,
const Int feedID = -1 
)

Manage the PBMath objects.

set the PB based on telescope name, antennaID and feedID If antennaID or feedID is -1, the PBMath object is set for all antennae or feeds, respectively. These are the default values to retain the previous interface.

Note. It would be nice to change the interface and make antennaID and feedID the second and the third parameter, respectively.

virtual void casa::BeamSkyJones::showState ( LogIO os) [virtual]

Print out information concerning the state of this object.

virtual Bool casa::BeamSkyJones::solve ( SkyEquation se) [virtual]

Solve.

Implements casa::SkyJones.

virtual void casa::BeamSkyJones::summary ( Int  n = 0) [virtual]

summarize the PBMaths contained here.

n = -1 => terse table n = 0 => table plus constructor values n = m => plot m samples of the PB profile

virtual Int casa::BeamSkyJones::support ( const VisBuffer vb,
const CoordinateSystem cs 
) [virtual]

Get an idea of the support of the PB in number of pixels.

Implements casa::SkyJones.

return the telescope it is on at this state

Implements casa::SkyJones.

virtual Type casa::BeamSkyJones::type ( ) [inline, virtual]

Return the type of this Jones matrix (actual type of derived class).

Implements casa::SkyJones.

Reimplemented in casa::VPSkyJones, and casa::DBeamSkyJones.

Definition at line 168 of file BeamSkyJones.h.

References casa::SkyJones::E.

void casa::BeamSkyJones::update ( const VisBuffer vb,
Int  row 
)

Update the FieldID, Telescope, pointingDirection, Parallactic angle info.

void casa::BeamSkyJones::updatePBMathIndices ( const VisBuffer vb,
Int  row 
) const [private]

update the indices cache.

This method could be made protected in the future (need access functions for lastUpdateIndex?_p to benefit from it) Cache will be valid for a given VisBuffer and row


Member Data Documentation

Definition at line 277 of file BeamSkyJones.h.

   

Definition at line 319 of file BeamSkyJones.h.

Definition at line 273 of file BeamSkyJones.h.

used when the operator was applied last time.

One value in radians for each beam model in PBMaths. A zero-length block means that the operator has never been applied

Definition at line 290 of file BeamSkyJones.h.

Definition at line 271 of file BeamSkyJones.h.

Definition at line 275 of file BeamSkyJones.h.

which the operator is considered to be changed (in radians)

Definition at line 285 of file BeamSkyJones.h.

correct row in the VisBuffer

Definition at line 315 of file BeamSkyJones.h.

Definition at line 316 of file BeamSkyJones.h.

is filled for the correct VisBuffer.

The value is used for comparison only

Definition at line 313 of file BeamSkyJones.h.

cache of the indices to the PBMaths container for antenna/feed 1 and 2

Definition at line 309 of file BeamSkyJones.h.

Antenna IDs (parallel with PBMaths)

Definition at line 304 of file BeamSkyJones.h.

Feed IDs (parallel with PBMaths)

Definition at line 306 of file BeamSkyJones.h.

used when the operator was applied last time.

                  One element for each beam model in PBMaths.
                  A zero-length block means that the operator
                  has never been applied

One or more PBMaths (a common one for the entire array, or one for each antenna) This requires some sorting out for heterogeneous arrays!

Definition at line 299 of file BeamSkyJones.h.

Names of telescopes (parralel with PBMaths.

Definition at line 301 of file BeamSkyJones.h.

Definition at line 279 of file BeamSkyJones.h.

Referenced by getPAIncrement().

beyond which the operator is considered to be changed (in radians)

Definition at line 282 of file BeamSkyJones.h.

Referenced by getSkyPositionThreshold().

Definition at line 269 of file BeamSkyJones.h.


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