Changeset 1113
- Timestamp:
- 08/04/06 12:10:35 (18 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/LineCatalog.cpp
r1108 r1113 16 16 // casa includes 17 17 #include <casa/Exceptions/Error.h> 18 #include <casa/iostream.h> 19 #include <casa/iomanip.h> 18 20 #include <casa/OS/Path.h> 19 21 #include <casa/OS/File.h> 22 #include <casa/Arrays/Vector.h> 20 23 #include <tables/Tables/ReadAsciiTable.h> 21 24 #include <tables/Tables/TableParse.h> 25 #include <tables/Tables/ScalarColumn.h> 22 26 27 #include "STAttr.h" 23 28 #include "LineCatalog.h" 24 29 … … 76 81 } 77 82 83 std::string LineCatalog::summary(int row) const 84 { 85 std::string stlout; 86 ostringstream oss; 87 oss << asap::SEPERATOR << endl; 88 oss << "Line Catalog summary" << endl; 89 oss << asap::SEPERATOR << endl << endl; 90 if (row == -1) { 91 Vector<uInt> rownrs = table_.rowNumbers(baseTable_); 92 for (uint i=0; i<rownrs.nelements(); ++i) { 93 oss << std::right << setw(7) << rownrs[i]; 94 oss << std::left << setw(12) << getName(i); 95 oss << setw(12) << setprecision(8) << std::left << getFrequency(i); 96 oss << endl; 97 } 98 } else { 99 oss << std::right << setw(7) << row; 100 oss << std::left << setw(12) << getName(row); 101 oss << setw(12) << setprecision(8) << std::left << getFrequency(row); 102 oss << endl; 103 } 104 /// @todo implement me 105 return String(oss); 106 } 107 108 /*! 109 \fn asap::LineCatalog::getName(int row) 110 */ 111 std::string LineCatalog::getName(uint row) const 112 { 113 ROScalarColumn<String> col(table_, "Column1"); 114 return col(row); 115 } 116 117 double asap::LineCatalog::getFrequency(uint row) const 118 { 119 ROScalarColumn<Double> col(table_, "Column2"); 120 return col(row); 121 } 122 123 78 124 } // namespace 125 126 -
trunk/src/LineCatalog.h
r1108 r1113 71 71 /** 72 72 * Return a string representation of this table 73 * @param an integer descriing the row number to show 74 * default -1 is all rows 73 75 * @return std::string 74 76 */ 77 std::string summary(int row=-1) const; 78 79 double getFrequency(uint row) const; 80 81 std::string getName(uint row) const; 75 82 76 83 private:
Note:
See TracChangeset
for help on using the changeset viewer.