Changeset 55
- Timestamp:
- 07/15/04 16:04:14 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/python_SDMath.cc
r43 r55 31 31 #include <boost/python.hpp> 32 32 33 #include "SDM emTableWrapper.h"33 #include "SDMathWrapper.h" 34 34 35 35 using namespace boost::python; … … 37 37 namespace atnf_sd { 38 38 namespace python { 39 40 SDMemTableWrapper SDMathWrapper::averages(boost::python::tuple tp, 41 const std::vector<bool>& mask) { 42 int n; 43 n = extract<int>(tp.attr("__len__")()); 44 Block<CountedPtr<atnf_sd::SDMemTable> > b(n); 45 for (int i=0;i< n;++i) { 46 SDMemTableWrapper sdmw = 47 extract<SDMemTableWrapper>( tp.attr("__getitem__")(i) ); 48 b[i] = sdmw.getCP(); 49 } 50 Vector<Bool> msk(mask); 51 return SDMemTableWrapper(SDMath::averages(b,msk)); 52 }; 39 53 40 54 void python_SDMath() { … … 45 59 .def("baseline", &SDMathWrapper::baseline) 46 60 .def("hanning", &SDMathWrapper::hanning) 61 .def("averages", &SDMathWrapper::averages) 62 .def("averagepol", &SDMathWrapper::averagePol) 63 .def("bin", &SDMathWrapper::bin) 64 .def("rms", &SDMathWrapper::rms) 47 65 ; 48 66 }; 49 67 50 68 } // python 51 } 69 } // atnf_sd 70
Note:
See TracChangeset
for help on using the changeset viewer.