- Timestamp:
- 03/24/09 12:33:56 (16 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/LineCatalog.cpp
r1259 r1534 62 62 void LineCatalog::setPattern(const std::string& name, const std::string& stype) 63 63 { 64 //std::string mode = stype+"('"+name+"')"; 65 std::string taql = "SELECT FROM $1 WHERE Column1 == pattern('"+name+"')"; 66 cerr << taql << endl; 64 std::string mode = stype+"('"+name+"')"; 65 std::string taql = "SELECT FROM $1 WHERE Column1 == " + mode; 67 66 Table tmp = tableCommand(taql, table_); 68 67 if (tmp.nrow() > 0) table_ = tmp.sort("Column2"); … … 110 109 } 111 110 } 112 /// @todo implement me113 111 return String(oss); 114 112 } 115 113 116 /*! 117 \fn asap::LineCatalog::getName(int row) 118 */ 114 119 115 std::string LineCatalog::getName(uint row) const 120 116 { … … 123 119 } 124 120 125 double asap::LineCatalog::getFrequency(uint row) const121 double LineCatalog::getFrequency(uint row) const 126 122 { 127 ROScalarColumn<Double> col(table_, "Column2"); 128 return col(row); 123 return getDouble("Column2", row); 129 124 } 130 125 131 double asap::LineCatalog::getStrength(uint row) const126 double LineCatalog::getStrength(uint row) const 132 127 { 133 ROScalarColumn<Double> col(table_, "Column3"); 134 return col(row); 128 return getDouble("Column4", row); 135 129 } 136 130 131 double LineCatalog::getDouble(const std::string& colname, uint row) const { 132 DataType dtype = table_.tableDesc().columnDesc(colname).dataType(); 133 if (dtype == TpDouble) { 134 ROScalarColumn<Double> col(table_, colname); 135 return col(row); 136 } else if (dtype == TpInt) { 137 ROScalarColumn<Int> col(table_, colname); 138 return Double(col(row)); 139 } else { 140 throw AipsError("Column " + colname + "doesn't contain numerical values." ); 141 } 142 } 137 143 138 144 } // namespace -
trunk/src/LineCatalog.h
r1353 r1534 111 111 casa::Table setLimits(double lmin, double lmax, const std::string& colname); 112 112 113 double getDouble(const std::string& colname, uint row) const; 114 113 115 // the table with seelection 114 116 casa::Table table_;
Note:
See TracChangeset
for help on using the changeset viewer.