Sky Jones: Model sky-plane instrumental effects for the SkyEquation. More...
#include <SkyJones.h>
Public Member Functions | |
SkyJones () | |
Allowed types of VisJones matrices we should use the namespace casa ones enum Type{E,T,F,D};. | |
virtual | ~SkyJones () |
Destructor. | |
virtual ImageInterface< Complex > & | apply (const ImageInterface< Complex > &in, ImageInterface< Complex > &out, const vi::VisBuffer2 &vb, Int row, Bool forward=True)=0 |
Apply Jones matrix to an image (and adjoint). | |
virtual ImageInterface< Float > & | apply (const ImageInterface< Float > &in, ImageInterface< Float > &out, const vi::VisBuffer2 &vb, Int row)=0 |
virtual ImageInterface< Float > & | applySquare (const ImageInterface< Float > &in, ImageInterface< Float > &out, const vi::VisBuffer2 &vb, Int row)=0 |
virtual SkyComponent & | apply (SkyComponent &in, SkyComponent &out, const vi::VisBuffer2 &vb, Int row, Bool forward=True)=0 |
Apply Jones matrix to a sky component (and adjoint). | |
virtual SkyComponent & | applySquare (SkyComponent &in, SkyComponent &out, const vi::VisBuffer2 &vb, Int row)=0 |
virtual Bool | changed (const vi::VisBuffer2 &vb, Int row)=0 |
Has this operator changed since the last application? | |
virtual Bool | changedBuffer (const vi::VisBuffer2 &vb, Int row1, 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. | |
virtual void | reset ()=0 |
Reset. | |
virtual void | assure (const vi::VisBuffer2 &vb, Int row)=0 |
Assure. | |
virtual Bool | change (const vi::VisBuffer2 &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. | |
virtual ::casa::SkyJones::Type | type ()=0 |
Return the type of this Jones matrix (actual type of derived class). | |
virtual ImageInterface< Complex > & | applyGradient (ImageInterface< Complex > &result, const vi::VisBuffer2 &vb, Int row)=0 |
Apply gradient. | |
virtual SkyComponent & | applyGradient (SkyComponent &result, const vi::VisBuffer2 &vb, Int row)=0 |
virtual Bool | isSolveable ()=0 |
Is this solveable? | |
virtual void | initializeGradients ()=0 |
Initialize for gradient search. | |
virtual void | finalizeGradients ()=0 |
Finalize for gradient search. | |
virtual void | addGradients (const vi::VisBuffer2 &vb, Int row, const Float sumwt, const Float chisq, const Matrix< Complex > &c, const Matrix< Float > &f)=0 |
Add to Gradient Chisq. | |
virtual ImageRegion * | extent (const ImageInterface< Complex > &im, const vi::VisBuffer2 &vb, const Int irow=-1, const Float fPad=1.2, const Int iChan=0, const casa::SkyJones::SizeType sizeType=casa::SkyJones::COMPOSITE)=0 |
Solve virtual Bool solve (SkyEquation& se) = 0;. | |
virtual ImageRegion * | extent (const ImageInterface< Float > &im, const vi::VisBuffer2 &vb, const Int irow=-1, const Float fPad=1.2, const Int iChan=0, const casa::SkyJones::SizeType sizeType=casa::SkyJones::COMPOSITE)=0 |
virtual String | telescope ()=0 |
virtual Int | support (const vi::VisBuffer2 &vb, const CoordinateSystem &cs)=0 |
virtual void | setThreshold (const Float t) |
virtual Float | threshold () |
Protected Member Functions | |
virtual String | typeName () |
Could be over-ridden if necessary. | |
Protected Attributes | |
Float | threshold_p |
Sky Jones: Model sky-plane instrumental effects for the SkyEquation.
Public interface
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.
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:
// Low level code example: MeasurementSet ms("imagertest/3C273XC1.ms", Table::Update); VPSkyJones unsquintedVPSJ(ms); VPSkyJones squintedVPSJ(ms, True, Quantity(5.0, "deg"), BeamSquint::GOFIGURE); unsquintedVPSJ.reset(); squintedVPSJ.reset(); PagedImage<Complex> imageIn; PagedImage<Complex> imageOut; // in reality, this ouwld need more construction with coords and shapes VisSet vs(ms,bi,chanSelection,interval); 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(PagedImage<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)) { PagedImage<Float> cleanImage=csm.image(0); cleanImage.setName("3c84.cleanImage"); }
The properties of sky-plane based calibration effects must be described for the SkyEquation
Definition at line 170 of file SkyJones.h.
casa::refim::SkyJones::SkyJones | ( | ) |
virtual casa::refim::SkyJones::~SkyJones | ( | ) | [virtual] |
Destructor.
virtual void casa::refim::SkyJones::addGradients | ( | const vi::VisBuffer2 & | vb, | |
Int | row, | |||
const Float | sumwt, | |||
const Float | chisq, | |||
const Matrix< Complex > & | c, | |||
const Matrix< Float > & | f | |||
) | [pure virtual] |
Add to Gradient Chisq.
Implemented in casa::refim::BeamSkyJones.
virtual SkyComponent& casa::refim::SkyJones::apply | ( | SkyComponent & | in, | |
SkyComponent & | out, | |||
const vi::VisBuffer2 & | vb, | |||
Int | row, | |||
Bool | forward = True | |||
) | [pure virtual] |
Apply Jones matrix to a sky component (and adjoint).
Implemented in casa::refim::BeamSkyJones.
virtual ImageInterface<Float>& casa::refim::SkyJones::apply | ( | const ImageInterface< Float > & | in, | |
ImageInterface< Float > & | out, | |||
const vi::VisBuffer2 & | vb, | |||
Int | row | |||
) | [pure virtual] |
Implemented in casa::refim::BeamSkyJones.
virtual ImageInterface<Complex>& casa::refim::SkyJones::apply | ( | const ImageInterface< Complex > & | in, | |
ImageInterface< Complex > & | out, | |||
const vi::VisBuffer2 & | vb, | |||
Int | row, | |||
Bool | forward = True | |||
) | [pure virtual] |
Apply Jones matrix to an image (and adjoint).
Implemented in casa::refim::BeamSkyJones.
virtual SkyComponent& casa::refim::SkyJones::applyGradient | ( | SkyComponent & | result, | |
const vi::VisBuffer2 & | vb, | |||
Int | row | |||
) | [pure virtual] |
Implemented in casa::refim::BeamSkyJones.
virtual ImageInterface<Complex>& casa::refim::SkyJones::applyGradient | ( | ImageInterface< Complex > & | result, | |
const vi::VisBuffer2 & | vb, | |||
Int | row | |||
) | [pure virtual] |
Apply gradient.
Implemented in casa::refim::BeamSkyJones.
virtual SkyComponent& casa::refim::SkyJones::applySquare | ( | SkyComponent & | in, | |
SkyComponent & | out, | |||
const vi::VisBuffer2 & | vb, | |||
Int | row | |||
) | [pure virtual] |
Implemented in casa::refim::BeamSkyJones.
virtual ImageInterface<Float>& casa::refim::SkyJones::applySquare | ( | const ImageInterface< Float > & | in, | |
ImageInterface< Float > & | out, | |||
const vi::VisBuffer2 & | vb, | |||
Int | row | |||
) | [pure virtual] |
Implemented in casa::refim::BeamSkyJones.
virtual void casa::refim::SkyJones::assure | ( | const vi::VisBuffer2 & | vb, | |
Int | row | |||
) | [pure virtual] |
Assure.
Implemented in casa::refim::BeamSkyJones.
virtual Bool casa::refim::SkyJones::change | ( | const vi::VisBuffer2 & | 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::refim::BeamSkyJones.
virtual Bool casa::refim::SkyJones::changed | ( | const vi::VisBuffer2 & | vb, | |
Int | row | |||
) | [pure virtual] |
Has this operator changed since the last application?
Implemented in casa::refim::BeamSkyJones.
virtual Bool casa::refim::SkyJones::changedBuffer | ( | const vi::VisBuffer2 & | vb, | |
Int | row1, | |||
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::refim::BeamSkyJones.
virtual ImageRegion* casa::refim::SkyJones::extent | ( | const ImageInterface< Float > & | im, | |
const vi::VisBuffer2 & | vb, | |||
const Int | irow = -1 , |
|||
const Float | fPad = 1.2 , |
|||
const Int | iChan = 0 , |
|||
const casa::SkyJones::SizeType | sizeType = casa::SkyJones::COMPOSITE | |||
) | [pure virtual] |
Implemented in casa::refim::BeamSkyJones.
virtual ImageRegion* casa::refim::SkyJones::extent | ( | const ImageInterface< Complex > & | im, | |
const vi::VisBuffer2 & | vb, | |||
const Int | irow = -1 , |
|||
const Float | fPad = 1.2 , |
|||
const Int | iChan = 0 , |
|||
const casa::SkyJones::SizeType | sizeType = casa::SkyJones::COMPOSITE | |||
) | [pure virtual] |
Solve virtual Bool solve (SkyEquation& se) = 0;.
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 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 ImageRegion includes all Stokes and Frequency Channels present in the input image. COMMENTING out for now as this depend on PBMathInterface and which depends back on SkyJones::sizeType
Implemented in casa::refim::BeamSkyJones.
virtual void casa::refim::SkyJones::finalizeGradients | ( | ) | [pure virtual] |
Finalize for gradient search.
Implemented in casa::refim::BeamSkyJones.
virtual void casa::refim::SkyJones::initializeGradients | ( | ) | [pure virtual] |
Initialize for gradient search.
Implemented in casa::refim::BeamSkyJones.
virtual Bool casa::refim::SkyJones::isSolveable | ( | ) | [pure virtual] |
Is this solveable?
Implemented in casa::refim::BeamSkyJones, and casa::refim::VPSkyJones.
virtual void casa::refim::SkyJones::reset | ( | ) | [pure virtual] |
Reset.
Implemented in casa::refim::BeamSkyJones.
virtual void casa::refim::SkyJones::setThreshold | ( | const Float | t | ) | [inline, virtual] |
Definition at line 290 of file SkyJones.h.
References threshold_p.
virtual Int casa::refim::SkyJones::support | ( | const vi::VisBuffer2 & | vb, | |
const CoordinateSystem & | cs | |||
) | [pure virtual] |
virtual String casa::refim::SkyJones::telescope | ( | ) | [pure virtual] |
Implemented in casa::refim::BeamSkyJones.
virtual Float casa::refim::SkyJones::threshold | ( | ) | [inline, virtual] |
Definition at line 291 of file SkyJones.h.
References threshold_p.
virtual ::casa::SkyJones::Type casa::refim::SkyJones::type | ( | ) | [pure virtual] |
Return the type of this Jones matrix (actual type of derived class).
Implemented in casa::refim::BeamSkyJones, and casa::refim::VPSkyJones.
Referenced by typeName().
virtual String casa::refim::SkyJones::typeName | ( | ) | [inline, protected, virtual] |
Float casa::refim::SkyJones::threshold_p [protected] |
Definition at line 309 of file SkyJones.h.
Referenced by setThreshold(), and threshold().