Changeset 2389 for trunk


Ignore:
Timestamp:
12/27/11 15:46:11 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2816

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

Introduced infileList_ (Block<String>) instead of infile_ (String).


Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STGrid.cpp

    r2388 r2389  
    7979{
    8080  String name( infile ) ;
    81   if ( infile_.compare( name ) != 0 ) {
    82     infile_ = String( infile ) ;
     81  if ( infileList_.size() == 0 || infileList_[0].compare( name ) != 0 ) {
     82    infileList_.resize( 1 ) ;
     83    infileList_[0] = String(infile) ;
    8384  }
    8485}
     
    732733  LogIO os( LogOrigin("STGrid","selectData",WHERE) ) ;   
    733734  Int ifno = ifno_ ;
    734   Table taborg( infile_ ) ;
    735   if ( ifno == -1 ) {
    736     ROScalarColumn<uInt> ifnoCol( taborg, "IFNO" ) ;
    737     ifno = ifnoCol( 0 ) ;
    738     os << LogIO::WARN
     735  uInt nfile = infileList_.size() ;
     736  tableList_.resize( nfile ) ;
     737  for ( uInt i = 0 ; i < nfile ; i++ ) {
     738    Table taborg( infileList_[i] ) ;
     739    if ( ifno == -1 ) {
     740      ROScalarColumn<uInt> ifnoCol( taborg, "IFNO" ) ;
     741      ifno = ifnoCol( 0 ) ;
     742      os << LogIO::WARN
    739743       << "IFNO is not given. Using default IFNO: " << ifno << LogIO::POST ;
    740   }
    741   TableExprNode node ;
    742   if ( isMultiIF( taborg ) ) {
    743     os << "apply selection on IFNO" << LogIO::POST ;
    744     node = taborg.col("IFNO") == ifno ;
    745   }
    746   if ( scanlist_.size() > 0 ) {
    747     os << "apply selection on SCANNO" << LogIO::POST ;
    748     node = node && taborg.col("SCANNO").in( scanlist_ ) ;
    749   }
    750   if ( node.isNull() ) {
    751     tab_ = taborg ;
    752   }
    753   else {
    754     tab_ = taborg( node ) ;
    755   }
    756   if ( tab_.nrow() == 0 ) {
    757     os << LogIO::SEVERE
    758        << "No corresponding rows for given selection: IFNO " << ifno ;
    759     if ( scanlist_.size() > 0 )
    760       os << " SCANNO " << scanlist_ ;
    761     os << LogIO::EXCEPTION ;
    762   }
     744    }
     745    TableExprNode node ;
     746    if ( isMultiIF( taborg ) ) {
     747      os << "apply selection on IFNO" << LogIO::POST ;
     748      node = taborg.col("IFNO") == ifno ;
     749    }
     750    if ( scanlist_.size() > 0 ) {
     751      os << "apply selection on SCANNO" << LogIO::POST ;
     752      node = node && taborg.col("SCANNO").in( scanlist_ ) ;
     753    }
     754    if ( node.isNull() ) {
     755      tableList_[i] = taborg ;
     756    }
     757    else {
     758      tableList_[i] = taborg( node ) ;
     759    }
     760    if ( tableList_[i].nrow() == 0 ) {
     761      os << LogIO::SEVERE
     762         << "No corresponding rows for given selection: IFNO " << ifno ;
     763      if ( scanlist_.size() > 0 )
     764        os << " SCANNO " << scanlist_ ;
     765      os << LogIO::EXCEPTION ;
     766    }
     767  }
     768  tab_ = tableList_[0] ;
    763769}
    764770
     
    12111217  String outfile_ ;
    12121218  if ( outfile.size() == 0 ) {
    1213     if ( infile_.lastchar() == '/' ) {
    1214       outfile_ = infile_.substr( 0, infile_.size()-1 ) ;
     1219    if ( infileList_[0].lastchar() == '/' ) {
     1220      outfile_ = infileList_[0].substr( 0, infileList_[0].size()-1 ) ;
    12151221    }
    12161222    else {
    1217       outfile_ = infile_ ;
     1223      outfile_ = infileList_[0] ;
    12181224    }
    12191225    outfile_ += ".grid" ;
     
    12761282void STGrid::prepareTable( Table &tab, String &name )
    12771283{
    1278   Table t( infile_, Table::Old ) ;
     1284  Table t( infileList_[0], Table::Old ) ;
    12791285  t.deepCopy( name, Table::New, False, t.endianFormat(), True ) ;
    12801286  tab = Table( name, Table::Update ) ;
  • trunk/src/STGrid.h

    r2388 r2389  
    166166  String centerUI_ ;
    167167
    168   String infile_ ;
     168  Block<String> infileList_ ;
    169169  Int ifno_ ;
    170170  Int nx_ ;
     
    187187
    188188  Table tab_ ;
     189  Block<Table> tableList_ ;
    189190  Table ptab_ ;
    190191  ROArrayColumn<Float> spectraCol_ ;
Note: See TracChangeset for help on using the changeset viewer.