Changeset 852 for trunk/src


Ignore:
Timestamp:
02/28/06 10:51:28 (19 years ago)
Author:
mar637
Message:

added member function rownumbers()
reworked subtable handling

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r847 r852  
    6161
    6262Scantable::Scantable(Table::TableType ttype) :
    63   type_(ttype),
    64   freqTable_(ttype),
    65   focusTable_(ttype),
    66   weatherTable_(ttype),
    67   tcalTable_(ttype),
    68   moleculeTable_(ttype)
     63  type_(ttype)
    6964{
    7065  setupMainTable();
     66  freqTable_ = STFrequencies(*this);
    7167  table_.rwKeywordSet().defineTable("FREQUENCIES", freqTable_.table());
     68  weatherTable_ = STWeather(*this);
    7269  table_.rwKeywordSet().defineTable("WEATHER", weatherTable_.table());
     70  focusTable_ = STFocus(*this);
    7371  table_.rwKeywordSet().defineTable("FOCUS", focusTable_.table());
     72  tcalTable_ = STTcal(*this);
    7473  table_.rwKeywordSet().defineTable("TCAL", tcalTable_.table());
     74  moleculeTable_ = STMolecules(*this);
    7575  table_.rwKeywordSet().defineTable("MOLECULES", moleculeTable_.table());
    7676  setupHistoryTable();
    7777  setupFitTable();
     78  historyTable_ = table_.keywordSet().asTable("HISTORY");
     79  fitTable_ = table_.keywordSet().asTable("FITS");
     80  cout << "DEBUG" << endl;
    7881
    7982  originalTable_ = table_;
    8083  attach();
     84  cout << "debug" << endl;
    8185}
    8286
    8387Scantable::Scantable(const std::string& name, Table::TableType ttype) :
    84   type_(ttype),
    85   freqTable_(ttype)
     88  type_(ttype)
    8689{
    8790  Table tab(name);
     
    9295  }
    9396  if ( type_ == Table::Memory )
    94     table_ = tab.copyToMemoryTable("dummy");
     97    table_ = tab.copyToMemoryTable(generateName());
    9598  else
    9699    table_ = tab;
    97 
     100  freqTable_ = STFrequencies(table_.keywordSet().asTable("FREQUENCIES"));
     101  focusTable_ = STFocus(table_.keywordSet().asTable("FOCUS"));
     102  weatherTable_ = STWeather(table_.keywordSet().asTable("WEATHER"));
     103  tcalTable_ = STTcal(table_.keywordSet().asTable("TCAL"));
     104  moleculeTable_ = STMolecules(table_.keywordSet().asTable("MOLECULES"));
    98105  originalTable_ = table_;
    99106  attach();
     
    105112  // with or without data
    106113  if (clear) {
    107     table_ = TableCopy::makeEmptyMemoryTable(String("dummy"), other.table_,
    108                                              True);
    109   } else {
    110     table_ = other.table_.copyToMemoryTable(String("dummy"));
     114    table_ = TableCopy::makeEmptyMemoryTable(String(generateName()),
     115                                             other.table_, True);
     116  } else {
     117    table_ = other.table_.copyToMemoryTable(String(generateName()));
    111118  }
    112119
     
    181188
    182189  // Now create Table SetUp from the description.
    183   SetupNewTable aNewTab("dummy", td, Table::New);
    184   table_ = Table(aNewTab, Table::Memory, 0);
    185 
     190  SetupNewTable aNewTab(generateName(), td, Table::New);
     191  table_ = Table(aNewTab, type_, 0);
    186192  originalTable_ = table_;
    187193
     
    213219void Scantable::attach()
    214220{
    215   historyTable_ = table_.keywordSet().asTable("HISTORY");
    216   fitTable_ = table_.keywordSet().asTable("FITS");
    217 
    218221  timeCol_.attach(table_, "TIME");
    219222  srcnCol_.attach(table_, "SRCNAME");
     
    785788}
    786789
     790std::vector< unsigned int > asap::Scantable::rownumbers( ) const
     791{
     792  std::vector<unsigned int> stlout;
     793  Vector<uInt> vec = table_.rowNumbers();
     794  vec.tovector(stlout);
     795  return stlout;
     796}
     797
    787798}//namespace asap
  • trunk/src/Scantable.h

    r847 r852  
    175175  void flag();
    176176
     177  /**
     178   * Return a list of row numbers with respect to the original table.
     179   * @return a lsi of rownumbers with respect to the original table
     180   */
     181  std::vector<unsigned int> rownumbers() const;
     182
    177183
    178184  /**
Note: See TracChangeset for help on using the changeset viewer.