Ignore:
Timestamp:
04/18/07 16:18:40 (17 years ago)
Author:
mar637
Message:

Fix for Ticket #104; protect the user from flagging the whole scantable. This has performance penalties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r1325 r1333  
    618618void Scantable::flag(const std::vector<bool>& msk)
    619619{
    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) )
    621628    throw(AipsError("Trying to flag whole scantable."));
    622629  if ( msk.size() == 0 ) {
Note: See TracChangeset for help on using the changeset viewer.