- Timestamp:
- 12/27/11 15:46:11 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STGrid.cpp
r2388 r2389 79 79 { 80 80 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) ; 83 84 } 84 85 } … … 732 733 LogIO os( LogOrigin("STGrid","selectData",WHERE) ) ; 733 734 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 739 743 << "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] ; 763 769 } 764 770 … … 1211 1217 String outfile_ ; 1212 1218 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 ) ; 1215 1221 } 1216 1222 else { 1217 outfile_ = infile _;1223 outfile_ = infileList_[0] ; 1218 1224 } 1219 1225 outfile_ += ".grid" ; … … 1276 1282 void STGrid::prepareTable( Table &tab, String &name ) 1277 1283 { 1278 Table t( infile _, Table::Old ) ;1284 Table t( infileList_[0], Table::Old ) ; 1279 1285 t.deepCopy( name, Table::New, False, t.endianFormat(), True ) ; 1280 1286 tab = Table( name, Table::Update ) ; -
trunk/src/STGrid.h
r2388 r2389 166 166 String centerUI_ ; 167 167 168 String infile_ ;168 Block<String> infileList_ ; 169 169 Int ifno_ ; 170 170 Int nx_ ; … … 187 187 188 188 Table tab_ ; 189 Block<Table> tableList_ ; 189 190 Table ptab_ ; 190 191 ROArrayColumn<Float> spectraCol_ ;
Note:
See TracChangeset
for help on using the changeset viewer.