00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef FLAGDATAHANDLER_H_
00024 #define FLAGDATAHANDLER_H_
00025
00026
00027 #include <ms/MeasurementSets/MeasurementSet.h>
00028 #include <ms/MSSel/MSSelection.h>
00029 #include <ms/MeasurementSets/MSAntennaColumns.h>
00030 #include <ms/MeasurementSets/MSFieldColumns.h>
00031 #include <ms/MeasurementSets/MSPolColumns.h>
00032 #include <ms/MeasurementSets/MSSpWindowColumns.h>
00033 #include <ms/MeasurementSets/MSProcessorColumns.h>
00034
00035
00036 #include <msvis/MSVis/StokesVector.h>
00037 #include <msvis/MSVis/VisBuffer2.h>
00038 #include <msvis/MSVis/VisibilityIterator2.h>
00039
00040
00041 #include <msvis/MSVis/AveragingVi2Factory.h>
00042 #include <msvis/MSVis/AveragingTvi2.h>
00043
00044
00045 #include <casa/System/AipsrcValue.h>
00046
00047
00048 #include <casa/Containers/Record.h>
00049
00050
00051 #include <casa/OS/HostInfo.h>
00052 #include <sys/time.h>
00053
00054
00055 #include <algorithm>
00056 #include <map>
00057
00058 #define STARTCLOCK timeval start,stop; double elapsedTime; if (profiling_p) gettimeofday(&start,0);
00059 #define STOPCLOCK if (profiling_p) \
00060 {\
00061 gettimeofday(&stop,0);\
00062 elapsedTime = (stop.tv_sec-start.tv_sec)*1000.0+(stop.tv_usec-start.tv_usec)/1000.0;\
00063 *logger_p << LogIO::DEBUG2 << "FlagDataHandler::" << __FUNCTION__ << " Executed in: " << elapsedTime << " ms, Memory free: " << HostInfo::memoryFree( )/1024.0 << " MB" << LogIO::POST;\
00064 }
00065
00066 namespace casa {
00067
00068
00069 typedef std::map< std::pair<Int,Int>,std::vector<uInt> >::iterator antennaPairMapIterator;
00070 typedef std::map< Double,std::vector<uInt> >::iterator subIntegrationMapIterator;
00071 typedef std::map< uShort,uShort >::iterator polartizationMapIterator;
00072 typedef std::map< std::pair<Int,Int>,std::vector<uInt> > antennaPairMap;
00073 typedef std::map< Double,std::vector<uInt> > subIntegrationMap;
00074 typedef std::map< uShort,uShort > polarizationMap;
00075 typedef std::map< uInt,String > polarizationIndexMap;
00076 typedef std::vector< vector<Double> > antennaPointingMap;
00077 typedef std::map< Int,vector<Double> > scanStartStopMap;
00078 typedef std::map< Int,Double > lambdaMap;
00079
00080 const Complex ImaginaryUnit = Complex(0,1);
00081
00082
00083 template<class T> class CubeView
00084 {
00085
00086 public:
00087
00088 CubeView(Cube<T> *parentCube, std::vector<uInt> *rows = NULL, std::vector<uInt> *channels = NULL, std::vector<uInt> *polarizations = NULL)
00089 {
00090 parentCube_p = parentCube;
00091 IPosition baseCubeShape = parentCube_p->shape();
00092 reducedLength_p = IPosition(3);
00093
00094 if (((polarizations != NULL) and (polarizations->size() > 0)) and
00095 ((channels != NULL) and (channels->size() > 0)) and
00096 ((rows != NULL) and (rows->size() > 0)))
00097 {
00098 access_p = &CubeView::accessMapped;
00099 }
00100 else if (((polarizations != NULL) and (polarizations->size() > 0)) and
00101 ((channels != NULL) and (channels->size() > 0)))
00102 {
00103 access_p = &CubeView::accessIndex12Mapped;
00104 }
00105 else if (((polarizations != NULL) and (polarizations->size() > 0)) and
00106 ((rows != NULL) and (rows->size() > 0)))
00107 {
00108 access_p = &CubeView::accessIndex13Mapped;
00109 }
00110 else if (((channels != NULL) and (channels->size() > 0)) and
00111 ((rows != NULL) and (rows->size() > 0)))
00112 {
00113 access_p = &CubeView::accessIndex23Mapped;
00114 }
00115 else if ((polarizations != NULL) and (polarizations->size() > 0))
00116 {
00117 access_p = &CubeView::accessIndex1Mapped;
00118 }
00119 else if ((channels != NULL) and (channels->size() > 0))
00120 {
00121 access_p = &CubeView::accessIndex2Mapped;
00122 }
00123 else if ((rows != NULL) and (rows->size() > 0))
00124 {
00125 access_p = &CubeView::accessIndex3Mapped;
00126 }
00127 else
00128 {
00129 access_p = &CubeView::accessUnmapped;
00130 }
00131
00132 if ((polarizations != NULL) and (polarizations->size() > 0))
00133 {
00134 polarizations_p = polarizations;
00135 reducedLength_p(0) = polarizations_p->size();
00136 }
00137 else
00138 {
00139 polarizations_p = NULL;
00140 reducedLength_p(0) = baseCubeShape(0);
00141 }
00142
00143 if ((channels != NULL) and (channels->size() > 0))
00144 {
00145 channels_p = channels;
00146 reducedLength_p(1) = channels_p->size();
00147 }
00148 else
00149 {
00150 channels_p = NULL;
00151 reducedLength_p(1) = baseCubeShape(1);
00152 }
00153
00154 if ((rows != NULL) and (rows->size() > 0))
00155 {
00156 rows_p = rows;
00157 reducedLength_p(2) = rows_p->size();
00158 }
00159 else
00160 {
00161 rows_p = NULL;
00162 reducedLength_p(2) = baseCubeShape(2);
00163 }
00164 }
00165
00166 T &operator()(uInt i1, uInt i2, uInt i3)
00167 {
00168 return (*this.*access_p)(i1,i2,i3);
00169 }
00170
00171 const IPosition &shape() const
00172 {
00173 return reducedLength_p;
00174 }
00175
00176 void shape(Int &s1, Int &s2, Int &s3) const
00177 {
00178 s1 = reducedLength_p(0);
00179 s2 = reducedLength_p(1);
00180 s3 = reducedLength_p(2);
00181 return;
00182 }
00183
00184 protected:
00185
00186 vector<uInt> *createIndex(uInt size)
00187 {
00188 vector<uInt> *index = new vector<uInt>(size);
00189 index->clear();
00190 for (uInt i=0; i<size; i++ )
00191 {
00192 index->push_back(i);
00193 }
00194 return index;
00195 }
00196
00197 T &accessUnmapped(uInt i1, uInt i2, uInt i3)
00198 {
00199 return parentCube_p->at(i1,i2,i3);
00200 }
00201
00202 T &accessMapped(uInt i1, uInt i2, uInt i3)
00203 {
00204 uInt i1_index = polarizations_p->at(i1);
00205 uInt i2_index = channels_p->at(i2);
00206 uInt i3_index = rows_p->at(i3);
00207 return parentCube_p->at(i1_index,i2_index,i3_index);
00208 }
00209
00210 T &accessIndex1Mapped(uInt i1, uInt i2, uInt i3)
00211 {
00212 uInt i1_index = polarizations_p->at(i1);
00213 return parentCube_p->at(i1_index,i2,i3);
00214 }
00215
00216 T &accessIndex2Mapped(uInt i1, uInt i2, uInt i3)
00217 {
00218 uInt i2_index = channels_p->at(i2);
00219 return parentCube_p->at(i1,i2_index,i3);
00220 }
00221
00222 T &accessIndex3Mapped(uInt i1, uInt i2, uInt i3)
00223 {
00224 uInt i3_index = rows_p->at(i3);
00225 return parentCube_p->at(i1,i2,i3_index);
00226 }
00227
00228 T &accessIndex12Mapped(uInt i1, uInt i2, uInt i3)
00229 {
00230 uInt i1_index = polarizations_p->at(i1);
00231 uInt i2_index = channels_p->at(i2);
00232 return parentCube_p->at(i1_index,i2_index,i3);
00233 }
00234
00235 T &accessIndex13Mapped(uInt i1, uInt i2, uInt i3)
00236 {
00237 uInt i1_index = polarizations_p->at(i1);
00238 uInt i3_index = rows_p->at(i3);
00239 return parentCube_p->at(i1_index,i2,i3_index);
00240 }
00241
00242 T &accessIndex23Mapped(uInt i1, uInt i2, uInt i3)
00243 {
00244 uInt i2_index = channels_p->at(i2);
00245 uInt i3_index = rows_p->at(i3);
00246 return parentCube_p->at(i1,i2_index,i3_index);
00247 }
00248
00249 private:
00250 Cube<T> *parentCube_p;
00251 std::vector<uInt> *rows_p;
00252 std::vector<uInt> *channels_p;
00253 std::vector<uInt> *polarizations_p;
00254 IPosition reducedLength_p;
00255 T &(casa::CubeView<T>::*access_p)(uInt,uInt,uInt);
00256 };
00257
00258 template<class T> class VectorView
00259 {
00260
00261 public:
00262 VectorView(Vector<T> *parentVector, std::vector<uInt> *rows = NULL)
00263 {
00264 IPosition parentVectorShape = parentVector->shape();
00265 parentVector_p = parentVector;
00266 reducedLength_p = IPosition(1);
00267
00268 if ((rows != NULL) and (rows->size() > 0))
00269 {
00270 access_p = &VectorView::accessMapped;
00271 }
00272 else
00273 {
00274 access_p = &VectorView::accessUnmapped;
00275 }
00276
00277 if ((rows != NULL) and (rows->size() > 0))
00278 {
00279 rows_p = rows;
00280 reducedLength_p(0) = rows_p->size();
00281 }
00282 else
00283 {
00284 rows_p = NULL;
00285 reducedLength_p(0) = parentVectorShape(0);
00286 }
00287 }
00288
00289 T &operator()(uInt i1)
00290 {
00291 return (*this.*access_p)(i1);
00292 }
00293
00294 const IPosition &shape() const
00295 {
00296 return reducedLength_p;
00297 }
00298
00299 void shape(Int &s1) const
00300 {
00301 s1 = reducedLength_p(0);
00302 return;
00303 }
00304
00305 protected:
00306
00307 vector<uInt> *createIndex(uInt size)
00308 {
00309 vector<uInt> *index = new vector<uInt>(size);
00310 index->clear();
00311 for (uInt i=0; i<size; i++ )
00312 {
00313 index->push_back(i);
00314 }
00315 return index;
00316 }
00317
00318 T &accessUnmapped(uInt i1)
00319 {
00320 return parentVector_p->operator()(i1);
00321 }
00322
00323 T &accessMapped(uInt i1)
00324 {
00325 uInt i1_index = rows_p->at(i1);
00326 return parentVector_p->operator()(i1_index);
00327 }
00328
00329 private:
00330 Vector<T> *parentVector_p;
00331 std::vector<uInt> *rows_p;
00332 IPosition reducedLength_p;
00333 T &(casa::VectorView<T>::*access_p)(uInt);
00334 };
00335
00336 class VisMapper
00337 {
00338 typedef Complex (casa::VisMapper::*corrProduct)(uInt,uInt);
00339
00340 public:
00341
00342 enum calsolutions {
00343
00344 CALSOL1=Stokes::NumberOfTypes,
00345 CALSOL2,
00346 CALSOL3,
00347 CALSOL4
00348 };
00349
00350 VisMapper(String expression,polarizationMap *polMap,CubeView<Complex> *leftVis,CubeView<Complex> *rightVis=NULL);
00351 VisMapper(String expression,polarizationMap *polMap);
00352 ~VisMapper();
00353
00354 void setParentCubes(CubeView<Complex> *leftVis,CubeView<Complex> *rightVis=NULL);
00355
00356 vector< vector<uInt> > getSelectedCorrelations() { return selectedCorrelations_p;}
00357 vector< string > getSelectedCorrelationStrings() { return selectedCorrelationStrings_p;}
00358
00359 Float operator()(uInt chan, uInt row);
00360 Float operator()(uInt pol, uInt chan, uInt row);
00361
00362
00363 Complex correlationProduct(uInt pol, uInt chan, uInt row);
00364
00365
00366 const IPosition &shape() const
00367 {
00368 return reducedLength_p;
00369 }
00370
00371 void shape(Int &chan, Int &row) const
00372 {
00373 chan = reducedLength_p(0);
00374 row = reducedLength_p(1);
00375 return;
00376 }
00377
00378 void shape(Int &pol, Int &chan, Int &row) const
00379 {
00380 chan = reducedLength_p(0);
00381 row = reducedLength_p(1);
00382 pol = reducedLength_p(2);
00383 return;
00384 }
00385
00386
00387 protected:
00388 void setExpressionMapping(String expression,polarizationMap *polMap);
00389 Float real(Complex val) {return val.real();}
00390 Float imag(Complex val) {return val.imag();}
00391 Float abs(Complex val) {return std::abs(val);}
00392 Float arg(Complex val) {return std::arg(val);}
00393 Float norm(Complex val) {return std::norm(val);}
00394 Complex leftVis(uInt pol, uInt chan, uInt row);
00395 Complex diffVis(uInt pol, uInt chan, uInt row);
00396 Complex stokes_i(uInt pol, uInt chan);
00397 Complex stokes_q(uInt pol, uInt chan);
00398 Complex stokes_u(uInt pol, uInt chan);
00399 Complex stokes_v(uInt pol, uInt chan);
00400 Complex linear_xx(uInt pol, uInt chan);
00401 Complex linear_yy(uInt pol, uInt chan);
00402 Complex linear_xy(uInt pol, uInt chan);
00403 Complex linear_yx(uInt pol, uInt chan);
00404 Complex circular_rr(uInt pol, uInt chan);
00405 Complex circular_ll(uInt pol, uInt chan);
00406 Complex circular_rl(uInt pol, uInt chan);
00407 Complex circular_lr(uInt pol, uInt chan);
00408 Complex stokes_i_from_linear(uInt chan, uInt row);
00409 Complex stokes_q_from_linear(uInt chan, uInt row);
00410 Complex stokes_u_from_linear(uInt chan, uInt row);
00411 Complex stokes_v_from_linear(uInt chan, uInt row);
00412 Complex stokes_i_from_circular(uInt chan, uInt row);
00413 Complex stokes_q_from_circular(uInt chan, uInt row);
00414 Complex stokes_u_from_circular(uInt chan, uInt row);
00415 Complex stokes_v_from_circular(uInt chan, uInt row);
00416 Complex calsol1(uInt chan, uInt row);
00417 Complex calsol2(uInt chan, uInt row);
00418 Complex calsol3(uInt chan, uInt row);
00419 Complex calsol4(uInt chan, uInt row);
00420
00421
00422 private:
00423 Float (casa::VisMapper::*applyVisExpr_p)(Complex);
00424 Complex (casa::VisMapper::*getVis_p)(uInt,uInt,uInt);
00425 Complex (casa::VisMapper::*getCorr_p)(uInt,uInt);
00426 vector<corrProduct> selectedCorrelationProducts_p;
00427 vector< vector<uInt> > selectedCorrelations_p;
00428 vector<string> selectedCorrelationStrings_p;
00429 CubeView<Complex> *leftVis_p;
00430 CubeView<Complex> *rightVis_p;
00431 IPosition reducedLength_p;
00432 polarizationMap *polMap_p;
00433 String expression_p;
00434 };
00435
00436 class FlagMapper
00437 {
00438
00439 public:
00440
00441 FlagMapper(Bool flag, vector < vector<uInt> > selectedCorrelations,
00442 CubeView<Bool> *commonFlagsView,
00443 CubeView<Bool> *originalFlagsView,
00444 CubeView<Bool> *privateFlagsView=NULL,
00445 VectorView<Bool> *commonFlagRowView=NULL,
00446 VectorView<Bool> *originalFlagRowView=NULL,
00447 VectorView<Bool> *privateFlagRowView=NULL);
00448 FlagMapper(Bool flag,vector< vector<uInt> > selectedCorrelations);
00449 ~FlagMapper();
00450
00451 void setParentCubes(CubeView<Bool> *commonFlagsView,CubeView<Bool> *originalFlagsView,CubeView<Bool> *privateFlagsView=NULL);
00452 void setParentFlagRow(VectorView<Bool> *commonFlagRowView,VectorView<Bool> *originalFlagRowView,VectorView<Bool> *privateFlagRowView=NULL);
00453
00454 void applyFlag(uInt chan, uInt row);
00455 void applyFlag(uInt pol, uInt channel, uInt row);
00456 void applyFlagRow(uInt row);
00457 void applyFlagInRow(uInt row);
00458
00459 Bool getOriginalFlags(uInt chan, uInt row);
00460 Bool getModifiedFlags(uInt chan, uInt row);
00461 Bool getPrivateFlags(uInt chan, uInt row);
00462
00463 Bool getOriginalFlags(uInt pol, uInt channel, uInt row);
00464 Bool getModifiedFlags(uInt pol, uInt channel, uInt row);
00465 Bool getPrivateFlags(uInt pol, uInt channel, uInt row);
00466
00467
00468 void setModifiedFlags(uInt pol, uInt channel, uInt row);
00469 void setPrivateFlags(uInt pol, uInt channel, uInt row);
00470
00471 Bool getOriginalFlagRow(uInt row);
00472 Bool getModifiedFlagRow(uInt row);
00473 Bool getPrivateFlagRow(uInt row);
00474
00475 const IPosition &shape() const
00476 {
00477 return reducedLength_p;
00478 }
00479
00480 void shape(Int &chan, Int &row) const
00481 {
00482 chan = reducedLength_p(0);
00483 row = reducedLength_p(1);
00484 return;
00485 }
00486
00487 void shape(Int &pol, Int &chan, Int &row) const
00488 {
00489 chan = reducedLength_p(0);
00490 row = reducedLength_p(1);
00491 pol = reducedLength_p(2);
00492 return;
00493 }
00494
00495 vector< vector<uInt> > getSelectedCorrelations() {return selectedCorrelations_p;}
00496
00497 void activateCheckMode() {applyFlag_p = &FlagMapper::checkCommonFlags;}
00498
00499 uInt nSelectedCorrelations() {return nSelectedCorrelations_p;}
00500 uInt flagsPerRow() {return flagsPerRow_p;}
00501
00502 protected:
00503
00504 void setExpressionMapping(vector< vector<uInt> > selectedCorrelations);
00505
00506
00507 void applyCommonFlags(uInt pol, uInt channel, uInt row);
00508
00509 void applyPrivateFlags(uInt pol, uInt channel, uInt row);
00510
00511 void checkCommonFlags(uInt pol, uInt channel, uInt row);
00512
00513
00514 void applyCommonFlagRow(uInt row);
00515
00516 void applyPrivateFlagRow(uInt row);
00517
00518 private:
00519
00520 Bool flag_p;
00521 IPosition reducedLength_p;
00522 CubeView<Bool> *commonFlagsView_p;
00523 CubeView<Bool> *originalFlagsView_p;
00524 CubeView<Bool> *privateFlagsView_p;
00525 VectorView<Bool> *commonFlagRowView_p;
00526 VectorView<Bool> *originalFlagRowView_p;
00527 VectorView<Bool> *privateFlagRowView_p;
00528 vector< vector<uInt> > selectedCorrelations_p;
00529 uInt nSelectedCorrelations_p;
00530 uInt flagsPerRow_p;
00531 void (casa::FlagMapper::*applyFlag_p)(uInt,uInt,uInt);
00532 void (casa::FlagMapper::*applyFlagRow_p)(uInt);
00533 };
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807 class FlagDataHandler
00808 {
00809
00810 public:
00811
00812 enum iteration {
00813
00814 COMPLETE_SCAN_MAPPED=0,
00815 COMPLETE_SCAN_MAP_SUB_INTEGRATIONS_ONLY,
00816 COMPLETE_SCAN_MAP_ANTENNA_PAIRS_ONLY,
00817 COMPLETE_SCAN_UNMAPPED,
00818 COMBINE_SCANS_MAPPED,
00819 COMBINE_SCANS_MAP_SUB_INTEGRATIONS_ONLY,
00820 COMBINE_SCANS_MAP_ANTENNA_PAIRS_ONLY,
00821 COMBINE_SCANS_UNMAPPED,
00822 ANTENNA_PAIR,
00823 SUB_INTEGRATION,
00824 ARRAY_FIELD
00825 };
00826
00827 enum tableType {
00828
00829 MEASUREMENT_SET=0,
00830 CALIBRATION_TABLE
00831 };
00832
00833
00834
00835 FlagDataHandler(string msname, uShort iterationApproach = SUB_INTEGRATION, Double timeInterval = 0);
00836
00837
00838 virtual ~FlagDataHandler();
00839
00840
00841 virtual bool open() {return false;}
00842 virtual bool close() {return false;}
00843 virtual bool selectData() {return false;}
00844 virtual bool generateIterator() {return false;}
00845 virtual bool nextChunk() {return false;}
00846 virtual bool nextBuffer() {return false;}
00847 virtual bool flushFlags() {return false;}
00848 virtual String getTableName() {return String("none");}
00849 virtual bool parseExpression(MSSelection &) {return true;}
00850 virtual bool checkIfColumnExists(String ) {return true;}
00851 virtual bool summarySignal() {return true;}
00852
00853
00854 void setIterationApproach(uShort iterationApproach);
00855
00856
00857 bool setDataSelection(Record record);
00858
00859
00860 void setTimeInterval(Double timeInterval);
00861
00862
00863 void enableAsyncIO(Bool enable);
00864
00865
00866
00867 void preLoadColumn(VisBufferComponent2 column);
00868 void preFetchColumns();
00869
00870
00871 void stopIteration() {stopIteration_p = true;};
00872
00873
00874 Cube<Bool> * getModifiedFlagCube() {return &modifiedFlagCube_p;}
00875 Cube<Bool> * getOriginalFlagCube() {return &originalFlagCube_p;}
00876 Vector<Bool> * getModifiedFlagRow() {return &modifiedFlagRow_p;}
00877 Vector<Bool> * getOriginalFlagRow() {return &originalFlagRow_p;}
00878
00879
00880 void setMapAntennaPairs(bool activated);
00881 void setMapSubIntegrations(bool activated);
00882 void setMapPolarizations(bool activated);
00883 void setMapAntennaPointing(bool activated);
00884 void setScanStartStopMap(bool activated);
00885 void setScanStartStopFlaggedMap(bool activated);
00886 void setTimeAverageIter(bool activated);
00887 void setChanAverageIter(Vector<Int> chanbin);
00888
00889
00890 antennaPairMap * getAntennaPairMap() {return antennaPairMap_p;}
00891 subIntegrationMap * getSubIntegrationMap() {return subIntegrationMap_p;}
00892 polarizationMap * getPolarizationMap() {return polarizationMap_p;}
00893 polarizationIndexMap * getPolarizationIndexMap() {return polarizationIndexMap_p;}
00894 antennaPointingMap * getMapAntennaPointing() {return antennaPointingMap_p;}
00895 scanStartStopMap * getMapScanStartStop() {return scanStartStopMap_p;}
00896 lambdaMap * getLambdaMap() {return lambdaMap_p;}
00897
00898 void setProfiling(Bool value) {profiling_p=value;}
00899
00900
00901 Cube<Complex>& weightVisCube();
00902 Cube<Complex> weight_spectrum_p;
00903
00904
00905 casa::LogIO *logger_p;
00906
00907
00908 String tablename_p;
00909 MSSelection *measurementSetSelection_p;
00910 Vector<String> *antennaNames_p;
00911 std::map< string, std::pair<Int,Int> > baselineToAnt1Ant2_p;
00912 std::map< std::pair<Int,Int>, string > Ant1Ant2ToBaseline_p;
00913 ROScalarMeasColumn<MPosition> *antennaPositions_p;
00914 Vector<Double> *antennaDiameters_p;
00915 Vector<String> *fieldNames_p;
00916 std::vector<String> *corrProducts_p;
00917
00918
00919 VisBufferComponents2 *prefetchColumns_p;
00920
00921 uLong processedRows;
00922 uShort chunkNo;
00923 uShort bufferNo;
00924
00925
00926 bool flushFlags_p;
00927 bool flushFlagRow_p;
00928 uInt64 chunkCounts_p;
00929 uInt64 progressCounts_p;
00930 uInt64 msCounts_p;
00931 uShort summaryThreshold_p;
00932 bool printChunkSummary_p;
00933 uShort tableTye_p;
00934 Bool loadProcessorTable_p;
00935
00936
00937 Vector<Bool> isCorrelatorType_p;
00938 bool processorTableExist_p;
00939
00940
00941
00942
00943
00944
00945
00946 vi::VisBuffer2 *visibilityBuffer_p;
00947
00948
00949 bool groupTimeSteps_p;
00950 Block<int> sortOrder_p;
00951
00952
00953 Bool enableTimeAvg_p;
00954 Bool enableChanAvg_p;
00955 Double timeAverageBin_p;
00956 Vector <Int> chanAverageBin_p;
00957 String dataColumnType_p;
00958 vi::AveragingOptions timeAvgOptions_p;
00959 Record chanAvgOptions_p;
00960
00961 protected:
00962
00963
00964 virtual void generateAntennaPairMap();
00965 virtual void generateSubIntegrationMap();
00966 virtual void generatePolarizationsMap();
00967 virtual void generateAntennaPointingMap();
00968 virtual void generateScanStartStopMap();
00969
00970
00971 bool anySelection_p;
00972 bool inrowSelection_p;
00973 casa::String arraySelection_p;
00974 casa::String fieldSelection_p;
00975 casa::String scanSelection_p;
00976 casa::String timeSelection_p;
00977 casa::String spwSelection_p;
00978 casa::String baselineSelection_p;
00979 casa::String uvwSelection_p;
00980 casa::String polarizationSelection_p;
00981 casa::String scanIntentSelection_p;
00982 casa::String observationSelection_p;
00983
00984
00985 bool asyncio_enabled_p;
00986
00987
00988 vector<VisBufferComponent2> preLoadColumns_p;
00989
00990
00991 uShort iterationApproach_p;
00992 Double timeInterval_p;
00993
00994 bool slurp_p;
00995
00996 bool chunksInitialized_p;
00997 bool buffersInitialized_p;
00998 bool iteratorGenerated_p;
00999 bool stopIteration_p;
01000
01001
01002 Cube<Bool> originalFlagCube_p;
01003 Cube<Bool> modifiedFlagCube_p;
01004
01005
01006 Vector<Bool> originalFlagRow_p;
01007 Vector<Bool> modifiedFlagRow_p;
01008
01009
01010 antennaPairMap *antennaPairMap_p;
01011 subIntegrationMap *subIntegrationMap_p;
01012 polarizationMap *polarizationMap_p;
01013 polarizationIndexMap *polarizationIndexMap_p;
01014 antennaPointingMap *antennaPointingMap_p;
01015 scanStartStopMap *scanStartStopMap_p;
01016 lambdaMap *lambdaMap_p;
01017 bool mapAntennaPairs_p;
01018 bool mapSubIntegrations_p;
01019 bool mapPolarizations_p;
01020 bool mapAntennaPointing_p;
01021 bool mapScanStartStop_p;
01022 bool mapScanStartStopFlagged_p;
01023
01024
01025 bool stats_p;
01026 uLong cubeAccessCounter_p;
01027 double cubeAccessTime_p;
01028 uLong cubeAccessCounterTotal_p;
01029 double cubeAccessTimeTotal_p;
01030
01031
01032 bool profiling_p;
01033
01034
01035
01036 };
01037
01038 }
01039
01040 #endif