Changeset 178


Ignore:
Timestamp:
01/07/05 11:19:31 (20 years ago)
Author:
kil064
Message:

remove 'hanning' functions and add 'smooth' functions

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMathWrapper.cc

    r175 r178  
    8888}
    8989
    90 void SDMathWrapper::hanningInSitu(SDMemTableWrapper& in, bool doAll)
     90
     91void SDMathWrapper::smoothInSitu(SDMemTableWrapper& in, const std::string& kernel, float width, bool doAll)
    9192{
    9293  SDMemTable* pIn = in.getPtr();
    9394  SDMath sdm;
    94   SDMemTable* pOut = sdm.hanning (*pIn, Bool(doAll));
     95  SDMemTable* pOut = sdm.smooth(*pIn, String(kernel), Float(width), Bool(doAll));
    9596  *pIn = *pOut;
    9697   delete pOut;
    9798}
    9899
    99 SDMemTableWrapper SDMathWrapper::hanning (const SDMemTableWrapper& in, bool doAll)
     100
     101SDMemTableWrapper SDMathWrapper::smooth (const SDMemTableWrapper& in, const std::string& kernel,
     102                                         float width, bool doAll)
    100103{
    101104  const CountedPtr<SDMemTable>& pIn = in.getCP();
    102105  SDMath sdm;
    103   return CountedPtr<SDMemTable>(sdm.hanning(*pIn, Bool(doAll)));
     106  return CountedPtr<SDMemTable>(sdm.smooth(*pIn, String(kernel), Float(width), Bool(doAll)));
    104107}
    105108
  • trunk/src/SDMathWrapper.h

    r175 r178  
    5656  SDMemTableWrapper add(const SDMemTableWrapper& in, float offset, bool all);
    5757
    58 // Hanning
    59   void hanningInSitu (SDMemTableWrapper& in, bool doAll);
    60   SDMemTableWrapper hanning(const SDMemTableWrapper& in, bool doAll);
     58// Smooth
     59  void smoothInSitu (SDMemTableWrapper& in, const std::string& kernel, float width, bool doAll);
     60  SDMemTableWrapper smooth (const SDMemTableWrapper& in, const std::string& kernel, float width, bool doAll);
    6161
    6262// Bin up
  • trunk/src/python_SDMath.cc

    r173 r178  
    7272      def("add_insitu", &SDMathWrapper::addInSitu);
    7373//
    74       def("hanning", &SDMathWrapper::hanning);
    75       def("hanning_insitu", &SDMathWrapper::hanningInSitu);
     74      def("smooth", &SDMathWrapper::smooth);
     75      def("smooth_insitu", &SDMathWrapper::smoothInSitu);
    7676//
    7777      def("average", &SDMathWrapper::average);
Note: See TracChangeset for help on using the changeset viewer.