VisCal.h

Go to the documentation of this file.
00001 //# VisCal.h: Definitions of interface for VisCal 
00002 //# Copyright (C) 1996,1997,2000,2001,2002,2003
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be adressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id: VisCal.h,v 1.10 2006/02/06 19:23:11 gmoellen Exp $
00028 
00029 #ifndef SYNTHESIS_VISCAL_H
00030 #define SYNTHESIS_VISCAL_H
00031 
00032 #include <casa/aips.h>
00033 #include <casa/Containers/Record.h>
00034 #include <casa/BasicSL/Complex.h>
00035 #include <casa/BasicSL/Constants.h>
00036 #include <synthesis/MeasurementComponents/Mueller.h>
00037 #include <synthesis/MeasurementComponents/Jones.h>
00038 #include <synthesis/CalTables/VisCalEnum.h>
00039 #include <synthesis/MeasurementComponents/VisVector.h>
00040 #include <msvis/MSVis/VisSet.h>
00041 #include <msvis/MSVis/VisBuffer2.h>
00042 
00043 #include <msvis/MSVis/VisBuffGroupAcc.h>
00044 
00045 namespace casa { //# NAMESPACE CASA - BEGIN
00046 
00047 class MSMetaInfoForCal;
00048 
00049 // **********************************************************
00050 //  VisCal
00051 //
00052 
00053 class VisCal {
00054 
00055   friend class SolvableVisJones;
00056 
00057 public:
00058  
00059   // Allowed types of VisCal matrices - 'correct' order
00060   //  enum Type{UVMOD,Mf,M,K,B,G,D,C,E,P,T,EP,F};
00061   enum Type{Test=0,ANoise,M,KAntPos,K,B,G,J,D,X,C,P,E,T,F,A,ALL};
00062 
00063   // Enumeration of parameter types (Complex, Real, or Both)
00064   enum ParType{Co,Re,CoRe};
00065 
00066   static String nameOfType(Type type) {
00067     switch (type) {
00068     case ANoise: return "ANoise";
00069     case M: return "M";
00070     case K: return "K";
00071     case B: return "B";
00072     case J: return "J";
00073     case D: return "D";
00074     case X: return "X";
00075     case C: return "C";
00076     case P: return "P";
00077     case E: return "E";
00078     case T: return "T";
00079     case F: return "F";
00080     case A: return "A";
00081     default: return "0";
00082     }
00083   }
00084 
00085   VisCal(VisSet& vs);
00086   
00087   VisCal(String msname,Int MSnAnt,Int MSnSpw);
00088 
00089   VisCal(const MSMetaInfoForCal& msmc);
00090   
00091   VisCal(const Int& nAnt);
00092   
00093   virtual ~VisCal();
00094 
00095   // Return the type of this calibration matrix (actual type of derived class).
00096   //    (Must be implemented in specializations!)
00097   virtual Type type()=0;
00098 
00099   // Return type name as string
00100   virtual String typeName()     { return "Unknown VisCal"; };
00101   virtual String longTypeName() { return "Unknown VisCal"; };
00102 
00103   // Return Matrix type
00104   virtual VisCalEnum::MatrixType matrixType() { return VisCalEnum::GLOBAL; };
00105 
00106   // Return the parameter type (nominally complex)
00107   virtual VisCalEnum::VCParType parType() { return VisCalEnum::COMPLEX; };
00108 
00109   // Number of pars per ant/bln
00110   //    (Must be implemented in specializations!)
00111   virtual Int nPar()=0;
00112 
00113   // Report calibration availability per spw
00114   //  (always True for non-tabular?)
00115   virtual Vector<Bool> spwOK() { return Vector<Bool>(nSpw(),True); };
00116   virtual Bool spwOK(Int) { return True; };
00117 
00118   // Frequency-dependent Parameters?  Nominally not.
00119   virtual Bool freqDepPar() { return False; };
00120 
00121   // Number of par channels in current spw
00122   inline const Int& nChanPar() const { return nChanPar_[currSpw_]; };
00123   
00124   // Frequency-dependent Matrices?  Nominally same as freqDepPar.
00125   virtual Bool freqDepMat() { return freqDepPar(); };
00126 
00127   // Freq-dep Weight scaling?  // almost always false
00128   virtual Bool freqDepCalWt() { return False; };
00129 
00130   // Matrices time-dependent per parameter set (nominally no)
00131   virtual Bool timeDepMat() { return False; };
00132 
00133   // Is this calibration matrix to be applied?
00134   inline Bool isApplied() {return applied_;};
00135 
00136   // Is this solveable? (never via this interface)
00137   virtual Bool isSolvable() {return False;};
00138 
00139   // Return the time interval over which this calibration is constant
00140   inline virtual Double& interval() {return interval_;}
00141 
00142   // Set the application parameters
00143   virtual void setApply();
00144   virtual void setApply(const Record& apply);
00145   virtual void setCallib(const Record& callib,const MeasurementSet& selms);
00146 
00147   // Apply info/params, suitable for logging
00148   virtual String applyinfo();
00149 
00150   // simulation params - for a VC, sim is apply; for a SVC this will get 
00151   // overriden
00152   inline virtual String siminfo() { return applyinfo(); };
00153 
00154   // Trigger calibration of weights
00155   inline Bool& calWt() { return calWt_; };
00156 
00157   // Apply calibration to data in VisBuffer (correct Data or corrupt Model)
00158   //  (in-place versions)
00159   virtual void correct(VisBuffer& vb, Bool trial=False);
00160   virtual void correct2(vi::VisBuffer2& vb, Bool trial=False, Bool doWtSp=False);
00161   virtual void corrupt(VisBuffer& vb);
00162   virtual void corrupt2(vi::VisBuffer2& vb);
00163 
00164   // Apply calibration to data in VisBuffer; 
00165   //  (alternate output versions)
00166   virtual void correct(VisBuffer& vb, Cube<Complex>& Vout,Bool trial=False);
00167   virtual void corrupt(VisBuffer& vb, Cube<Complex>& Mout);
00168   virtual void corrupt2(vi::VisBuffer2& vb, Cube<Complex>& Mout);
00169 
00170   // Flag counting
00171   virtual void initCalFlagCount();
00172   virtual Record actionRec();
00173 
00174   // Report the state
00175   virtual void state();
00176 
00177   virtual void currMetaNote();
00178 
00179   // Set the print level
00180   inline void setPrtlev(const Int& prtlev) { prtlev_=prtlev; };
00181 
00182   // Baseline index from antenna indices: (assumes a1<=a2 !!)
00183   inline Int blnidx(const Int& a1, 
00184                     const Int& a2) { return  a1*nAnt() - a1*(a1+1)/2 + a2; };
00185 
00186   inline String& extraTag() { return extratag_; };
00187 
00188  
00189   // VI2-related refactor--------------------------------------
00190 
00191   // Set "current" meta info, so internals can be registered
00192   virtual void setMeta(Int obs, Int scan, Double time,
00193                        Int spw, const Vector<Double>& freq,
00194                        Int fld);
00195 
00196   // Reshape solvePar* arrays for the currSpw()  
00197   //  (sensitive to freqDepPar())
00198   virtual void sizeApplyParCurrSpw(Int nVisChan);
00199 
00200   // Set parameters to def values in the currSpw(), 
00201   //   and optionally sync everything
00202   virtual void setDefApplyParCurrSpw(Bool sync=False, Bool doInv=False);
00203 
00204 
00205 protected:
00206 
00207   // Set applied state flag
00208   inline void setApplied(const Bool& flag) {applied_=flag;};
00209 
00210   inline String& msName() { return msName_; };
00211 
00212   // General Shape Info 
00213   inline Int& nSpw() { return nSpw_; };
00214   inline Int& nAnt() { return nAnt_; };
00215   inline Int& nBln() { return nBln_; };
00216 
00217   // The number of sets of parameters under consideration
00218   virtual Int& nElem()=0;
00219 
00220   // Number of Calibration matrices on ant/bln axis
00221   virtual Int nCalMat()=0;
00222 
00223   // Current in-focus spw
00224   inline Int& currSpw() { return currSpw_; };
00225 
00226   // Current coords
00227   inline Double& lastTime()                { return lastTime_(currSpw()); };
00228   inline Double& currTime()                { return currTime_(currSpw()); };
00229   inline Int&    currScan()                { return currScan_(currSpw()); };
00230   inline Int&    currObs()                 { return currObs_(currSpw()); };
00231   inline Int&    currField()               { return currField_(currSpw()); };
00232   inline Vector<Double>& currFreq()        { return currFreq_; };
00233 
00234   inline Double& refTime()                 { return refTime_; };
00235   inline Double& refFreq()                 { return refFreq_; };
00236 
00237   // Current spectral shapes
00238   inline Int& nChanPar()              { return nChanPar_[currSpw_]; };
00239   inline Int& nChanMat()              { return nChanMat_[currSpw_]; };
00240   inline Int& startChan()             { return startChan_[currSpw_];};
00241   inline Vector<Int>& nChanParList()  { return nChanPar_; };
00242   inline Vector<Int>& nChanMatList()  { return nChanMat_; };
00243   inline Vector<Int>& startChanList() { return startChan_;};
00244 
00245   // Access to matrix renderings of Visibilities
00246   inline VisVector& V() { return (*V_[currSpw()]); };
00247 
00248   // Access to current solution parameters and matrices
00249   inline virtual Cube<Complex>& currCPar()  {return (*currCPar_[currSpw()]);};
00250   inline virtual Cube<Float>&   currRPar()  {return (*currRPar_[currSpw()]);};
00251   inline virtual Cube<Bool>&    currParOK() {return (*currParOK_[currSpw()]);};
00252 
00253   // Validation of calibration parameters
00254   inline void invalidateP() {PValid_(currSpw())=False;};
00255   inline void validateP()   {PValid_(currSpw())=True;};
00256   inline Bool PValid()      {return PValid_(currSpw());};
00257 
00258   // Invalidate cal matrices generically 
00259   virtual void invalidateCalMat()=0;
00260 
00261   // Access to weight-scaling factors
00262   inline Cube<Float>& currWtScale() { return (*currWtScale_[currSpw()]); };
00263 
00264   // Flag counting
00265   virtual void countInFlag(const VisBuffer& vb);
00266   virtual void countInFlag2(const vi::VisBuffer2& vb);
00267   virtual void countOutFlag(const VisBuffer& vb);
00268   virtual void countOutFlag2(const vi::VisBuffer2& vb);
00269 
00270   // Row-by-row apply to a Cube<Complex> (generic)
00271   virtual void applyCal(VisBuffer& vb, Cube<Complex>& Vout,Bool trial=False)=0;
00272   virtual void applyCal2(vi::VisBuffer2& vb, 
00273                          Cube<Complex>& Vout,Cube<Float>& Wout,
00274                          Bool trial=False)=0;
00275 
00276   // Synchronize "gains" with a VisBuffer or another VisCal
00277   virtual void syncCal(const VisBuffer& vb,
00278                        const Bool& doInv=False);
00279   virtual void syncCal2(const vi::VisBuffer2& vb,
00280                        const Bool& doInv=False);
00281   virtual void syncCal(VisCal& vc);
00282 
00283   // Set internal meta data from a VisBuffer or another VisCal
00284   virtual void syncMeta(const VisBuffer& vb);
00285   virtual void syncMeta2(const vi::VisBuffer2& vb);
00286   void syncMeta(VisCal& vc);
00287 
00288   void syncMeta(const Int& spw,
00289                 const Double& time,
00290                 const Int& field,
00291                 const Vector<Double>& freq,
00292                 const Int& nchan);
00293 
00294   // Set the calibration matrix channelization
00295   void setCalChannelization(const Int& nChanDat);
00296 
00297   // Test for need of new calibration
00298   void checkCurrCal();
00299 
00300   // Synchronize "gains" with current meta-data
00301   virtual void syncCal(const Bool& doInv=False);
00302 
00303   // Sync parameters for current meta data
00304   virtual void syncPar();
00305 
00306   // Calculate Mueller parameters by some means 
00307   virtual void calcPar();
00308 
00309   // Sync matrices generically for current meta data 
00310   virtual void syncCalMat(const Bool& doInv=False)=0;
00311 
00312   // Return print (cout) level
00313   inline Int& prtlev() { return prtlev_; };
00314 
00315   // set current field index vector to given field id
00316   void setCurrField(const Int& ifld);
00317 
00318   // Access to the MSMetaInfoForCal (throws if none)
00319   const MSMetaInfoForCal& msmc() const { if (msmc_) return *msmc_; else throw(AipsError("VisCal::msmc(): No MSMetaInfoForCal object!")); };
00320 
00321 private:
00322 
00323   // Defalt ctor is private
00324   VisCal();
00325 
00326   // Initialize pointers, etc.
00327   void initVisCal();
00328 
00329   // Delete pointers
00330   void deleteVisCal();
00331 
00332   // Associated MS name
00333   String msName_;
00334 
00335   // The MSMetaInfoForCal pointer
00336   const MSMetaInfoForCal* msmc_;
00337   const Bool delmsmc_;  // must delete _only_ if locally formed
00338 
00339   // Number of Spectral windows
00340   Int nSpw_;
00341 
00342   // Number of antennas
00343   Int nAnt_;
00344 
00345   // Number of baselines
00346   Int nBln_;
00347 
00348   // Current synchronized spw
00349   Int currSpw_;
00350 
00351   // Current indices
00352   Vector<Double> currTime_;
00353   Vector<Int> currScan_;
00354   Vector<Int> currObs_;
00355   Vector<Int> currField_;
00356   Vector<Double> currFreq_;
00357   Vector<Double> lastTime_;
00358   Double refTime_;
00359   Double refFreq_;
00360 
00361   // Channel counts
00362   Vector<Int> nChanPar_, nChanMat_;
00363   Vector<Int> startChan_;
00364 
00365   // Solution timescale (context-dependent)
00366   Double interval_;
00367 
00368   // Application flag
00369   Bool applied_;
00370 
00371   // In-focus channel for single-chan solves on multi-chan data
00372   Int focusChan_;
00373 
00374   // VisVector wrapper (per Spw)
00375   PtrBlock<VisVector*> V_;
00376 
00377   // Current parameters
00378   PtrBlock<Cube<Complex>*>  currCPar_;   // [nSpw](nPar,nChanPar,nElm)
00379   PtrBlock<Cube<Float>*>    currRPar_;   // [nSpw](nPar,nChanPar,nElm)
00380   PtrBlock<Cube<Bool>*>     currParOK_;  // [nSpw](nPar,nChanPar,nElm)
00381 
00382   // Paremeter validity
00383   Vector<Bool> PValid_;
00384 
00385   // Trigger calibration of weights
00386   Bool calWt_;
00387 
00388   // Weight scale factors
00389   PtrBlock<Cube<Float>*> currWtScale_;  // [nSpw](nPar,nChan,nElm)
00390 
00391   // Flag counting
00392   Int64 ndataIn_, nflagIn_, nflagOut_;
00393 
00394   // Print level
00395   Int prtlev_;
00396 
00397   String extratag_;  // e.g. to tag as noise scale
00398 
00399 
00400 };
00401 
00402 
00403 // **********************************************************
00404 //  VisMueller
00405 //
00406 
00407 class VisMueller : virtual public VisCal {
00408 
00409 public:
00410 
00411   // Constructor
00412   VisMueller(VisSet& vs);
00413 
00414   VisMueller(String msname,Int MSnAnt,Int MSnSpw);
00415 
00416   VisMueller(const MSMetaInfoForCal& msmc);
00417 
00418   VisMueller(const Int& nAnt);
00419 
00420   virtual ~VisMueller();
00421 
00422   // Return Matrix type
00423   virtual VisCalEnum::MatrixType matrixType() { return VisCalEnum::MUELLER; };
00424 
00425   // Mueller matrix type (must be implemented in Mueller specializations!)
00426   virtual Mueller::MuellerType muellerType()=0;  
00427 
00428   // Report the state
00429   virtual void state();
00430 
00431 protected:
00432 
00433   // Total number of parameter sets required
00434   virtual Int& nElem() { return nBln(); };
00435 
00436   // Number of Cal Matrices to form on baseline axis
00437   //  (Mueller, apply context: nBln())
00438   virtual Int nCalMat() { return nBln(); };
00439 
00440   // Are the parameters the matrix elements? 
00441   //   (or is a non-trivial calculation required?)
00442   //    (Must be implemented in specializations!)
00443   virtual Bool trivialMuellerElem()=0;
00444 
00445   // Are we applying via Mueller multiplication?
00446   //   (necessarily True for native Muellers)
00447   virtual Bool applyByMueller() { return True; };
00448 
00449   // Access to matrix renderings of Muellers
00450   inline Mueller& M()   { return (*M_[currSpw()]); };
00451 
00452   // Access to current matrices
00453   inline Cube<Complex>& currMElem()   {return (*currMElem_[currSpw()]);};
00454   inline Cube<Bool>&    currMElemOK() {return (*currMElemOK_[currSpw()]);};
00455 
00456   // Invalidate cal matrices generically (at this level, just Mueller)
00457   inline virtual void invalidateCalMat() { invalidateM(); };
00458 
00459   // Validation of Mueller matrices (for currSpw)
00460   inline void invalidateM() {MValid_(currSpw())=False;};
00461   inline void validateM()   {MValid_(currSpw())=True;};
00462   inline Bool MValid()      {return MValid_(currSpw());};
00463 
00464   // Row-by-row apply to a Cube<Complex> (applyByMueller override)
00465   virtual void applyCal(VisBuffer& vb, Cube<Complex>& Vout,Bool trial=False);
00466   virtual void applyCal2(vi::VisBuffer2& vb, 
00467                          Cube<Complex>& Vout,Cube<Float>& Wout,
00468                          Bool trial=False);
00469   //  { throw(AipsError("VisMueller::applyCal2 NYI!!!!!!!!!!!!!")); };
00470 
00471   // Sync matrices for current meta data (Mueller override)
00472   virtual void syncCalMat(const Bool& doInv=False);
00473 
00474   // Sync Mueller matrix elements for current parameters
00475   virtual void syncMueller(const Bool& doInv=False);
00476 
00477   // Calculate an ensemble of Mueller matrices (all baselines, channels)
00478   virtual void calcAllMueller();
00479 
00480   // Calculate a single Mueller matrix by some means
00481   virtual void calcOneMueller(Vector<Complex>& mat, Vector<Bool>& mOk,
00482                               const Vector<Complex>& par, const Vector<Bool>& pOk);
00483 
00484   // Invert Mueller matrices
00485   virtual void invMueller();
00486 
00487   // Set matrix elements according to their ok flags
00488   //  (e.g., makes a unit matrix if everything flagged,
00489   //   so we don't have to make atomic ok checks in apply)
00490   virtual void setMatByOk();
00491 
00492   // Create Mueller matrix algebra interface
00493   void createMueller();
00494  
00495   // Synchronize weight scale factors
00496   virtual void syncWtScale();
00497 
00498   // Perform weight scale calculation (specializable)
00499   virtual void calcWtScale();
00500 
00501   // Update the wt vector for a baseline
00502   virtual void updateWt(Vector<Float>& wt,const Int& a1,const Int& a2);
00503 
00504 
00505 private:
00506 
00507   // Default ctor is private
00508   VisMueller();
00509 
00510   // Init VisMueller pointers, etc.
00511   void initVisMueller();
00512 
00513   // Delete the this* caches
00514   void deleteVisMueller();
00515 
00516   // Mueller algebra wrapper (per Spw)
00517   PtrBlock<Mueller*> M_;                
00518 
00519   // Current Mueller matrix elements
00520   PtrBlock<Cube<Complex>*> currMElem_;    // [nSpw]([1,2,4,16],nChanMat,nBln)
00521   PtrBlock<Cube<Bool>*>    currMElemOK_;  // [nSpw]([1,2,4,16],nChanMat,nBln)
00522 
00523   // Mueller validity
00524   Vector<Bool> MValid_;
00525 
00526 };
00527 
00528 
00529 // **********************************************************
00530 //  VisJones
00531 //
00532 
00533 class VisJones : virtual public VisMueller {
00534 
00535   friend class SolvableVisJones;
00536 
00537 public:
00538 
00539   // Constructor
00540   VisJones(VisSet& vs);
00541 
00542   VisJones(String msname,Int MSnAnt,Int MSnSpw);
00543 
00544   VisJones(const MSMetaInfoForCal& msmc);
00545 
00546   VisJones(const Int& nAnt);
00547 
00548   virtual ~VisJones();
00549 
00550   // Return Matrix type
00551   virtual VisCalEnum::MatrixType matrixType() { return VisCalEnum::JONES; };
00552 
00553   // What kind of Mueller matrices should we use?  
00554   //   (A function of the jonesType and target data shape)
00555   virtual Mueller::MuellerType muellerType();
00556 
00557   // What kind of Jones matrix are we?  
00558   //    (Must be implemented in specializations!)
00559   virtual Jones::JonesType jonesType()=0; 
00560 
00561   // Report the state
00562   virtual void state();
00563 
00564 protected:
00565 
00566   // Number of parameter sets is number of antennas
00567   inline virtual Int& nElem() { return nAnt(); };
00568 
00569   // Number of Cal Matrices to form on antenna axis
00570   //  (Jones, apply context: nAnt())
00571   virtual Int nCalMat() { return nAnt(); };
00572 
00573   // Jones matrices can never be trivial Muellers!
00574   virtual Bool trivialMuellerElem() { return False; };
00575 
00576   // Are the parameters the Jones matrix elements?
00577   //   (or is a non-trivial calculation required?)
00578   //    (Must be implemented in specializations!)
00579   virtual Bool trivialJonesElem()=0;
00580 
00581   // Are we applying via Mueller or Jones multiplication?
00582   //   (probably by Jones for native Jones?)
00583   virtual Bool applyByMueller() { return False; };
00584   virtual Bool applyByJones()   { return True; };
00585 
00586   // Access to matrix renderings of Jones matrices
00587   inline Jones& J1() { return *J1_[currSpw()]; };
00588   inline Jones& J2() { return *J2_[currSpw()]; };
00589 
00590   // Access to Jones matrix element array
00591   inline Cube<Complex>& currJElem() {return (*currJElem_[currSpw()]);};
00592   inline Cube<Bool>& currJElemOK()  {return (*currJElemOK_[currSpw()]);};
00593 
00594   // Invalidate cal matrices generically (at this level, both Mueller and Jones)
00595   inline virtual void invalidateCalMat() { invalidateM(); invalidateJ(); };
00596 
00597   // Validation of Jones matrices
00598   inline void invalidateJ() {JValid_(currSpw())=False;};
00599   inline void validateJ()   {JValid_(currSpw())=True;};
00600   inline Bool JValid()      {return JValid_(currSpw());};
00601 
00602   // Row-by-row apply to a Cube<Complex> (applyByJones override)
00603   virtual void applyCal(VisBuffer& vb, Cube<Complex>& Vout,Bool trial=False);
00604   virtual void applyCal2(vi::VisBuffer2& vb, 
00605                          Cube<Complex>& Vout,Cube<Float>& Wout,
00606                          Bool trial=False);
00607 
00608   // Sync matrices for current meta data (VisJones override)
00609   virtual void syncCalMat(const Bool& doInv=False);
00610 
00611   // Calculate an ensemble of Mueller matrices (all baselines, channels)
00612   //  (only meaningful if applyByMueller()=T)
00613   virtual void calcAllMueller();
00614 
00615   // Synchronize current Jones matrices
00616   virtual void syncJones(const Bool& doInv=False);
00617 
00618   // Calculate an ensemble of Jones matrices (all antennas, channels)
00619   virtual void calcAllJones();
00620 
00621   // Calculate a single Jones matrix by some means from parameters
00622   virtual void calcOneJones(Vector<Complex>& mat, Vector<Bool>& mOk, 
00623                             const Vector<Complex>& par, const Vector<Bool>& pOk );
00624 
00625   // Invert Jones matrices
00626   virtual void invJones();
00627 
00628   // Set matrix elements according to their ok flags
00629   //  (e.g., makes a unit matrix if everything flagged,
00630   //   so we don't have to make atomic ok checks in apply)
00631   virtual void setMatByOk();
00632 
00633   // Create Jones interface
00634   void createJones();
00635 
00636   // Synchronize weight scale factors
00637   virtual void syncWtScale();
00638 
00639   // Perform weight scale calculation (specializable)
00640   virtual void calcWtScale();
00641 
00642   // Update the wt vector for a baseline
00643   virtual void updateWt(Vector<Float>& wt,const Int& a1,const Int& a2);
00644   virtual void updateWt2(Matrix<Float>& wt,const Int& a1,const Int& a2);
00645 
00646 private:
00647 
00648   // Default ctor is private
00649   VisJones();
00650 
00651   // Init VisJones pointers
00652   void initVisJones();
00653 
00654   // Delete the this* caches
00655   void deleteVisJones();
00656 
00657   // Jones algebra wrapper (per Spw)
00658   PtrBlock<Jones*> J1_;
00659   PtrBlock<Jones*> J2_;
00660 
00661   // Current Jones matrix-element arrays
00662   PtrBlock<Cube<Complex>*> currJElem_;    // [nSpw](nJElem,nChanMat,nAnt)
00663   PtrBlock<Cube<Bool>*>    currJElemOK_;  // [nSpw](nJElem,nChanMat,nAnt)
00664 
00665   // Jones validity, per spw
00666   Vector<Bool> JValid_;
00667 
00668 
00669 };
00670 
00671 } //# NAMESPACE CASA - END
00672 
00673 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1