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

#include <SkyEquation.h>

Inheritance diagram for casa::SkyEquation:
casa::CubeSkyEquation

List of all members.

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, ROVisibilityIterator &vi, FTMachine &ft, ComponentFTMachine &cft, Bool noModelCol)
 SkyEquation with ROVisIter.
 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< ImageInterface< 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, MS::PredefinedColumns Type=MS::MODEL_DATA)
 Predict model coherence for the SkyModel.
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)
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 getCoverageImage (Int model, ImageInterface< Float > &im)
 assign the flux scale that the ftmachines have if they have
virtual void doFlatNoise (Bool doFlat=False)
 Set this to true if the residual image for mosaic is to be in pb^2 units (optimum mode for clean search for centimetric imaging)
virtual void getWeightImage (const Int, ImageInterface< Float > &)
 get the weight image from the ftmachines
virtual Bool isNewFTM ()

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.
 SkyEquation ()
Bool ok ()
 Check for validity.
virtual void initializeGet (const VisBuffer &vb, Int row, Int model, Bool incremental)
 Apply Sky Jones to an image, also adjoint operation.
virtual VisBufferget (VisBuffer &vb, Int model, Bool incremental, MS::PredefinedColumns Type=MS::MODEL_DATA)
virtual void finalizeGet ()
virtual void initializePut (const VisBuffer &vb, Int model)
virtual void put (const VisBuffer &vb, Int model, Bool dopsf=False, FTMachine::Type col=FTMachine::OBSERVED)
virtual void finalizePut (const VisBuffer &vb, Int Model)
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 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 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)
SkyComponentapplySkyJones (SkyComponent &corruptedComponent, const VisBuffer &vb, Int row)
 Do the sum of the gets for all the models for this visbuffer.
virtual void fixImageScale ()
 Modify the ggS and Create the imageScale.
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)
virtual void checkVisIterNumRows (ROVisibilityIterator &vi)
 Check the VisIter chunck size...force a more reasonable chunk if default is too small.
virtual void predictComponents (Bool &incremental, Bool &initialized, MS::PredefinedColumns Type=MS::MODEL_DATA)
 virtual void predictComponents(Bool& incremental, Bool& initialized);
LogSinklogSink ()

Protected Attributes

SkyModelsm_
 SkyModel.
VisSetvs_
 VisSet.
VisibilityIteratorwvi_p
 Visibilityiterators.
ROVisibilityIteratorrvi_p
FTMachineft_
 FTMachine objects.
FTMachineift_
ComponentFTMachinecft_
SkyJonesej_
 List of terms in left to right order.
SkyJonesdj_
SkyJonestj_
SkyJonesfj_
Float chisq
 Workspace.
Float sumwt
Float ggSMax_p
LogSink logSink_p
 
   

Int iDebug_p
VisBufferAutoPtr 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.
Bool doflat_p

Detailed Description

Definition at line 134 of file SkyEquation.h.


Constructor & Destructor Documentation

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.

SkyEquation with ROVisIter.

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.

Copy constructor.

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

Definition at line 259 of file SkyEquation.h.


Member Function Documentation

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

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

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::assertSkyJones ( const VisBuffer vb,
Int  row 
) [protected, virtual]

Return the name of the underlying MeasurementSet.

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::changedSkyJones ( const VisBuffer vb,
Int  row 
) [protected, virtual]

Have the SkyJones changed since their last application?

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::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 void casa::SkyEquation::checkVisIterNumRows ( ROVisibilityIterator vi) [protected, virtual]

Check the VisIter chunck size...force a more reasonable chunk if default is too small.

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

Definition at line 177 of file SkyEquation.h.

References cft_.

virtual void casa::SkyEquation::doFlatNoise ( Bool  doFlat = False) [inline, virtual]

Set this to true if the residual image for mosaic is to be in pb^2 units (optimum mode for clean search for centimetric imaging)

Definition at line 239 of file SkyEquation.h.

References doflat_p.

virtual void casa::SkyEquation::finalizeGet ( ) [protected, virtual]
virtual void casa::SkyEquation::finalizePut ( const VisBuffer vb,
Int  Model 
) [protected, virtual]
virtual void casa::SkyEquation::finalizePutConvolve ( 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::fixImageScale ( ) [protected, virtual]

Modify the ggS and Create the imageScale.

Reimplemented in casa::CubeSkyEquation.

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

Definition at line 171 of file SkyEquation.h.

References ft_.

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 VisBuffer& casa::SkyEquation::get ( VisBuffer vb,
Int  model,
Bool  incremental,
MS::PredefinedColumns  Type = MS::MODEL_DATA 
) [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 void casa::SkyEquation::getCoverageImage ( Int  model,
ImageInterface< Float > &  im 
) [virtual]

assign the flux scale that the ftmachines have if they have

Reimplemented in casa::CubeSkyEquation.

virtual void casa::SkyEquation::getWeightImage ( const Int  ,
ImageInterface< Float > &   
) [inline, virtual]

get the weight image from the ftmachines

Reimplemented in casa::CubeSkyEquation.

Definition at line 242 of file SkyEquation.h.

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]

Reimplemented in casa::CubeSkyEquation.

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

Definition at line 174 of file SkyEquation.h.

References ift_.

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::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::initializePut ( const VisBuffer vb,
Int  model 
) [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::initializePutXFR ( const VisBuffer vb,
Int  model,
Int  numXFR 
) [protected, virtual]

Puts for calculating the complex XFRs.

virtual Bool casa::SkyEquation::isNewFTM ( ) [inline, virtual]

Reimplemented in casa::CubeSkyEquation.

Definition at line 244 of file SkyEquation.h.

References casa::False.

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

Lock and unlock the underlying MeasurementSet.

LogSink& casa::SkyEquation::logSink ( ) [inline, protected]

Definition at line 396 of file SkyEquation.h.

References logSink_p.

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< ImageInterface< Float > * > &  PSFs) [virtual]

make all the approx psfs in one go

Reimplemented in casa::CubeSkyEquation.

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

Make complex XFRs needed for incrementGradientChiSquared.

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

Check for validity.

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

Assignment operator.

virtual void casa::SkyEquation::predict ( Bool  incremental = False,
MS::PredefinedColumns  Type = MS::MODEL_DATA 
) [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 predict(Bool incremental=False);

Reimplemented in casa::CubeSkyEquation.

virtual void casa::SkyEquation::predictComponents ( Bool incremental,
Bool initialized,
MS::PredefinedColumns  Type = MS::MODEL_DATA 
) [protected, virtual]

virtual void predictComponents(Bool& incremental, Bool& initialized);

virtual void casa::SkyEquation::put ( const VisBuffer vb,
Int  model,
Bool  dopsf = False,
FTMachine::Type  col = FTMachine::OBSERVED 
) [protected, virtual]
virtual void casa::SkyEquation::putConvolve ( const VisBuffer vb,
Int  model,
Int numXFR 
) [protected, virtual]
virtual void casa::SkyEquation::putXFR ( const VisBuffer vb,
Int  model,
Int numXFR 
) [protected, virtual]
virtual void casa::SkyEquation::resetSkyJones ( ) [protected, virtual]
virtual void casa::SkyEquation::scaleDeltaImage ( Int  model = 0) [protected, virtual]
virtual void casa::SkyEquation::scaleImage ( Int  model,
Bool  incremental 
) [protected, virtual]

Deal with scaling or unscaling image or deltaImage.

virtual void casa::SkyEquation::scaleImage ( Int  model = 0) [protected, virtual]
void casa::SkyEquation::setImagePlaneWeighting ( const String type,
const Float  minPB,
const Float  constPB 
) [inline]

Set image plane weighting.

Definition at line 223 of file SkyEquation.h.

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

Add Jones matrices to be used for Gain calculations.

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

Return the SkyModel used by this SkyEquation.

Definition at line 165 of file SkyEquation.h.

References sm_.

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

Solve for variables.

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

virtual void casa::SkyEquation::unlock ( ) [virtual]
virtual void casa::SkyEquation::unScaleDeltaImage ( Int  model = 0) [protected, virtual]
virtual void casa::SkyEquation::unScaleImage ( Int  model,
Bool  incremental 
) [protected, virtual]
virtual void casa::SkyEquation::unScaleImage ( Int  model = 0) [protected, virtual]

Return the VisSet used by this SkyEquation.

Definition at line 168 of file SkyEquation.h.

References vs_.


Member Data Documentation

Definition at line 378 of file SkyEquation.h.

Referenced by componentFTMachine().

Workspace.

Definition at line 391 of file SkyEquation.h.

Definition at line 408 of file SkyEquation.h.

Referenced by setImagePlaneWeighting().

Definition at line 384 of file SkyEquation.h.

Definition at line 421 of file SkyEquation.h.

Referenced by doFlatNoise().

List of terms in left to right order.

Definition at line 383 of file SkyEquation.h.

Definition at line 386 of file SkyEquation.h.

FTMachine objects.

Definition at line 376 of file SkyEquation.h.

Referenced by fTMachine().

Definition at line 392 of file SkyEquation.h.

Definition at line 396 of file SkyEquation.h.

Definition at line 377 of file SkyEquation.h.

Referenced by iFTMachine().

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.

Definition at line 420 of file SkyEquation.h.

Definition at line 411 of file SkyEquation.h.

   

Definition at line 395 of file SkyEquation.h.

Referenced by logSink().

Definition at line 407 of file SkyEquation.h.

Referenced by setImagePlaneWeighting().

Definition at line 415 of file SkyEquation.h.

Definition at line 413 of file SkyEquation.h.

Definition at line 371 of file SkyEquation.h.

Definition at line 409 of file SkyEquation.h.

Referenced by setImagePlaneWeighting().

SkyModel.

Definition at line 365 of file SkyEquation.h.

Referenced by skyModel().

Definition at line 391 of file SkyEquation.h.

Definition at line 385 of file SkyEquation.h.

Previous VisBuffer, used to determine how to apply SkyJones; Set in initializePut and initializePutXFR, Used in finalizePut and finalizePutXFR.

Definition at line 405 of file SkyEquation.h.

VisSet.

Definition at line 368 of file SkyEquation.h.

Referenced by visSet().

Visibilityiterators.

Definition at line 370 of file SkyEquation.h.


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