Changeset 2916 for trunk


Ignore:
Timestamp:
04/03/14 13:45:09 (10 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

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...

Replaced STIdxIter classes with STIdxIter2 as much as possible.
Also disabled python interface for STIdxIter since the iterator has
a problem.


Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/EdgeMarker.cpp

    r2757 r2916  
    7777    ROArrayColumn<uChar> flagCol( st_->table(), "FLAGTRA" ) ;
    7878    vector<string> cols( 1, "IFNO" ) ;
    79     STIdxIterAcc iter( st_, cols ) ;
     79    STIdxIter2 iter( st_, cols ) ;
    8080    while( !iter.pastEnd() ) {
    81       uInt current = iter.current()[0] ;
     81      uInt current = iter.currentValue().asuInt("IFNO") ;
    8282      uInt firstRow = iter.getRows()[0] ;
    8383      uInt nchan = flagCol( firstRow ).nelements() ;
     
    110110  cols[2] = "IFNO" ;
    111111  cols[3] = "SRCTYPE" ;
    112   STIdxIterExAcc iter( st_, cols ) ;
     112  STIdxIter2 iter( st_, cols ) ;
    113113  ROScalarColumn<Double> timeCol( st_->table(), "TIME" ) ;
    114114  ROArrayColumn<Double> directionCol( st_->table(), "DIRECTION" ) ;
    115115  while( !iter.pastEnd() ) {
    116     Vector<uInt> current = iter.current() ;
    117     Int srcType = iter.getSrcType() ;
     116    Record current = iter.currentValue() ;
     117    Int srcType = current.asInt("SRCTYPE");
     118    uInt ifno = current.asuInt("IFNO");
    118119    os_ << LogIO::DEBUGGING
    119         << "BEAMNO=" << current[0]
    120         << " POLNO=" << current[1]
    121         << " IFNO=" << current[2]
     120        << "BEAMNO=" << current.asuInt("BEAMNO")
     121        << " POLNO=" << current.asuInt("POLNO")
     122        << " IFNO=" << ifno
    122123        << " SRCTYPE=" << srcType << LogIO::POST ;
    123124    // only process ON position and no WVR
    124125    Vector<uInt> rows = iter.getRows( SHARE ) ;
    125126    uInt nrow = rows.nelements() ;
    126     if ( srcType == Int(SrcType::PSON) && allNE( wvr_, current[2] ) && nrow > 0 ) {
     127    if ( srcType == Int(SrcType::PSON) && allNE( wvr_, ifno ) && nrow > 0 ) {
    127128      Vector<Double> t( nrow ) ;
    128129      Matrix<Double> d( 2, nrow ) ;
  • trunk/src/STApplyCal.cpp

    r2862 r2916  
    226226  cols[1] = "POLNO" ;
    227227  cols[2] = "IFNO" ;
    228   CountedPtr<STIdxIter> iter = new STIdxIterAcc(work_, cols) ;
     228  CountedPtr<STIdxIter2> iter = new STIdxIter2(work_, cols) ;
    229229  while (!iter->pastEnd()) {
    230     Vector<uInt> ids = iter->current();
     230    Record ids = iter->currentValue();
    231231    Vector<uInt> rows = iter->getRows(SHARE);
    232232    if (rows.nelements() > 0)
    233       doapply(ids[0], ids[2], ids[1], rows, skycalList, filltsys);
     233      doapply(ids.asuInt("BEAMNO"), ids.asuInt("IFNO"), ids.asuInt("POLNO"), rows, skycalList, filltsys);
    234234    iter->next();
    235235  }
  • trunk/src/STCalibration.cpp

    r2915 r2916  
    4444  cols[1] = "POLNO";
    4545  cols[2] = "BEAMNO";
    46   STIdxIterAcc iter(scantable_, cols);
     46  STIdxIter2 iter(scantable_, cols);
    4747
    4848  ROScalarColumn<Double> *tcol = new ROScalarColumn<Double>(scantable_->table(), "TIME");
     
    6969  while(!iter.pastEnd()) {
    7070    Vector<uInt> rows = iter.getRows(SHARE);
    71     Vector<uInt> current = iter.current();
     71    Record current = iter.currentValue();
    7272    //os_ << "current=" << current << LogIO::POST;
    7373    uInt len = rows.nelements();
     
    7878    else if (len == 1) {
    7979      uInt irow = rows[0];
    80       appenddata(0, 0, current[2], current[0], current[1],
     80      appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), current.asuInt("POLNO"),
    8181                 freqidCol(irow), timeSec[irow], elevation[irow], specCol(irow));
    8282      iter.next();
     
    126126          timeCen /= (Double)count * 86400.0; // sec->day
    127127          elCen /= (Float)count;
    128           appenddata(0, 0, current[2], current[0], current[1],
     128          appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), current.asuInt("POLNO"),
    129129                     freqidCol(irow), timeCen, elCen, acc.getSpectrum());
    130130        }
  • trunk/src/STMath.cpp

    r2911 r2916  
    35383538    cols[1] = "POLNO" ;
    35393539    cols[2] = "IFNO" ;
    3540     STIdxIter *iter = new STIdxIterAcc( out, cols ) ;
    3541     while ( !iter->pastEnd() ) {
    3542       Vector<uInt> ids = iter->current() ;
     3540    STIdxIter2 iter(out, cols);
     3541    while ( !iter.pastEnd() ) {
     3542      Record ids = iter.currentValue();
    35433543      stringstream ss ;
    35443544      ss << "SELECT FROM $1 WHERE "
    3545          << "BEAMNO==" << ids[0] << "&&"
    3546          << "POLNO==" << ids[1] << "&&"
    3547          << "IFNO==" << ids[2] ;
     3545         << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&"
     3546         << "POLNO==" << ids.asuInt("POLNO") << "&&"
     3547         << "IFNO==" << ids.asuInt("IFNO") ;
    35483548      //cout << "TaQL string: " << ss.str() << endl ;
    35493549      sel.setTaQL( ss.str() ) ;
     
    35513551      ahot->setSelection( sel ) ;
    35523552      asky->setSelection( sel ) ;
    3553       Vector<uInt> rows = iter->getRows( SHARE ) ;
     3553      Vector<uInt> rows = iter.getRows( SHARE ) ;
    35543554      // out should be an exact copy of s except that SPECTRA column is empty
    35553555      calibrateCW( out, s, aoff, asky, ahot, acold, rows, antname ) ;
     
    35583558      asky->unsetSelection() ;
    35593559      sel.reset() ;
    3560       iter->next() ;
    3561     }
    3562     delete iter ;
     3560      iter.next() ;
     3561    }
    35633562    s->table_ = torg ;
    35643563    s->attach() ;
     
    36163615//     t0 = mathutil::gettimeofday_sec() ;
    36173616
    3618     // using STIdxIterAcc
     3617    // using STIdxIter2
    36193618    vector<string> cols( 3 ) ;
    36203619    cols[0] = "BEAMNO" ;
     
    37443743         
    37453744    if ( apexcalmode == 0 ) {
    3746       // using STIdxIterAcc
     3745      // using STIdxIter2
    37473746      vector<string> cols( 3 ) ;
    37483747      cols[0] = "BEAMNO" ;
    37493748      cols[1] = "POLNO" ;
    37503749      cols[2] = "IFNO" ;
    3751       STIdxIter *iter = new STIdxIterAcc( ssig, cols ) ;
     3750      STIdxIter2 iter(ssig, cols) ;
    37523751      STSelector sel ;
    37533752      vector< CountedPtr<Scantable> > on( 2 ) ;
     
    37613760      hot[1] = ahothi ;
    37623761      vector< CountedPtr<Scantable> > cold( 2 ) ;
    3763       while ( !iter->pastEnd() ) {
    3764         Vector<uInt> ids = iter->current() ;
     3762      while ( !iter.pastEnd() ) {
     3763        Record ids = iter.currentValue() ;
    37653764        stringstream ss ;
    37663765        ss << "SELECT FROM $1 WHERE "
    3767            << "BEAMNO==" << ids[0] << "&&"
    3768            << "POLNO==" << ids[1] << "&&"
    3769            << "IFNO==" << ids[2] ;
     3766           << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&"
     3767           << "POLNO==" << ids.asuInt("POLNO") << "&&"
     3768           << "IFNO==" << ids.asuInt("IFNO") ;
    37703769        //cout << "TaQL string: " << ss.str() << endl ;
    37713770        sel.setTaQL( ss.str() ) ;
     
    37743773        hot[0]->setSelection( sel ) ;
    37753774        hot[1]->setSelection( sel ) ;
    3776         Vector<uInt> rows = iter->getRows( SHARE ) ;
     3775        Vector<uInt> rows = iter.getRows( SHARE ) ;
    37773776        calibrateAPEXFS( ssig, sref, on, sky, hot, cold, rows ) ;
    37783777        sky[0]->unsetSelection() ;
     
    37813780        hot[1]->unsetSelection() ;
    37823781        sel.reset() ;
    3783         iter->next() ;
    3784       }
    3785       delete iter ;
     3782        iter.next() ;
     3783      }
    37863784
    37873785    }
     
    38063804      cols[1] = "POLNO" ;
    38073805      cols[2] = "IFNO" ;
    3808       STIdxIter *iter = new STIdxIterAcc( ssig, cols ) ;
     3806      STIdxIter2 iter(ssig, cols);
    38093807      STSelector sel ;
    3810       while ( !iter->pastEnd() ) {
    3811         Vector<uInt> ids = iter->current() ;
     3808      while ( !iter.pastEnd() ) {
     3809        Record ids = iter.currentValue() ;
    38123810        stringstream ss ;
    38133811        ss << "SELECT FROM $1 WHERE "
    3814            << "BEAMNO==" << ids[0] << "&&"
    3815            << "POLNO==" << ids[1] << "&&"
    3816            << "IFNO==" << ids[2] ;
     3812           << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&"
     3813           << "POLNO==" << ids.asuInt("POLNO") << "&&"
     3814           << "IFNO==" << ids.asuInt("IFNO") ;
    38173815        //cout << "TaQL string: " << ss.str() << endl ;
    38183816        sel.setTaQL( ss.str() ) ;
     
    38203818        ahotlo->setSelection( sel ) ;
    38213819        askylo->setSelection( sel ) ;
    3822         Vector<uInt> rows = iter->getRows( SHARE ) ;
     3820        Vector<uInt> rows = iter.getRows( SHARE ) ;
    38233821        calibrateCW( ssig, rsig, aofflo, askylo, ahotlo, acoldlo, rows, antname ) ;
    38243822        aofflo->unsetSelection() ;
     
    38263824        askylo->unsetSelection() ;
    38273825        sel.reset() ;
    3828         iter->next() ;
    3829       }
    3830       delete iter ;
    3831       iter = new STIdxIterAcc( sref, cols ) ;
    3832       while ( !iter->pastEnd() ) {
    3833         Vector<uInt> ids = iter->current() ;
     3826        iter.next() ;
     3827      }
     3828      iter = STIdxIter2(sref, cols);
     3829      while ( !iter.pastEnd() ) {
     3830        Record ids = iter.currentValue() ;
    38343831        stringstream ss ;
    38353832        ss << "SELECT FROM $1 WHERE "
    3836            << "BEAMNO==" << ids[0] << "&&"
    3837            << "POLNO==" << ids[1] << "&&"
    3838            << "IFNO==" << ids[2] ;
     3833           << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&"
     3834           << "POLNO==" << ids.asuInt("POLNO") << "&&"
     3835           << "IFNO==" << ids.asuInt("IFNO") ;
    38393836        //cout << "TaQL string: " << ss.str() << endl ;
    38403837        sel.setTaQL( ss.str() ) ;
     
    38423839        ahothi->setSelection( sel ) ;
    38433840        askyhi->setSelection( sel ) ;
    3844         Vector<uInt> rows = iter->getRows( SHARE ) ;
     3841        Vector<uInt> rows = iter.getRows( SHARE ) ;
    38453842        calibrateCW( sref, rref, aoffhi, askyhi, ahothi, acoldhi, rows, antname ) ;
    38463843        aoffhi->unsetSelection() ;
     
    38483845        askyhi->unsetSelection() ;
    38493846        sel.reset() ;
    3850         iter->next() ;
    3851       }
    3852       delete iter ;
     3847        iter.next() ;
     3848      }
    38533849    }
    38543850  }
     
    39023898    cols[1] = "POLNO" ;
    39033899    cols[2] = "IFNO" ;
    3904     STIdxIter *iter = new STIdxIterAcc( ssig, cols ) ;
    3905     while ( !iter->pastEnd() ) {
    3906       Vector<uInt> ids = iter->current() ;
     3900    STIdxIter2 iter(ssig, cols);
     3901    while ( !iter.pastEnd() ) {
     3902      Record ids = iter.currentValue() ;
    39073903      stringstream ss ;
    39083904      ss << "SELECT FROM $1 WHERE "
    3909          << "BEAMNO==" << ids[0] << "&&"
    3910          << "POLNO==" << ids[1] << "&&"
    3911          << "IFNO==" << ids[2] ;
     3905         << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&"
     3906         << "POLNO==" << ids.asuInt("POLNO") << "&&"
     3907         << "IFNO==" << ids.asuInt("IFNO") ;
    39123908      //cout << "TaQL string: " << ss.str() << endl ;
    39133909      sel.setTaQL( ss.str() ) ;
    39143910      ahot->setSelection( sel ) ;
    39153911      asky->setSelection( sel ) ;
    3916       Vector<uInt> rows = iter->getRows( SHARE ) ;
     3912      Vector<uInt> rows = iter.getRows( SHARE ) ;
    39173913      // out should be an exact copy of s except that SPECTRA column is empty
    39183914      calibrateFS( ssig, sref, rsig, rref, asky, ahot, acold, rows ) ;
     
    39203916      asky->unsetSelection() ;
    39213917      sel.reset() ;
    3922       iter->next() ;
    3923     }
    3924     delete iter ;
     3918      iter.next() ;
     3919    }
    39253920  }
    39263921
     
    47824777  cols[1] = "POLNO" ;
    47834778  cols[2] = "BEAMNO" ;
    4784   STIdxIterAcc iter( s, cols ) ;
     4779  STIdxIter2 iter( s, cols ) ;
    47854780
    47864781  Table ttab = s->table() ;
  • trunk/src/python_asap.cpp

    r2832 r2916  
    8888  asap::python::python_SrcType();
    8989  asap::python::python_STGrid();
    90   asap::python::python_Iterator();
     90  //asap::python::python_Iterator();
    9191  asap::python::python_EdgeMarker();
    9292  asap::python::python_PlotHelper();
  • trunk/src/python_asap.h

    r2832 r2916  
    5555    void python_SrcType();
    5656    void python_STGrid();
    57     void python_Iterator();
     57    //void python_Iterator();
    5858    void python_EdgeMarker();
    5959    void python_PlotHelper();
Note: See TracChangeset for help on using the changeset viewer.