Changeset 145 for trunk


Ignore:
Timestamp:
12/25/04 00:28:13 (20 years ago)
Author:
kil064
Message:

cahneg inertface so that function 'averages' and 'average' are combined
into one called 'average'

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMathWrapper.h

    r139 r145  
    4343
    4444namespace SDMathWrapper {
    45   SDMemTableWrapper average(const SDMemTableWrapper& sdt) {
    46     return SDMemTableWrapper(SDMath::average(sdt.getCP()));
    47   }
    4845
    4946  SDMemTableWrapper quotient(const SDMemTableWrapper& on,
     
    5754    return SDMemTableWrapper(SDMath::multiply(in.getCP(),factor));
    5855  }
     56
    5957  void scaleInSitu(SDMemTableWrapper& in, casa::Float factor) {
    6058    SDMemTable* sdmt = in.getPtr();
     
    7169  }
    7270
    73   SDMemTableWrapper averages(boost::python::tuple tpl,
    74                              const std::vector<bool>& mask);
     71  SDMemTableWrapper average (boost::python::tuple tpl,
     72                             const std::vector<bool>& mask,
     73                             bool scanAv, const std::string& wt);
    7574
    7675  SDMemTableWrapper averagePol(const SDMemTableWrapper& in,
  • trunk/src/python_SDMath.cc

    r140 r145  
    4242namespace asap {
    4343  namespace SDMathWrapper {
    44     SDMemTableWrapper SDMathWrapper::averages(boost::python::tuple tp,
    45                                               const std::vector<bool>& mask) {
     44    SDMemTableWrapper SDMathWrapper::average(boost::python::tuple tp,
     45                                             const std::vector<bool>& mask,
     46                                             bool scanAv,
     47                                             const std::string& weightStr) {
    4648      int n;
    4749      n = extract<int>(tp.attr("__len__")());
     
    5355      }
    5456      Vector<Bool> msk(mask);
    55       return SDMemTableWrapper(SDMath::averages(b,msk));
     57      return SDMemTableWrapper(SDMath::average(b,msk,scanAv,weightStr));
    5658    };
    57 
    5859  } // namespace SDMathWrapper
    5960
    6061  namespace python {
    6162    void python_SDMath() {
    62       def("average", &SDMathWrapper::average);
    6363      def("quotient", &SDMathWrapper::quotient);
    6464      def("scale", &SDMathWrapper::scale);
     
    6666      def("add", &SDMathWrapper::add);
    6767      def("hanning", &SDMathWrapper::hanning);
    68       def("averages", &SDMathWrapper::averages);
     68      def("average", &SDMathWrapper::average);
    6969      def("averagepol", &SDMathWrapper::averagePol);
    7070      def("bin", &SDMathWrapper::bin);
Note: See TracChangeset for help on using the changeset viewer.