Changeset 1333
- Timestamp:
- 04/18/07 16:18:40 (18 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/RowAccumulator.cpp
r1314 r1333 125 125 casa::Double asap::RowAccumulator::getTime( ) const 126 126 { 127 return timeSum_/max(n_); 127 Float n = max(n_); 128 if (n < 1.0) n = 1.0; 129 return timeSum_/n; 128 130 } 129 131 … … 135 137 casa::Vector< casa::Bool > RowAccumulator::getMask( ) const 136 138 { 139 // if no elements accumulated the mask is all True 140 // we have to return everything False 141 if (max(n_) < 1.0) return !spectrum_.getMask(); 137 142 return spectrum_.getMask(); 138 143 } -
trunk/src/STMath.cpp
r1321 r1333 137 137 ROScalarColumn<Double> mjdCol, intCol; 138 138 ROScalarColumn<Int> scanIDCol; 139 140 Vector<uInt> rowstodelete; 139 141 140 142 for (uInt i=0; i < tout.nrow(); ++i) { … … 180 182 } 181 183 } 184 const Vector<Bool>& msk = acc.getMask(); 185 if ( allEQ(msk, False) ) { 186 uint n = rowstodelete.nelements(); 187 rowstodelete.resize(n+1, True); 188 rowstodelete[n] = i; 189 continue; 190 } 191 cout << "write "<< i << endl; 182 192 //write out 183 specColOut.put(i, acc.getSpectrum());184 const Vector<Bool>& msk = acc.getMask();185 193 Vector<uChar> flg(msk.shape()); 186 194 convertArray(flg, !msk); 187 195 flagColOut.put(i, flg); 196 specColOut.put(i, acc.getSpectrum()); 188 197 tsysColOut.put(i, acc.getTsys()); 189 198 intColOut.put(i, acc.getInterval()); … … 194 203 cycColOut.put(i, uInt(0)); 195 204 acc.reset(); 205 } 206 if (rowstodelete.nelements() > 0) { 207 cout << rowstodelete << endl; 208 tout.removeRow(rowstodelete); 209 if (tout.nrow() == 0) { 210 throw(AipsError("Can't average fully flagged data.")); 211 } 196 212 } 197 213 return out; -
trunk/src/Scantable.cpp
r1325 r1333 618 618 void Scantable::flag(const std::vector<bool>& msk) 619 619 { 620 if ( selector_.empty() && msk.size() == 0 ) 620 std::vector<bool>::const_iterator it; 621 uInt ntrue = 0; 622 for (it = msk.begin(); it != msk.end(); ++it) { 623 if ( *it ) { 624 ntrue++; 625 } 626 } 627 if ( selector_.empty() && (msk.size() == 0 || msk.size() == ntrue) ) 621 628 throw(AipsError("Trying to flag whole scantable.")); 622 629 if ( msk.size() == 0 ) {
Note:
See TracChangeset
for help on using the changeset viewer.