Changeset 300


Ignore:
Timestamp:
01/26/05 02:00:25 (19 years ago)
Author:
kil064
Message:

add resample wrappers

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMathWrapper.cc

    r295 r300  
    150150}
    151151
     152void SDMathWrapper::resampleInSitu(SDMemTableWrapper& in, const std::string& method,
     153                                   float width)
     154{
     155  SDMemTable* pIn = in.getPtr();
     156  SDMath sdm;
     157  SDMemTable* pOut = sdm.resample(*pIn, String(method), Float(width));
     158  *pIn = *pOut;
     159   delete pOut;
     160}
     161
     162SDMemTableWrapper SDMathWrapper::resample (const SDMemTableWrapper& in,
     163                                           const std::string& method, float width)
     164{
     165  const CountedPtr<SDMemTable>& pIn = in.getCP();
     166  SDMath sdm;
     167  return CountedPtr<SDMemTable>(sdm.resample(*pIn, String(method), Float(width)));
     168}
     169
    152170
    153171void SDMathWrapper::averagePolInSitu(SDMemTableWrapper& in,
  • trunk/src/SDMathWrapper.h

    r295 r300  
    7171  SDMemTableWrapper bin(const SDMemTableWrapper& in, int width);
    7272
     73// Resample
     74  void resampleInSitu(SDMemTableWrapper& in, const std::string& method, float width);
     75  SDMemTableWrapper resample(const SDMemTableWrapper& in, const std::string& method,
     76                             float width);
     77
    7378// Convert brightness between Jy and K
    7479  void convertFluxInSitu(SDMemTableWrapper& in, float area, float eta, bool doAll);
  • trunk/src/python_SDMath.cc

    r268 r300  
    9797      def("bin_insitu", &SDMathWrapper::binInSitu);
    9898//
     99      def("resample", &SDMathWrapper::resample);
     100      def("resample_insitu", &SDMathWrapper::resampleInSitu);
     101//
    99102      def("stats", &SDMathWrapper::statistic);
    100103    };
Note: See TracChangeset for help on using the changeset viewer.