Changeset 2002


Ignore:
Timestamp:
02/18/11 19:26:01 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2718

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

  • Changed column-based data access to row-based data-access when writing the data.
  • Tuning on getSysCalTime() and other related parts


Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MSFiller.cpp

    r1993 r2002  
    2323#include <tables/Tables/TableParse.h>
    2424#include <tables/Tables/RefRows.h>
    25 
    26 #include <casa/Containers/Block.h>
     25#include <tables/Tables/TableRow.h>
     26
     27#include <casa/Containers/RecordField.h>
    2728#include <casa/Logging/LogIO.h>
    2829#include <casa/Arrays/Slicer.h>
     
    197198      colTsys_ = "TSYS" ;
    198199  }
     200  //colTcal_ = "TCAL" ;
     201  //colTsys_ = "TSYS" ;
    199202  MSPointing pointtab = mstable_.pointing() ;
    200203  if ( mstable_.weather().nrow() == 0 )
     
    206209  // memory allocation by boost::object_pool
    207210  boost::object_pool<ROTableColumn> *tpoolr = new boost::object_pool<ROTableColumn> ;
    208   boost::object_pool<TableColumn> *tpoolw = new boost::object_pool<TableColumn> ;
    209211  //
    210212
     
    222224  // SUBTABLES: TCAL
    223225  if ( isSysCal_ )
    224     fillTcal( tpoolr, tpoolw ) ;
     226    fillTcal( tpoolr ) ;
    225227
    226228  // SUBTABLES: FIT
     
    232234  // shared pointers
    233235  ROTableColumn *tcolr ;
    234   TableColumn *tcolw ;
    235 
    236   // Scantable columns
    237   Table stab = table_->table() ;
    238   TableColumn *scannoCol = tpoolw->construct( stab, "SCANNO" ) ;
    239   TableColumn *cyclenoCol = tpoolw->construct( stab, "CYCLENO" ) ;
    240   TableColumn *beamnoCol = tpoolw->construct( stab, "BEAMNO" ) ;
    241   TableColumn *ifnoCol = tpoolw->construct( stab, "IFNO" ) ;
    242   TableColumn *polnoCol = tpoolw->construct( stab, "POLNO" ) ;
    243   TableColumn *freqidCol = tpoolw->construct( stab, "FREQ_ID" ) ;
    244   TableColumn *molidCol = tpoolw->construct( stab, "MOLECULE_ID" ) ;
    245   TableColumn *flagrowCol = tpoolw->construct( stab, "FLAGROW" ) ;
    246   ScalarMeasColumn<MEpoch> *timeCol = new ScalarMeasColumn<MEpoch>( stab, "TIME" ) ;
    247   TableColumn *intervalCol = tpoolw->construct( stab, "INTERVAL" ) ;
    248   TableColumn *srcnameCol = tpoolw->construct( stab, "SRCNAME" ) ;
    249   TableColumn *srctypeCol = tpoolw->construct( stab, "SRCTYPE" ) ;
    250   TableColumn *fieldnameCol = tpoolw->construct( stab, "SRCNAME" ) ;
    251   ArrayColumn<Float> *spCol = new ArrayColumn<Float>( stab, "SPECTRA" ) ;
    252   ArrayColumn<uChar> *flCol = new ArrayColumn<uChar>( stab, "FLAGTRA" ) ;
    253   ArrayColumn<Float> *tsysCol = new ArrayColumn<Float>( stab, "TSYS" ) ;
    254   ArrayColumn<Double> *dirCol = new ArrayColumn<Double>( stab, "DIRECTION" ) ;
    255   TableColumn *azCol = tpoolw->construct( stab, "AZIMUTH" ) ;
    256   TableColumn *elCol = tpoolw->construct( stab, "ELEVATION" ) ;
    257   TableColumn *tcalidCol = tpoolw->construct( stab, "TCAL_ID" ) ;
    258   TableColumn *focusidCol = tpoolw->construct( stab, "FOCUS_ID" ) ;
    259   TableColumn *weatheridCol = tpoolw->construct( stab, "WEATHER_ID" ) ;
    260   ArrayColumn<Double> *srcpmCol = new ArrayColumn<Double>( stab, "SRCPROPERMOTION" ) ;
    261   ArrayColumn<Double> *srcdirCol = new ArrayColumn<Double>( stab, "SRCDIRECTION" ) ;
    262   TableColumn *srcvelCol = tpoolw->construct( stab, "SRCVELOCITY" ) ;
    263   ArrayColumn<Double> *scanrateCol = new ArrayColumn<Double>( stab, "SCANRATE" ) ;
    264  
     236
    265237  // MAIN
    266238  // Iterate over several ids
    267   Int oldnr = table_->nrow() ;
    268239  map<Int, uInt> ifmap ; // (IFNO, FREQ_ID) pair
    269240  ROArrayQuantColumn<Double> *sharedQDArrCol = new ROArrayQuantColumn<Double>( anttab, "POSITION" ) ;
     
    289260  os_ << "end fill init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    290261
     262  // row based
     263  Table &stab = table_->table() ;
     264  TableRow row( stab ) ;
     265  TableRecord &trec = row.record() ;
     266  RecordFieldPtr< Array<Float> > spRF( trec, "SPECTRA" ) ;
     267  RecordFieldPtr< Array<uChar> > ucarrRF( trec, "FLAGTRA" ) ;
     268  RecordFieldPtr<Double> timeRF( trec, "TIME" ) ;
     269  RecordFieldPtr< Array<Float> > tsysRF( trec, "TSYS" ) ;
     270  RecordFieldPtr<Double> intervalRF( trec, "INTERVAL" ) ;
     271  RecordFieldPtr< Array<Double> > dirRF( trec, "DIRECTION" ) ;
     272  RecordFieldPtr<Float> azRF( trec, "AZIMUTH" ) ;
     273  RecordFieldPtr<Float> elRF( trec, "ELEVATION" ) ;
     274  RecordFieldPtr< Array<Double> > scrRF( trec, "SCANRATE" ) ;
     275  RecordFieldPtr<uInt> cycleRF( trec, "CYCLENO" ) ;
     276  RecordFieldPtr<uInt> flrRF( trec, "FLAGROW" ) ;
     277  RecordFieldPtr<uInt> tcalidRF( trec, "TCAL_ID" ) ;
     278  RecordFieldPtr<uInt> widRF( trec, "WEATHER_ID" ) ;
     279  RecordFieldPtr<uInt> polnoRF( trec, "POLNO" ) ;
     280
     281
     282  // REFBEAMNO
     283  RecordFieldPtr<Int> intRF( trec, "REFBEAMNO" ) ;
     284  *intRF = 0 ;
     285
     286  // FIT_ID
     287  intRF.attachToRecord( trec, "FIT_ID" ) ;
     288  *intRF = -1 ;
     289
     290  // OPACITY
     291  RecordFieldPtr<Float> floatRF( trec, "OPACITY" ) ;
     292  *floatRF = 0.0 ;
     293
    291294  //
    292295  // ITERATION: OBSERVATION_ID
    293296  //
    294   Int added0 = 0 ;
    295   Int current0 = table_->nrow() ;
    296297  TableIterator iter0( mstable_, "OBSERVATION_ID" ) ;
    297298  while( !iter0.pastEnd() ) {
     
    329330    // ITERATION: FEED1
    330331    //
    331     Int added1 = 0 ;
    332     Int current1 = table_->nrow() ;
    333332    TableIterator iter1( t0, "FEED1" ) ;
    334333    while( !iter1.pastEnd() ) {
     
    341340      tpoolr->destroy( tcolr ) ;
    342341      nbeam++ ;
     342
     343      // BEAMNO
     344      RecordFieldPtr<uInt> uintRF( trec, "BEAMNO" ) ;
     345      *uintRF = feedId ;
     346
     347      // FOCUS_ID
     348      uintRF.attachToRecord( trec, "FOCUS_ID" ) ;
     349      *uintRF = 0 ;
     350
    343351      time1 = gettimeofday_sec() ;
    344352      os_ << "end 1st iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     
    346354      // ITERATION: FIELD_ID
    347355      //
    348       Int added2 = 0 ;
    349       Int current2 = table_->nrow() ;
    350356      TableIterator iter2( t1, "FIELD_ID" ) ;
    351357      while( !iter2.pastEnd() ) {
     
    362368        String fieldName = tcolr->asString( fieldId ) + "__" + String::toString(fieldId) ;
    363369        tpoolr->destroy( tcolr ) ;
     370
     371        // FIELDNAME
     372        RecordFieldPtr<String> strRF( trec, "FIELDNAME" ) ;
     373        *strRF = fieldName ;
     374
     375
    364376        time1 = gettimeofday_sec() ;
    365377        os_ << "end 2nd iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     
    367379        // ITERATION: DATA_DESC_ID
    368380        //
    369         Int added3 = 0 ;
    370         Int current3 = table_->nrow() ;
    371381        TableIterator iter3( t2, "DATA_DESC_ID" ) ;
    372382        while( !iter3.pastEnd() ) {
     
    383393          Int spwId = tcolr->asInt( ddId ) ;
    384394          tpoolr->destroy( tcolr ) ;
     395
     396          // IFNO
     397          uintRF.attachToRecord( trec, "IFNO" ) ;
     398          *uintRF = (uInt)spwId ;
     399
    385400          // polarization information
    386401          tcolr = tpoolr->construct( poltab, "NUM_CORR" ) ;
     
    396411          // source information
    397412          MSSource srctabSel( srctab( srctab.col("SOURCE_ID") == srcId && srctab.col("SPECTRAL_WINDOW_ID") == spwId ) ) ;
    398           //os_ << "srcId = " << srcId << " spwId = " << spwId << " nrow = " << srctabSel.nrow() << LogIO::POST ;
     413          os_ << "srcId = " << srcId << " spwId = " << spwId << " nrow = " << srctabSel.nrow() << LogIO::POST ;
    399414          tcolr = tpoolr->construct( srctabSel, "NAME" ) ;
    400415          String srcName = tcolr->asString( 0 ) ;
    401416          tpoolr->destroy( tcolr ) ;
     417
     418          // SRCNAME
     419          strRF.attachToRecord( trec, "SRCNAME" ) ;
     420          *strRF = srcName ;
     421
    402422          //os_ << "srcName = " << srcName << LogIO::POST ;
    403423          ROArrayColumn<Double> *roArrDCol = new ROArrayColumn<Double>( srctabSel, "PROPER_MOTION" ) ;
    404424          Array<Double> srcPM = (*roArrDCol)( 0 ) ;
    405425          delete roArrDCol ;
     426
     427          // SRCPROPERMOTION
     428          RecordFieldPtr< Array<Double> > darrRF( trec, "SRCPROPERMOTION" ) ;
     429          *darrRF = srcPM ;
     430
    406431          //os_ << "srcPM = " << srcPM << LogIO::POST ;
    407432          roArrDCol = new ROArrayColumn<Double>( srctabSel, "DIRECTION" ) ;
    408433          Array<Double> srcDir = (*roArrDCol)( 0 ) ;
    409434          delete roArrDCol ;
     435
     436          // SRCDIRECTION
     437          darrRF.attachToRecord( trec, "SRCDIRECTION" ) ;
     438          *darrRF = srcDir ;
     439
    410440          //os_ << "srcDir = " << srcDir << LogIO::POST ;
    411441          Array<Double> sysVels ;
     
    421451            sysVel = sysVels( IPosition(1,0) ) ;
    422452          }
     453
     454          // SRCVELOCITY
     455          RecordFieldPtr<Double> doubleRF( trec, "SRCVELOCITY" ) ;
     456          *doubleRF = sysVel ;
     457
    423458          //delete tmpArrCol ;
    424459          //os_ << "sysVel = " << sysVel << LogIO::POST ;
     
    451486          }
    452487          uInt molId = table_->molecules().addEntry( restFreqs, transitionName, transitionName ) ;
     488
     489          // MOLECULE_ID
     490          uintRF.attachToRecord( trec, "MOLECULE_ID" ) ;
     491          *uintRF = molId ;
     492
    453493          // spectral setup
    454494          MeasFrame mf( me, mp, md ) ;
     
    521561            //os_ << "added to ifmap: (" << spwId << "," << freqId << ")" << LogIO::POST ;
    522562          }
     563
     564          // FREQ_ID
     565          uintRF.attachToRecord( trec, "FREQ_ID" ) ;
     566          *uintRF = freqId ;
     567
    523568          // for TSYS and TCAL
    524569          MSSysCal caltabsel( caltab( caltab.col("ANTENNA_ID") == antenna_ && caltab.col("FEED_ID") == feedId && caltab.col("SPECTRAL_WINDOW_ID") == spwId ).sort("TIME") ) ;
     570          ROScalarMeasColumn<MEpoch> scTimeCol( caltabsel, "TIME" ) ;
     571          Block<MEpoch> scTime( caltabsel.nrow() ) ;
     572          for ( uInt irow = 0 ; irow < caltabsel.nrow() ; irow++ )
     573            scTime[irow] = scTimeCol( irow ) ;
     574          ROScalarColumn<Double> *scIntervalCol = new ROScalarColumn<Double>( caltabsel, "INTERVAL" ) ;
     575          Vector<Double> scInterval = scIntervalCol->getColumn() ;
     576          delete scIntervalCol ;
     577          ROArrayColumn<Float> scTsysCol( caltabsel, "TSYS" ) ;
    525578          time1 = gettimeofday_sec() ;
    526579          os_ << "end 3rd iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     
    528581          // ITERATION: SCAN_NUMBER
    529582          //
    530           Int added4 = 0 ;
    531           Int current4 = table_->nrow() ;
    532583          TableIterator iter4( t3, "SCAN_NUMBER" ) ;
    533584          while( !iter4.pastEnd() ) {
     
    538589            Int scanNum = tcolr->asInt( 0 ) ;
    539590            tpoolr->destroy( tcolr ) ;
     591
     592            // SCANNO
     593            uintRF.attachToRecord( trec, "SCANNO" ) ;
     594            *uintRF = scanNum - 1 ;
     595
    540596            uInt cycle = 0 ;
    541597            time1 = gettimeofday_sec() ;
     
    544600            // ITERATION: STATE_ID
    545601            //
    546             Int added5 = 0 ;
    547             Int current5 = table_->nrow() ;
    548602            TableIterator iter5( t4, "STATE_ID" ) ;
    549603            while( !iter5.pastEnd() ) {
     
    560614
    561615              Int nrow = t5.nrow() ;
    562               Int prevnr = oldnr ;
    563               Int addednr = 0 ;
    564               Int nloop = 0 ;
    565616              time1 = gettimeofday_sec() ;
    566617              os_ << "end 5th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    567            
    568               // SPECTRA, FLAG
    569               time0 = gettimeofday_sec() ;
    570               os_ << "start fill SPECTRA and FLAG: " << time0 << LogIO::POST ;
    571               ROArrayColumn<Bool> mFlagCol( t5, "FLAG" ) ;
    572               //Cube<Bool> mFlagArr = mFlagCol.getColumn() ;
     618
     619              Cube<Float> spArr ;
     620              Cube<Bool> flArr ;
    573621              if ( isFloatData_ ) {
    574                 //os_ << "FLOAT_DATA exists" << LogIO::POST ;
     622                ROArrayColumn<Bool> mFlagCol( t5, "FLAG" ) ;
    575623                ROArrayColumn<Float> mFloatDataCol( t5, "FLOAT_DATA" ) ;
    576                 //Cube<Float> mFloatDataArr = mFloatDataCol.getColumn() ;
    577                 addednr = nrow*npol ;
    578                 oldnr += addednr ;
    579                 stab.addRow( addednr ) ;
    580                 nloop = npol ;
    581                 for ( Int irow = 0 ; irow < nrow ; irow++ ) {
    582                   Matrix<Float> sp = mFloatDataCol( irow ) ;
    583                   //Matrix<Float> sp = mFloatDataArr.xyPlane( irow ) ;
    584                   for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    585                     spCol->put( prevnr+ipol*nrow+irow, sp.row(ipol) ) ;
    586                   }
    587                 }
    588                 for ( Int irow = 0 ; irow < nrow ; irow++ ) {
    589                   Matrix<Bool> flb = mFlagCol( irow ) ;
    590                   //Matrix<Bool> flb = mFlagArr.xyPlane( irow ) ;
    591                   Matrix<uChar> fl( flb.shape() ) ;
    592                   convertArray( fl, flb ) ;
    593                   for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    594                     flCol->put( prevnr+ipol*nrow+irow, fl.row(ipol) ) ;
    595                   }
    596                 }
     624                spArr = mFloatDataCol.getColumn() ;
     625                flArr = mFlagCol.getColumn() ;
    597626                if ( sdh.fluxunit == "" ) {
    598                   const TableRecord dataColKeys = mFloatDataCol.keywordSet() ;
     627                  const TableRecord &dataColKeys = mFloatDataCol.keywordSet() ;
    599628                  if ( dataColKeys.isDefined( "UNIT" ) )
    600629                    sdh.fluxunit = dataColKeys.asString( "UNIT" ) ;
     
    602631              }
    603632              else if ( isData_ ) {
    604                 //os_ << "DATA exists" << LogIO::POST ;
     633                spArr.resize( npol, nchan, nrow ) ;
     634                ROArrayColumn<Bool> mFlagCol( t5, "FLAG" ) ;
    605635                ROArrayColumn<Complex> mDataCol( t5, "DATA" ) ;
    606                 //Cube<Complex> mDataArr = mDataCol.getColumn() ;
    607                 addednr = nrow*npol ;
    608                 oldnr += addednr ;
    609                 stab.addRow( addednr ) ;
    610                 nloop = npol ;
    611636                for ( Int irow = 0 ; irow < nrow ; irow++ ) {
    612637                  Bool crossOK = False ;
    613638                  Matrix<Complex> sp = mDataCol( irow ) ;
    614                   //Matrix<Complex> sp = mDataArr.xyPlane( irow ) ;
     639                  Matrix<Bool> fl = mFlagCol( irow ) ;
    615640                  for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    616641                    if ( corrtype[ipol] == Stokes::XY || corrtype[ipol] == Stokes::YX
    617642                         || corrtype[ipol] == Stokes::RL || corrtype[ipol] == Stokes::LR ) {
    618643                      if ( !crossOK ) {
    619                         crossOK = True ;
    620                         Int pidx = prevnr + ipol * nrow + irow ;
    621                         spCol->put( pidx, real( sp.row(ipol) ) ) ;
    622                         if ( corrtype[ipol] == Stokes::XY || corrtype[ipol] == Stokes::RL )
    623                           spCol->put( pidx+nrow, imag( sp.row(ipol) ) ) ;
    624                         else
    625                           spCol->put( pidx+nrow, imag( conj(sp.row(ipol)) ) ) ;
     644                        spArr( Slicer(Slice(ipol,1),Slice(0,nchan),Slice(irow,1)) ) = real( sp.row( ipol ) ) ;
     645                        flArr( Slicer(Slice(ipol,1),Slice(0,nchan),Slice(irow,1)) ) = fl.row( ipol ) ;
     646                        if ( corrtype[ipol] == Stokes::XY || corrtype[ipol] == Stokes::RL ) {
     647                          spArr( Slicer(Slice(ipol+1,1),Slice(0,nchan),Slice(irow,1)) ) = imag( sp.row( ipol ) ) ;
     648                          flArr( Slicer(Slice(ipol+1,1),Slice(0,nchan),Slice(irow,1)) ) = fl.row( ipol ) ;
     649                        }                       
     650                        else {
     651                          spArr( Slicer(Slice(ipol+1,1),Slice(0,nchan),Slice(irow,1)) ) = imag( conj( sp.row( ipol ) ) ) ;
     652                          flArr( Slicer(Slice(ipol+1,1),Slice(0,nchan),Slice(irow,1)) ) = fl.row( ipol ) ;
     653                        }
    626654                      }
    627655                    }
    628656                    else {
    629                       spCol->put( prevnr+ipol*nrow+irow, real( sp.row(ipol) ) ) ;
    630                     }
    631                   }
    632                 }
    633                 for ( Int irow = 0 ; irow < nrow ; irow++ ) {
    634                   Bool crossOK = False ;
    635                   Matrix<Bool> flb = mFlagCol( irow ) ;
    636                   //Matrix<Bool> flb = mFlagArr.xyPlane( irow ) ;
    637                   Matrix<uChar> fl( flb.shape() ) ;
    638                   convertArray( fl, flb ) ;
    639                   for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    640                     if ( corrtype[ipol] == Stokes::XY || corrtype[ipol] == Stokes::YX
    641                          || corrtype[ipol] == Stokes::RL || corrtype[ipol] == Stokes::LR ) {
    642                       if ( !crossOK ) {
    643                         crossOK = True ;
    644                         Int pidx = prevnr + ipol * nrow + irow ;
    645                         flCol->put( pidx, fl.row(ipol) ) ;
    646                         flCol->put( pidx+nrow, fl.row(ipol+1) ) ;
    647                       }
    648                     }
    649                     else {
    650                       flCol->put( prevnr+ipol*nrow+irow, fl.row(ipol) ) ;
     657                      spArr( Slicer(Slice(ipol,1),Slice(0,nchan),Slice(irow,1)) ) = real( sp.row( ipol ) ) ;
     658                      flArr( Slicer(Slice(ipol,1),Slice(0,nchan),Slice(irow,1)) ) = fl.row( ipol ) ;
    651659                    }
    652660                  }
    653661                }
    654662                if ( sdh.fluxunit == "" ) {
    655                   const TableRecord dataColKeys = mDataCol.keywordSet() ;
     663                  const TableRecord &dataColKeys = mDataCol.keywordSet() ;
    656664                  if ( dataColKeys.isDefined( "UNIT" ) )
    657                     sdh.fluxunit = dataColKeys.asString( "UNIT" ) ; 
    658                 }
     665                    sdh.fluxunit = dataColKeys.asString( "UNIT" ) ;
     666                } 
    659667              }
    660               time1 = gettimeofday_sec() ;
    661               os_ << "end fill SPECTRA and FLAGTRA: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    662 
    663               // number of rows added in this cycle
    664               //os_ << "prevnr = " << prevnr << LogIO::POST ;
    665               //os_ << "addednr = " << addednr << LogIO::POST ;
    666               RefRows rows( prevnr, prevnr+addednr-1 ) ;
    667 
    668               // TIME
    669               time0 = gettimeofday_sec() ;
    670               os_ << "start fill TIME: " << time0 << LogIO::POST ;
    671668              ROScalarMeasColumn<MEpoch> *mTimeCol = new ROScalarMeasColumn<MEpoch>( t5, "TIME" ) ;
    672               Int tidx = prevnr ;
    673               for ( Int i = 0 ; i < nloop ; i++ ) {
    674                 for ( Int j = 0 ; j < nrow ; j++ ) {
    675                   timeCol->put( tidx++, (*mTimeCol)( j ) ) ;
    676                 }
     669              Block<MEpoch> mTimeB( nrow ) ;
     670              for ( Int irow = 0 ; irow < nrow ; irow++ )
     671                mTimeB[irow] = (*mTimeCol)( irow ) ;
     672              ROTableColumn *mIntervalCol = tpoolr->construct( t5, "INTERVAL" ) ;
     673              ROTableColumn *mFlagRowCol = tpoolr->construct( t5, "FLAG_ROW" ) ;
     674              //Vector<Double> sysCalTime( nrow, -1.0 ) ;
     675              Block<Double> sysCalTime( nrow, -1.0 ) ;
     676              Block<Int> sysCalIdx( nrow, -1 ) ;
     677              if ( isSysCal_ ) {
     678                //getSysCalTime( caltabsel, mTimeB, sysCalTime, sysCalIdx ) ;
     679                getSysCalTime( scTime, scInterval, mTimeB, sysCalTime, sysCalIdx ) ;
    677680              }
    678               time1 = gettimeofday_sec() ;
    679               os_ << "end fill TIME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    680            
    681               // TSYS
    682               time0 = gettimeofday_sec() ;
    683               os_ << "start fill TSYS: " << time0 << LogIO::POST ;
    684               Vector<Double> sysCalTime( nrow, -1.0 ) ;
    685               //Vector<Double> sysCalTime ;
    686               if ( isSysCal_ ) {
    687                 //sysCalTime = getSysCalTime( caltabsel, *mTimeCol ) ;
    688                 getSysCalTime( caltabsel, *mTimeCol, sysCalTime ) ;
    689                 tidx = prevnr ;
    690                 uInt calidx = 0 ;
    691                 for ( Int i = 0 ; i < nrow ; i++ ) {
    692                   Matrix<Float> tsys ;
    693                   calidx = getTsys( calidx, tsys, caltabsel, sysCalTime(i) ) ;
    694                   //os_ << "tsys = " << tsys << LogIO::POST ;
    695                   uInt ncol = tsys.ncolumn() ;
    696                   if ( ncol == 0 ) {
    697                     IPosition cShape = IPosition( 2, npol, 1 ) ;
    698                     tsys.resize( cShape ) ;
    699                     tsys = 1.0 ;
    700                   }
    701                   for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    702                     //floatArrCol->put( prevnr+i+nrow*ipol, tsys.row( ipol ) ) ;
    703                     tsysCol->put( prevnr+i+nrow*ipol, tsys.row( ipol ) ) ;
    704                   }                 
    705                 }
    706               }
    707               else {
    708                 Vector<Float> tsys( 1, 1.0 ) ;
    709                 for ( Int i = prevnr ; i < prevnr+addednr ; i++ )
    710                   tsysCol->put( i, tsys ) ;
    711               }
    712               time1 = gettimeofday_sec() ;
    713               os_ << "end fill TSYS: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    714 
    715 
    716               // INTERVAL
    717               time0 = gettimeofday_sec() ;
    718               os_ << "start fill INTERVAL: " << time0 << LogIO::POST ;
    719               tcolr = tpoolr->construct( t5, "INTERVAL" ) ;
    720               //Vector<Double> integ = mIntervalCol->getColumn() ;
    721               for ( int i = 0 ; i < nloop ; i++ ) {
    722                 //Int startrow = prevnr + i ;
    723                 //Int endrow = startrow + nrow - 1 ;
    724                 //RefRows prows( startrow, endrow ) ;
    725                 //intervalCol->putColumnCells( prows, integ ) ;
    726                 for ( int j = 0 ; j < nrow ; j++ ) {
    727                   intervalCol->putScalar( prevnr+i*nrow+j, (Double)(tcolr->asdouble( j )) ) ;
    728                 }
    729               }
    730               tpoolr->destroy( tcolr ) ;
    731               time1 = gettimeofday_sec() ;
    732               os_ << "end fill INTERVAL: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    733 
    734               // SRCTYPE
    735               time0 = gettimeofday_sec() ;
    736               os_ << "start fill SRCTYPE: " << time0 << LogIO::POST ;
     681              delete mTimeCol ;
     682              Matrix<Float> defaulttsys( npol, 1, 1.0 ) ;
     683              //uInt calidx = 0 ;
    737684              Int srcType = getSrcType( stateId, tpoolr ) ;
    738               for ( int i = 0 ; i < addednr ; i++ ) {
    739                 srctypeCol->putScalar( prevnr+i, srcType ) ;
    740               }
    741               //Vector<Int> *srcType = new Vector<Int>( addednr, getSrcType( stateId ) ) ;
    742               //srcTypeCol->putColumnCells( rows, *srcType ) ;
    743               time1 = gettimeofday_sec() ;
    744               os_ << "end fill SRCTYPE: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    745 
    746               // DIRECTION, AZIMUTH, ELEVATION, SCANRATE
    747               time0 = gettimeofday_sec() ;
    748               os_ << "start fill DIRECTION, AZIMUTH, ELEVATION, SCANRATE: " << time0 << LogIO::POST ;
    749685              Vector<Double> defaultScanrate( 2, 0.0 ) ;
    750686              uInt diridx = 0 ;
    751687              MDirection::Types dirType ;
    752               if ( getPt_ ) {
    753                 for ( Int i = 0 ; i < nrow ; i++ ) {
     688              uInt wid = 0 ;
     689              Int pidx = 0 ;
     690              Bool crossOK = False ;
     691              Block<uInt> polnos( npol, 99 ) ;
     692              for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
     693                Block<uInt> p = getPolNo( corrtype[ipol] ) ;
     694                if ( p.size() > 1 ) {
     695                  if ( crossOK ) continue ;
     696                  else {
     697                    polnos[pidx] = p[0] ;
     698                    pidx++ ;
     699                    polnos[pidx] = p[1] ;
     700                    pidx++ ;
     701                    crossOK = True ;
     702                  }
     703                }
     704                else {
     705                  polnos[pidx] = p[0] ;
     706                  pidx++ ;
     707                }
     708              }
     709             
     710              // SRCTYPE
     711              intRF.attachToRecord( trec, "SRCTYPE" ) ;
     712              *intRF = srcType ;
     713
     714              for ( Int irow = 0 ; irow < nrow ; irow++ ) {
     715                // CYCLENO
     716                *cycleRF = cycle ;
     717
     718                // FLAGROW
     719                *flrRF = (uInt)mFlagRowCol->asBool( irow ) ;
     720
     721                // SPECTRA, FLAG
     722                //Matrix<Float> sp = mFloatDataCol( irow ) ;
     723                //Matrix<Bool> flb = mFlagCol( irow ) ;
     724                Matrix<Float> sp = spArr.xyPlane( irow ) ;
     725                Matrix<Bool> flb = flArr.xyPlane( irow ) ;
     726                Matrix<uChar> fl( flb.shape() ) ;
     727                convertArray( fl, flb ) ;
     728
     729                // TIME
     730                *timeRF = mTimeB[irow].get("s").getValue() ;
     731
     732                // INTERVAL
     733                *intervalRF = (Double)(mIntervalCol->asdouble( irow )) ;
     734
     735                // TSYS
     736                Matrix<Float> tsys ;
     737                //calidx = getTsys( calidx, tsys, caltabsel, sysCalTime[irow] ) ;
     738//                 calidx = getTsys( calidx, tsys, scTsysCol, scTime, sysCalTime[irow] ) ;
     739//                 if ( tsys.nelements() == 0 )
     740//                   tsys = defaulttsys ;
     741                if ( sysCalIdx[irow] != -1 )
     742                  tsys = scTsysCol( irow ) ;
     743                else
     744                  tsys = defaulttsys ;
     745
     746                // TCAL_ID
     747                Block<uInt> tcalids = getTcalId( feedId, spwId, sysCalTime[irow] ) ;
     748                if ( tcalids.size() == 0 ) {
     749                  tcalids.resize( npol ) ;
     750                  tcalids = 0 ;
     751                }
     752
     753                // WEATHER_ID
     754                if ( isWeather_ )
     755                  wid = getWeatherId( wid, mTimeB[irow].get("s").getValue() ) ;
     756                *widRF = wid ;
     757                 
     758
     759                // DIRECTION, AZEL, SCANRATE
     760                if ( getPt_ ) {
    754761                  Vector<Double> dir ;
    755762                  Vector<Double> scanrate ;
    756763                  String refString ;
    757                   diridx = getDirection( diridx, dir, scanrate, refString, pointtab, (*mTimeCol)(i).get("s").getValue() ) ;
    758                   //os_ << "diridx = " << diridx << " dmTimeCol(" << i << ") = " << mTimeCol(i).get("s").getValue()-mTimeCol(0).get("s").getValue() << LogIO::POST ;
    759                   //os_ << "dir = " << dir << LogIO::POST ;
    760                   //os_ << "scanrate = " << scanrate << LogIO::POST ;
    761                   //os_ << "refString = " << refString << LogIO::POST ;
     764                  diridx = getDirection( diridx, dir, scanrate, refString, pointtab, mTimeB[irow].get("s").getValue() ) ;
    762765                  MDirection::getType( dirType, refString ) ;
    763                   //os_ << "dirType = " << dirType << LogIO::POST ;
    764                   mf.resetEpoch( (*mTimeCol)(i) ) ;
     766                  mf.resetEpoch( mTimeB[irow] ) ;
    765767                  mf.resetDirection( MDirection( MVDirection(dir), dirType ) ) ;
    766768                  if ( refString == "J2000" ) {
    767                     //os_ << "J2000" << LogIO::POST ;
    768                     for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    769                       dirCol->put( prevnr+i+nrow*ipol, dir ) ;
    770                     }
     769                    *dirRF = dir ;
    771770                    MDirection::Convert toazel( dirType, MDirection::Ref( MDirection::AZEL, mf ) ) ;
    772771                    Vector<Double> azel = toazel( dir ).getAngle("rad").getValue() ;
    773                     for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    774                       azCol->putScalar( prevnr+i+nrow*ipol, (Float)azel(0) ) ;
    775                       elCol->putScalar( prevnr+i+nrow*ipol, (Float)azel(1) ) ;
    776                     }                 
     772                    *azRF = (Float)azel(0) ;
     773                    *elRF = (Float)azel(1) ;
    777774                  }
    778775                  else if ( refString(0,4) == "AZEL" ) {
    779                     //os_ << "AZEL" << LogIO::POST ;
    780                     for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    781                       azCol->putScalar( prevnr+i+nrow*ipol, (Float)dir(0) ) ;
    782                       elCol->putScalar( prevnr+i+nrow*ipol, (Float)dir(1) ) ;
    783                     }
     776                    *azRF = (Float)dir(0) ;
     777                    *elRF = (Float)dir(1) ;
    784778                    MDirection::Convert toj2000( dirType, MDirection::Ref( MDirection::J2000, mf ) ) ;
    785779                    Vector<Double> newdir = toj2000( dir ).getAngle("rad").getValue() ;
    786                     for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    787                       dirCol->put( prevnr+i+nrow*ipol, newdir ) ;
    788                     }                 
     780                    *dirRF = newdir ;
    789781                  }
    790782                  else {
    791                     //os_ << "OTHER: " << refString << LogIO::POST ;
    792783                    MDirection::Convert toazel( dirType, MDirection::Ref( MDirection::AZEL, mf ) ) ;
    793784                    Vector<Double> azel = toazel( dir ).getAngle("rad").getValue() ;
    794785                    MDirection::Convert toj2000( dirType, MDirection::Ref( MDirection::J2000, mf ) ) ;
    795786                    Vector<Double> newdir = toj2000( dir ).getAngle("rad").getValue() ;
    796                     for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    797                       dirCol->put( prevnr+i+nrow*ipol, newdir ) ;
    798                       azCol->putScalar( prevnr+i+nrow*ipol, (Float)dir(0) ) ;
    799                       elCol->putScalar( prevnr+i+nrow*ipol, (Float)dir(1) ) ;
    800                     }                 
     787                    *dirRF = newdir ;
     788                    *azRF = (Float)azel(0) ;
     789                    *elRF = (Float)azel(1) ;
    801790                  }
    802791                  if ( scanrate.size() != 0 ) {
    803                     //os_ << "scanrate.size() = " << scanrate.size() << LogIO::POST ;
    804                     for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    805                       scanrateCol->put( prevnr+i+nrow*ipol, scanrate ) ;
    806                     }
     792                    *scrRF = scanrate ;
    807793                  }
    808794                  else {
    809                     //os_ << "scanrate.size() = " << scanrate.size() << LogIO::POST ;
    810                     for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    811                       scanrateCol->put( prevnr+i+nrow*ipol, defaultScanrate ) ;
    812                     }
     795                    *scrRF = defaultScanrate ;
    813796                  }
    814797                }
    815               }
    816               else {
    817                 // All directions are set to source direction
    818                 //ROArrayMeasColumn<MDirection> dmcol( pointtab, "DIRECTION" ) ;
    819                 //ROArrayColumn<Double> dcol( pointtab, "DIRECTION" ) ;
    820                 //IPosition ip( dmcol(0).shape().nelements(), 0 ) ;
    821                 //IPosition outp( 1, 2 ) ;
    822                 //String ref = dmcol(0)(ip).getRefString() ;
    823                 String ref = md.getRefString() ;
    824                 //Slice ds( 0, 2, 1 ) ;
    825                 //Slice ds0( 0, 1, 1 ) ;
    826                 //Slicer dslice0( ds, ds0 ) ;
    827                 //Vector<Double> defaultDir = dcol(0)(dslice0).reform(outp) ;
    828                 Vector<Double> defaultDir = srcDir ;
    829                 MDirection::getType( dirType, "J2000" ) ;
    830                 //mf.resetDirection( MDirection( MVDirection(srcDir), dirType ) ) ;
    831                 if ( ref != "J2000" ) {
    832                   ROScalarMeasColumn<MEpoch> tmCol( pointtab, "TIME" ) ;
    833                   mf.resetEpoch( tmCol( 0 ) ) ;
    834                   MDirection::Convert toj2000( dirType, MDirection::Ref( MDirection::J2000, mf ) ) ;
    835                   defaultDir = toj2000( defaultDir ).getAngle("rad").getValue() ;
     798                else {
     799                  String ref = md.getRefString() ;
     800                  Vector<Double> defaultDir = srcDir ;
     801                  MDirection::getType( dirType, "J2000" ) ;
     802                  if ( ref != "J2000" ) {
     803                    ROScalarMeasColumn<MEpoch> tmCol( pointtab, "TIME" ) ;
     804                    mf.resetEpoch( tmCol( 0 ) ) ;
     805                    MDirection::Convert toj2000( dirType, MDirection::Ref( MDirection::J2000, mf ) ) ;
     806                    defaultDir = toj2000( defaultDir ).getAngle("rad").getValue() ;
     807                  }
     808                  mf.resetEpoch( mTimeB[irow] ) ;
     809                  MDirection::Convert toazel( dirType, MDirection::Ref( MDirection::AZEL, mf ) ) ;
     810                  Vector<Double> azel = toazel( defaultDir ).getAngle("rad").getValue() ;
     811                  *azRF = (Float)azel(0) ;
     812                  *elRF = (Float)azel(1) ;
     813                  *dirRF = defaultDir ;
     814                  *scrRF = defaultScanrate ;
    836815                }
    837                 for ( Int i = 0 ; i < nrow ; i++ ) {
    838                   mf.resetEpoch( (*mTimeCol)(i) ) ;
    839                   for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    840                     Int localidx = prevnr+i+nrow*ipol ;
    841                     MDirection::Convert toazel( dirType, MDirection::Ref( MDirection::AZEL, mf ) ) ;
    842                     Vector<Double> azel = toazel( defaultDir ).getAngle("rad").getValue() ;
    843                     azCol->putScalar( localidx, (Float)azel(0) ) ;
    844                     elCol->putScalar( localidx, (Float)azel(1) ) ;
    845                     dirCol->put( localidx, defaultDir ) ;
    846                     scanrateCol->put( localidx, defaultScanrate ) ;
    847                   }
     816
     817                // Polarization dependent things
     818                for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
     819                  // POLNO
     820                  *polnoRF = polnos[ipol] ;
     821
     822                  *spRF = sp.row( ipol ) ;
     823                  *ucarrRF = fl.row( ipol ) ;
     824                  *tsysRF = tsys.row( ipol ) ;
     825                  *tcalidRF = tcalids[ipol] ;
     826
     827                  // Commit row
     828                  stab.addRow() ;
     829                  row.put( stab.nrow()-1 ) ;
    848830                }
    849831              }
     832              //delete mTimeCol ;
     833              tpoolr->destroy( mIntervalCol ) ;
     834              tpoolr->destroy( mFlagRowCol ) ;
     835
    850836              time1 = gettimeofday_sec() ;
    851               os_ << "end fill DIRECTION, AZIMUTH, ELEVATION, SCANRATE: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    852 
    853               // CYCLENO
    854               time0 = gettimeofday_sec() ;
    855               os_ << "start fill CYCLENO: " << time0 << LogIO::POST ;
    856               for ( int i = 0 ; i < nloop ; i++ ) {
    857                 for ( int j = 0 ; j < nrow ; j++ ) {
    858                   cyclenoCol->putScalar( prevnr+nrow*i+j, cycle+j ) ;
    859                 }
    860               }
    861               cycle += nrow ;
    862               time1 = gettimeofday_sec() ;
    863               os_ << "end fill CYCLENO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    864 
    865               // POLNO
    866               time0 = gettimeofday_sec() ;
    867               os_ << "start fill POLNO: " << time0 << LogIO::POST ;
    868               Int pidx = 0 ;
    869               Bool crossOK = False ;
    870               for ( int i = 0 ; i < npol ; i++ ) {
    871                 Vector<uInt> polnos = getPolNo( corrtype[i] ) ;
    872                 if ( polnos.size() > 1 ) {
    873                   if ( crossOK ) continue ;
    874                   else crossOK = True ;
    875                 }
    876                 for ( uInt j = 0 ; j < polnos.size() ; j++ ) {
    877                   for ( Int irow = 0 ; irow < nrow ; irow++ ) {
    878                     polnoCol->putScalar( prevnr+pidx*nrow+irow, polnos[j] ) ;
    879                   }
    880                   pidx++ ;
    881                 }
    882               }
    883               time1 = gettimeofday_sec() ;
    884               os_ << "end fill POLNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    885 
    886               // FLAGROW
    887               time0 = gettimeofday_sec() ;
    888               os_ << "start fill FLAGROW: " << time0 << LogIO::POST ;
    889               tcolr = tpoolr->construct( t5, "FLAG_ROW" ) ;
    890               for ( int i = 0 ; i < nloop ; i++ ) {
    891                 for ( int j = 0 ; j < nrow ; j++ ) {
    892                   flagrowCol->putScalar( prevnr+nrow*i+j, (uInt)(tcolr->asBool( j )) ) ;
    893                 }
    894               }
    895               tpoolr->destroy( tcolr ) ;
    896               time1 = gettimeofday_sec() ;
    897               os_ << "end fill FLAGROW: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    898 
    899               // TCAL_ID
    900               time0 = gettimeofday_sec() ;
    901               os_ << "start fill TCAL_ID: " << time0 << LogIO::POST ;
    902               if ( isSysCal_ ) {
    903                 for( Int irow = 0 ; irow < nrow ; irow++ ) {
    904                   Vector<uInt> tcalids = getTcalId( feedId, spwId, sysCalTime[irow] ) ;
    905                   if ( tcalids.size() == 0 ) {
    906                     tcalids.resize( npol ) ;
    907                     tcalids = 0 ;
    908                   }
    909                   for ( Int ipol = 0 ; ipol < npol ; ipol++ ) {
    910                     tcalidCol->putScalar( prevnr+irow+nrow*ipol, tcalids[ipol] ) ;
    911                   }
    912                 }
    913               }
    914               else {
    915                 //Vector<uInt> tcalid( addednr, 0 ) ;
    916                 //uIntCol->putColumnCells( rows, tcalid ) ;
    917                 uInt tcalid = 0 ;
    918                 for ( Int irow = 0 ; irow < addednr ; irow++ )
    919                   tcalidCol->putScalar( prevnr+irow, tcalid ) ;
    920               }
    921               time1 = gettimeofday_sec() ;
    922               os_ << "end fill TCAL_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    923 
    924               // WEATHER_ID
    925               time0 = gettimeofday_sec() ;
    926               os_ << "start fill WEATHER_ID: " << time0 << LogIO::POST ;
    927               if ( isWeather_ ) {
    928                 uInt wid = 0 ;
    929                 for ( Int irow = 0 ; irow < nrow ; irow++ ) {
    930                   wid = getWeatherId( wid, (*mTimeCol)(irow).get("s").getValue() ) ;
    931                   for ( Int ipol = 0 ; ipol < nloop ; ipol++ ) {
    932                     weatheridCol->putScalar( prevnr+ipol*nrow+irow, wid ) ;
    933                   }
    934                 }
    935               }
    936               time1 = gettimeofday_sec() ;
    937               os_ << "end fill WEATHER_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    938 
    939               delete mTimeCol ;
    940              
    941               //os_ << "field: " << fieldId << " scan: " << scanNum << " obs: " << obsId << " state: " << stateId << " ddid: " << ddId << endl ;
    942               os_ << "addednr = " << addednr << endl ;
    943               added5 += addednr ;
     837              os_ << "end 5th iteration: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     838
    944839              iter5.next() ;
    945840            }
    946841
    947             // SCANNO
    948             // MS: 1-base
    949             // Scantable: 0-base
    950             time0 = gettimeofday_sec() ;
    951             os_ << "start fill SCANNO: " << time0 << LogIO::POST ;
    952             Int dest5 = current5 + added5 ;
    953             scanNum -= 1 ;
    954             for ( Int irow = current5 ; irow < dest5 ; irow++ )
    955               scannoCol->putScalar( irow, (uInt)scanNum ) ;
    956             time1 = gettimeofday_sec() ;
    957             os_ << "end fill SCANNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    958 
    959             os_ << "added5 = " << added5 << endl ;
    960             added4 += added5 ;
     842
    961843            iter4.next() ;
    962844          }
    963845
    964           // IFNO
    965           time0 = gettimeofday_sec() ;
    966           os_ << "start fill IFNO: " << time0 << LogIO::POST ;
    967           Int dest4 = current4 + added4 ;
    968           for ( Int irow = current4 ; irow < dest4 ; irow++ )
    969             ifnoCol->putScalar( irow, (uInt)spwId ) ;
    970           time1 = gettimeofday_sec() ;
    971           os_ << "end fill IFNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    972 
    973           // FREQ_ID
    974           time0 = gettimeofday_sec() ;
    975           os_ << "start fill FREQ_ID: " << time0 << LogIO::POST ;
    976           uInt fid = ifmap[spwId] ;
    977           for ( Int irow = current4 ; irow < dest4 ; irow++ )
    978             freqidCol->putScalar( irow, fid ) ;
    979           time1 = gettimeofday_sec() ;
    980           os_ << "end fill FREQ_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    981 
    982           // MOLECULE_ID
    983           time0 = gettimeofday_sec() ;
    984           os_ << "start fill MOLECULE_ID: " << time0 << LogIO::POST ;
    985           for ( Int irow = current4 ; irow < dest4 ; irow++ )
    986             molidCol->putScalar( irow, molId ) ;
    987           time1 = gettimeofday_sec() ;
    988           os_ << "end fill MOLECULE_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    989 
    990           // SRCNAME
    991           time0 = gettimeofday_sec() ;
    992           os_ << "start fill SRCNAME: " << time0 << LogIO::POST ;
    993           for ( Int irow = current4 ; irow < dest4 ; irow++ )
    994             srcnameCol->putScalar( irow, srcName ) ;
    995           time1 = gettimeofday_sec() ;
    996           os_ << "end fill SRCNAME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    997 
    998           // SRCVELOCITY, SRCPROPERMOTION and SRCDIRECTION
    999           // no reference conversion for direction at the moment (assume J2000)
    1000           // no reference conversion for velocity at the moment (assume LSRK)
    1001           time0 = gettimeofday_sec() ;
    1002           os_ << "start fill SRCPROPERMOTION: " << time0 << LogIO::POST ;
    1003           for ( Int irow = current4 ; irow < dest4 ; irow++ )
    1004             srcpmCol->put( irow, srcPM ) ;
    1005           time1 = gettimeofday_sec() ;
    1006           os_ << "end fill SRCPROPERMOTION: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1007           time0 = gettimeofday_sec() ;
    1008           os_ << "start fill SRCDIRECTION: " << time0 << LogIO::POST ;
    1009           for ( Int irow = current4 ; irow < dest4 ; irow++ )
    1010             srcdirCol->put( irow, srcDir ) ;
    1011           time1 = gettimeofday_sec() ;
    1012           os_ << "end fill SRCDIRECTION: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1013           time0 = gettimeofday_sec() ;
    1014           os_ << "start fill SRCVELOCITY: " << time0 << LogIO::POST ;
    1015           for ( Int irow = current4 ; irow < dest4 ; irow++ )
    1016             srcvelCol->putScalar( irow, sysVel ) ;
    1017           time1 = gettimeofday_sec() ;
    1018           os_ << "end fill SRCVELOCITY: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1019 
    1020           os_ << "added4 = " << added4 << endl ;
    1021           added3 += added4 ;
     846
    1022847          iter3.next() ;
    1023848        }
    1024849
    1025         // FIELDNAME
    1026         time0 = gettimeofday_sec() ;
    1027         os_ << "start fill FIELDNAME: " << time0 << LogIO::POST ;
    1028         Int dest3 = current3 + added3 ;
    1029         for ( Int irow = current3 ; irow < dest3 ; irow++ )
    1030           fieldnameCol->putScalar( irow, fieldName ) ;
    1031         time1 = gettimeofday_sec() ;
    1032         os_ << "end fill FIELDNAME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1033850             
    1034         os_ << "added3 = " << added3 << endl ;
    1035         added2 += added3 ;
    1036851        iter2.next() ;
    1037852      }
    1038853
    1039       // BEAMNO
    1040       time0 = gettimeofday_sec() ;
    1041       os_ << "start fill BEAMNO: " << time0 << LogIO::POST ;
    1042       Int dest2 = current2 + added2 ;
    1043       for ( Int irow = current2 ; irow < dest2 ; irow++ )
    1044         beamnoCol->putScalar( irow, (uInt)feedId ) ;
    1045       time1 = gettimeofday_sec() ;
    1046       os_ << "end fill BEAMNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1047 
    1048       // FOCUS_ID
    1049       // tentative
    1050       time0 = gettimeofday_sec() ;
    1051       os_ << "start fill FOCUS_ID: " << time0 << LogIO::POST ;
    1052       uInt focusId = 0 ;
    1053       for ( Int irow = current2 ; irow < dest2 ; irow++ )
    1054         focusidCol->putScalar( irow, focusId ) ;
    1055       time1 = gettimeofday_sec() ;
    1056       os_ << "end fill FOCUS_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1057 
    1058       os_ << "added2 = " << added2 << endl ;
    1059       added1 += added2 ;
     854
    1060855      iter1.next() ;
    1061856    }
    1062857    if ( sdh.nbeam < nbeam ) sdh.nbeam = nbeam ;
    1063858
    1064     os_ << "added1 = " << added1 << endl ;
    1065     added0 += added1 ;
    1066859    iter0.next() ;
    1067860  }
    1068861
    1069   os_ << "added0 = " << added0 << endl ;
    1070 
    1071   // REFBEAMNO
    1072   // set 0 at the moment
    1073   time0 = gettimeofday_sec() ;
    1074   os_ << "start fill REFBEAMNO: " << time0 << LogIO::POST ;
    1075   tcolw = tpoolw->construct( stab, "REFBEAMNO" ) ;
    1076   for ( Int irow = current0 ; irow < added0 ; irow++ )
    1077     tcolw->putScalar( irow, 0 ) ;
    1078   tpoolw->destroy( tcolw ) ;
    1079   time1 = gettimeofday_sec() ;
    1080   os_ << "end fill REFBEAMNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1081 
    1082   // FIT_ID
    1083   // nothing to do
    1084   time0 = gettimeofday_sec() ;
    1085   os_ << "start fill FIT_ID: " << time0 << LogIO::POST ;
    1086   tcolw = tpoolw->construct( stab, "FIT_ID" ) ;
    1087   for ( Int irow = current0 ; irow < added0 ; irow++ )
    1088     tcolw->putScalar( irow, -1 ) ;
    1089   tpoolw->destroy( tcolw ) ;
    1090   time1 = gettimeofday_sec() ;
    1091   os_ << "end fill FIT_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1092 
    1093   // OPACITY
    1094   // not used?
    1095   time0 = gettimeofday_sec() ;
    1096   os_ << "start fill OPACITY: " << time0 << LogIO::POST ;
    1097   tcolw = tpoolw->construct( stab, "OPACITY" ) ;
    1098   for ( Int irow = current0 ; irow < added0 ; irow++ )
    1099     tcolw->putScalar( irow, 0.0 ) ;
    1100   tpoolw->destroy( tcolw ) ;
    1101   time1 = gettimeofday_sec() ;
    1102   os_ << "end fill OPACITY: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    1103 
    1104   // delete Scantable columns
    1105   tpoolw->destroy( scannoCol ) ;
    1106   tpoolw->destroy( cyclenoCol ) ;
    1107   tpoolw->destroy( beamnoCol ) ;
    1108   tpoolw->destroy( ifnoCol ) ;
    1109   tpoolw->destroy( polnoCol ) ;
    1110   tpoolw->destroy( freqidCol ) ;
    1111   tpoolw->destroy( molidCol ) ;
    1112   tpoolw->destroy( flagrowCol ) ;
    1113   delete timeCol ;
    1114   tpoolw->destroy( intervalCol ) ;
    1115   tpoolw->destroy( srcnameCol ) ;
    1116   tpoolw->destroy( srctypeCol ) ;
    1117   tpoolw->destroy( fieldnameCol ) ;
    1118   delete spCol ;
    1119   delete flCol ;
    1120   delete tsysCol ;
    1121   delete dirCol ;
    1122   tpoolw->destroy( azCol ) ;
    1123   tpoolw->destroy( elCol ) ;
    1124   tpoolw->destroy( tcalidCol ) ;
    1125   tpoolw->destroy( focusidCol ) ;
    1126   tpoolw->destroy( weatheridCol ) ;
    1127   delete srcpmCol ;
    1128   delete srcdirCol ;
    1129   tpoolw->destroy( srcvelCol ) ;
    1130   delete scanrateCol ;
    1131862
    1132863  delete tpoolr ;
    1133   delete tpoolw ;
    1134864
    1135865
     
    13061036}
    13071037
    1308 Vector<uInt> MSFiller::getPolNo( Int corrType )
     1038//Vector<uInt> MSFiller::getPolNo( Int corrType )
     1039Block<uInt> MSFiller::getPolNo( Int corrType )
    13091040{
    13101041  double startSec = gettimeofday_sec() ;
    13111042  os_ << "start MSFiller::getPolNo() startSec=" << startSec << LogIO::POST ;
    1312   Vector<uInt> polno( 1 ) ;
     1043  Block<uInt> polno( 1 ) ;
    13131044
    13141045  if ( corrType == Stokes::I || corrType == Stokes::RR || corrType == Stokes::XX ) {
     
    14601191}
    14611192
    1462 void MSFiller::fillTcal( boost::object_pool<ROTableColumn> *tpoolr,
    1463                          boost::object_pool<TableColumn> *tpoolw )
     1193void MSFiller::fillTcal( boost::object_pool<ROTableColumn> *tpoolr )
    14641194{
    14651195  double startSec = gettimeofday_sec() ;
    14661196  os_ << "start MSFiller::fillTcal() startSec=" << startSec << LogIO::POST ;
    14671197
    1468   //MSSysCal sctab = mstable_.sysCal() ;
    14691198  Table sctab = mstable_.sysCal() ;
    14701199  if ( sctab.nrow() == 0 ) {
     
    14821211  //os_ << "fillTcal(): npol = " << npol << LogIO::POST ;
    14831212  Table tab = table_->tcal().table() ;
    1484   TableColumn *idCol = tpoolw->construct( tab, "ID" ) ;
    1485   TableColumn *timeCol = tpoolw->construct( tab, "TIME" ) ;
    14861213  ArrayColumn<Float> tcalCol( tab, "TCAL" ) ;
    14871214  ROTableColumn *sharedCol ;
    1488   ROArrayColumn<Float> scTcalCol ;
    14891215  uInt oldnr = 0 ;
    14901216  uInt newnr = 0 ;
     1217  TableRow row( tab ) ;
     1218  TableRecord &trec = row.record() ;
     1219  RecordFieldPtr<uInt> idRF( trec, "ID" ) ;
     1220  RecordFieldPtr<String> timeRF( trec, "TIME" ) ;
     1221  RecordFieldPtr< Array<Float> > tcalRF( trec, "TCAL" ) ;
    14911222  TableIterator iter0( sctabsel, "FEED_ID" ) ;
    14921223  while( !iter0.pastEnd() ) {
     
    14951226    Int feedId = sharedCol->asInt( 0 ) ;
    14961227    tpoolr->destroy( sharedCol ) ;
    1497     //String ffield = "FEED" + String::toString( feedId ) ;
    1498     //Record rec0 ;
    14991228    TableIterator iter1( t0, "SPECTRAL_WINDOW_ID" ) ;
    15001229    while( !iter1.pastEnd() ) {
     
    15031232      Int spwId = sharedCol->asInt( 0 ) ;
    15041233      tpoolr->destroy( sharedCol ) ;
    1505       //String spwfield = "SPW" + String::toString( spwId ) ;
    1506       //Record rec1 ;
    1507       TableIterator iter2( t1, "TIME" ) ;
    1508       while( !iter2.pastEnd() ) {
    1509         Table t2 = iter2.table() ;
    1510         uInt nrow = t2.nrow() ; // must be 1
    1511         //os_ << "fillTcal::t2.nrow = " << nrow << LogIO::POST ;
    1512         ROScalarQuantColumn<Double> scTimeCol( t2, "TIME" ) ;
    1513         scTcalCol.attach( t2, colTcal_ ) ;
    1514         tab.addRow( nrow*npol ) ;
    1515         newnr += nrow*npol ;
    1516         String sTime = MVTime( scTimeCol(0) ).string( MVTime::YMD ) ;
     1234      tmpTcalCol = new ROArrayColumn<Float>( t1, colTcal_ ) ;
     1235      ROScalarQuantColumn<Double> scTimeCol( t1, "TIME" ) ;
     1236      Vector<uInt> idminmax( 2, oldnr ) ;
     1237      for ( uInt irow = 0 ; irow < t1.nrow() ; irow++ ) {
     1238        String sTime = MVTime( scTimeCol(irow) ).string( MVTime::YMD ) ;
     1239        *timeRF = sTime ;
     1240        uInt idx = oldnr ;
     1241        Matrix<Float> subtcal = (*tmpTcalCol)( irow ) ;
    15171242        for ( uInt ipol = 0 ; ipol < npol ; ipol++ ) {
    1518           timeCol->putScalar( oldnr+ipol, sTime ) ;
     1243          *idRF = idx++ ;
     1244          *tcalRF = subtcal.row( ipol ) ;
     1245
     1246          // commit row
     1247          tab.addRow() ;
     1248          row.put( tab.nrow()-1 ) ;
     1249
     1250          newnr++ ;
    15191251        }
    1520         uInt idx = oldnr ;
    1521         for ( uInt ipol = 0 ; ipol < npol ; ipol++ ) {
    1522             idCol->putScalar( oldnr+ipol, idx++ ) ;
    1523         }
    1524         Vector<uInt> idminmax( 2, oldnr ) ;
    1525         Matrix<Float> subtcal = scTcalCol( 0 ) ;
    1526         for ( uInt ipol = 0 ; ipol < npol ; ipol++ ) {
    1527           tcalCol.put( oldnr+ipol, subtcal.row( ipol ) ) ;
    1528         }
     1252        idminmax[0] = oldnr ;
    15291253        idminmax[1] = newnr - 1 ;
    15301254        oldnr = newnr ;
    15311255
    1532         //String key = ffield+":"+spwfield+":"+sTime ;
    15331256        String key = keyTcal( feedId, spwId, sTime ) ;
    15341257        tcalrec_.define( key, idminmax ) ;
    1535         //rec1.define( sTime, idminmax ) ;
    1536         iter2++ ;
    15371258      }
    1538       //rec0.defineRecord( spwfield, rec1 ) ;
     1259      delete tmpTcalCol ;
    15391260      iter1++ ;
    15401261    }
    1541     //tcalrec_.defineRecord( ffield, rec0 ) ;
    15421262    iter0++ ;
    15431263  }
    1544 
    1545   tpoolw->destroy( idCol ) ;
    1546   tpoolw->destroy( timeCol ) ;
    15471264
    15481265  //tcalrec_.print( std::cout ) ;
     
    15881305}
    15891306
    1590 //Vector<Double> MSFiller::getSysCalTime( MSSysCal &tab, MEpoch::ROScalarColumn &tcol )
    1591 void MSFiller::getSysCalTime( MSSysCal &tab, MEpoch::ROScalarColumn &tcol, Vector<Double> &tstr )
     1307void MSFiller::getSysCalTime( Block<MEpoch> &scTime, Vector<Double> &scInterval, Block<MEpoch> &tcol, Block<Double> &tstr, Block<Int> &tidx )
    15921308{
    15931309  double startSec = gettimeofday_sec() ;
    15941310  os_ << "start MSFiller::getSysCalTime() startSec=" << startSec << LogIO::POST ;
    1595   //uInt nrow = tcol.table().nrow() ;
    15961311  uInt nrow = tstr.nelements() ;
    1597   //Vector<Double> tstr( nrow, -1.0 ) ;
    1598   if ( tab.nrow() == 0 )
    1599     //return tstr ;
     1312  if ( scTime.nelements() == 0 )
    16001313    return ;
    1601   uInt scnrow = tab.nrow() ;
    1602   ROScalarMeasColumn<MEpoch> scTimeCol( tab, "TIME" ) ;
    1603   ROScalarQuantColumn<Double> scIntervalCol( tab, "INTERVAL" ) ;
     1314  uInt scnrow = scTime.nelements() ;
    16041315  uInt idx = 0 ;
    16051316  const Double half = 0.5e0 ;
    16061317  for ( uInt i = 0 ; i < nrow ; i++ ) {
    1607     Double t = tcol( i ).get( "s" ).getValue() ;
     1318    Double t = tcol[i].get( "s" ).getValue() ;
     1319    os_ << "getSysCalTime()  irow = " << i << " idx = " << idx << LogIO::POST ;
    16081320    for ( uInt j = idx ; j < scnrow-1 ; j++ ) {
    1609       Double tsc1 = scTimeCol( j ).get( "s" ).getValue() ;
    1610       Double dt1 = scIntervalCol( j ).getValue("s") ;
    1611       Double tsc2 = scTimeCol( j+1 ).get( "s" ).getValue() ;
    1612       Double dt2 = scIntervalCol( j+1 ).getValue("s") ;
     1321      Double tsc1 = scTime[j].get( "s" ).getValue() ;
     1322      Double dt1 = scInterval[j] ;
     1323      Double tsc2 = scTime[j+1].get( "s" ).getValue() ;
     1324      Double dt2 = scInterval[j+1] ;
    16131325      if ( t > tsc1-half*dt1 && t <= tsc2-half*dt2 ) {
    16141326        tstr[i] = tsc1 ;
     1327        tidx[i] = j ;
    16151328        idx = j ;
    16161329        break ;
     
    16181331    }
    16191332    if ( tstr[i] == -1.0 ) {
    1620       Double tsc = scTimeCol( scnrow-1 ).get( "s" ).getValue() ;
    1621       Double dt = scIntervalCol( scnrow-1 ).getValue( "s" ) ;
    1622       if ( t <= tsc+0.5*dt )
     1333      Double tsc = scTime[scnrow-1].get( "s" ).getValue() ;
     1334      Double dt = scInterval[scnrow-1] ;
     1335      if ( t <= tsc+0.5*dt ) {
    16231336        tstr[i] = tsc ;
     1337        tidx[i] = scnrow-1 ;
     1338      }
    16241339    }
    16251340  }
    16261341  double endSec = gettimeofday_sec() ;
    1627   os_ << "end MSFiller::getSysCalTime() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    1628   //return tstr ;
     1342  os_ << "end MSFiller::getSysCalTime() endSec=" << endSec << " (" << endSec-startSec << "sec) scnrow = " << scnrow << "tcol.nelements() = " << tcol.nelements() << LogIO::POST ;
    16291343  return ;
    16301344}
    16311345
    1632 uInt MSFiller::getTsys( uInt idx, Matrix<Float> &tsys, MSSysCal &tab, Double t )
    1633 {
    1634   double startSec = gettimeofday_sec() ;
    1635   os_ << "start MSFiller::getTsys() startSec=" << startSec << LogIO::POST ;
    1636   uInt nrow = tab.nrow() ;
    1637   if ( nrow == 0 ) {
    1638     os_ << "No SysCal rows" << LogIO::POST ;
    1639     tsys.resize( IPosition(0) ) ;
    1640     return 0 ;
    1641   }
    1642   ROScalarMeasColumn<MEpoch> scTimeCol( tab, "TIME" ) ;
    1643   ROArrayColumn<Float> mTsysCol ;
    1644   mTsysCol.attach( tab, colTsys_ ) ;
    1645   for ( uInt i = idx ; i < nrow ; i++ ) {
    1646     Double tref = scTimeCol( i ).get( "s" ).getValue() ;
    1647     if ( t == tref ) {
    1648       tsys.reference( mTsysCol( i ) ) ;
    1649       idx = i ;
    1650       break ;
    1651     }
    1652   }
    1653   //os_ << "MSFiller::getTsys() idx = " << idx << " tsys = " << tsys << LogIO::POST ;
    1654   double endSec = gettimeofday_sec() ;
    1655   os_ << "end MSFiller::getTsys() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    1656   return idx ;
    1657 }
    1658 
    1659 Vector<uInt> MSFiller::getTcalId( Int fid, Int spwid, Double t )
     1346// uInt MSFiller::getTsys( uInt idx, Matrix<Float> &tsys, ROArrayColumn<Float> &mTsysCol, Block<MEpoch> &scTimeCol, Double t )
     1347// {
     1348//   double startSec = gettimeofday_sec() ;
     1349//   os_ << "start MSFiller::getTsys() startSec=" << startSec << LogIO::POST ;
     1350//   uInt nrow = mTsysCol.nrow() ;
     1351//   if ( nrow == 0 ) {
     1352//     os_ << "No SysCal rows" << LogIO::POST ;
     1353//     tsys.resize( IPosition(0) ) ;
     1354//     return 0 ;
     1355//   }
     1356//   for ( uInt i = idx ; i < nrow ; i++ ) {
     1357//     Double tref = scTimeCol[i].get("s").getValue() ;
     1358//     if ( t == tref ) {
     1359//       tsys.reference( mTsysCol( i ) ) ;
     1360//       idx = i ;
     1361//       break ;
     1362//     }
     1363//   }
     1364//   //os_ << "MSFiller::getTsys() idx = " << idx << " tsys = " << tsys << LogIO::POST ;
     1365//   double endSec = gettimeofday_sec() ;
     1366//   os_ << "end MSFiller::getTsys() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1367//   return idx ;
     1368// }
     1369
     1370Block<uInt> MSFiller::getTcalId( Int fid, Int spwid, Double t )
    16601371{
    16611372  double startSec = gettimeofday_sec() ;
     
    16631374  if ( table_->tcal().table().nrow() == 0 ) {
    16641375    os_ << "No TCAL rows" << LogIO::POST ;
    1665     Vector<uInt> tcalids( 0 ) ;
     1376    Block<uInt> tcalids( 0 ) ;
    16661377    return  tcalids ;
    16671378  }   
    1668   //String feed = "FEED" + String::toString(fid) ;
    1669   //String spw = "SPW" + String::toString(spwid) ;
    16701379  String sctime = MVTime( Quantum<Double>(t,"s") ).string(MVTime::YMD) ;
    1671   //String key = feed + ":" + spw + ":" + sctime ;
    16721380  String key = keyTcal( fid, spwid, sctime ) ;
    1673   //Record rec = tcalrec_.asRecord(feed).asRecord(spw) ;
    1674   //if ( !rec.isDefined( sctime ) ) {
    16751381  if ( !tcalrec_.isDefined( key ) ) {
    16761382    os_ << "No TCAL rows" << LogIO::POST ;
    1677     Vector<uInt> tcalids( 0 ) ;
     1383    Block<uInt> tcalids( 0 ) ;
    16781384    return tcalids ;
    16791385  }
    1680   //Vector<uInt> ids = rec.asArrayuInt(sctime) ;
    16811386  Vector<uInt> ids = tcalrec_.asArrayuInt( key ) ;
    16821387  uInt npol = ids[1] - ids[0] + 1 ;
    1683   Vector<uInt> tcalids( npol ) ;
     1388  Block<uInt> tcalids( npol ) ;
    16841389  tcalids[0] = ids[0] ;
    16851390  tcalids[1] = ids[1] ;
  • trunk/src/MSFiller.h

    r1993 r2002  
    2929
    3030#include <casa/Containers/Record.h>
     31#include <casa/Containers/Block.h>
    3132
    3233//#include <tables/Tables/TableColumn.h>
     
    6667  //void fillHistory() ;
    6768  //void fillFit() ;
    68   void fillTcal( boost::object_pool<casa::ROTableColumn> *poolr,
    69                  boost::object_pool<casa::TableColumn> *poolw ) ;
     69  void fillTcal( boost::object_pool<casa::ROTableColumn> *poolr ) ;
    7070
    7171  // get SRCTYPE from STATE_ID
    7272  casa::Int getSrcType( casa::Int stateId, boost::object_pool<casa::ROTableColumn> *pool ) ;
    73   //casa::Int getSrcType( casa::Int stateId ) ;
    7473
    7574  // get POLNO from CORR_TYPE
    76   casa::Vector<casa::uInt> getPolNo( casa::Int corrType ) ;
     75  casa::Block<casa::uInt> getPolNo( casa::Int corrType ) ;
    7776
    7877  // get poltype from CORR_TYPE
     
    8584  // assume that tab is selected by ANTENNA_ID, FEED_ID, SPECTRAL_WINDOW_ID
    8685  // and sorted by TIME
    87   //casa::Vector<casa::Double> getSysCalTime( casa::MSSysCal &tab, casa::MEpoch::ROScalarColumn &tcol ) ;
    88   void getSysCalTime( casa::MSSysCal &tab, casa::MEpoch::ROScalarColumn &tcal, casa::Vector<casa::Double> &scTime ) ;
     86  void getSysCalTime( casa::Block<casa::MEpoch> &scTimeIn, casa::Vector<casa::Double> &scInterval, casa::Block<casa::MEpoch> &tcol, casa::Block<casa::Double> &scTimeOut, casa::Block<casa::Int> &tidx ) ;
    8987
    9088  // get tsys by time stamp
    9189  // assume that tab is selected by ANTENNA_ID, FEED_ID, SPECTRAL_WINDOW_ID
    9290  // and sorted by TIME
    93   casa::uInt getTsys( casa::uInt idx, casa::Matrix<casa::Float> &tsys, casa::MSSysCal &tab, casa::Double t ) ;
     91//   casa::uInt getTsys( casa::uInt idx, casa::Matrix<casa::Float> &tsys, casa::ROArrayColumn<casa::Float> &tsysCol, casa::Block<casa::MEpoch> &scTime, casa::Double t ) ;
    9492
    9593  // get TCAL_ID
    96   casa::Vector<casa::uInt> getTcalId( casa::Int feedId, casa::Int spwId, casa::Double t ) ;
     94  casa::Block<casa::uInt> getTcalId( casa::Int feedId, casa::Int spwId, casa::Double t ) ;
    9795
    9896  // get direction for DIRECTION, AZIMUTH, and ELEVATION columns
Note: See TracChangeset for help on using the changeset viewer.