- Timestamp:
- 03/01/06 14:06:05 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ScantableWrapper.h
r863 r864 36 36 37 37 public: 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 } 40 45 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 } 43 52 44 53 ScantableWrapper(casa::CountedPtr<Scantable> cp) : table_(cp) {;} … … 47 56 table_(mt.getCP()) {;} 48 57 49 ScantableWrapper(const ScantableWrapper& mt, const std::string& expr) :50 table_(new Scantable(mt.getCP()->table(), expr)) {;}51 52 58 ScantableWrapper copy() { 53 59 return ScantableWrapper(new Scantable(*(this->getCP()), false)); 54 60 } 55 56 61 /* 57 62 std::vector<float> getSpectrum(int whichRow=0) const { 58 63 return table_->getSpectrum(whichRow); … … 68 73 return table_->stokesToPolSpectrum(whichRow, linear, polIdx); 69 74 } 70 75 */ 71 76 // std::string getPolarizationLabel(bool linear, bool stokes, bool linPol, int polIdx) const { 72 77 // Boost fails with 4 arguments. … … 77 82 } 78 83 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); } 85 86 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); } 94 89 95 std::string getTime(int whichRow=0) {return table_->getTime(whichRow);} 90 float getTsys(int whichRow=0) const 91 { return table_->getTsys(whichRow); } 96 92 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); } 99 99 100 100 void setInstrument(const std::string& name) {table_->setInstrument(name);} 101 101 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); } 105 104 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(); } 112 106 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); } 122 109 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); } 126 112 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); } 130 115 131 STSelector getSelection() { return table_->getSelection(); } 116 float getParAngle(int whichRow=0) const 117 { return table_->getParAngle(whichRow); } 132 118 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();} 139 134 ///@todo int nstokes() {return table_->nStokes();} 140 135 141 void makePersistent(const std::string& fname) { 142 table_->makePersistent(fname); 143 } 136 void makePersistent(const std::string& fname) 137 { table_->makePersistent(fname); } 144 138 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); } 148 141 149 142 void setRestFreqs(const std::string& name) { … … 151 144 } 152 145 153 std::vector<double> getRestFrequencies() { 154 return table_->getRestFrequencies(); 155 } 146 std::vector<double> getRestFrequencies() const 147 { return table_->getRestFrequencies(); } 156 148 157 149 void setCoordInfo(std::vector<string> theinfo) { … … 169 161 } 170 162 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(); } 177 165 166 void addHistory(const std::string& hist) 167 { table_->addHistory(hist); } 168 /* 178 169 void addFit(int whichRow, const std::vector<double>& p, 179 170 const std::vector<bool>& m, const std::vector<string>& f, … … 189 180 return table_->getSDFitTable(casa::uInt(whichRow)); 190 181 } 191 182 */ 192 183 void calculateAZEL() { table_->calculateAZEL(); }; 193 184
Note:
See TracChangeset
for help on using the changeset viewer.