- Timestamp:
- 11/12/04 12:05:49 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMathWrapper.h
r83 r86 48 48 49 49 SDMemTableWrapper quotient(const SDMemTableWrapper& on, 50 50 const SDMemTableWrapper& off) { 51 51 return SDMemTableWrapper(SDMath::quotient(on.getCP(), 52 52 off.getCP())); 53 53 } 54 54 55 SDMemTableWrapper multiply(const SDMemTableWrapper& in, 56 Float factor) { 57 return SDMemTableWrapper(SDMath::multiply(in.getCP(),factor)); 58 } 59 60 SDMemTableWrapper hanning(const SDMemTableWrapper& in) { 61 return SDMemTableWrapper(SDMath::hanning(in.getCP())); 55 SDMemTableWrapper scale(const SDMemTableWrapper& in, 56 Float factor) { 57 return SDMemTableWrapper(SDMath::multiply(in.getCP(),factor)); 62 58 } 63 59 64 SDMemTableWrapper baseline(const SDMemTableWrapper& in, 65 const std::string& fitexpr, 66 const std::vector<bool>& mask) { 60 SDMemTableWrapper hanning(const SDMemTableWrapper& in) { 61 return SDMemTableWrapper(SDMath::hanning(in.getCP())); 62 } 63 64 SDMemTableWrapper baseline(const SDMemTableWrapper& in, 65 const std::string& fitexpr, 66 const std::vector<bool>& mask) { 67 67 return SDMath::baseline(in.getCP(), fitexpr, mask); 68 68 } 69 69 70 SDMemTableWrapper averages(boost::python::tuple tpl, 71 70 SDMemTableWrapper averages(boost::python::tuple tpl, 71 const std::vector<bool>& mask); 72 72 73 SDMemTableWrapper averagePol(const SDMemTableWrapper& in, 74 73 SDMemTableWrapper averagePol(const SDMemTableWrapper& in, 74 const std::vector<bool>& mask) { 75 75 return SDMath::averagePol(in.getCP(), mask); 76 76 } 77 77 78 SDMemTableWrapper bin(const SDMemTableWrapper& in, 79 78 SDMemTableWrapper bin(const SDMemTableWrapper& in, 79 int width) { 80 80 return SDMath::bin(in.getCP(), width); 81 81 } 82 82 83 float rms(const SDMemTableWrapper& in, 84 83 float rms(const SDMemTableWrapper& in, 84 const std::vector<bool>& mask) { 85 85 return SDMath::rms(in.getCP(), mask); 86 86 } -
trunk/src/python_SDMath.cc
r83 r86 38 38 namespace SDMathWrapper { 39 39 SDMemTableWrapper SDMathWrapper::averages(boost::python::tuple tp, 40 40 const std::vector<bool>& mask) { 41 41 int n; 42 42 n = extract<int>(tp.attr("__len__")()); 43 43 Block<CountedPtr<asap::SDMemTable> > b(n); 44 44 for (int i=0;i< n;++i) { 45 SDMemTableWrapper sdmw = 46 47 45 SDMemTableWrapper sdmw = 46 extract<SDMemTableWrapper>( tp.attr("__getitem__")(i) ); 47 b[i] = sdmw.getCP(); 48 48 } 49 49 Vector<Bool> msk(mask); 50 50 return SDMemTableWrapper(SDMath::averages(b,msk)); 51 51 }; 52 52 53 53 } // namespace SDMathWrapper 54 54 … … 57 57 def("average", &SDMathWrapper::average); 58 58 def("quotient", &SDMathWrapper::quotient); 59 def(" multiply", &SDMathWrapper::multiply);59 def("scale", &SDMathWrapper::scale); 60 60 def("baseline", &SDMathWrapper::baseline); 61 61 def("hanning", &SDMathWrapper::hanning); … … 65 65 def("rms", &SDMathWrapper::rms); 66 66 }; 67 67 68 68 } // python 69 69 } // asap
Note:
See TracChangeset
for help on using the changeset viewer.