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 | Private Member Functions | Private Attributes | List of all members
casa::BeamSkyJones Class Referenceabstract

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

#include <BeamSkyJones.h>

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

Public Member Functions

 BeamSkyJones (const casacore::Quantity &parallacticAngleIncrement=casacore::Quantity(720.0,"deg"), BeamSquint::SquintType doSquint=BeamSquint::NONE, const casacore::Quantity &skyPositionThreshold=casacore::Quantity(180,"deg"))
 Eventually, the casacore::MS will have all the beam information in its Beam Subtable. More...
 
virtual ~BeamSkyJones ()=0
 this operator due to position offset More...
 
virtual void showState (casacore::LogIO &os)
 Print out information concerning the state of this object. More...
 
casacore::ImageInterface
< casacore::Complex > & 
apply (const casacore::ImageInterface< casacore::Complex > &in, casacore::ImageInterface< casacore::Complex > &out, const VisBuffer &vb, casacore::Int row, casacore::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. More...
 
casacore::ImageInterface
< casacore::Float > & 
apply (const casacore::ImageInterface< casacore::Float > &in, casacore::ImageInterface< casacore::Float > &out, const VisBuffer &vb, casacore::Int row)
 
casacore::ImageInterface
< casacore::Float > & 
applySquare (const casacore::ImageInterface< casacore::Float > &in, casacore::ImageInterface< casacore::Float > &out, const VisBuffer &vb, casacore::Int row)
 
SkyComponentapply (SkyComponent &in, SkyComponent &out, const VisBuffer &vb, casacore::Int row, casacore::Bool forward=true, casacore::Bool fullspectral=false)
 
 Apply Jones matrix to a sky component (and adjoint)

if fullspectral==True then the output skycomponent will have a TabularSpectrum Spectral Model which will be at all the channel frequencies available in the vb; when False the out SkyComponent is modified using the first channel frequency only. More...

 
SkyComponentapplySquare (SkyComponent &in, SkyComponent &out, const VisBuffer &vb, casacore::Int row, casacore::Bool fullspectral=false)
 
virtual void reset ()
 Understand if things have changed since last PB application. More...
 
virtual casacore::Bool changed (const VisBuffer &vb, casacore::Int row)
 Has this operator changed since the last Application? (or more properly, since the last update()) More...
 
virtual casacore::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. More...
 
virtual casacore::Bool changedBuffer (const VisBuffer &vb, casacore::Int row1, casacore::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. More...
 
void update (const VisBuffer &vb, casacore::Int row)
 Update the FieldID, Telescope, pointingDirection, Parallactic angle info. More...
 
virtual void assure (const VisBuffer &vb, casacore::Int row)
 if (changed) {update()} More...
 
virtual Type type ()
 Return the type of this Jones matrix (actual type of derived class). More...
 
virtual
casacore::ImageInterface
< casacore::Complex > & 
applyGradient (casacore::ImageInterface< casacore::Complex > &result, const VisBuffer &vb, casacore::Int row)
 Apply gradient. More...
 
virtual SkyComponentapplyGradient (SkyComponent &result, const VisBuffer &vb, casacore::Int row)
 
virtual casacore::Bool isSolveable ()
 Is this solveable? More...
 
virtual void initializeGradients ()
 Initialize for gradient search. More...
 
virtual void finalizeGradients ()
 Finalize for gradient search. More...
 
virtual void addGradients (const VisBuffer &vb, casacore::Int row, const casacore::Float sumwt, const casacore::Float chisq, const casacore::Matrix< casacore::Complex > &c, const casacore::Matrix< casacore::Float > &f)
 Add to Gradient Chisq. More...
 
virtual casacore::Bool solve (SkyEquation &se)
 Solve. More...
 
void setPBMath (const casacore::String &telescope, PBMath &myPBmath, const casacore::Int &antennaID=-1, const casacore::Int &feedID=-1)
 Manage the PBMath objects. More...
 
casacore::Bool getPBMath (casacore::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 More...
 
casacore::Bool getPBMath (const casacore::String &telescope, PBMath &myPBMath, const casacore::Int &antennaID=-1, const casacore::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 More...
 
casacore::Quantity getPAIncrement ()
 
casacore::Quantity getSkyPositionThreshold ()
 
casacore::Bool isHomogeneous () const
 Return true if all antennas share a common VP. More...
 
casacore::ImageRegionextent (const casacore::ImageInterface< casacore::Complex > &im, const VisBuffer &vb, const casacore::Int irow=-1, const casacore::Float fPad=1.2, const casacore::Int iChan=0, const SkyJones::SizeType sizeType=SkyJones::COMPOSITE)
 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 > &im, const VisBuffer &vb, const casacore::Int irow=-1, const casacore::Float fPad=1.2, const casacore::Int iChan=0, const SkyJones::SizeType sizeType=SkyJones::COMPOSITE)
 
virtual void summary (casacore::Int n=0)
 summarize the PBMaths contained here. More...
 
casacore::String telescope ()
 return the telescope it is on at this state More...
 
virtual casacore::Int support (const VisBuffer &vb, const casacore::CoordinateSystem &cs)
 Get an idea of the support of the PB in number of pixels. More...
 
- Public Member Functions inherited from casa::SkyJones
 SkyJones ()
 
virtual ~SkyJones ()
 Destructor. More...
 
virtual void setThreshold (const casacore::Float t)
 
virtual casacore::Float threshold ()
 

Protected Member Functions

casacore::Bool directionsCloseEnough (const casacore::MDirection &dir1, const casacore::MDirection &dir2) const
 return true if two directions are close enough to consider the operator unchanged, false otherwise More...
 
casacore::Int indexTelescope (const casacore::String &compareTelescope, const casacore::Int &compareAntenna=-1, const casacore::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. More...
 
casacore::MDirection convertDir (const VisBuffer &vb, const casacore::MDirection &inDir, const casacore::MDirection::Types outType)
 
- Protected Member Functions inherited from casa::SkyJones
virtual casacore::String typeName ()
 Could be over-ridden if necessary. More...
 

Protected Attributes

casacore::String telescope_p
 
casacore::CountedPtr
< VisBufferUtil
vbutil_p
 
- Protected Attributes inherited from casa::SkyJones
casacore::Float threshold_p
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Public Types inherited from casa::SkyJones
enum  Type {
  E,
  T,
  F,
  D
}
 Allowed types of VisJones matrices. More...
 
enum  SizeType {
  COMPOSITE,
  POWEROF2,
  ANY
}
 

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 91 of file BeamSkyJones.h.

Constructor & Destructor Documentation

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

Eventually, the casacore::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 casacore::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,
casacore::Int  row,
const casacore::Float  sumwt,
const casacore::Float  chisq,
const casacore::Matrix< casacore::Complex > &  c,
const casacore::Matrix< casacore::Float > &  f 
)
virtual

Add to Gradient Chisq.

Implements casa::SkyJones.

casacore::ImageInterface<casacore::Complex>& casa::BeamSkyJones::apply ( const casacore::ImageInterface< casacore::Complex > &  in,
casacore::ImageInterface< casacore::Complex > &  out,
const VisBuffer vb,
casacore::Int  row,
casacore::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.

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

Implements casa::SkyJones.

SkyComponent& casa::BeamSkyJones::apply ( SkyComponent in,
SkyComponent out,
const VisBuffer vb,
casacore::Int  row,
casacore::Bool  forward = true,
casacore::Bool  fullspectral = false 
)
virtual

 Apply Jones matrix to a sky component (and adjoint)

if fullspectral==True then the output skycomponent will have a TabularSpectrum Spectral Model which will be at all the channel frequencies available in the vb; when False the out SkyComponent is modified using the first channel frequency only.

Thus dealing with the frequency dependence of the SkyJones.

Implements casa::SkyJones.

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

Apply gradient.

virtual SkyComponent& casa::BeamSkyJones::applyGradient ( SkyComponent result,
const VisBuffer vb,
casacore::Int  row 
)
virtual
casacore::ImageInterface<casacore::Float>& casa::BeamSkyJones::applySquare ( const casacore::ImageInterface< casacore::Float > &  in,
casacore::ImageInterface< casacore::Float > &  out,
const VisBuffer vb,
casacore::Int  row 
)
virtual

Implements casa::SkyJones.

SkyComponent& casa::BeamSkyJones::applySquare ( SkyComponent in,
SkyComponent out,
const VisBuffer vb,
casacore::Int  row,
casacore::Bool  fullspectral = false 
)
virtual

Implements casa::SkyJones.

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

if (changed) {update()}

Implements casa::SkyJones.

virtual casacore::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 casacore::Bool casa::BeamSkyJones::changed ( const VisBuffer vb,
casacore::Int  row 
)
virtual

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

Implements casa::SkyJones.

virtual casacore::Bool casa::BeamSkyJones::changedBuffer ( const VisBuffer vb,
casacore::Int  row1,
casacore::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, casacore::Int row) and shield the user from the case where the fieldID has changed (which only changes in blocks)

Implements casa::SkyJones.

casacore::MDirection casa::BeamSkyJones::convertDir ( const VisBuffer vb,
const casacore::MDirection inDir,
const casacore::MDirection::Types  outType 
)
protected
casacore::Bool casa::BeamSkyJones::directionsCloseEnough ( const casacore::MDirection dir1,
const casacore::MDirection dir2 
) const
protected

return true if two directions are close enough to consider the operator unchanged, false otherwise

casacore::ImageRegion* casa::BeamSkyJones::extent ( const casacore::ImageInterface< casacore::Complex > &  im,
const VisBuffer vb,
const casacore::Int  irow = -1,
const casacore::Float  fPad = 1.2,
const casacore::Int  iChan = 0,
const SkyJones::SizeType  sizeType = SkyJones::COMPOSITE 
)
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 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 casacore::ImageRegion includes all casacore::Stokes and Frequency Channels present in the input image.

Implements casa::SkyJones.

casacore::ImageRegion* casa::BeamSkyJones::extent ( const casacore::ImageInterface< casacore::Float > &  im,
const VisBuffer vb,
const casacore::Int  irow = -1,
const casacore::Float  fPad = 1.2,
const casacore::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.

casacore::Quantity casa::BeamSkyJones::getPAIncrement ( )
inline

Definition at line 232 of file BeamSkyJones.h.

References parallacticAngleIncrement_p.

casacore::Bool casa::BeamSkyJones::getPBMath ( casacore::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

casacore::Bool casa::BeamSkyJones::getPBMath ( const casacore::String telescope,
PBMath myPBMath,
const casacore::Int antennaID = -1,
const casacore::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

casacore::Quantity casa::BeamSkyJones::getSkyPositionThreshold ( )
inline

Definition at line 234 of file BeamSkyJones.h.

References skyPositionThreshold_p.

casacore::Int casa::BeamSkyJones::indexTelescope ( const casacore::String compareTelescope,
const casacore::Int compareAntenna = -1,
const casacore::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.

casacore::Bool casa::BeamSkyJones::isHomogeneous ( ) const

Return true if all antennas share a common VP.

virtual casacore::Bool casa::BeamSkyJones::isSolveable ( )
inlinevirtual

Is this solveable?

Implements casa::SkyJones.

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

Definition at line 188 of file BeamSkyJones.h.

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 casacore::String telescope,
PBMath myPBmath,
const casacore::Int antennaID = -1,
const casacore::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 ( casacore::LogIO os)
virtual

Print out information concerning the state of this object.

virtual casacore::Bool casa::BeamSkyJones::solve ( SkyEquation se)
virtual

Solve.

Implements casa::SkyJones.

virtual void casa::BeamSkyJones::summary ( casacore::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 casacore::Int casa::BeamSkyJones::support ( const VisBuffer vb,
const casacore::CoordinateSystem cs 
)
virtual

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

Implements casa::SkyJones.

casacore::String casa::BeamSkyJones::telescope ( )
virtual

return the telescope it is on at this state

Implements casa::SkyJones.

virtual Type casa::BeamSkyJones::type ( )
inlinevirtual

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 176 of file BeamSkyJones.h.

References casa::SkyJones::E.

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

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

void casa::BeamSkyJones::updatePBMathIndices ( const VisBuffer vb,
casacore::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

BeamSquint::SquintType casa::BeamSkyJones::doSquint_p
private

Definition at line 286 of file BeamSkyJones.h.

casacore::Bool casa::BeamSkyJones::hasBeenApplied
mutableprivate

Definition at line 328 of file BeamSkyJones.h.

casacore::Int casa::BeamSkyJones::lastArrayId_p
private

Definition at line 281 of file BeamSkyJones.h.

casacore::Block<casacore::MDirection> casa::BeamSkyJones::lastDirections_p
private

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 299 of file BeamSkyJones.h.

casacore::Int casa::BeamSkyJones::lastFieldId_p
private

Definition at line 279 of file BeamSkyJones.h.

casacore::Int casa::BeamSkyJones::lastMSId_p
private

Definition at line 283 of file BeamSkyJones.h.

casacore::Block<casacore::Double> casa::BeamSkyJones::lastParallacticAngles_p
private

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

Definition at line 294 of file BeamSkyJones.h.

casacore::Double casa::BeamSkyJones::lastTime_p
private

Definition at line 285 of file BeamSkyJones.h.

casacore::Int casa::BeamSkyJones::lastUpdateIndex1_p
mutableprivate

correct row in the VisBuffer

Definition at line 324 of file BeamSkyJones.h.

casacore::Int casa::BeamSkyJones::lastUpdateIndex2_p
mutableprivate

Definition at line 325 of file BeamSkyJones.h.

casacore::Int casa::BeamSkyJones::lastUpdateRow_p
mutableprivate

is filled for the correct VisBuffer.

The value is used for comparison only

Definition at line 322 of file BeamSkyJones.h.

const VisBuffer* casa::BeamSkyJones::lastUpdateVisBuffer_p
mutableprivate

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

Definition at line 318 of file BeamSkyJones.h.

casacore::Block<casacore::Int> casa::BeamSkyJones::myAntennaIDs_p
private

Antenna IDs (parallel with PBMaths)

Definition at line 313 of file BeamSkyJones.h.

casacore::Block<casacore::Int> casa::BeamSkyJones::myFeedIDs_p
private

Feed IDs (parallel with PBMaths)

Definition at line 315 of file BeamSkyJones.h.

casacore::Block<PBMath> casa::BeamSkyJones::myPBMaths_p
private

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 308 of file BeamSkyJones.h.

casacore::Block<casacore::String> casa::BeamSkyJones::myTelescopes_p
private

Names of telescopes (parralel with PBMaths.

Definition at line 310 of file BeamSkyJones.h.

casacore::Double casa::BeamSkyJones::parallacticAngleIncrement_p
private

Definition at line 288 of file BeamSkyJones.h.

Referenced by getPAIncrement().

casacore::Double casa::BeamSkyJones::skyPositionThreshold_p
private

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

Definition at line 291 of file BeamSkyJones.h.

Referenced by getSkyPositionThreshold().

casacore::String casa::BeamSkyJones::telescope_p
protected

Definition at line 355 of file BeamSkyJones.h.

casacore::CountedPtr<VisBufferUtil> casa::BeamSkyJones::vbutil_p
protected

Definition at line 356 of file BeamSkyJones.h.


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