- Timestamp:
- 02/15/11 14:38:44 (14 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MSFiller.cpp
r1988 r1990 91 91 { 92 92 os_.origin( LogOrigin( "MSFiller", "open()", WHERE ) ) ; 93 //double startSec = gettimeofday_sec() ;94 //os_ << "start MSFiller::open() startsec=" << startSec << LogIO::POST ;93 double startSec = gettimeofday_sec() ; 94 os_ << "start MSFiller::open() startsec=" << startSec << LogIO::POST ; 95 95 //os_ << " filename = " << filename << endl ; 96 96 … … 134 134 isData_ = mstable_.tableDesc().isColumn( "DATA" ) ; 135 135 136 //double endSec = gettimeofday_sec() ;137 //os_ << "end MSFiller::open() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;136 double endSec = gettimeofday_sec() ; 137 os_ << "end MSFiller::open() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 138 138 return true ; 139 139 } … … 142 142 { 143 143 os_.origin( LogOrigin( "MSFiller", "fill()", WHERE ) ) ; 144 //double startSec = gettimeofday_sec() ; 145 //os_ << "start MSFiller::fill() startSec=" << startSec << LogIO::POST ; 144 double startSec = gettimeofday_sec() ; 145 os_ << "start MSFiller::fill() startSec=" << startSec << LogIO::POST ; 146 147 double time0 = gettimeofday_sec() ; 148 os_ << "start init fill: " << time0 << LogIO::POST ; 146 149 147 150 // Initialize header … … 260 263 delete sharedQDArrCol ; 261 264 MPosition mp( MVPosition( antpos ), MPosition::ITRF ) ; 262 //pointtab = pointtab( pointtab.col("ANTENNA_ID")==antenna_ ).sort("TIME") ; 263 pointtab = MSPointing( pointtab( pointtab.col("ANTENNA_ID")==antenna_ ).sort("TIME") ) ; 265 if ( getPt_ ) { 266 //pointtab = pointtab( pointtab.col("ANTENNA_ID")==antenna_ ).sort("TIME") ; 267 pointtab = MSPointing( pointtab( pointtab.col("ANTENNA_ID")==antenna_ ).sort("TIME") ) ; 268 } 264 269 tcolr = tpoolr->construct( anttab, "STATION" ) ; 265 270 String stationName = tcolr->asString( antenna_ ) ; … … 273 278 String telescopeName = "" ; 274 279 280 double time1 = gettimeofday_sec() ; 281 os_ << "end fill init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 282 275 283 // 276 284 // ITERATION: OBSERVATION_ID … … 280 288 TableIterator iter0( mstable_, "OBSERVATION_ID" ) ; 281 289 while( !iter0.pastEnd() ) { 290 time0 = gettimeofday_sec() ; 291 os_ << "start 0th iteration: " << time0 << LogIO::POST ; 282 292 Table t0 = iter0.table() ; 283 293 tcolr = tpoolr->construct( t0, "OBSERVATION_ID" ) ; … … 306 316 } 307 317 Int nbeam = 0 ; 318 time1 = gettimeofday_sec() ; 319 os_ << "end 0th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 308 320 // 309 321 // ITERATION: FEED1 … … 313 325 TableIterator iter1( t0, "FEED1" ) ; 314 326 while( !iter1.pastEnd() ) { 327 time0 = gettimeofday_sec() ; 328 os_ << "start 1st iteration: " << time0 << LogIO::POST ; 315 329 Table t1 = iter1.table() ; 316 330 // assume FEED1 == FEED2 … … 319 333 tpoolr->destroy( tcolr ) ; 320 334 nbeam++ ; 335 time1 = gettimeofday_sec() ; 336 os_ << "end 1st iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 321 337 // 322 338 // ITERATION: FIELD_ID … … 326 342 TableIterator iter2( t1, "FIELD_ID" ) ; 327 343 while( !iter2.pastEnd() ) { 344 time0 = gettimeofday_sec() ; 345 os_ << "start 2nd iteration: " << time0 << LogIO::POST ; 328 346 Table t2 = iter2.table() ; 329 347 tcolr = tpoolr->construct( t2, "FIELD_ID" ) ; … … 336 354 String fieldName = tcolr->asString( fieldId ) + "__" + String::toString(fieldId) ; 337 355 tpoolr->destroy( tcolr ) ; 356 time1 = gettimeofday_sec() ; 357 os_ << "end 2nd iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 338 358 // 339 359 // ITERATION: DATA_DESC_ID … … 343 363 TableIterator iter3( t2, "DATA_DESC_ID" ) ; 344 364 while( !iter3.pastEnd() ) { 365 time0 = gettimeofday_sec() ; 366 os_ << "start 3rd iteration: " << time0 << LogIO::POST ; 345 367 Table t3 = iter3.table() ; 346 368 tcolr = tpoolr->construct( t3, "DATA_DESC_ID" ) ; … … 493 515 // for TSYS and TCAL 494 516 MSSysCal caltabsel( caltab( caltab.col("ANTENNA_ID") == antenna_ && caltab.col("FEED_ID") == feedId && caltab.col("SPECTRAL_WINDOW_ID") == spwId ).sort("TIME") ) ; 517 time1 = gettimeofday_sec() ; 518 os_ << "end 3rd iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 495 519 // 496 520 // ITERATION: SCAN_NUMBER … … 500 524 TableIterator iter4( t3, "SCAN_NUMBER" ) ; 501 525 while( !iter4.pastEnd() ) { 526 time0 = gettimeofday_sec() ; 527 os_ << "start 4th iteration: " << time0 << LogIO::POST ; 502 528 Table t4 = iter4.table() ; 503 529 tcolr = tpoolr->construct( t4, "SCAN_NUMBER" ) ; … … 505 531 tpoolr->destroy( tcolr ) ; 506 532 uInt cycle = 0 ; 533 time1 = gettimeofday_sec() ; 534 os_ << "end 4th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 507 535 // 508 536 // ITERATION: STATE_ID … … 512 540 TableIterator iter5( t4, "STATE_ID" ) ; 513 541 while( !iter5.pastEnd() ) { 542 time0 = gettimeofday_sec() ; 543 os_ << "start 5th iteration: " << time0 << LogIO::POST ; 514 544 Table t5 = iter5.table() ; 515 545 tcolr = tpoolr->construct( t5, "STATE_ID" ) ; … … 525 555 Int addednr = 0 ; 526 556 Int nloop = 0 ; 557 time1 = gettimeofday_sec() ; 558 os_ << "end 5th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 527 559 528 560 // SPECTRA, FLAG 561 time0 = gettimeofday_sec() ; 562 os_ << "start fill SPECTRA and FLAG: " << time0 << LogIO::POST ; 529 563 ROArrayColumn<Bool> mFlagCol( t5, "FLAG" ) ; 530 564 if ( isFloatData_ ) { … … 533 567 addednr = nrow*npol ; 534 568 oldnr += addednr ; 535 table_->table().addRow( addednr ) ;569 stab.addRow( addednr ) ; 536 570 nloop = npol ; 537 571 for ( Int irow = 0 ; irow < nrow ; irow++ ) { … … 560 594 addednr = nrow*npol ; 561 595 oldnr += addednr ; 562 table_->table().addRow( addednr ) ;596 stab.addRow( addednr ) ; 563 597 nloop = npol ; 564 598 for ( Int irow = 0 ; irow < nrow ; irow++ ) { … … 609 643 } 610 644 } 645 time1 = gettimeofday_sec() ; 646 os_ << "end fill SPECTRA and FLAGTRA: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 611 647 612 648 // number of rows added in this cycle … … 616 652 617 653 // TIME 654 time0 = gettimeofday_sec() ; 655 os_ << "start fill TIME: " << time0 << LogIO::POST ; 618 656 ROScalarMeasColumn<MEpoch> *mTimeCol = new ROScalarMeasColumn<MEpoch>( t5, "TIME" ) ; 619 657 Int tidx = prevnr ; … … 623 661 } 624 662 } 663 time1 = gettimeofday_sec() ; 664 os_ << "end fill TIME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 625 665 626 666 // TSYS 667 time0 = gettimeofday_sec() ; 668 os_ << "start fill TSYS: " << time0 << LogIO::POST ; 627 669 Vector<Double> sysCalTime ; 628 670 if ( isSysCal_ ) { … … 651 693 tsysCol->put( i, tsys ) ; 652 694 } 695 time1 = gettimeofday_sec() ; 696 os_ << "end fill TSYS: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 653 697 654 698 655 699 // INTERVAL 700 time0 = gettimeofday_sec() ; 701 os_ << "start fill INTERVAL: " << time0 << LogIO::POST ; 656 702 tcolr = tpoolr->construct( t5, "INTERVAL" ) ; 657 703 //Vector<Double> integ = mIntervalCol->getColumn() ; … … 666 712 } 667 713 tpoolr->destroy( tcolr ) ; 714 time1 = gettimeofday_sec() ; 715 os_ << "end fill INTERVAL: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 668 716 669 717 // SRCTYPE 718 time0 = gettimeofday_sec() ; 719 os_ << "start fill SRCTYPE: " << time0 << LogIO::POST ; 670 720 Int srcType = getSrcType( stateId, tpoolr ) ; 671 721 for ( int i = 0 ; i < addednr ; i++ ) { … … 674 724 //Vector<Int> *srcType = new Vector<Int>( addednr, getSrcType( stateId ) ) ; 675 725 //srcTypeCol->putColumnCells( rows, *srcType ) ; 726 time1 = gettimeofday_sec() ; 727 os_ << "end fill SRCTYPE: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 676 728 677 729 // DIRECTION, AZIMUTH, ELEVATION, SCANRATE 730 time0 = gettimeofday_sec() ; 731 os_ << "start fill DIRECTION, AZIMUTH, ELEVATION, SCANRATE: " << time0 << LogIO::POST ; 678 732 Vector<Double> defaultScanrate( 2, 0.0 ) ; 679 733 uInt diridx = 0 ; … … 745 799 else { 746 800 // All directions are set to source direction 747 ROArrayMeasColumn<MDirection> dmcol( pointtab, "DIRECTION" ) ; 748 ROArrayColumn<Double> dcol( pointtab, "DIRECTION" ) ; 749 IPosition ip( dmcol(0).shape().nelements(), 0 ) ; 750 IPosition outp( 1, 2 ) ; 751 String ref = dmcol(0)(ip).getRefString() ; 752 Slice ds( 0, 2, 1 ) ; 753 Slice ds0( 0, 1, 1 ) ; 754 Slicer dslice0( ds, ds0 ) ; 755 Vector<Double> defaultDir = dcol(0)(dslice0).reform(outp) ; 801 //ROArrayMeasColumn<MDirection> dmcol( pointtab, "DIRECTION" ) ; 802 //ROArrayColumn<Double> dcol( pointtab, "DIRECTION" ) ; 803 //IPosition ip( dmcol(0).shape().nelements(), 0 ) ; 804 //IPosition outp( 1, 2 ) ; 805 //String ref = dmcol(0)(ip).getRefString() ; 806 String ref = md.getRefString() ; 807 //Slice ds( 0, 2, 1 ) ; 808 //Slice ds0( 0, 1, 1 ) ; 809 //Slicer dslice0( ds, ds0 ) ; 810 //Vector<Double> defaultDir = dcol(0)(dslice0).reform(outp) ; 811 Vector<Double> defaultDir = srcDir ; 756 812 MDirection::getType( dirType, "J2000" ) ; 757 mf.resetDirection( MDirection( MVDirection(srcDir), dirType ) ) ;813 //mf.resetDirection( MDirection( MVDirection(srcDir), dirType ) ) ; 758 814 if ( ref != "J2000" ) { 759 815 ROScalarMeasColumn<MEpoch> tmCol( pointtab, "TIME" ) ; … … 775 831 } 776 832 } 833 time1 = gettimeofday_sec() ; 834 os_ << "end fill DIRECTION, AZIMUTH, ELEVATION, SCANRATE: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 777 835 778 836 // CYCLENO 837 time0 = gettimeofday_sec() ; 838 os_ << "start fill CYCLENO: " << time0 << LogIO::POST ; 779 839 for ( int i = 0 ; i < nloop ; i++ ) { 780 840 for ( int j = 0 ; j < nrow ; j++ ) { … … 783 843 } 784 844 cycle += nrow ; 845 time1 = gettimeofday_sec() ; 846 os_ << "end fill CYCLENO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 785 847 786 848 // POLNO 849 time0 = gettimeofday_sec() ; 850 os_ << "start fill POLNO: " << time0 << LogIO::POST ; 787 851 Int pidx = 0 ; 788 852 Bool crossOK = False ; … … 800 864 } 801 865 } 866 time1 = gettimeofday_sec() ; 867 os_ << "end fill POLNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 802 868 803 869 // FLAGROW 870 time0 = gettimeofday_sec() ; 871 os_ << "start fill FLAGROW: " << time0 << LogIO::POST ; 804 872 tcolr = tpoolr->construct( t5, "FLAG_ROW" ) ; 805 873 for ( int i = 0 ; i < nloop ; i++ ) { … … 809 877 } 810 878 tpoolr->destroy( tcolr ) ; 879 time1 = gettimeofday_sec() ; 880 os_ << "end fill FLAGROW: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 811 881 812 882 // TCAL_ID 883 time0 = gettimeofday_sec() ; 884 os_ << "start fill TCAL_ID: " << time0 << LogIO::POST ; 813 885 if ( isSysCal_ ) { 814 886 for( Int irow = 0 ; irow < nrow ; irow++ ) { … … 830 902 tcalidCol->putScalar( prevnr+irow, tcalid ) ; 831 903 } 904 time1 = gettimeofday_sec() ; 905 os_ << "end fill TCAL_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 832 906 833 907 // WEATHER_ID 908 time0 = gettimeofday_sec() ; 909 os_ << "start fill WEATHER_ID: " << time0 << LogIO::POST ; 834 910 if ( isWeather_ ) { 835 911 uInt wid = 0 ; … … 841 917 } 842 918 } 919 time1 = gettimeofday_sec() ; 920 os_ << "end fill WEATHER_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 843 921 844 922 delete mTimeCol ; … … 853 931 // MS: 1-base 854 932 // Scantable: 0-base 933 time0 = gettimeofday_sec() ; 934 os_ << "start fill SCANNO: " << time0 << LogIO::POST ; 855 935 Int dest5 = current5 + added5 ; 856 936 scanNum -= 1 ; 857 937 for ( Int irow = current5 ; irow < dest5 ; irow++ ) 858 938 scannoCol->putScalar( irow, (uInt)scanNum ) ; 939 time1 = gettimeofday_sec() ; 940 os_ << "end fill SCANNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 859 941 860 942 os_ << "added5 = " << added5 << endl ; … … 864 946 865 947 // IFNO 948 time0 = gettimeofday_sec() ; 949 os_ << "start fill IFNO: " << time0 << LogIO::POST ; 866 950 Int dest4 = current4 + added4 ; 867 951 for ( Int irow = current4 ; irow < dest4 ; irow++ ) 868 952 ifnoCol->putScalar( irow, (uInt)spwId ) ; 953 time1 = gettimeofday_sec() ; 954 os_ << "end fill IFNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 869 955 870 956 // FREQ_ID 957 time0 = gettimeofday_sec() ; 958 os_ << "start fill FREQ_ID: " << time0 << LogIO::POST ; 871 959 uInt fid = ifmap[spwId] ; 872 960 for ( Int irow = current4 ; irow < dest4 ; irow++ ) 873 961 freqidCol->putScalar( irow, fid ) ; 962 time1 = gettimeofday_sec() ; 963 os_ << "end fill FREQ_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 874 964 875 965 // MOLECULE_ID 966 time0 = gettimeofday_sec() ; 967 os_ << "start fill MOLECULE_ID: " << time0 << LogIO::POST ; 876 968 for ( Int irow = current4 ; irow < dest4 ; irow++ ) 877 969 molidCol->putScalar( irow, molId ) ; 970 time1 = gettimeofday_sec() ; 971 os_ << "end fill MOLECULE_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 878 972 879 973 // SRCNAME 974 time0 = gettimeofday_sec() ; 975 os_ << "start fill SRCNAME: " << time0 << LogIO::POST ; 880 976 for ( Int irow = current4 ; irow < dest4 ; irow++ ) 881 977 srcnameCol->putScalar( irow, srcName ) ; 978 time1 = gettimeofday_sec() ; 979 os_ << "end fill SRCNAME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 882 980 883 981 // SRCVELOCITY, SRCPROPERMOTION and SRCDIRECTION 884 982 // no reference conversion for direction at the moment (assume J2000) 885 983 // no reference conversion for velocity at the moment (assume LSRK) 984 time0 = gettimeofday_sec() ; 985 os_ << "start fill SRCPROPERMOTION: " << time0 << LogIO::POST ; 886 986 for ( Int irow = current4 ; irow < dest4 ; irow++ ) 887 987 srcpmCol->put( irow, srcPM ) ; 988 time1 = gettimeofday_sec() ; 989 os_ << "end fill SRCPROPERMOTION: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 990 time0 = gettimeofday_sec() ; 991 os_ << "start fill SRCDIRECTION: " << time0 << LogIO::POST ; 888 992 for ( Int irow = current4 ; irow < dest4 ; irow++ ) 889 993 srcdirCol->put( irow, srcDir ) ; 994 time1 = gettimeofday_sec() ; 995 os_ << "end fill SRCDIRECTION: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 996 time0 = gettimeofday_sec() ; 997 os_ << "start fill SRCVELOCITY: " << time0 << LogIO::POST ; 890 998 for ( Int irow = current4 ; irow < dest4 ; irow++ ) 891 999 srcvelCol->putScalar( irow, sysVel ) ; 1000 time1 = gettimeofday_sec() ; 1001 os_ << "end fill SRCVELOCITY: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 892 1002 893 1003 os_ << "added4 = " << added4 << endl ; … … 897 1007 898 1008 // FIELDNAME 1009 time0 = gettimeofday_sec() ; 1010 os_ << "start fill FIELDNAME: " << time0 << LogIO::POST ; 899 1011 Int dest3 = current3 + added3 ; 900 1012 for ( Int irow = current3 ; irow < dest3 ; irow++ ) 901 1013 fieldnameCol->putScalar( irow, fieldName ) ; 902 1014 time1 = gettimeofday_sec() ; 1015 os_ << "end fill FIELDNAME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 1016 903 1017 os_ << "added3 = " << added3 << endl ; 904 1018 added2 += added3 ; … … 907 1021 908 1022 // BEAMNO 1023 time0 = gettimeofday_sec() ; 1024 os_ << "start fill BEAMNO: " << time0 << LogIO::POST ; 909 1025 Int dest2 = current2 + added2 ; 910 1026 for ( Int irow = current2 ; irow < dest2 ; irow++ ) 911 1027 beamnoCol->putScalar( irow, (uInt)feedId ) ; 1028 time1 = gettimeofday_sec() ; 1029 os_ << "end fill BEAMNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 912 1030 913 1031 // FOCUS_ID 914 1032 // tentative 1033 time0 = gettimeofday_sec() ; 1034 os_ << "start fill FOCUS_ID: " << time0 << LogIO::POST ; 915 1035 uInt focusId = 0 ; 916 1036 for ( Int irow = current2 ; irow < dest2 ; irow++ ) 917 1037 focusidCol->putScalar( irow, focusId ) ; 918 1038 time1 = gettimeofday_sec() ; 1039 os_ << "end fill FOCUS_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 1040 919 1041 os_ << "added2 = " << added2 << endl ; 920 1042 added1 += added2 ; … … 932 1054 // REFBEAMNO 933 1055 // set 0 at the moment 934 tcolw = tpoolw->construct( table_->table(), "REFBEAMNO" ) ; 1056 time0 = gettimeofday_sec() ; 1057 os_ << "start fill REFBEAMNO: " << time0 << LogIO::POST ; 1058 tcolw = tpoolw->construct( stab, "REFBEAMNO" ) ; 935 1059 for ( Int irow = current0 ; irow < added0 ; irow++ ) 936 1060 tcolw->putScalar( irow, 0 ) ; 937 1061 tpoolw->destroy( tcolw ) ; 1062 time1 = gettimeofday_sec() ; 1063 os_ << "end fill REFBEAMNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 938 1064 939 1065 // FIT_ID 940 1066 // nothing to do 941 tcolw = tpoolw->construct( table_->table(), "FIT_ID" ) ; 1067 time0 = gettimeofday_sec() ; 1068 os_ << "start fill FIT_ID: " << time0 << LogIO::POST ; 1069 tcolw = tpoolw->construct( stab, "FIT_ID" ) ; 942 1070 for ( Int irow = current0 ; irow < added0 ; irow++ ) 943 1071 tcolw->putScalar( irow, -1 ) ; 944 1072 tpoolw->destroy( tcolw ) ; 1073 time1 = gettimeofday_sec() ; 1074 os_ << "end fill FIT_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 945 1075 946 1076 // OPACITY 947 1077 // not used? 948 tcolw = tpoolw->construct( table_->table(), "OPACITY" ) ; 1078 time0 = gettimeofday_sec() ; 1079 os_ << "start fill OPACITY: " << time0 << LogIO::POST ; 1080 tcolw = tpoolw->construct( stab, "OPACITY" ) ; 949 1081 for ( Int irow = current0 ; irow < added0 ; irow++ ) 950 1082 tcolw->putScalar( irow, 0.0 ) ; 951 1083 tpoolw->destroy( tcolw ) ; 1084 time1 = gettimeofday_sec() ; 1085 os_ << "end fill OPACITY: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 952 1086 953 1087 // delete Scantable columns … … 1022 1156 Path datapath( tablename_ ) ; 1023 1157 String pTabName = datapath.absoluteName() + "/POINTING" ; 1024 table_->table().rwKeywordSet().define( "POINTING", pTabName ) ;1158 stab.rwKeywordSet().define( "POINTING", pTabName ) ; 1025 1159 1026 1160 // for GBT 1027 1161 if ( antennaName == "GBT" ) { 1028 1162 String goTabName = datapath.absoluteName() + "/GBT_GO" ; 1029 table_->table().rwKeywordSet().define( "GBT_GO", goTabName ) ;1030 } 1031 //double endSec = gettimeofday_sec() ;1032 //os_ << "end MSFiller::fill() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1163 stab.rwKeywordSet().define( "GBT_GO", goTabName ) ; 1164 } 1165 double endSec = gettimeofday_sec() ; 1166 os_ << "end MSFiller::fill() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1033 1167 } 1034 1168 … … 1043 1177 Int MSFiller::getSrcType( Int stateId, boost::object_pool<ROTableColumn> *tpool ) 1044 1178 { 1045 //double startSec = gettimeofday_sec() ;1046 //os_ << "start MSFiller::getSrcType() startSec=" << startSec << LogIO::POST ;1179 double startSec = gettimeofday_sec() ; 1180 os_ << "start MSFiller::getSrcType() startSec=" << startSec << LogIO::POST ; 1047 1181 1048 1182 MSState statetab = mstable_.state() ; … … 1150 1284 1151 1285 //os_ << "srcType = " << srcType << LogIO::POST ; 1152 //double endSec = gettimeofday_sec() ;1153 //os_ << "end MSFiller::getSrcType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1286 double endSec = gettimeofday_sec() ; 1287 os_ << "end MSFiller::getSrcType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1154 1288 return srcType ; 1155 1289 } … … 1157 1291 Vector<uInt> MSFiller::getPolNo( Int corrType ) 1158 1292 { 1159 //double startSec = gettimeofday_sec() ;1160 //os_ << "start MSFiller::getPolNo() startSec=" << startSec << LogIO::POST ;1293 double startSec = gettimeofday_sec() ; 1294 os_ << "start MSFiller::getPolNo() startSec=" << startSec << LogIO::POST ; 1161 1295 Vector<uInt> polno( 1 ) ; 1162 1296 … … 1188 1322 } 1189 1323 //os_ << "polno = " << polno << LogIO::POST ; 1190 //double endSec = gettimeofday_sec() ;1191 //os_ << "end MSFiller::getPolNo() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1324 double endSec = gettimeofday_sec() ; 1325 os_ << "end MSFiller::getPolNo() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1192 1326 1193 1327 return polno ; … … 1196 1330 String MSFiller::getPolType( Int corrType ) 1197 1331 { 1198 //double startSec = gettimeofday_sec() ;1199 //os_ << "start MSFiller::getPolType() startSec=" << startSec << LogIO::POST ;1332 double startSec = gettimeofday_sec() ; 1333 os_ << "start MSFiller::getPolType() startSec=" << startSec << LogIO::POST ; 1200 1334 String poltype = "" ; 1201 1335 … … 1209 1343 poltype = "linpol" ; 1210 1344 1211 //double endSec = gettimeofday_sec() ;1212 //os_ << "end MSFiller::getPolType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1345 double endSec = gettimeofday_sec() ; 1346 os_ << "end MSFiller::getPolType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1213 1347 return poltype ; 1214 1348 } … … 1216 1350 void MSFiller::fillWeather() 1217 1351 { 1218 //double startSec = gettimeofday_sec() ;1219 //os_ << "start MSFiller::fillWeather() startSec=" << startSec << LogIO::POST ;1352 double startSec = gettimeofday_sec() ; 1353 os_ << "start MSFiller::fillWeather() startSec=" << startSec << LogIO::POST ; 1220 1354 Table mWeather = mstable_.weather() ; 1221 1355 //Table mWeatherSel = mWeather( mWeather.col("ANTENNA_ID") == antenna_ ).sort("TIME") ; … … 1292 1426 mwInterval_ *= 86400.0 ; 1293 1427 //os_ << "mwTime[0] = " << mwTime_[0] << " mwInterval[0] = " << mwInterval_[0] << LogIO::POST ; 1294 //double endSec = gettimeofday_sec() ;1295 //os_ << "end MSFiller::fillWeather() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1428 double endSec = gettimeofday_sec() ; 1429 os_ << "end MSFiller::fillWeather() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1296 1430 } 1297 1431 1298 1432 void MSFiller::fillFocus() 1299 1433 { 1300 //double startSec = gettimeofday_sec() ;1301 //os_ << "start MSFiller::fillFocus() startSec=" << startSec << LogIO::POST ;1434 double startSec = gettimeofday_sec() ; 1435 os_ << "start MSFiller::fillFocus() startSec=" << startSec << LogIO::POST ; 1302 1436 // tentative 1303 1437 Table tab = table_->focus().table() ; … … 1305 1439 ScalarColumn<uInt> idCol( tab, "ID" ) ; 1306 1440 idCol.put( 0, 0 ) ; 1307 //double endSec = gettimeofday_sec() ;1308 //os_ << "end MSFiller::fillFocus() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1441 double endSec = gettimeofday_sec() ; 1442 os_ << "end MSFiller::fillFocus() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1309 1443 } 1310 1444 … … 1312 1446 boost::object_pool<TableColumn> *tpoolw ) 1313 1447 { 1314 //double startSec = gettimeofday_sec() ;1315 //os_ << "start MSFiller::fillTcal() startSec=" << startSec << LogIO::POST ;1448 double startSec = gettimeofday_sec() ; 1449 os_ << "start MSFiller::fillTcal() startSec=" << startSec << LogIO::POST ; 1316 1450 1317 1451 //MSSysCal sctab = mstable_.sysCal() ; … … 1346 1480 Int feedId = sharedCol->asInt( 0 ) ; 1347 1481 tpoolr->destroy( sharedCol ) ; 1348 String ffield = "FEED" + String::toString( feedId ) ;1482 //String ffield = "FEED" + String::toString( feedId ) ; 1349 1483 //Record rec0 ; 1350 1484 TableIterator iter1( t0, "SPECTRAL_WINDOW_ID" ) ; … … 1354 1488 Int spwId = sharedCol->asInt( 0 ) ; 1355 1489 tpoolr->destroy( sharedCol ) ; 1356 String spwfield = "SPW" + String::toString( spwId ) ;1490 //String spwfield = "SPW" + String::toString( spwId ) ; 1357 1491 //Record rec1 ; 1358 1492 TableIterator iter2( t1, "TIME" ) ; … … 1388 1522 oldnr = newnr ; 1389 1523 1390 String key = ffield+":"+spwfield+":"+sTime ; 1524 //String key = ffield+":"+spwfield+":"+sTime ; 1525 String key = keyTcal( feedId, spwId, sTime ) ; 1391 1526 tcalrec_.define( key, idminmax ) ; 1392 1527 //rec1.define( sTime, idminmax ) ; … … 1404 1539 1405 1540 //tcalrec_.print( std::cout ) ; 1406 //double endSec = gettimeofday_sec() ;1407 //os_ << "end MSFiller::fillTcal() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1541 double endSec = gettimeofday_sec() ; 1542 os_ << "end MSFiller::fillTcal() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1408 1543 } 1409 1544 1410 1545 uInt MSFiller::getWeatherId( uInt idx, Double wtime ) 1411 1546 { 1412 //double startSec = gettimeofday_sec() ;1413 //os_ << "start MSFiller::getWeatherId() startSec=" << startSec << LogIO::POST ;1547 double startSec = gettimeofday_sec() ; 1548 os_ << "start MSFiller::getWeatherId() startSec=" << startSec << LogIO::POST ; 1414 1549 uInt nrow = mwTime_.size() ; 1415 1550 if ( nrow == 0 ) … … 1440 1575 //os_ << LogIO::WARN << "Couldn't find correct WEATHER_ID for time " << wtime << LogIO::POST ; 1441 1576 1442 //double endSec = gettimeofday_sec() ;1443 //os_ << "end MSFiller::getWeatherId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1577 double endSec = gettimeofday_sec() ; 1578 os_ << "end MSFiller::getWeatherId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1444 1579 return wid ; 1445 1580 } … … 1447 1582 Vector<Double> MSFiller::getSysCalTime( MSSysCal &tab, MEpoch::ROScalarColumn &tcol ) 1448 1583 { 1449 //double startSec = gettimeofday_sec() ;1450 //os_ << "start MSFiller::getSysCalTime() startSec=" << startSec << LogIO::POST ;1584 double startSec = gettimeofday_sec() ; 1585 os_ << "start MSFiller::getSysCalTime() startSec=" << startSec << LogIO::POST ; 1451 1586 uInt nrow = tcol.table().nrow() ; 1452 1587 Vector<Double> tstr( nrow, -1.0 ) ; … … 1478 1613 } 1479 1614 } 1480 //double endSec = gettimeofday_sec() ;1481 //os_ << "end MSFiller::getSysCalTime() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1615 double endSec = gettimeofday_sec() ; 1616 os_ << "end MSFiller::getSysCalTime() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1482 1617 return tstr ; 1483 1618 } … … 1485 1620 uInt MSFiller::getTsys( uInt idx, Matrix<Float> &tsys, MSSysCal &tab, Double t ) 1486 1621 { 1487 //double startSec = gettimeofday_sec() ;1488 //os_ << "start MSFiller::getTsys() startSec=" << startSec << LogIO::POST ;1622 double startSec = gettimeofday_sec() ; 1623 os_ << "start MSFiller::getTsys() startSec=" << startSec << LogIO::POST ; 1489 1624 uInt nrow = tab.nrow() ; 1490 1625 if ( nrow == 0 ) { … … 1511 1646 } 1512 1647 //os_ << "MSFiller::getTsys() idx = " << idx << " tsys = " << tsys << LogIO::POST ; 1513 //double endSec = gettimeofday_sec() ;1514 //os_ << "end MSFiller::getTsys() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1648 double endSec = gettimeofday_sec() ; 1649 os_ << "end MSFiller::getTsys() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1515 1650 return idx ; 1516 1651 } … … 1518 1653 Vector<uInt> MSFiller::getTcalId( Int fid, Int spwid, Double t ) 1519 1654 { 1520 //double startSec = gettimeofday_sec() ;1521 //os_ << "start MSFiller::getTcalId() startSec=" << startSec << LogIO::POST ;1655 double startSec = gettimeofday_sec() ; 1656 os_ << "start MSFiller::getTcalId() startSec=" << startSec << LogIO::POST ; 1522 1657 if ( table_->tcal().table().nrow() == 0 ) { 1523 1658 os_ << "No TCAL rows" << LogIO::POST ; … … 1525 1660 return tcalids ; 1526 1661 } 1527 String feed = "FEED" + String::toString(fid) ;1528 String spw = "SPW" + String::toString(spwid) ;1662 //String feed = "FEED" + String::toString(fid) ; 1663 //String spw = "SPW" + String::toString(spwid) ; 1529 1664 String sctime = MVTime( Quantum<Double>(t,"s") ).string(MVTime::YMD) ; 1530 String key = feed + ":" + spw + ":" + sctime ; 1665 //String key = feed + ":" + spw + ":" + sctime ; 1666 String key = keyTcal( fid, spwid, sctime ) ; 1531 1667 //Record rec = tcalrec_.asRecord(feed).asRecord(spw) ; 1532 1668 //if ( !rec.isDefined( sctime ) ) { … … 1545 1681 tcalids[ipol] = ids[0] + ipol - 1 ; 1546 1682 1547 //double endSec = gettimeofday_sec() ;1548 //os_ << "end MSFiller::getTcalId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1683 double endSec = gettimeofday_sec() ; 1684 os_ << "end MSFiller::getTcalId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1549 1685 return tcalids ; 1550 1686 } … … 1552 1688 uInt MSFiller::getDirection( uInt idx, Vector<Double> &dir, Vector<Double> &srate, String &ref, MSPointing &tab, Double t ) 1553 1689 { 1554 //double startSec = gettimeofday_sec() ;1555 //os_ << "start MSFiller::getDirection() startSec=" << startSec << LogIO::POST ;1690 double startSec = gettimeofday_sec() ; 1691 os_ << "start MSFiller::getDirection() startSec=" << startSec << LogIO::POST ; 1556 1692 // assume that cols is sorted by TIME 1557 1693 Bool doInterp = False ; … … 1627 1763 } 1628 1764 1629 //double endSec = gettimeofday_sec() ;1630 //os_ << "end MSFiller::getDirection() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;1765 double endSec = gettimeofday_sec() ; 1766 os_ << "end MSFiller::getDirection() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1631 1767 return idx ; 1632 1768 } 1633 1769 1770 String MSFiller::keyTcal( Int feedid, Int spwid, String stime ) 1771 { 1772 String sfeed = "FEED" + String::toString( feedid ) ; 1773 String sspw = "SPW" + String::toString( spwid ) ; 1774 return sfeed+":"+sspw+":"+stime ; 1775 } 1776 1634 1777 } ; 1635 1778 -
trunk/src/MSFiller.h
r1988 r1990 96 96 // get direction for DIRECTION, AZIMUTH, and ELEVATION columns 97 97 casa::uInt getDirection( casa::uInt idx, casa::Vector<casa::Double> &dir, casa::Vector<casa::Double> &srate, casa::String &ref, casa::MSPointing &tab, casa::Double t ) ; 98 99 // create key for TCAL table 100 casa::String keyTcal( casa::Int feedid, casa::Int spwid, casa::String stime ) ; 98 101 99 102 casa::CountedPtr<Scantable> table_ ;
Note:
See TracChangeset
for help on using the changeset viewer.