- Timestamp:
- 04/07/06 09:41:02 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STFit.cpp
r972 r1000 90 90 Table t = table_(table_.col("ID") == id ); 91 91 if (t.nrow() > 0) { 92 rno = t.rowNumbers( )[0];92 rno = t.rowNumbers(table_)[0]; 93 93 resultid = id; 94 94 foundentry = true; … … 102 102 // add new row if new id 103 103 if ( !foundentry ) table_.addRow(); 104 cout << rno << " " << resultid << endl;105 104 funcCol_.put(rno, mathutil::toVectorString(fit.getFunctions())); 106 105 compCol_.put(rno, Vector<Int>(fit.getComponents())); -
trunk/src/STMath.cpp
r996 r1000 1004 1004 setInsitu(insitu); 1005 1005 Table& tout = out->table(); 1006 // clear ouput frequency table1007 //Table ftable = out->frequencies().table();1008 //ftable.removeRow(ftable.rowNumbers());1009 1006 // Get reference Epoch to time of first row or given String 1010 1007 Unit DAY(String("d")); … … 1135 1132 if ( in->getPolType() == newtype ) 1136 1133 throw(AipsError("No need to convert.")); 1134 if ( ! in->selector_.empty() ) 1135 throw(AipsError("Can only convert whole scantable. Unset the selection.")); 1137 1136 bool insitu = insitu_; 1138 1137 setInsitu(false); -
trunk/src/STSelector.cpp
r995 r1000 123 123 TableExprNode query; 124 124 intidmap::const_iterator it; 125 for (it = intselections_.begin(); it != intselections_.end(); ++it) {125 for (it = intselections_.begin(); it != intselections_.end(); ++it) { 126 126 TableExprNode theset(Vector<Int>( (*it).second )); 127 127 if ( query.isNull() ) { … … 154 154 return sort(tab); 155 155 } else { 156 cout << "query rows"<< tab(query).nrow() << endl; 156 157 return sort(tab(query)); 157 158 } -
trunk/src/Scantable.cpp
r999 r1000 578 578 } 579 579 580 void Scantable::flag( )580 void Scantable::flag(const std::vector<bool>& msk) 581 581 { 582 582 if ( selector_.empty() ) 583 throw(AipsError("Trying to flag whole scantable. Aborted.")); 584 TableVector<uChar> tvec(table_, "FLAGTRA"); 585 uChar userflag = 1 << 7; 586 tvec = userflag; 583 throw(AipsError("Trying to flag whole scantable.")); 584 if ( msk.size() == 0 ) { 585 uChar userflag = 1 << 7; 586 for ( uInt i=0; i<table_.nrow(); ++i) { 587 Vector<uChar> flgs = flagsCol_(i); 588 flgs = userflag; 589 flagsCol_.put(i, flgs); 590 } 591 return; 592 } 593 if ( int(msk.size()) != nchan() ) { 594 throw(AipsError("Mask has incorrect number of channels.")); 595 } 596 for ( uInt i=0; i<table_.nrow(); ++i) { 597 Vector<uChar> flgs = flagsCol_(i); 598 if ( flgs.nelements() != msk.size() ) { 599 throw(AipsError("Mask has incorrect number of channels." 600 " Probably varying with IF. Please flag per IF")); 601 } 602 std::vector<bool>::const_iterator it; 603 uInt j = 0; 604 uChar userflag = 1 << 7; 605 for (it = msk.begin(); it != msk.end(); ++it) { 606 if ( *it ) { 607 flgs(j) = userflag; 608 } 609 ++j; 610 } 611 flagsCol_.put(i, flgs); 612 } 587 613 } 588 614 … … 762 788 ROTableRow brow(bsubt); 763 789 const TableRecord& brec = brow.get(0); 764 uInt row0 = bsubt.rowNumbers( )[0];790 uInt row0 = bsubt.rowNumbers(table_)[0]; 765 791 oss << setw(5) << "" << setw(4) << std::right << brec.asuInt("BEAMNO")<< std::left; 766 792 oss << setw(4) << "" << formatDirection(getDirection(row0)) << endl; -
trunk/src/Scantable.h
r987 r1000 183 183 * "hard" flag the data, this flags everything selected in setSelection() 184 184 */ 185 void flag( );185 void flag( const std::vector<bool>& msk = std::vector<bool>()); 186 186 187 187 /** -
trunk/src/ScantableWrapper.h
r987 r1000 94 94 { return table_->getMask(whichrow); } 95 95 96 void flag() { table_->flag(); } 96 void flag(const std::vector<bool>& msk=std::vector<bool>()) 97 { table_->flag(msk); } 97 98 98 99 std::string getSourceName(int whichrow=0) const -
trunk/src/python_Scantable.cpp
r987 r1000 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id: 29 //# $Id:$ 30 30 //#--------------------------------------------------------------------------- 31 31 #include <vector>
Note:
See TracChangeset
for help on using the changeset viewer.