Changeset 864


Ignore:
Timestamp:
03/01/06 14:06:05 (19 years ago)
Author:
mar637
Message:

lots of changes to the new Scantable interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ScantableWrapper.h

    r863 r864  
    3636
    3737public:
    38   ScantableWrapper(const std::string& name) :
    39     table_(new Scantable(name)) {;}
     38  ScantableWrapper( const std::string& name,
     39                    const std::string& type="")
     40  {
     41    casa::Table::TableType tp = casa::Table::Memory;
     42    if ( type == "disk") tp = casa::Table::Plain;
     43    table_ = new Scantable(name, tp);
     44  }
    4045
    41   ScantableWrapper() :
    42     table_(new Scantable()) {;}
     46  ScantableWrapper(const std::string& type="")
     47  {
     48    casa::Table::TableType tp = casa::Table::Memory;
     49    if ( type == "disk") tp = casa::Table::Plain;
     50    table_= new Scantable(tp);
     51  }
    4352
    4453  ScantableWrapper(casa::CountedPtr<Scantable> cp) : table_(cp) {;}
     
    4756    table_(mt.getCP()) {;}
    4857
    49   ScantableWrapper(const ScantableWrapper& mt, const std::string& expr) :
    50     table_(new Scantable(mt.getCP()->table(), expr)) {;}
    51 
    5258  ScantableWrapper copy() {
    5359    return ScantableWrapper(new Scantable(*(this->getCP()), false));
    5460  }
    55 
    56 
     61  /*
    5762  std::vector<float> getSpectrum(int whichRow=0) const {
    5863    return table_->getSpectrum(whichRow);
     
    6873    return table_->stokesToPolSpectrum(whichRow, linear, polIdx);
    6974  }
    70 
     75  */
    7176  //  std::string getPolarizationLabel(bool linear, bool stokes, bool linPol, int polIdx) const {
    7277  // Boost fails with 4 arguments.
     
    7782  }
    7883
    79   std::vector<double> getAbcissa(int whichRow=0) const {
    80     return table_->getAbcissa(whichRow);
    81   }
    82   std::string getAbcissaString(int whichRow=0) const {
    83     return table_->getAbcissaString(whichRow);
    84   }
     84  std::vector<double> getAbcissa(int whichRow=0) const
     85    { return table_->getAbcissa(whichRow); }
    8586
    86   std::vector<float> getTsys() {
    87      int nRow = table_->nRow();
    88      std::vector<float> result(nRow);
    89      for (uint i=0; i<nRow; i++) {
    90         result[i] = table_->getTsys(i);
    91      }
    92      return result;
    93   }
     87  std::string getAbcissaString(int whichRow=0) const
     88    { return table_->getAbcissaString(whichRow); }
    9489
    95   std::string getTime(int whichRow=0) {return table_->getTime(whichRow);}
     90  float getTsys(int whichRow=0) const
     91    { return table_->getTsys(whichRow); }
    9692
    97   std::string getFluxUnit() const {return table_->getFluxUnit();}
    98   void setFluxUnit(const std::string& unit) {table_->setFluxUnit(unit);}
     93  std::string getTime(int whichRow=0) const
     94    { return table_->getTime(whichRow); }
     95
     96  std::string getFluxUnit() const { return table_->getFluxUnit(); }
     97
     98  void setFluxUnit(const std::string& unit) { table_->setFluxUnit(unit); }
    9999
    100100  void setInstrument(const std::string& name) {table_->setInstrument(name);}
    101101
    102   std::vector<bool> getMask(int whichRow=0) const {
    103     return table_->getMask(whichRow);
    104   }
     102  std::vector<bool> getMask(int whichRow=0) const
     103    { return table_->getMask(whichRow); }
    105104
    106   void flag(int whichRow=-1) {
    107     table_->flag(whichRow);
    108   }
    109   std::string getSourceName(int whichRow=0) {
    110     return table_->getSourceName(whichRow);
    111   }
     105  void flag() { table_->flag(); }
    112106
    113   float getElevation(int whichRow=0) {
    114     return table_->getElevation(whichRow);
    115   }
    116   float getAzimuth(int whichRow=0) {
    117     return table_->getAzimuth(whichRow);
    118   }
    119   float getParAngle(int whichRow=0) {
    120     return table_->getParAngle(whichRow);
    121   }
     107  std::string getSourceName(int whichRow=0) const
     108    { return table_->getSourceName(whichRow); }
    122109
    123   void setSpectrum(std::vector<float> spectrum, int whichrow=0) {
    124       table_->setSpectrum(spectrum, whichrow);
    125   }
     110  float getElevation(int whichRow=0) const
     111    { return table_->getElevation(whichRow); }
    126112
    127   int getIF(int whichrow) {return table_->getIF(whichrow);}
    128   int getBeam(int whichrow) {return table_->getBeam(whichrow);}
    129   int getPol(int whichrow) {return table_->getPol(whichrow);}
     113  float getAzimuth(int whichRow=0) const
     114    { return table_->getAzimuth(whichRow); }
    130115
    131   STSelector getSelection() { return table_->getSelection(); }
     116  float getParAngle(int whichRow=0) const
     117    { return table_->getParAngle(whichRow); }
    132118
    133   int nif(int scanno=-1) {return table_->nif(scanno);}
    134   int nbeam(int scanno=-1) {return table_->nbeam(scanno);}
    135   int npol(int scanno=-1) {return table_->npol(scanno);}
    136   int nchan(int ifno=-1) {return table_->nchan(ifno);}
    137   int nscan() {return table_->nscan();}
    138   int nrow() {return table_->nrow();}
     119  void setSpectrum(std::vector<float> spectrum, int whichrow=0)
     120    { table_->setSpectrum(spectrum, whichrow); }
     121
     122  int getIF(int whichrow) const {return table_->getIF(whichrow);}
     123  int getBeam(int whichrow) const {return table_->getBeam(whichrow);}
     124  int getPol(int whichrow) const {return table_->getPol(whichrow);}
     125
     126  STSelector getSelection() const { return table_->getSelection(); }
     127
     128  int nif(int scanno=-1) const {return table_->nif(scanno);}
     129  int nbeam(int scanno=-1) const {return table_->nbeam(scanno);}
     130  int npol(int scanno=-1) const {return table_->npol(scanno);}
     131  int nchan(int ifno=-1) const {return table_->nchan(ifno);}
     132  int nscan() const {return table_->nscan();}
     133  int nrow() const {return table_->nrow();}
    139134  ///@todo int nstokes() {return table_->nStokes();}
    140135
    141   void makePersistent(const std::string& fname) {
    142     table_->makePersistent(fname);
    143   }
     136  void makePersistent(const std::string& fname)
     137    { table_->makePersistent(fname); }
    144138
    145   void setRestFreqs(double rf, const std::string& unit) {
    146     table_->setRestFreqs(rf, unit);
    147   }
     139  void setRestFreqs(double rf, const std::string& unit)
     140    { table_->setRestFreqs(rf, unit); }
    148141
    149142  void setRestFreqs(const std::string& name) {
     
    151144  }
    152145
    153   std::vector<double> getRestFrequencies() {
    154     return table_->getRestFrequencies();
    155   }
     146  std::vector<double> getRestFrequencies() const
     147    { return table_->getRestFrequencies(); }
    156148
    157149  void setCoordInfo(std::vector<string> theinfo) {
     
    169161  }
    170162
    171   std::vector<std::string> getHistory() {
    172     return table_->getHistory();
    173   }
    174   void addHistory(const std::string& hist) {
    175     table_->addHistory(hist);
    176   }
     163  std::vector<std::string> getHistory()const
     164    { return table_->getHistory(); }
    177165
     166  void addHistory(const std::string& hist)
     167    { table_->addHistory(hist); }
     168  /*
    178169  void addFit(int whichRow, const std::vector<double>& p,
    179170              const std::vector<bool>& m, const std::vector<string>& f,
     
    189180    return table_->getSDFitTable(casa::uInt(whichRow));
    190181  }
    191 
     182  */
    192183  void calculateAZEL() { table_->calculateAZEL(); };
    193184
Note: See TracChangeset for help on using the changeset viewer.