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

Sky Jones: Model sky-plane instrumental effects for the SkyEquation. More...

#include <SkyJones.h>

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

Public Types

enum  Type {
  E,
  T,
  F,
  D
}
 Allowed types of VisJones matrices. More...
 
enum  SizeType {
  COMPOSITE,
  POWEROF2,
  ANY
}
 

Public Member Functions

 SkyJones ()
 
virtual ~SkyJones ()
 Destructor. More...
 
virtual
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)=0
 Apply Jones matrix to an image (and adjoint) More...
 
virtual
casacore::ImageInterface
< casacore::Float > & 
apply (const casacore::ImageInterface< casacore::Float > &in, casacore::ImageInterface< casacore::Float > &out, const VisBuffer &vb, casacore::Int row)=0
 
virtual
casacore::ImageInterface
< casacore::Float > & 
applySquare (const casacore::ImageInterface< casacore::Float > &in, casacore::ImageInterface< casacore::Float > &out, const VisBuffer &vb, casacore::Int row)=0
 
virtual SkyComponentapply (SkyComponent &in, SkyComponent &out, const VisBuffer &vb, casacore::Int row, casacore::Bool forward=true, casacore::Bool fullSpectrum=false)=0
 Apply Jones matrix to a sky component (and adjoint) More...
 
virtual SkyComponentapplySquare (SkyComponent &in, SkyComponent &out, const VisBuffer &vb, casacore::Int row, casacore::Bool fullspectrum=false)=0
 
virtual casacore::Bool changed (const VisBuffer &vb, casacore::Int row)=0
 Has this operator changed since the last application? More...
 
virtual casacore::Bool changedBuffer (const VisBuffer &vb, casacore::Int row1, casacore::Int &row2)=0
 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...
 
virtual void reset ()=0
 Reset. More...
 
virtual void assure (const VisBuffer &vb, casacore::Int row)=0
 Assure. More...
 
virtual casacore::Bool change (const VisBuffer &vb)=0
 Does the operator change in this visbuffer or since the last call? I'm not sure this is useful – come back to it m.a.h. More...
 
virtual Type type ()=0
 Return the type of this Jones matrix (actual type of derived class). More...
 
virtual
casacore::ImageInterface
< casacore::Complex > &virtual
SkyComponent &virtual
casacore::Bool 
isSolveable ()=0
 Apply gradient. More...
 
virtual void initializeGradients ()=0
 Initialize for gradient search. More...
 
virtual void finalizeGradients ()=0
 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)=0
 Add to Gradient Chisq. More...
 
virtual casacore::Bool solve (SkyEquation &se)=0
 Solve. More...
 
virtual 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=COMPOSITE)=0
 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...
 
virtual 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=COMPOSITE)=0
 
virtual casacore::String telescope ()=0
 
virtual casacore::Int support (const VisBuffer &vb, const casacore::CoordinateSystem &cs)=0
 
virtual void setThreshold (const casacore::Float t)
 
virtual casacore::Float threshold ()
 

Protected Member Functions

virtual casacore::String typeName ()
 Could be over-ridden if necessary. More...
 

Protected Attributes

casacore::Float threshold_p
 

Detailed Description

Sky Jones: Model sky-plane instrumental effects for the SkyEquation.

Intended use:

Public interface

Prerequisite

Etymology

SkyJones describes an interface for Components to be used in the SkyEquation. It is an Abstract Base Class: most methods must be defined in derived classes.

Synopsis

A SkyJones implements the instrumental effect of some sky-plane based calibration effect. It conceptually applies an image of Jones matrices to an image. For example, it takes an image of the sky brightness and applies the complex primary beam for a given interferometer. Only the interface is defined here in the Abstract Base Class. Actual concrete classes must be derived from SkyJones. Some (most) SkyJones are solvable: the SkyEquation can be used by the SkyJones to return gradients with respect to itself (via the image interface). Thus for a SkyJones to solve for itself, it calls the SkyEquation methods to get gradients of chi-squared with respect to the image pixel values. The SkyJones then uses these gradients as appropriate to update itself.

The following examples illustrate how a SkyJones can be used:

Example

// Low level code example:
casacore::MeasurementSet ms("imagertest/3C273XC1.ms", casacore::Table::Update);
VPSkyJones unsquintedVPSJ(ms);
VPSkyJones squintedVPSJ(ms, true, casacore::Quantity(5.0, "deg"), BeamSquint::GOFIGURE);
unsquintedVPSJ.reset();
squintedVPSJ.reset();
casacore::PagedImage<casacore::Complex> imageOut; // in reality, this ouwld need more construction with coords and shapes
VisSet vs(ms,bi,chanSelection,interval);
casacore::Int row = 0;
VisIter &vi = vs.iter();
VisBuffer vb(vi);
for (vi.originChunks();vi.moreChunks();vi.nextChunk()) {
cout << "This is integration: " << nChunks++ << endl;
for (vi.origin();vi.more();vi++) {
if (myVPSJ.change(vb)) {
cout << "State has changed: " << endl;
squintedVPSJ.showState(os);
squintedVPSJ.apply(imageIn, imageOut, vb, row);
}
}
}
// High Level Code Example:
// Create an ImageSkyJones from an image on disk
ImageSkyModel ism(casacore::PagedImage<casacore::Float>("3C273XC1.modelImage"));
// Make an FTMachine: here we use a simple Grid and FT.
GridFT ft;
SkyEquation se(ism, vs, ft);
// Make a Primary Beam Sky Model
VPSkyJones pbsj(ms);
// Add it to the SkyEquation
se.setSkyJones(pbsj);
// Predict the visibility set
se.predict();
// Read some other data
VisSet othervs("3c84.MS.Otherdata");
// Make a Clean Image and write it out
HogbomCleanImageSkyJones csm(ism);
if (csm.solve(othervs)) {
casacore::PagedImage<casacore::Float> cleanImage=csm.image(0);
cleanImage.setName("3c84.cleanImage");
}

Motivation

The properties of sky-plane based calibration effects must be described for the SkyEquation

To Do

Definition at line 172 of file SkyJones.h.

Member Enumeration Documentation

Enumerator
COMPOSITE 
POWEROF2 
ANY 

Definition at line 178 of file SkyJones.h.

Allowed types of VisJones matrices.

Enumerator
E 
T 
F 
D 

Definition at line 176 of file SkyJones.h.

Constructor & Destructor Documentation

casa::SkyJones::SkyJones ( )
virtual casa::SkyJones::~SkyJones ( )
virtual

Destructor.

Member Function Documentation

virtual void casa::SkyJones::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 
)
pure virtual

Add to Gradient Chisq.

Implemented in casa::BeamSkyJones.

virtual casacore::ImageInterface<casacore::Complex>& casa::SkyJones::apply ( const casacore::ImageInterface< casacore::Complex > &  in,
casacore::ImageInterface< casacore::Complex > &  out,
const VisBuffer vb,
casacore::Int  row,
casacore::Bool  forward = true 
)
pure virtual

Apply Jones matrix to an image (and adjoint)

Implemented in casa::BeamSkyJones.

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

Implemented in casa::BeamSkyJones.

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

Apply Jones matrix to a sky component (and adjoint)

Implemented in casa::BeamSkyJones.

virtual casacore::ImageInterface<casacore::Float>& casa::SkyJones::applySquare ( const casacore::ImageInterface< casacore::Float > &  in,
casacore::ImageInterface< casacore::Float > &  out,
const VisBuffer vb,
casacore::Int  row 
)
pure virtual

Implemented in casa::BeamSkyJones.

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

Implemented in casa::BeamSkyJones.

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

Assure.

Implemented in casa::BeamSkyJones.

virtual casacore::Bool casa::SkyJones::change ( const VisBuffer vb)
pure virtual

Does the operator change in this visbuffer or since the last call? I'm not sure this is useful – come back to it m.a.h.

Dec 30 1999

Implemented in casa::BeamSkyJones.

virtual casacore::Bool casa::SkyJones::changed ( const VisBuffer vb,
casacore::Int  row 
)
pure virtual

Has this operator changed since the last application?

Implemented in casa::BeamSkyJones.

virtual casacore::Bool casa::SkyJones::changedBuffer ( const VisBuffer vb,
casacore::Int  row1,
casacore::Int row2 
)
pure 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.

Implemented in casa::BeamSkyJones.

virtual casacore::ImageRegion* casa::SkyJones::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 = COMPOSITE 
)
pure 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 the 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 SizeType: COMPOSITE = next larger composite number, POWEROF2 = next larger power of 2, ANY = just take what we get!

Potential problem: this casacore::ImageRegion includes all casacore::Stokes and Frequency Channels present in the input image.

Implemented in casa::BeamSkyJones.

virtual casacore::ImageRegion* casa::SkyJones::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 = COMPOSITE 
)
pure virtual

Implemented in casa::BeamSkyJones.

virtual void casa::SkyJones::finalizeGradients ( )
pure virtual

Finalize for gradient search.

Implemented in casa::BeamSkyJones.

virtual void casa::SkyJones::initializeGradients ( )
pure virtual

Initialize for gradient search.

Implemented in casa::BeamSkyJones.

virtual casacore::ImageInterface<casacore::Complex>& virtual SkyComponent& virtual casacore::Bool casa::SkyJones::isSolveable ( )
pure virtual

Apply gradient.

Is this solveable?

Implemented in casa::BeamSkyJones, casa::VPSkyJones, and casa::DBeamSkyJones.

virtual void casa::SkyJones::reset ( )
pure virtual

Reset.

Implemented in casa::BeamSkyJones.

virtual void casa::SkyJones::setThreshold ( const casacore::Float  t)
inlinevirtual

Definition at line 289 of file SkyJones.h.

References threshold_p.

virtual casacore::Bool casa::SkyJones::solve ( SkyEquation se)
pure virtual

Solve.

Implemented in casa::BeamSkyJones.

virtual casacore::Int casa::SkyJones::support ( const VisBuffer vb,
const casacore::CoordinateSystem cs 
)
pure virtual

Implemented in casa::BeamSkyJones.

virtual casacore::String casa::SkyJones::telescope ( )
pure virtual

Implemented in casa::BeamSkyJones.

virtual casacore::Float casa::SkyJones::threshold ( )
inlinevirtual

Definition at line 290 of file SkyJones.h.

References threshold_p.

virtual Type casa::SkyJones::type ( )
pure virtual

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

Implemented in casa::BeamSkyJones, casa::VPSkyJones, and casa::DBeamSkyJones.

Referenced by typeName().

virtual casacore::String casa::SkyJones::typeName ( )
inlineprotectedvirtual

Could be over-ridden if necessary.

Definition at line 296 of file SkyJones.h.

References D, E, F, T, and type().

Member Data Documentation

casacore::Float casa::SkyJones::threshold_p
protected

Definition at line 308 of file SkyJones.h.

Referenced by setThreshold(), and threshold().


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