Changeset 800 for branches/Release12/src


Ignore:
Timestamp:
01/10/06 15:11:58 (19 years ago)
Author:
mar637
Message:

Request: added channel based flagging

Location:
branches/Release12/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/Release12/src/SDMemTable.cc

    r787 r800  
    16221622}
    16231623*/
    1624 void SDMemTable::flag(int whichRow)
     1624void SDMemTable::flagSpectrum(const std::vector<bool>& flags, int whichRow)
    16251625  {
    16261626  Array<uChar> arr;
    16271627  flagsCol_.get(whichRow, arr);
     1628
     1629  std::vector<bool>::const_iterator it = flags.begin();
     1630  if ( flags.size() != arr.shape()(asap::ChanAxis) )
     1631    throw(AipsError("Incorrect number of channels in flags"));
    16281632
    16291633  ArrayAccessor<uChar, Axis<asap::BeamAxis> > aa0(arr);
     
    16341638  aa2.reset(aa2.begin(uInt(polSel_)));// go to pol
    16351639
     1640  uChar userflag = 1 << 7; // user flag bit
    16361641  for (ArrayAccessor<uChar, Axis<asap::ChanAxis> > i(aa2); i != i.end(); ++i) {
    1637     (*i) = uChar(True);
     1642    if (*it)
     1643      (*i) |= userflag;
     1644    ++it;
    16381645  }
    16391646
  • branches/Release12/src/SDMemTable.h

    r787 r800  
    182182  virtual void resetCursor();
    183183
    184   // Hard flags the current spectrum, not reversible
    185   virtual void flag(int whichRow);
     184  // Hard flags the current spectrum, (currently) not reversible
     185  virtual void flagSpectrum(const std::vector<bool>& flags, int whichRow);
    186186
    187187  // return the currently selected values
  • branches/Release12/src/SDMemTableWrapper.h

    r787 r800  
    131131  }
    132132
    133   void flag(int whichRow=-1) {
    134     table_->flag(whichRow);
    135   }
     133  void flagSpectrum(const std::vector<bool>& flags, int whichRow=-1) {
     134    table_->flagSpectrum(flags, whichRow);
     135  }
     136
    136137  std::string getSourceName(int whichRow=0) {
    137138    return table_->getSourceName(whichRow);
  • branches/Release12/src/python_SDMemTable.cc

    r787 r800  
    101101    .def("_gettime", &SDMemTableWrapper::getTime,
    102102         (boost::python::arg("whichRow")=0) )
    103     .def("_flag", &SDMemTableWrapper::flag,
     103    .def("_flagspectrum", &SDMemTableWrapper::flagSpectrum,
    104104         (boost::python::arg("whichRow")=-1) )
    105105    .def("_save",  &SDMemTableWrapper::makePersistent)
Note: See TracChangeset for help on using the changeset viewer.