Changeset 862 for trunk/src


Ignore:
Timestamp:
03/01/06 14:01:16 (19 years ago)
Author:
mar637
Message:

added history append to average and merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMath.cpp

    r858 r862  
    6969  CountedPtr< Scantable > out = getScantable(in[0], true);
    7070  setInsitu(insitu);
     71  std::vector<CountedPtr<Scantable> >::const_iterator stit = in.begin();
     72  ++stit;
     73  while ( stit != in.end() ) {
     74    out->appendToHistoryTable((*stit)->history());
     75    ++stit;
     76  }
    7177
    7278  Table& tout = out->table();
     
    8187
    8288  // set up the output table rows. These are based on the structure of the
    83   // FIRST scantabel in the vector
     89  // FIRST scantable in the vector
    8490  const Table& baset = in[0]->table();
    8591
     
    803809{
    804810  if ( in.size() < 2 ) {
    805     throw(AipsError("Need at least two scantables to perform merge."));
     811    throw(AipsError("Need at least two scantables to perform a merge."));
    806812  }
    807813  std::vector<CountedPtr < Scantable > >::const_iterator it = in.begin();
    808   ++it;
    809814  bool insitu = insitu_;
    810815  setInsitu(false);
    811   CountedPtr< Scantable > out = getScantable(in[0], false);
     816  CountedPtr< Scantable > out = getScantable(*it, false);
    812817  setInsitu(insitu);
    813818  Table& tout = out->table();
     
    815820  ScalarColumn<uInt> scannocol(tout,"SCANNO"),focusidcol(tout,"FOCUS_ID");
    816821  uInt newscanno = max(scannocol.getColumn())+1;
     822  ++it;
    817823  while ( it != in.end() ){
    818824    if ( ! (*it)->conformant(*out) ) {
     
    823829      continue;
    824830    }
     831    out->appendToHistoryTable((*it)->history());
    825832    const Table& tab = (*it)->table();
    826833    TableIterator scanit(tab, "SCANNO");
Note: See TracChangeset for help on using the changeset viewer.