00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #if !defined CASA_MSPLOT_HOOKS_H
00038 #define CASA_MSPLOT_HOOKS_H
00039
00040
00041 #include <stdio.h>
00042 #include <iostream>
00043 #include <iomanip>
00044
00045
00046 #include <casa/BasicSL/String.h>
00047 #include <casa/Arrays/Slice.h>
00048
00049
00050 #include <tableplot/TablePlot/TablePlot.h>
00051
00052 #include <tableplot/TablePlot/SLog.h>
00053 #include <flagging/Flagging/Flagger.h>
00054 #include <flagging/Flagging/ExtendFlagger.h>
00055
00056 #define LOG0 0
00057 #define LOG2 1
00058
00059 namespace casa {
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118 class MSPlotReset : public TPResetCallBack
00119 {
00120 public:
00121 MSPlotReset( MsPlot *inMsPlot )
00122 {
00123 String fnname = "MSPlotReset";
00124 log = SLog::slog();
00125 log->FnEnter(fnname, clname);
00126
00127 itsMsPlot = inMsPlot;
00128
00129 log->FnExit(fnname, clname);
00130 };
00131
00132 ~MSPlotReset() {
00133 String fnname = "MSPlotReset";
00134 log->FnEnter(fnname, clname);
00135
00136 log->FnExit(fnname, clname);
00137 };
00138
00139 Bool reset() {
00140 String fnname = "reset";
00141 log->FnEnter(fnname, clname);
00142
00143 log->FnExit(fnname, clname);
00144 return True;
00145 };
00146
00147
00148 private:
00149 MsPlot *itsMsPlot;
00150
00151
00152 SLog *log;
00153 static const String clname;
00154 };
00155
00156 const String MSPlotReset::clname = "MSPlotReset";
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232 class MSPlotMainMSCallBack : public TPGuiCallBackHooks
00233 {
00234 public:
00235 MSPlotMainMSCallBack( MeasurementSet *inMS,
00236 Vector<String> antNames,
00237
00238 Vector<String> fieldNames,
00239 Vector<Vector<String> >corrNames,
00240 Vector<Double> refFrequencies,
00241 String msname,
00242 String extendChn,
00243 String extendCor,
00244 String extendSp,
00245 String extendAnts,
00246 String extendTm,
00247 Bool crossbl,
00248 Double avetime,
00249 MeasurementSet *aMS)
00250 {
00251 log = SLog::slog();
00252 String fnname = "MSPlotMainMSCallBack";
00253 #if LOG2
00254 log->FnEnter(fnname +
00255 "(inMS, antNames, fieldNames, corrNames, refFrequencies)", clname);
00256 #endif
00257
00258 localMS = inMS;
00259 itsAntNames = antNames;
00260
00261 itsFieldNames = fieldNames;
00262 itsCorrNames = corrNames;
00263 itsRefFrequencies = refFrequencies;
00264 flagms = msname;
00265 extendChan = extendChn;
00266 extendCorr = extendCor;
00267 extendSpw = extendSp;
00268 extendAnt = extendAnts;
00269 extendTime = extendTm;
00270 aveBl = crossbl;
00271 aveTime = avetime;
00272 aveMS = aMS;
00273
00274 LocateColumns.resize(5);
00275 LocateColumns[0] = "ANTENNA1";
00276 LocateColumns[1] = "ANTENNA2";
00277 LocateColumns[2] = "FIELD_ID";
00278 LocateColumns[3] = "TIME";
00279 LocateColumns[4] = "DATA_DESC_ID";
00280
00281
00282 #if LOG2
00283 log->FnExit(fnname, clname);
00284 #endif
00285 };
00286
00287 ~MSPlotMainMSCallBack(){
00288 String fnname = "~MSPlotMainMSCallback";
00289 #if LOG2
00290 log->FnEnter(fnname, clname);
00291
00292 log->FnExit(fnname, clname);
00293 #endif
00294 };
00295
00296 casa::Bool
00297 releasetable( Int nrows, Int ncols, Int panel, String tablename )
00298 {
00299 String fnname = "releasetable";
00300 #if LOG2
00301 log->FnEnter(fnname + "(nrows,ncols,panel,tablename)", clname);
00302 #endif
00303
00304
00305
00306 #if LOG2
00307 log->FnExit(fnname, clname);
00308 #endif
00309 return True;
00310 }
00311
00312 casa::Bool
00313 createiterplotlabels(Vector<String> iteraxes,
00314 Vector<Double> values, String &titleString) {
00315 String fnname = "createiterplotlabels";
00316 #if LOG2
00317 log->FnEnter(fnname + "(iteraxes, values, titleString)", clname );
00318 #endif
00319
00320
00321
00322
00323
00324 titleString = "Iter: ";
00325
00326 uInt iterNum = iteraxes.nelements();
00327 for (uint axesId = 0; axesId < iterNum; axesId++) {
00328 if (upcase(iteraxes[axesId]).matches("BASELINE") ||
00329 upcase(iteraxes[axesId]).matches("ANTENNA") ||
00330 upcase(iteraxes[axesId]).matches("ANTENNA1") ||
00331 upcase(iteraxes[axesId]).matches("ANTENNA2")) {
00332
00333 if (iterNum == 2 &&
00334 upcase(iteraxes[0]).contains("ANTENNA") &&
00335 upcase(iteraxes[1]).contains("ANTENNA")) {
00336 if (axesId == 0)
00337 titleString += "Baseline ";
00338 }
00339 else {
00340 titleString += String("Antenna") +
00341 (iteraxes[axesId].contains("2") ? "2" : "1")
00342 + String(" ");
00343 }
00344
00345 if (values[axesId] < itsAntNames.nelements()) {
00346 if (axesId > 0)
00347 titleString += String(" : ");
00348 titleString += itsAntNames[Int(values[axesId])];
00349 }
00350 else {
00351 #if LOG2
00352 ostringstream os;
00353 os << "Internal error! Antenna ID is "
00354 << values[axesId]
00355 << ", but there are only "
00356 << itsAntNames.nelements()
00357 << ".";
00358 log->out(os, fnname, clname, LogMessage::DEBUG1);
00359 #endif
00360 }
00361
00362 }
00363 else if (upcase(iteraxes[axesId]).matches("FIELD") ||
00364 upcase(iteraxes[axesId]).matches("FIELD_ID") ) {
00365 titleString += "FIELD ";
00366 if ( values[axesId] < itsFieldNames.nelements() ) {
00367 if ( axesId > 0 )
00368 titleString += String( " : " );
00369 titleString += itsFieldNames[Int(values[axesId])];
00370 }
00371 else {
00372 #if LOG2
00373 ostringstream os;
00374 os << "Internal error! Field ID is "
00375 << values[axesId]
00376 << ", but there are only "
00377 << itsFieldNames.nelements()
00378 << ".";
00379 log->out(os, fnname, clname, LogMessage::WARN);
00380 #endif
00381 }
00382 } else {
00383
00384
00385
00386 titleString += iteraxes[axesId] + String( " ");
00387
00388 if ( axesId > 0 )
00389 titleString += String( " : " );
00390 titleString += String::toString( Int(values[axesId]) );
00391 }
00392 }
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440 log->FnExit(fnname, clname);
00441 return True;
00442 };
00443
00444 casa::Bool
00445 flagdata(String tablename) {
00446 #if LOG2
00447 String fnname = "flagdata";
00448 log->FnEnter(fnname, clname);
00449 log->FnExit(fnname, clname);
00450 #endif
00451 return True;
00452 }
00453
00454 casa::Bool
00455 flagdisplay(Int direction, Vector<String> collist,
00456 Matrix<Double> infomat, Vector<String> cpol) {
00457 String fnname = "flagdisplay";
00458
00459
00460 IPosition mshape = infomat.shape();
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471 ROMSDataDescColumns dataDescCol(aveMS->dataDescription());
00472 ROMSSpWindowColumns spwColumn(aveMS->spectralWindow());
00473
00474
00475 Int maxrows = 0;
00476 for (Int i = 0; i < mshape[1]; i++) {
00477 maxrows += (Int)infomat(1, i);
00478 }
00479
00480 Vector<FlagID> flagids(maxrows);
00481
00482 Int idCount = 0;
00483 String warnings = String("Bad row:");
00484 for (Int i = 0; i < mshape[1]; i++) {
00485 if (mshape[0] != 7) {
00486 warnings += String(" ") + String::toString(i);
00487 break;
00488 }
00489
00490 FlagID flagid;
00491 flagid.rowNum = (uInt)infomat(0, i);
00492
00493 if (infomat(2, i) < 0 ||
00494 infomat(2, i) >= itsAntNames.nelements()) {
00495 warnings += String(" ") + String::toString(i);
00496 break;
00497 }
00498 flagid.ant1 = (uInt)infomat(2, i);
00499 if (infomat(3, i) < 0 ||
00500 infomat(3, i) >= itsAntNames.nelements()) {
00501 warnings += String(" ") + String::toString(i);
00502 break;
00503 }
00504 flagid.ant2 = (uInt)infomat(3, i);
00505 if (infomat(4, i) < 0 ||
00506 infomat(4, i) >= itsFieldNames.nelements()) {
00507 warnings += String(" ") + String::toString(i);
00508 break;
00509 }
00510 flagid.field = (uInt)infomat(4, i);
00511
00512 if (aveTime > 0.) {
00513
00514 Double start = max(infomat(5, i) - aveTime / 2, 0.);
00515 Double end = max(infomat(5, i) + aveTime / 2, start);
00516 flagid.time = MVTime(start / C::day).string(MVTime::YMD, 7) +
00517 String("~") +
00518 MVTime(end / C::day).string(MVTime::YMD, 7);
00519 }
00520 else {
00521 String ltime =
00522 MVTime(infomat(5, i)/C::day).string(MVTime::YMD, 7);
00523
00524 String ntime =
00525 MVTime((infomat(5, i) + 0.1)/C::day).string(MVTime::YMD, 7);
00526
00527 flagid.time = ltime + String("~") + ntime;
00528 }
00529
00530 if (infomat(6, i) < 0 ||
00531 infomat(6, i) >= dataDescCol.spectralWindowId().nrow()) {
00532 warnings += String(" ") + String::toString(i);
00533 break;
00534 }
00535 flagid.spw = dataDescCol.spectralWindowId()((Int)infomat(6, i));
00536 if (infomat(6, i) < 0 ||
00537 infomat(6, i) >= dataDescCol.polarizationId().nrow()) {
00538 warnings += String(" ") + String::toString(i);
00539 break;
00540 }
00541 Int polId = dataDescCol.polarizationId()((Int)infomat(6, i));
00542 if (itsCorrNames[polId].nelements() <= 0) {
00543 warnings += String(" ") + String::toString(i);
00544 break;
00545 }
00546
00547
00548
00549
00550 Int cCnt = cpol(i).freq(']');
00551 Int k = 0;
00552 Int l = 0;
00553 for (Int j = 0; j < cCnt; j++) {
00554 l = cpol(i).index(']', k) + 1;
00555 String sect = cpol(i).substr(k, l);
00556 sect = sect.after('[');
00557 sect = sect.before(']');
00558
00559 String corr = sect.before(',');
00560 String chan = sect.after(',');
00561
00562 Int corrId = atoi(corr.chars());
00563 flagid.corr = itsCorrNames[polId][corrId];
00564
00565 Int colCnt = chan.freq(':');
00566 if (colCnt == 2) {
00567 Int fst = chan.index(':');
00568 fst = chan.index(':', fst + 1);
00569 String s = chan.substr(0, fst);
00570
00571 flagid.chan = s.before(':') + String('~') + s.after(':');
00572 }
00573 else if (colCnt == 1) {
00574 flagid.chan = chan.before(':') + String('~') + chan.after(':');
00575 }
00576 else {
00577 flagid.chan = chan;
00578 }
00579
00580
00581
00582 flagids(idCount++) = flagid;
00583 k = l;
00584 }
00585 }
00586 flagids.resize(idCount, True);
00587
00588
00589
00590 Vector<Int> spwNumChan = spwColumn.numChan().getColumn();
00591
00592
00593
00594
00595
00596 if (aveBl) {
00597 extendAnt="ALL";
00598 }
00599
00600 ExtendFlagger eflg;
00601 eflg.attach(*aveMS);
00602
00603 Bool ret;
00604 ret = eflg.initdata();
00605 eflg.setdata();
00606 eflg.setExtend(extendChan, extendCorr, extendSpw,
00607 extendAnt, extendTime, itsCorrNames, spwNumChan);
00608 eflg.setUnflag(!Bool(direction));
00609
00610
00611
00612
00613 ret = eflg.extend(flagids);
00614
00615
00616 return True;
00617
00618 }
00619
00620 casa::Bool
00621 flagdata(Int direction, Vector<String> collist,
00622 Matrix<Double> infomat, Vector<String> cpol, Bool ave) {
00623 String fnname = "flagdata";
00624
00625
00626 IPosition mshape = infomat.shape();
00627
00628
00629
00630 if (mshape[1] < 1 || cpol.size() < 1)
00631 return True;
00632
00633
00634
00635
00636
00637
00638 ROMSDataDescColumns dataDescCol(localMS->dataDescription());
00639
00640
00641
00642 MS ms(flagms, Table::Update);
00643
00644 ROMSSpWindowColumns spwColumn(ms.spectralWindow());
00645
00646
00647 Int maxrows = 0;
00648 for (Int i = 0; i < mshape[1]; i++) {
00649 maxrows += (Int)infomat(1, i);
00650 }
00651
00652
00653 Vector<FlagID> flagids(maxrows);
00654
00655 Int idCount = 0;
00656 String warnings = String("Bad row:");
00657 for (Int i = 0; i < mshape[1]; i++) {
00658 if (mshape[0] != 7) {
00659 warnings += String(" ") + String::toString(i);
00660 break;
00661 }
00662
00663 FlagID flagid;
00664 flagid.rowNum = (uInt)infomat(0, i);
00665
00666 if (infomat(2, i) < 0 ||
00667 infomat(2, i) >= itsAntNames.nelements()) {
00668 warnings += String(" ") + String::toString(i);
00669 break;
00670 }
00671 flagid.ant1 = (uInt)infomat(2, i);
00672 if (infomat(3, i) < 0 ||
00673 infomat(3, i) >= itsAntNames.nelements()) {
00674 warnings += String(" ") + String::toString(i);
00675 break;
00676 }
00677 flagid.ant2 = (uInt)infomat(3, i);
00678 if (infomat(4, i) < 0 ||
00679 infomat(4, i) >= itsFieldNames.nelements()) {
00680 warnings += String(" ") + String::toString(i);
00681 break;
00682 }
00683 flagid.field = (uInt)infomat(4, i);
00684
00685 if (aveTime > 0.) {
00686
00687 Double start = max(infomat(5, i) - aveTime / 2, 0.);
00688 Double end = max(infomat(5, i) + aveTime / 2, start);
00689 flagid.time = MVTime(start / C::day).string(MVTime::YMD, 7) +
00690 String("~") +
00691 MVTime(end / C::day).string(MVTime::YMD, 7);
00692 }
00693 else {
00694 String ltime =
00695 MVTime(infomat(5, i)/C::day).string(MVTime::YMD, 7);
00696
00697
00698
00699
00700
00701 flagid.time = ltime;
00702 }
00703
00704 if (infomat(6, i) < 0 ||
00705 infomat(6, i) >= dataDescCol.spectralWindowId().nrow()) {
00706 warnings += String(" ") + String::toString(i);
00707 break;
00708 }
00709 flagid.spw = dataDescCol.spectralWindowId()((Int)infomat(6, i));
00710 if (infomat(6, i) < 0 ||
00711 infomat(6, i) >= dataDescCol.polarizationId().nrow()) {
00712 warnings += String(" ") + String::toString(i);
00713 break;
00714 }
00715 Int polId = dataDescCol.polarizationId()((Int)infomat(6, i));
00716 if (itsCorrNames[polId].nelements() <= 0) {
00717 warnings += String(" ") + String::toString(i);
00718 break;
00719 }
00720
00721
00722
00723
00724 Int cCnt = cpol(i).freq(']');
00725 Vector<String> chans(4);
00726 for (Int s = 0; s < 4; s++)
00727 chans(s) = "";
00728 Int k = 0;
00729 Int l = 0;
00730 String tmpChan = "";
00731 String tmpCorr = "";
00732 Int secCnt = 0;
00733 for (Int j = 0; j < cCnt; j++) {
00734 l = cpol(i).index(']', k) + 1;
00735 String sect = cpol(i).substr(k, l);
00736 sect = sect.after('[');
00737 sect = sect.before(']');
00738
00739 String corr = sect.before(',');
00740 String chan = sect.after(',');
00741
00742 Int corrId = atoi(corr.chars());
00743 tmpCorr = itsCorrNames[polId][corrId];
00744
00745 Int colCnt = chan.freq(':');
00746 if (secCnt > 0) {
00747 tmpChan += ";";
00748 }
00749 if (colCnt == 2) {
00750 Int fst = chan.index(':');
00751 fst = chan.index(':', fst + 1);
00752 String s = chan.substr(0, fst);
00753
00754 tmpChan += (s.before(':') + String('~') + s.after(':'));
00755 }
00756 else if (colCnt == 1) {
00757 tmpChan += (chan.before(':') + String('~') + chan.after(':'));
00758 }
00759 else {
00760 tmpChan += chan;
00761 }
00762 chans(corrId) = tmpChan;
00763 secCnt++;
00764 k = l;
00765 }
00766 for (Int s = 0; s < 4; s++) {
00767 if (chans(s) != "") {
00768 flagid.chan = chans(s);
00769 flagid.corr = itsCorrNames[polId][s];
00770 flagids(idCount++) = flagid;
00771
00772
00773 }
00774 }
00775 }
00776 if (idCount < 1)
00777 return True;
00778
00779 flagids.resize(idCount, True);
00780
00781
00782
00783
00784
00785 Vector<Int> spwNumChan = spwColumn.numChan().getColumn();
00786
00787
00788 if (aveBl) {
00789 extendAnt="ALL";
00790 }
00791
00792
00793 Int maxSel = 8 * sizeof(uint) - 5;
00794 Int nSel = maxSel;
00795 Int start = 0;
00796 while (start < idCount) {
00797
00798 nSel = min(idCount - start, maxSel);
00799
00800 ExtendFlagger eflg;
00801 eflg.attach(ms);
00802
00803
00804 Bool ret;
00805 ret = eflg.initdata();
00806 eflg.setdata();
00807 eflg.setExtend(extendChan, extendCorr, extendSpw,
00808 extendAnt, extendTime, itsCorrNames, spwNumChan);
00809 eflg.setUnflag(!Bool(direction));
00810
00811
00812
00813
00814 ret = eflg.extend(flagids(Slice(start, nSel)));
00815
00816
00817 start += nSel;
00818 }
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895 return True;
00896
00897 }
00898
00899 casa::Bool
00900 printlocateinfo( Vector<String> collist,
00901 Matrix<Double> infomat,Vector<String> cpol)
00902 {
00903 String fnname = "printlocateinfo";
00904 #if LOG2
00905 log->FnEnter(fnname + "(collist, infomat, cpol)", clname);
00906 #endif
00907
00908
00909
00910
00911
00912 Vector<uInt> columnWidths(9);
00913 columnWidths[0]=8; columnWidths[1]=8; columnWidths[2]=9;
00914 columnWidths[3]=25; columnWidths[4]=22; columnWidths[5]=6;
00915 columnWidths[6]=10; columnWidths[7]=14; columnWidths[8]=30;
00916
00917 String colNames;
00918 ostringstream tmp;
00919 tmp << std::setw( columnWidths[0] ) << "ROW # " << " | "
00920 << std::setw( columnWidths[1] ) << "# Points" << " |"
00921 << std::setw( columnWidths[2] ) << "Baseline" << "| "
00922 << std::setw( columnWidths[3] ) << "Field ID/Name " << " | "
00923 << std::setw( columnWidths[4] ) << "Time " << " | "
00924 << std::setw( columnWidths[5] ) << "SPW ID" << " | "
00925 << std::setw( columnWidths[6] ) << "Ref. Freq." << " | "
00926 << std::setw( columnWidths[7] ) << "Corr. Id/Name" << " |"
00927 << std::setw( columnWidths[8] ) << "[pol /chan]" << " | "
00928 << endl;
00929 colNames += String( tmp );
00930 tmp.str( "" );
00931
00932
00933
00934 ROMSDataDescColumns dataDescCol( localMS->dataDescription());
00935
00936 IPosition mshape = infomat.shape();
00937 String warnings;
00938 String info;
00939 if (mshape[1] > 0)
00940 info += colNames;
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057 for (Int i=0; i < mshape[1]; i++) {
01058 if ( mshape[0] != 7 ) {
01059 warnings += String( "Skipping the " )
01060 + String::toString( i )
01061 + String( " set of data, its not a complete row. " );
01062 break;
01063 }
01064
01065 tmp.str("");
01066
01067
01068 tmp << std::noshowpoint << std::setw( columnWidths[0] )
01069 << String::toString(infomat(0, i) ) << " | "
01070 << std::noshowpoint << std::setw( columnWidths[1] )
01071 << infomat(1, i) << " | ";
01072
01073
01074
01075
01076 String baseline;
01077 if (infomat(2, i) < 0 || infomat(2, i) >= itsAntNames.nelements()) {
01078 baseline += String::toString(infomat(2, i)) + String("(ID)");
01079 continue;
01080 }
01081 else
01082 baseline += itsAntNames((uInt)infomat(2, i));
01083 baseline += String( "/" );
01084 if (infomat(3, i) < 0 || infomat(3, i) >= itsAntNames.nelements()) {
01085 baseline += String::toString(infomat(3, i)) + String("(ID)");
01086 continue;
01087 }
01088 else
01089 baseline += itsAntNames((uInt)infomat(3, i));
01090 baseline += "| ";
01091 tmp << std::setw( columnWidths[2]) << baseline;
01092
01093
01094 String fieldStr = String::toString(infomat(4, i)) + String("/");
01095 if (infomat(4, i) < 0 || infomat(4, i) >= itsFieldNames.nelements()) {
01096 warnings += String( "Field ID, " )
01097 + String::toString(Int(infomat(4, i)))
01098 + String(" does not exist" )
01099 + String( ". \n" );
01100 continue;
01101 }
01102 else {
01103 fieldStr += itsFieldNames[Int(infomat(4, i))];
01104 }
01105
01106 tmp << std::noshowpoint << std::setw(columnWidths[3])
01107 << fieldStr << " | ";
01108
01109
01110 tmp << std::setw(columnWidths[4])
01111 << MVTime(infomat(5, i)/C::day).string(MVTime::DMY, 7)
01112 << " | ";
01113
01114
01115 if (infomat(6, i) < 0 ||
01116 infomat(6, i) >= dataDescCol.spectralWindowId().nrow()) {
01117 warnings += String("row ")
01118 + String::toString(Int(infomat(6, i)))
01119 + String(" does not exist in SpectralWindow")
01120 + String(". \n");
01121 continue;
01122 }
01123
01124 Int spwId = dataDescCol.spectralWindowId()((Int)infomat(6, i));
01125 tmp << std::noshowpoint << std::setw(columnWidths[5])
01126 << spwId << " | ";
01127
01128 if (spwId < (Int)itsRefFrequencies.nelements()) {
01129 tmp << std::showpoint
01130 << std::setprecision( columnWidths[6]-7)
01131 << std::setw(columnWidths[6])
01132 << itsRefFrequencies[spwId] << " | ";
01133 }
01134 else {
01135 warnings += String("SPW ID, ")
01136 + String::toString(spwId)
01137 + String(" number of reference frequencies, ")
01138 + String::toString(itsRefFrequencies.nelements())
01139 + String(". \n" );
01140 tmp << " ?? " << " | ";
01141 }
01142
01143
01144
01145
01146 if (infomat(6, i) < 0 ||
01147 infomat(6, i) >= dataDescCol.polarizationId().nrow()) {
01148 warnings += String("row ")
01149 + String::toString(Int(infomat(6, i)))
01150 + String(" does not exist in Polarization")
01151 + String( ". \n" );
01152 continue;
01153 }
01154
01155 Int polId = dataDescCol.polarizationId()((Int)infomat(6, i));
01156 String polStr = String::toString(polId) + String( "/" );
01157 if (itsCorrNames[polId].nelements() > 0) {
01158 for (Int corrId=0;
01159 corrId < (Int)itsCorrNames[polId].nelements(); corrId++ ) {
01160 if (corrId > 0)
01161 polStr += String( ", " );
01162 polStr += itsCorrNames[polId][corrId];
01163 }
01164 }
01165 else {
01166 warnings += String("Pol ID, ")
01167 + String::toString( polId )
01168 + String( ", is larger then the" )
01169 + String( " number of polarizations, " )
01170 + String::toString( itsCorrNames[polId].nelements() )
01171 + String( ", \n" );
01172 polStr += "??";
01173 }
01174 tmp << std::noshowpoint << std::setw( columnWidths[7] )
01175 << polStr << " | ";
01176
01177 tmp << std::setw( columnWidths[8] )
01178 << cpol(i) << "| " << endl;
01179
01180 info += String(tmp);
01181 }
01182
01183
01184
01185
01186 if ( info.length() > colNames.length() )
01187 log->out(info, fnname, clname, LogMessage::NORMAL);
01188
01189
01190 if (warnings.length() > 0)
01191
01192 log->out("Error occured while locating data points",
01193 fnname, clname, LogMessage::WARN);
01194
01195 #if LOG2
01196 log->FnExit(fnname, clname);
01197 #endif
01198 return True;
01199 };
01200 private:
01201 MeasurementSet *localMS;
01202 MeasurementSet *aveMS;
01203 Vector<String> itsAntNames;
01204
01205 Vector<String> itsFieldNames;
01206 Vector< Vector<String> > itsCorrNames;
01207 Vector<Double> itsRefFrequencies;
01208 String flagms;
01209 String extendChan;
01210 String extendCorr;
01211 String extendSpw;
01212 String extendAnt;
01213 String extendTime;
01214 Bool aveBl;
01215 Double aveTime;
01216
01217
01218 SLog* log;
01219 static const String clname;
01220 };
01221
01222 const String MSPlotMainMSCallBack::clname = "MSPlotMainMSCallBack";
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280
01281
01282
01283
01284
01285
01286
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311 class MSPlotAntennaCallBack : public TPGuiCallBackHooks
01312 {
01313 public:
01314 MSPlotAntennaCallBack(Vector<String> inAntNames, Vector<String> inFieldNames )
01315 {
01316 log = SLog::slog();
01317 String fnname = "MSPlotAntennaMSCallBack" ;
01318 #if LOG2
01319 log->FnEnter(fnname + "(antNames, fieldNames)", clname );
01320 #endif
01321
01322 itsAntNames = inAntNames;
01323 itsFieldNames = inFieldNames;
01324
01325 LocateColumns.resize(3);
01326
01327
01328 LocateColumns[0] = "POSITION[1]";
01329 LocateColumns[1] = "POSITION[2]";
01330 LocateColumns[2] = "POSITION[3]";
01331
01332 #if LOG2
01333 log->FnExit(fnname, clname);
01334 #endif
01335 };
01336
01337 ~MSPlotAntennaCallBack(){
01338 #if LOG2
01339 String fnname = "~MSPlotAntennaCallback";
01340 log->FnEnter(fnname, clname);
01341 log->FnExit(fnname, clname);
01342 #endif
01343 };
01344
01345 casa::Bool
01346 releasetable( Int nrows,
01347 Int ncols,
01348 Int panel,
01349 String tablename )
01350 {
01351 String fnname = "releasetable";
01352 #if LOG2
01353 log->FnEnter(fnname + "(nrows,ncols,panel,tablename)", clname );
01354 #endif
01355
01356
01357
01358 #if LOG2
01359 log->FnExit(fnname, clname);
01360 #endif
01361 return True;
01362 }
01363
01364 casa::Bool
01365 createiterplotlabels( Vector<String> iteraxes,
01366 Vector<Double> values,
01367 String &titleString )
01368 {
01369 String fnname = "createiterplotlabels";
01370 #if LOG2
01371 log->FnEnter(fnname + "(iteraxes, values, titleString)", clname );
01372 #endif
01373
01374 titleString = "Iter: ";
01375
01376
01377 for ( uint axesId = 0; axesId < iteraxes.nelements(); axesId++ )
01378 {
01379 if ( upcase( iteraxes[axesId] ).matches( "BASELINE" )
01380 || upcase( iteraxes[axesId] ).matches( "ANTENNA" )
01381 || upcase( iteraxes[axesId] ).matches( "ANTENNA1" )
01382 || upcase( iteraxes[axesId] ).matches( "ANTENNA2" ) )
01383 {
01384 if ( iteraxes.nelements() == 2
01385 && upcase( iteraxes[0] ).contains( "ANTENNA" )
01386 && upcase( iteraxes[1] ).contains( "ANTENNA" ) )
01387 {
01388 if ( axesId == 0 )
01389 titleString += "Baseline ";
01390 } else
01391 titleString += "Antenna ";
01392
01393 if ( values[axesId] < itsAntNames.nelements() )
01394 {
01395 if ( axesId > 0 )
01396 titleString += String( " : " );
01397 titleString += itsAntNames[Int(values[axesId])];
01398 } else {
01399 ostringstream os;
01400 os << "Internal error! Antenna ID is "
01401 << values[axesId]
01402 << ", but there are only "
01403 << itsAntNames.nelements()
01404 << ".";
01405 log->out(os, fnname, clname, LogMessage::DEBUG1);
01406 }
01407 } else if ( upcase(iteraxes[axesId]).matches("FIELD")
01408 || upcase(iteraxes[axesId]).matches("FIELD_ID") )
01409 {
01410 titleString += "FIELD ";
01411 if ( values[axesId] < itsFieldNames.nelements() )
01412 {
01413 if ( axesId > 0 )
01414 titleString += String( " : " );
01415 titleString += itsFieldNames[Int(values[axesId])];
01416 } else {
01417 ostringstream os;
01418 os << "Internal error! Antenna ID is "
01419 << values[axesId]
01420 << ", but there are only "
01421 << itsFieldNames.nelements()
01422 << ".";
01423 log->out(os, fnname, clname, LogMessage::DEBUG1);
01424 }
01425 } else {
01426
01427
01428
01429 titleString += iteraxes[axesId] + String( " ");
01430
01431 if ( axesId > 0 )
01432 titleString += String( " : " );
01433 titleString += String::toString( Int(values[axesId]) );
01434 }
01435 }
01436
01437 #if LOG2
01438 log->FnExit(fnname, clname);
01439 #endif
01440 return True;
01441 };
01442
01443
01444 casa::Bool
01445 flagdata(String tablename) {
01446 #if LOG2
01447 String fnname = "flagdata";
01448 log->FnEnter(fnname, clname);
01449 log->FnExit(fnname, clname);
01450 #endif
01451 return True;
01452 }
01453
01454 casa::Bool
01455 flagdata(Int direction, Vector<String> collist,
01456 Matrix<Double> infomat,Vector<String> cpol, Bool ave) {
01457 String fnname = "flagdata";
01458
01459
01460
01461 return True;
01462
01463 }
01464
01465 casa::Bool
01466 printlocateinfo( Vector<String> collist,
01467 Matrix<Double> infomat,Vector<String> cpol)
01468 {
01469 String fnname = "printlocateinfo";
01470 #if LOG2
01471 log->FnEnter(fnname + "(collist, infomat, cpol)", clname);
01472 #endif
01473
01474
01475
01476
01477
01478 Vector<uInt> columnWidths(5);
01479 columnWidths[0]=10; columnWidths[1]=10; columnWidths[2]=10;
01480 columnWidths[3]=10; columnWidths[4]=10;
01481
01482
01483 String colNames;
01484 ostringstream tmp;
01485 tmp << std::setw( columnWidths[0] ) << "Ant ID " << " | "
01486 << std::setw( columnWidths[1] ) << "Ant. Names" << " | "
01487 << std::setw( columnWidths[2] ) << "X " << " | "
01488 << std::setw( columnWidths[3] ) << "Y " << " | "
01489 << std::setw( columnWidths[4] ) << "Z " << " |"
01490 << endl;
01491 colNames += String( tmp );
01492 tmp.str( "" );
01493
01494
01495
01496 String warnings;
01497 String info;
01498 info += colNames;
01499
01500 IPosition mshape = infomat.shape();
01501 Vector<Double> position(3);
01502
01503 if ( mshape[1] < 1 )
01504 warnings += String( "No data to display" );
01505
01506 for( Int i=0; i < mshape[1]; i++)
01507 {
01508 if ( mshape[0] != 5 )
01509 {
01510 warnings += String( "Skipping the " )
01511 + String::toString( i )
01512 + String( " set of data, its not a complete row.\n" );
01513 } else {
01514 if ( infomat( 0, i ) < 0
01515 || infomat( 0, i ) >= itsAntNames.nelements() )
01516 {
01517 warnings += String( "Unable to find antenna name ")
01518 + String( "for antenna ID: " )
01519 + String::toString( infomat( 0, i ) );
01520 }
01521 tmp << std::noshowpoint << std::setw( columnWidths[0] )
01522 << infomat( 0, i ) << " | "
01523 << std::noshowpoint << std::setw( columnWidths[1] )
01524 << itsAntNames[ Int(infomat( 0, i ) ) ] << " | "
01525 << std::showpoint
01526 << std::setprecision( columnWidths[2]-7)
01527 << std::setw( columnWidths[2] )
01528 << infomat( 2, i ) << " | "
01529 << std::showpoint
01530 << std::setprecision( columnWidths[3]-7)
01531 << std::setw( columnWidths[3] )
01532 << infomat( 3, i ) << " | "
01533 << std::showpoint
01534 << std::setprecision( columnWidths[4]-7)
01535 << std::setw( columnWidths[4] )
01536 << infomat( 4, i ) << " | " <<endl;;
01537 info += String( tmp );
01538 tmp.str( "" );
01539 }
01540 }
01541 info += colNames;
01542
01543
01544 if ( info.length() > 0 )
01545 log->out( info, fnname, clname, LogMessage::NORMAL);
01546
01547
01548 if ( warnings.length() > 0 )
01549 log->out(warnings, fnname, clname, LogMessage::NORMAL);
01550
01551 #if LOG2
01552 log->FnExit(fnname, clname);
01553 #endif
01554 return True;
01555 };
01556
01557 private:
01558 Vector<String> itsAntNames;
01559 Vector<String> itsFieldNames;
01560
01561
01562 SLog *log;
01563 static const String clname;
01564 };
01565
01566 const String MSPlotAntennaCallBack::clname = "MSPlotAntennaCallBack";
01567
01568
01569
01570
01571
01572
01573
01574
01575
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595
01596
01597
01598
01599
01600
01601
01602
01603
01604
01605
01606
01607
01608
01609
01610
01611
01612
01613
01614
01615
01616
01617
01618
01619
01620
01621
01622
01623
01624
01625
01626
01627
01628
01629
01630
01631
01632
01633
01634
01635
01636
01637 class MSPlotUVWCallBack : public TPGuiCallBackHooks
01638 {
01639 public:
01640 MSPlotUVWCallBack( MeasurementSet *inMS,
01641 Vector<String> antNames,
01642 Vector<String> fieldNames,
01643 Vector<Vector<String> >corrNames,
01644 Vector<Double> refFrequencies )
01645 {
01646
01647 log = SLog::slog();
01648 String fnname = "MSPlotUVWCallback";
01649 #if LOG2
01650 log->FnEnter(fnname +
01651 "( inMS, antNames, fieldNames, corrNames, refFrequencies )",
01652 clname);
01653 #endif
01654
01655 localMS = inMS;
01656 itsAntNames = antNames;
01657 itsFieldNames = fieldNames;
01658 itsCorrNames = corrNames;
01659 itsRefFrequencies = refFrequencies;
01660
01661 LocateColumns.resize(8);
01662 LocateColumns[0] = "UVW[1]";
01663 LocateColumns[1] = "UVW[2]";
01664 LocateColumns[2] = "UVW[3]";
01665 LocateColumns[3] = "ANTENNA1";
01666 LocateColumns[4] = "ANTENNA2";
01667 LocateColumns[5] = "FIELD_ID";
01668 LocateColumns[6] = "TIME";
01669 LocateColumns[7] = "DATA_DESC_ID";
01670
01671 #if LOG2
01672 log->FnExit(fnname, clname);
01673 #endif
01674 };
01675
01676 ~MSPlotUVWCallBack(){
01677 #if LOG2
01678 String fnname = "~MSPlotUVWCallback";
01679 log->FnEnter(fnname, clname);
01680 log->FnExit(fnname, clname);
01681 #endif
01682 };
01683
01684
01685 casa::Bool
01686 releasetable( Int nrows, Int ncols, Int panel, String tablename )
01687 {
01688 String fnname = "releasetable";
01689 #if LOG2
01690 log->FnEnter(fnname + "(nrows,ncols,panel,tablename )", clname);
01691 #endif
01692
01693
01694
01695 #if LOG2
01696 log->FnExit(fnname, clname);
01697 #endif
01698 return True;
01699 }
01700
01701
01702 casa::Bool
01703 createiterplotlabels( Vector<String> iteraxes,
01704 Vector<Double> values,
01705 String &titleString )
01706 {
01707 String fnname = "createiterplotlabels";
01708 #if LOG2
01709 log->FnEnter(fnname + "(iteraxes, values, titleString)", clname);
01710 #endif
01711 titleString = "Iter: ";
01712
01713 for ( uint axesId = 0; axesId < iteraxes.nelements(); axesId++ )
01714 {
01715 if ( upcase( iteraxes[axesId] ).matches( "BASELINE" )
01716 || upcase( iteraxes[axesId] ).matches( "ANTENNA" )
01717 || upcase( iteraxes[axesId] ).matches( "ANTENNA1" )
01718 || upcase( iteraxes[axesId] ).matches( "ANTENNA2" ) )
01719 {
01720 if ( iteraxes.nelements() == 2
01721 && upcase( iteraxes[0] ).contains( "ANTENNA" )
01722 && upcase( iteraxes[1] ).contains( "ANTENNA" ) )
01723 {
01724 if ( axesId == 0 )
01725 titleString += "Baseline ";
01726 } else
01727 titleString += "Antenna ";
01728
01729
01730 if ( values[axesId] < itsAntNames.nelements() )
01731 {
01732 if ( axesId > 0 )
01733 titleString += String( " : " );
01734 titleString += itsAntNames[Int(values[axesId])];
01735 } else {
01736 #if LOG2
01737 ostringstream os;
01738 os << "Internal error! Antenna ID is "
01739 << values[axesId]
01740 << ", but there are only "
01741 << itsAntNames.nelements()
01742 << ".";
01743 log->out(os, fnname, clname, LogMessage::DEBUG1);
01744 #endif
01745 }
01746 } else if ( upcase(iteraxes[axesId]).matches("FIELD")
01747 || upcase(iteraxes[axesId]).matches("FIELD_ID") )
01748 {
01749 titleString += "FIELD ";
01750 if ( values[axesId] < itsFieldNames.nelements() )
01751 {
01752 if ( axesId > 0 )
01753 titleString += String( " : " );
01754 titleString += itsFieldNames[Int(values[axesId])];
01755 } else {
01756 #if LOG2
01757 ostringstream os;
01758 os << "Internal error! Antenna ID is "
01759 << values[axesId]
01760 << ", but there are only "
01761 << itsFieldNames.nelements()
01762 << ".";
01763 log->out(os, fnname, clname, LogMessage::DEBUG1);
01764 #endif
01765 }
01766 } else {
01767
01768
01769
01770 titleString += iteraxes[axesId] + String( " ");
01771
01772 if ( axesId > 0 )
01773 titleString += String( " : " );
01774 titleString += String::toString( Int(values[axesId]) );
01775 }
01776 }
01777
01778 #if LOG2
01779 log->FnExit(fnname, clname);
01780 #endif
01781 return True;
01782 };
01783
01784 casa::Bool
01785 flagdata(String tablename) {
01786 #if LOG2
01787 String fnname = "flagdata";
01788 log->FnEnter(fnname, clname);
01789 log->FnExit(fnname, clname);
01790 #endif
01791 return True;
01792 }
01793
01794 casa::Bool
01795 flagdata(Int direction, Vector<String> collist,
01796 Matrix<Double> infomat,Vector<String> cpol, Bool ave) {
01797 String fnname = "flagdata";
01798
01799
01800 return True;
01801
01802 }
01803
01804 casa::Bool
01805 printlocateinfo( Vector<String> collist,
01806 Matrix<Double> infomat,Vector<String> cpol)
01807 {
01808 String fnname = "printlocateinfo";
01809 #if LOG2
01810 log->FnEnter(fnname + "(collist, infomat, cpol)", clname);
01811 #endif
01812
01813
01814 Vector<uInt> columnWidths(12);
01815 columnWidths[0]=8; columnWidths[1]=8; columnWidths[2]=11;
01816 columnWidths[3]=11; columnWidths[4]=11; columnWidths[5]=8;
01817 columnWidths[6]=25; columnWidths[7]=22; columnWidths[8]=6;
01818 columnWidths[9]=10; columnWidths[10]=14; columnWidths[11]=30;
01819
01820 String colNames;
01821 ostringstream tmp;
01822 tmp << std::setw( columnWidths[0] ) << "ROW #" << " | "
01823 << std::setw( columnWidths[1] ) << "# Points" << " | "
01824 << std::setw( columnWidths[2] ) << "U " << " | "
01825 << std::setw( columnWidths[3] ) << "V " << " | "
01826 << std::setw( columnWidths[4] ) << "W " << " | "
01827
01828 << std::setw( columnWidths[5] ) << "Baseline" << " | "
01829 << std::setw( columnWidths[6] ) << "Field ID/Name " << " | "
01830 << std::setw( columnWidths[7] ) << "Time " << " | "
01831 << std::setw( columnWidths[8] ) << "SPW ID" << " | "
01832 << std::setw( columnWidths[9] ) << "Ref. Freq." << " | "
01833 << std::setw( columnWidths[10] ) << "Corr. Id/Name" << " |"
01834 << std::setw( columnWidths[11] ) << "[pol /chan]" << " | "
01835 << endl;
01836 colNames += String( tmp );
01837 tmp.str( "" );
01838
01839
01840
01841 ROMSDataDescColumns dataDescCol( localMS->dataDescription() );
01842
01843 IPosition mshape = infomat.shape();
01844 String warnings;
01845 String info;
01846 info += colNames;
01847
01848 for(Int i=0; i < mshape[1]; i++)
01849 {
01850 if ( mshape[0] != 10 )
01851 {
01852 warnings += String( "Skipping the " )
01853 + String::toString( i )
01854 + String( " set of data, its not a complete row. " );
01855 break;
01856 }
01857
01858
01859
01860 tmp << std::noshowpoint << std::setw( columnWidths[0] )
01861 << String::toString( infomat( 0, i ) ) << " | "
01862 << std::noshowpoint << std::setw( columnWidths[1] )
01863 << infomat( 1, i ) << " | ";
01864
01865
01866 tmp << std::showpoint
01867 << std::setprecision( columnWidths[2]-7)
01868 << std::setw( columnWidths[2] )
01869 << infomat( 2, i ) << " | ";
01870 tmp << std::showpoint
01871 << std::setprecision( columnWidths[3]-7)
01872 << std::setw( columnWidths[3] )
01873 << infomat( 3, i ) << " | ";
01874 tmp << std::showpoint
01875 << std::setprecision( columnWidths[4]-7)
01876 << std::setw( columnWidths[4] )
01877 << infomat( 4, i ) << " | ";
01878
01879
01880 String baseline;
01881 if ( infomat(5,i) < 0
01882 || infomat(5,i) > itsAntNames.nelements() )
01883 baseline += String::toString( infomat(5,i) )
01884 + String( "(ID)" );
01885 else
01886 baseline += itsAntNames( (uInt)infomat(5,i) );
01887 baseline += String( "/" );
01888 if ( infomat(6,i) < 0
01889 || infomat(6,i) > itsAntNames.nelements() )
01890 baseline += String::toString( infomat(6,i) )
01891 + String( "(ID)" );
01892 else
01893 baseline += itsAntNames( (uInt)infomat(6,i) );
01894 baseline += " | ";
01895 tmp << std::setw( columnWidths[5] )
01896 << baseline;
01897
01898
01899 String fieldStr = String::toString(infomat(7,i) )
01900 + String( "/" );
01901 if ( infomat(7,i) < itsFieldNames.nelements() )
01902 fieldStr += itsFieldNames[ Int( infomat(7,i) ) ];
01903 else {
01904 warnings += String( "Field ID, " )
01905 + String::toString( Int( infomat(7,i) ) )
01906 + String( ", is larger then the" )
01907 + String( " number of field names, " )
01908 + String::toString( itsFieldNames.nelements() )
01909 + String( ". \n" );
01910 fieldStr += "??";
01911 }
01912 tmp << std::noshowpoint << std::setw( columnWidths[6] )
01913 << fieldStr << " | ";
01914
01915
01916 tmp << std::setw( columnWidths[7] )
01917 << MVTime( infomat(8, i)/C::day).string( MVTime::DMY,7)
01918 << " | ";
01919
01920
01921
01922 Int spwId = dataDescCol.spectralWindowId()( (Int)infomat(9, i ) );
01923 tmp << std::noshowpoint << std::setw( columnWidths[8] )
01924 << spwId << " | ";
01925
01926 if ( spwId < (Int)itsRefFrequencies.nelements() )
01927 tmp << std::showpoint
01928 << std::setprecision( columnWidths[9]-7)
01929 << std::setw( columnWidths[9] )
01930 << itsRefFrequencies[ spwId ] << " | ";
01931 else {
01932 warnings += String( "SPW ID, " )
01933 + String::toString( spwId )
01934 + String( ", is larger then the" )
01935 + String( " number of reference frequencies, " )
01936 + String::toString( itsRefFrequencies.nelements() )
01937 + String( ". \n" );
01938 tmp << " ?? " << " | ";
01939 }
01940
01941
01942
01943
01944
01945 Int polId = dataDescCol.polarizationId()( (Int)infomat(9, i ) );
01946 String polStr = String::toString( polId ) + String( "/" );
01947 if ( itsCorrNames[polId].nelements() > 0 )
01948 for ( Int corrId=0;
01949 corrId < (Int)itsCorrNames[polId].nelements();
01950 corrId++ ) {
01951 if ( corrId > 0 )
01952 polStr += String( ", " );
01953 polStr += itsCorrNames[polId][corrId];
01954 }
01955 else {
01956 warnings += String( "Pol ID, " )
01957 + String::toString( polId )
01958 + String( ", is larger then the" )
01959 + String( " number of polarizations, " )
01960 + String::toString( itsCorrNames[spwId].nelements() )
01961 + String( ", \n" );
01962 polStr += "??";
01963 }
01964 tmp << std::noshowpoint << std::setw( columnWidths[10] )
01965 << polStr << " | ";
01966
01967 tmp << std::setw( columnWidths[11] )
01968 << cpol(i) << " | " << endl;
01969
01970 info += String( tmp );
01971 tmp.str( "" );
01972 }
01973 info += colNames;
01974
01975
01976 if ( info.length() > colNames.length() )
01977 log->out(info, fnname, clname, LogMessage::NORMAL);
01978
01979
01980 if ( warnings.length() > 0 )
01981 log->out( warnings, fnname, clname, LogMessage::WARN);
01982
01983 #if LOG2
01984 log->FnExit(fnname, clname);
01985 #endif
01986 return True;
01987 }
01988
01989 private:
01990 MeasurementSet *localMS;
01991 Vector<String> itsAntNames;
01992 Vector<String> itsFieldNames;
01993 Vector< Vector<String> > itsCorrNames;
01994 Vector<Double> itsRefFrequencies;
01995
01996
01997 SLog* log;
01998 static const String clname;
01999 };
02000
02001 const String MSPlotUVWCallBack::clname = "MSPlotUVWCallBack";
02002
02003 };
02004
02005
02006 #endif //CASA_MSPLOT__HOOKS_H