Changeset 1113


Ignore:
Timestamp:
08/04/06 12:10:35 (18 years ago)
Author:
mar637
Message:

towards a working version

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/LineCatalog.cpp

    r1108 r1113  
    1616// casa includes
    1717#include <casa/Exceptions/Error.h>
     18#include <casa/iostream.h>
     19#include <casa/iomanip.h>
    1820#include <casa/OS/Path.h>
    1921#include <casa/OS/File.h>
     22#include <casa/Arrays/Vector.h>
    2023#include <tables/Tables/ReadAsciiTable.h>
    2124#include <tables/Tables/TableParse.h>
     25#include <tables/Tables/ScalarColumn.h>
    2226
     27#include "STAttr.h"
    2328#include "LineCatalog.h"
    2429
     
    7681}
    7782
     83std::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 */
     111std::string LineCatalog::getName(uint row) const
     112{
     113  ROScalarColumn<String> col(table_, "Column1");
     114  return col(row);
     115}
     116
     117double asap::LineCatalog::getFrequency(uint row) const
     118{
     119  ROScalarColumn<Double> col(table_, "Column2");
     120  return col(row);
     121}
     122
     123
    78124} // namespace
     125
     126
  • trunk/src/LineCatalog.h

    r1108 r1113  
    7171  /**
    7272    * Return a string representation of this table
     73    * @param an integer descriing the row number to show
     74    * default -1 is all rows
    7375    * @return std::string
    7476    */
     77  std::string summary(int row=-1) const;
     78
     79  double getFrequency(uint row) const;
     80
     81  std::string getName(uint row) const;
    7582
    7683private:
Note: See TracChangeset for help on using the changeset viewer.