Changeset 1707 for branches/alma


Ignore:
Timestamp:
02/19/10 20:30:37 (15 years ago)
Author:
WataruKawasaki
Message:

New Development: No

JIRA Issue: Yes (CAS-1807)

Ready to Release: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sdflag

Description: added Scantable::getClipMask() and Scantable::srchChannelsToClip().


Location:
branches/alma/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/src/Scantable.cpp

    r1706 r1707  
    706706{
    707707  for (uInt i=0; i<table_.nrow(); ++i) {
    708     Vector<Float> spcs = specCol_(i);
    709708    Vector<uChar> flgs = flagsCol_(i);
     709    srchChannelsToClip(i, uthres, dthres, clipoutside, unflag, flgs);
     710    flagsCol_.put(i, flgs);
     711  }
     712}
     713
     714std::vector<bool> Scantable::getClipMask(int whichrow, const Float uthres, const Float dthres, bool clipoutside, bool unflag)
     715{
     716  Vector<uChar> flags;
     717  flagsCol_.get(uInt(whichrow), flags);
     718  srchChannelsToClip(uInt(whichrow), uthres, dthres, clipoutside, unflag, flags);
     719  Vector<Bool> bflag(flags.shape());
     720  convertArray(bflag, flags);
     721  //bflag = !bflag;
     722
     723  std::vector<bool> mask;
     724  bflag.tovector(mask);
     725  return mask;
     726}
     727
     728void Scantable::srchChannelsToClip(uInt whichrow, const Float uthres, const Float dthres, bool clipoutside, bool unflag,
     729                                   Vector<uChar> flgs)
     730{
     731    Vector<Float> spcs = specCol_(whichrow);
    710732    uInt nchannel = nchan();
    711733    if (spcs.nelements() != nchannel) {
     
    731753      }
    732754    }
    733     flagsCol_.put(i, flgs);
    734   }
    735755}
    736756
  • branches/alma/src/Scantable.h

    r1703 r1707  
    250250
    251251  /**
     252   * Return a list of booleans with the size of nchan for a specified row, to get info
     253   * about which channel is clipped.
     254   */
     255  std::vector<bool> getClipMask(int whichrow, const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag);
     256  void srchChannelsToClip(casa::uInt whichrow, const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag,
     257                          casa::Vector<casa::uChar> flgs);
     258
     259  /**
    252260   * Return a list of row numbers with respect to the original table.
    253261   * @return a list of unsigned ints
  • branches/alma/src/ScantableWrapper.h

    r1703 r1707  
    117117    { table_->clip(uthres, dthres, clipoutside, unflag); }
    118118
     119  std::vector<bool> getClipMask(int whichrow, const casa::Float uthres, const casa::Float dthres, bool clipoutside, bool unflag) const
     120    { return table_->getClipMask(whichrow, uthres, dthres, clipoutside, unflag); }
     121
    119122  std::string getSourceName(int whichrow=0) const
    120123    { return table_->getSourceName(whichrow); }
  • branches/alma/src/python_Scantable.cpp

    r1700 r1707  
    8888    .def("_getmask", &ScantableWrapper::getMask,
    8989         (boost::python::arg("whichrow")=0) )
     90    .def("_getclipmask", &ScantableWrapper::getClipMask,
     91         (boost::python::arg("whichrow")=0) )
    9092    .def("_gettsys", &ScantableWrapper::getTsys)
    9193    .def("_getsourcename", &ScantableWrapper::getSourceName,
Note: See TracChangeset for help on using the changeset viewer.