Changeset 51 for trunk


Ignore:
Timestamp:
07/15/04 15:59:46 (20 years ago)
Author:
mmarquar
Message:

Removed other Wrapper classes and put them into their own files.
Added/changed some wrappers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTableWrapper.h

    r41 r51  
    3636
    3737#include "SDMemTable.h"
    38 #include "SDReader.h"
    39 #include "SDMath.h"
    4038
    4139namespace atnf_sd {
     
    5856    return SDMemTableWrapper(*this, scan);
    5957  }
    60   std::vector<float> getSpectrum(int whichRow) const {
     58  std::vector<float> getSpectrum(int whichRow=0) const {
    6159    return table_->getSpectrum(whichRow);
    6260  }
     
    6866  }
    6967
    70   float getTsys(int whichRow) {return table_->getTsys(whichRow);}
    71   double getTime(int whichRow) {return table_->getTime(whichRow);}
     68  float getTsys(int whichRow=0) {return table_->getTsys(whichRow);}
     69  std::string getTime(int whichRow=0) {return table_->getTime(whichRow);}
    7270
    73   std::vector<bool> getMask(int whichRow) const {
     71  std::vector<bool> getMask(int whichRow=0) const {
    7472    return table_->getMask(whichRow);
    7573  }
    7674  bool setMask(const std::vector<int> mvals) const {
    7775    return table_->setMask(mvals);
    78   }
     76 }
    7977
    80   std::string getSourceName(int whichRow) {
     78  std::string getSourceName(int whichRow=0) {
    8179    return table_->getSourceName(whichRow);
    8280  }
     
    9492  int nPol() {return table_->nPol();}
    9593  int nChan() {return table_->nChan();}
     94  int nScans() {return table_->nScans();}
    9695
    9796  //sets the mask
     
    109108};
    110109
    111 class SDReaderWrapper : public SDReader {
    112 public:
    113   SDReaderWrapper() {;}
    114   SDReaderWrapper(SDMemTableWrapper tbl) :
    115     SDReader(tbl.getCP()){;}
    116   SDMemTableWrapper getSDMemTable() const {
    117     return SDMemTableWrapper(getTable());
    118   }
    119 };
    120 
    121 class SDMathWrapper {
    122 public:
    123   SDMemTableWrapper average(const SDMemTableWrapper& sdt) {
    124     return SDMemTableWrapper(SDMath::average(sdt.getCP()));
    125   }
    126   SDMemTableWrapper quotient(const SDMemTableWrapper& on,
    127                              const SDMemTableWrapper& off) {
    128     return SDMemTableWrapper(SDMath::quotient(on.getCP(),
    129                                              off.getCP()));
    130   }
    131   SDMemTableWrapper multiply(const SDMemTableWrapper& in,
    132                              Float factor) {
    133     return SDMemTableWrapper(SDMath::multiply(in.getCP(),factor));   
    134   }
    135  
    136   SDMemTableWrapper hanning(const SDMemTableWrapper& in) {
    137     return SDMemTableWrapper(SDMath::hanning(in.getCP()));   
    138   }
    139   std::vector<float> baseline(const SDMemTableWrapper& in, const std::string& fitexpr) {
    140     return SDMath::baseline(in.getCP(), fitexpr);
    141   }
    142 };
    143 
    144110} // namespace
    145 
    146111#endif
    147 
Note: See TracChangeset for help on using the changeset viewer.