casa::SkyEquation Class Reference

#include <SkyEquation.h>

Inheritance diagram for casa::SkyEquation:

Inheritance graph
[legend]
Collaboration diagram for casa::SkyEquation:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 132 of file SkyEquation.h.

Public Member Functions

 SkyEquation (SkyModel &sm, VisSet &vs, FTMachine &ft)
 Define a SkyEquation linking a VisSet vs with a SkyModel sm using an FTMachine ft for transforms in both directions.
 SkyEquation (SkyModel &sm, VisSet &vs, FTMachine &ft, ComponentFTMachine &cft, Bool noModelcol=False)
 Define a SkyEquation linking a VisSet vs with a SkyModel sm using an FTMachine ft for transforms in both directions and a ComponentFTMachine for the component lists.
 SkyEquation (SkyModel &sm, VisSet &vs, FTMachine &ft, FTMachine &ift)
 Define a SkyEquation linking a VisSet vs with a SkyModel sm using an FTMachine ft for Sky->Vis and ift for Vis->Sky.
 SkyEquation (SkyModel &sm, VisSet &vs, FTMachine &ft, FTMachine &ift, ComponentFTMachine &cft)
 Define a SkyEquation linking a VisSet vs with a SkyModel sm using an FTMachine ft for Sky->Vis and ift for Vis->Sky and a ComponentFTMachine for the component lists Default make use of MODEL_DATA Column of ms.
SkyModelskyModel ()
 Return the SkyModel used by this SkyEquation.
VisSetvisSet ()
 Return the VisSet used by this SkyEquation.
FTMachinefTMachine ()
 Return the (Sky->Vis) FTMachine used by this SkyEquation.
FTMachineiFTMachine ()
 Return the (Vis->Sky) FTMachine used by this SkyEquation.
ComponentFTMachinecomponentFTMachine ()
 Return the (Sky->Vis) ComponentFTMachine used by this SkyEquation.
virtual ~SkyEquation ()
 Destructor.
SkyEquationoperator= (const SkyEquation &other)
 Assignment operator.
 SkyEquation (const SkyEquation &other)
 Copy constructor.
void setSkyJones (SkyJones &j)
 Add Jones matrices to be used for Gain calculations.
virtual void makeApproxPSF (Int model, ImageInterface< Float > &PSF)
 Make an approximate PSF for each model.
virtual void makeApproxPSF (PtrBlock< TempImage< Float > * > &PSFs)
 make all the approx psfs in one go
virtual void makeComplexXFRs ()
 Make complex XFRs needed for incrementGradientChiSquared.
virtual void predict (Bool incremental=False)
 Predict model coherence for the SkyModel.
void setImagePlaneWeighting (const String &type, const Float minPB, const Float constPB)
 Set image plane weighting.
virtual void lock ()
 Lock and unlock the underlying MeasurementSet.
virtual void unlock ()
virtual String associatedMSName ()
 Return the name of the underlying MeasurementSet.
virtual void gradientsChiSquared (const Matrix< Bool > &required, SkyJones &sj)
 Find sum of weights, Chi-squared, and the first and second derivatives by transforming to the measurements.
virtual void gradientsChiSquared (Bool incremental, Bool commitToMS=False)
virtual Bool solveSkyModel ()
 Solve for variables.
virtual Bool solveSkyJones (SkyJones &sj)

Protected Member Functions

virtual void incrementGradientsChiSquared ()
 Increment gradientsChiSquared.
virtual void fullGradientsChiSquared (Bool incremental=False)
 Do the full calculation - this must be called if the FTMachine cannot be represented by a Fourier transform.
virtual void fullGradientsChiSquared (Bool incremental, Bool useCorrectedData)
 SkyEquation ()
Bool ok ()
 Check for validity.
virtual Bool changedSkyJonesBuffer (const VisBuffer &vb, Int row1, Int &row2)
 Do the Sky Jones change in this Visbuffer, starting from row1? Returns row2, the last row with the same skyJones.
virtual void resetSkyJones ()
virtual void assertSkyJones (const VisBuffer &vb, Int row)
virtual ImageInterface< Complex > & applySkyJones (const VisBuffer &vb, Int row, ImageInterface< Float > &in, ImageInterface< Complex > &out)
virtual void applySkyJonesInv (const VisBuffer &vb, Int row, ImageInterface< Complex > &in, ImageInterface< Float > &work, ImageInterface< Float > &out)
virtual void applySkyJonesSquare (const VisBuffer &vb, Int row, Matrix< Float > &weights, ImageInterface< Float > &work, ImageInterface< Float > &ggS)
virtual void fixImageScale ()
 Modify the ggS and Create the imageScale.
virtual void checkVisIterNumRows (ROVisibilityIterator &vi)
 Check the VisIter chunck size.
virtual void predictComponents (Bool &incremental, Bool &initialized)
LogSinklogSink ()
virtual void initializeGet (const VisBuffer &vb, Int row, Int model, Bool incremental)
 Apply Sky Jones to an image, also adjoint operation.
virtual void initializeGet (const VisBuffer &vb, Int row, Int model, Array< Complex > &griddedVis, Vector< Double > &uvscale, UVWMachine *&uvwMachine, Bool incremental)
virtual VisBufferget (VisBuffer &vb, Int model, Bool incremental)
virtual void finalizeGet ()
virtual void initializePut (const VisBuffer &vb, Int model)
virtual void initializePut (const VisBuffer &vb, Int model, Vector< Double > &uvscale, UVWMachine *&uvwMachine)
virtual void put (const VisBuffer &vb, Int model, Bool dopsf=False, FTMachine::Type col=FTMachine::OBSERVED)
virtual void put (const VisBuffer &vb, Int model, Vector< Double > &scale, UVWMachine *uvwMachine, Bool dopsf=False)
virtual void finalizePut (const VisBuffer &vb, Int Model)
virtual void finalizePut (const VisBuffer &vb, Int Model, Bool &isCopy)
virtual void changedSkyJonesLogic (const VisBuffer &vb, Bool &firstOneChanges, Bool &internalChanges)
 This encapsulates all of the change logic we should have to deal with (short of returning a range of rows that has the same SkyJones).
virtual Bool changedSkyJones (const VisBuffer &vb, Int row)
 Have the SkyJones changed since their last application?
virtual Bool changedFTMachine (const VisBuffer &vb)
 Has the FTMachine changed since last application?
virtual Bool changedIFTMachine (const VisBuffer &vb)
virtual void initializePutXFR (const VisBuffer &vb, Int model, Int numXFR)
 Puts for calculating the complex XFRs.
virtual void putXFR (const VisBuffer &vb, Int model, Int &numXFR)
virtual void finalizePutXFR (const VisBuffer &vb, Int Model, Int numXFR)
virtual void initializePutConvolve (const VisBuffer &vb, Int model, Int numXFR)
 Puts for calculating the complex convolutions.
virtual void putConvolve (const VisBuffer &vb, Int model, Int &numXFR)
virtual void finalizePutConvolve (const VisBuffer &vb, Int Model, Int numXFR)
virtual VisBufferget (VisBuffer &vb, const SkyComponent &component)
 Get, etc.
virtual VisBufferget (VisBuffer &vb, const ComponentList &components)
virtual Bool get (VisBuffer &vb, PtrBlock< Array< Complex > * > &griddedVis, Cube< Complex > &modelVis, Block< Vector< Double > > &uvscale, PtrBlock< UVWMachine * > &uvwMachines, Bool &incremental)
 Do the sum of the gets for all the models for this visbuffer.
SkyComponentapplySkyJones (SkyComponent &corruptedComponent, const VisBuffer &vb, Int row)
virtual void scaleImage (Int model, Bool incremental)
 Deal with scaling or unscaling image or deltaImage.
virtual void unScaleImage (Int model, Bool incremental)
virtual void scaleImage (Int model=0)
virtual void unScaleImage (Int model=0)
virtual void scaleDeltaImage (Int model=0)
virtual void unScaleDeltaImage (Int model=0)

Protected Attributes

SkyModelsm_
 SkyModel.
VisSetvs_
 VisSet.
LogSink logSink_p
Int iDebug_p
VisBuffer vb_p
 Previous VisBuffer, used to determine how to apply SkyJones; Set in initializePut and initializePutXFR, Used in finalizePut and finalizePutXFR.
Float minPB_p
Float constPB_p
String scaleType_p
Bool isPSFWork_p
Bool noModelCol_p
Vector< BoolmodelIsEmpty_p
Bool isBeginingOfSkyJonesCache_p
 SkyJones::changed returns a True the first time its called We have to ignore this at the very begining and first call to 'changed' and not call finalizePut.
FTMachineft_
 FTMachine objects.
FTMachineift_
ComponentFTMachinecft_
SkyJonesej_
 List of terms in left to right order.
SkyJonesdj_
SkyJonestj_
SkyJonesfj_
Float chisq
 Workspace.
Float sumwt
Matrix< FloatsggS


Constructor & Destructor Documentation

casa::SkyEquation::SkyEquation ( SkyModel sm,
VisSet vs,
FTMachine ft 
)

Define a SkyEquation linking a VisSet vs with a SkyModel sm using an FTMachine ft for transforms in both directions.

casa::SkyEquation::SkyEquation ( SkyModel sm,
VisSet vs,
FTMachine ft,
ComponentFTMachine cft,
Bool  noModelcol = False 
)

Define a SkyEquation linking a VisSet vs with a SkyModel sm using an FTMachine ft for transforms in both directions and a ComponentFTMachine for the component lists.

casa::SkyEquation::SkyEquation ( SkyModel sm,
VisSet vs,
FTMachine ft,
FTMachine ift 
)

Define a SkyEquation linking a VisSet vs with a SkyModel sm using an FTMachine ft for Sky->Vis and ift for Vis->Sky.

casa::SkyEquation::SkyEquation ( SkyModel sm,
VisSet vs,
FTMachine ft,
FTMachine ift,
ComponentFTMachine cft 
)

Define a SkyEquation linking a VisSet vs with a SkyModel sm using an FTMachine ft for Sky->Vis and ift for Vis->Sky and a ComponentFTMachine for the component lists Default make use of MODEL_DATA Column of ms.

virtual casa::SkyEquation::~SkyEquation (  )  [virtual]

Destructor.

casa::SkyEquation::SkyEquation ( const SkyEquation other  ) 

Copy constructor.

casa::SkyEquation::SkyEquation (  )  [inline, protected]

Definition at line 242 of file SkyEquation.h.


Member Function Documentation

SkyModel& casa::SkyEquation::skyModel (  )  [inline]

Return the SkyModel used by this SkyEquation.

Definition at line 158 of file SkyEquation.h.

References sm_.

VisSet& casa::SkyEquation::visSet (  )  [inline]

Return the VisSet used by this SkyEquation.

Definition at line 161 of file SkyEquation.h.

References vs_.

FTMachine& casa::SkyEquation::fTMachine (  )  [inline]

Return the (Sky->Vis) FTMachine used by this SkyEquation.

Definition at line 164 of file SkyEquation.h.

References ft_.

FTMachine& casa::SkyEquation::iFTMachine (  )  [inline]

Return the (Vis->Sky) FTMachine used by this SkyEquation.

Definition at line 167 of file SkyEquation.h.

References ift_.

ComponentFTMachine& casa::SkyEquation::componentFTMachine (  )  [inline]

Return the (Sky->Vis) ComponentFTMachine used by this SkyEquation.

Definition at line 170 of file SkyEquation.h.

References cft_.

SkyEquation& casa::SkyEquation::operator= ( const SkyEquation other  ) 

Assignment operator.

void casa::SkyEquation::setSkyJones ( SkyJones j  ) 

Add Jones matrices to be used for Gain calculations.

Each SkyJones knows what type it is and therefore where to slot in.

virtual void casa::SkyEquation::makeApproxPSF ( Int  model,
ImageInterface< Float > &  PSF 
) [virtual]

Make an approximate PSF for each model.

The PSF is approximate in the sense that it is a shift-invariant approximation

virtual void casa::SkyEquation::makeApproxPSF ( PtrBlock< TempImage< Float > * > &  PSFs  )  [virtual]

make all the approx psfs in one go

virtual void casa::SkyEquation::makeComplexXFRs (  )  [virtual]

Make complex XFRs needed for incrementGradientChiSquared.

virtual void casa::SkyEquation::predict ( Bool  incremental = False  )  [virtual]

Predict model coherence for the SkyModel.

If this is incremental then the model visibilities are not reset but are simply added to

virtual void casa::SkyEquation::gradientsChiSquared ( const Matrix< Bool > &  required,
SkyJones sj 
) [virtual]

Find sum of weights, Chi-squared, and the first and second derivatives by transforming to the measurements.

virtual void casa::SkyEquation::gradientsChiSquared ( Bool  incremental,
Bool  commitToMS = False 
) [virtual]

virtual Bool casa::SkyEquation::solveSkyModel (  )  [virtual]

Solve for variables.

Both the SkyModel and the SkyJones can in principle be solved for.

virtual Bool casa::SkyEquation::solveSkyJones ( SkyJones sj  )  [virtual]

void casa::SkyEquation::setImagePlaneWeighting ( const String type,
const Float  minPB,
const Float  constPB 
) [inline]

Set image plane weighting.

Definition at line 215 of file SkyEquation.h.

References constPB_p, minPB_p, scaleType_p, and casa::type().

virtual void casa::SkyEquation::lock (  )  [virtual]

Lock and unlock the underlying MeasurementSet.

virtual void casa::SkyEquation::unlock (  )  [virtual]

virtual String casa::SkyEquation::associatedMSName (  )  [virtual]

Return the name of the underlying MeasurementSet.

virtual void casa::SkyEquation::incrementGradientsChiSquared (  )  [protected, virtual]

Increment gradientsChiSquared.

The image of SkyModel must contain the increment to the image. For each model, a collection of complex transfer functions are used to avoid gridding and degridding all the visibilities.

virtual void casa::SkyEquation::fullGradientsChiSquared ( Bool  incremental = False  )  [protected, virtual]

Do the full calculation - this must be called if the FTMachine cannot be represented by a Fourier transform.

virtual void casa::SkyEquation::fullGradientsChiSquared ( Bool  incremental,
Bool  useCorrectedData 
) [protected, virtual]

Bool casa::SkyEquation::ok (  )  [protected]

Check for validity.

virtual void casa::SkyEquation::initializeGet ( const VisBuffer vb,
Int  row,
Int  model,
Bool  incremental 
) [protected, virtual]

Apply Sky Jones to an image, also adjoint operation.

virtual void casa::SkyEquation::initializeGet ( const VisBuffer vb,
Int  row,
Int  model,
Array< Complex > &  griddedVis,
Vector< Double > &  uvscale,
UVWMachine *&  uvwMachine,
Bool  incremental 
) [protected, virtual]

virtual VisBuffer& casa::SkyEquation::get ( VisBuffer vb,
Int  model,
Bool  incremental 
) [protected, virtual]

virtual void casa::SkyEquation::finalizeGet (  )  [protected, virtual]

virtual void casa::SkyEquation::initializePut ( const VisBuffer vb,
Int  model 
) [protected, virtual]

virtual void casa::SkyEquation::initializePut ( const VisBuffer vb,
Int  model,
Vector< Double > &  uvscale,
UVWMachine *&  uvwMachine 
) [protected, virtual]

virtual void casa::SkyEquation::put ( const VisBuffer vb,
Int  model,
Bool  dopsf = False,
FTMachine::Type  col = FTMachine::OBSERVED 
) [protected, virtual]

virtual void casa::SkyEquation::put ( const VisBuffer vb,
Int  model,
Vector< Double > &  scale,
UVWMachine uvwMachine,
Bool  dopsf = False 
) [protected, virtual]

virtual void casa::SkyEquation::finalizePut ( const VisBuffer vb,
Int  Model 
) [protected, virtual]

virtual void casa::SkyEquation::finalizePut ( const VisBuffer vb,
Int  Model,
Bool isCopy 
) [protected, virtual]

virtual void casa::SkyEquation::changedSkyJonesLogic ( const VisBuffer vb,
Bool firstOneChanges,
Bool internalChanges 
) [protected, virtual]

This encapsulates all of the change logic we should have to deal with (short of returning a range of rows that has the same SkyJones).

First we look to see if the first row of the VB requires a new SkyJones; then we determine if there are internal SkyJones changes in the VB which require going row by row in the get/put formalism.

virtual Bool casa::SkyEquation::changedSkyJones ( const VisBuffer vb,
Int  row 
) [protected, virtual]

Have the SkyJones changed since their last application?

virtual Bool casa::SkyEquation::changedFTMachine ( const VisBuffer vb  )  [protected, virtual]

Has the FTMachine changed since last application?

virtual Bool casa::SkyEquation::changedIFTMachine ( const VisBuffer vb  )  [protected, virtual]

virtual Bool casa::SkyEquation::changedSkyJonesBuffer ( const VisBuffer vb,
Int  row1,
Int row2 
) [protected, virtual]

Do the Sky Jones change in this Visbuffer, starting from row1? Returns row2, the last row with the same skyJones.

virtual void casa::SkyEquation::resetSkyJones (  )  [protected, virtual]

virtual void casa::SkyEquation::assertSkyJones ( const VisBuffer vb,
Int  row 
) [protected, virtual]

virtual ImageInterface<Complex>& casa::SkyEquation::applySkyJones ( const VisBuffer vb,
Int  row,
ImageInterface< Float > &  in,
ImageInterface< Complex > &  out 
) [protected, virtual]

virtual void casa::SkyEquation::applySkyJonesInv ( const VisBuffer vb,
Int  row,
ImageInterface< Complex > &  in,
ImageInterface< Float > &  work,
ImageInterface< Float > &  out 
) [protected, virtual]

virtual void casa::SkyEquation::applySkyJonesSquare ( const VisBuffer vb,
Int  row,
Matrix< Float > &  weights,
ImageInterface< Float > &  work,
ImageInterface< Float > &  ggS 
) [protected, virtual]

virtual void casa::SkyEquation::initializePutXFR ( const VisBuffer vb,
Int  model,
Int  numXFR 
) [protected, virtual]

Puts for calculating the complex XFRs.

virtual void casa::SkyEquation::putXFR ( const VisBuffer vb,
Int  model,
Int numXFR 
) [protected, virtual]

virtual void casa::SkyEquation::finalizePutXFR ( const VisBuffer vb,
Int  Model,
Int  numXFR 
) [protected, virtual]

virtual void casa::SkyEquation::initializePutConvolve ( const VisBuffer vb,
Int  model,
Int  numXFR 
) [protected, virtual]

Puts for calculating the complex convolutions.

virtual void casa::SkyEquation::putConvolve ( const VisBuffer vb,
Int  model,
Int numXFR 
) [protected, virtual]

virtual void casa::SkyEquation::finalizePutConvolve ( const VisBuffer vb,
Int  Model,
Int  numXFR 
) [protected, virtual]

virtual VisBuffer& casa::SkyEquation::get ( VisBuffer vb,
const SkyComponent component 
) [protected, virtual]

Get, etc.

for a SkyComponent is much simpler

virtual VisBuffer& casa::SkyEquation::get ( VisBuffer vb,
const ComponentList components 
) [protected, virtual]

virtual Bool casa::SkyEquation::get ( VisBuffer vb,
PtrBlock< Array< Complex > * > &  griddedVis,
Cube< Complex > &  modelVis,
Block< Vector< Double > > &  uvscale,
PtrBlock< UVWMachine * > &  uvwMachines,
Bool incremental 
) [protected, virtual]

Do the sum of the gets for all the models for this visbuffer.