Changeset 2883 for trunk/src


Ignore:
Timestamp:
12/20/13 21:17:06 (11 years ago)
Author:
WataruKawasaki
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sd

Description: fixed two bugs in Scantable::subBaseline() reported by Kana: (1) RuntimeError "too many channels masked..." occurs when clipniter>0 and (2) RuntimeError "row index is out of range" occurs when outbltable exists.


Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STBaselineTable.cpp

    r2773 r2883  
    113113{
    114114  if (irow >= (uInt)nrow()) {
    115     throw AipsError("row index out of range");
     115    //throw AipsError("row index out of range");
     116    stringstream ss;
     117    ss << "row index out of range[irow=" << irow << "][nrow=" << nrow() << "]";
     118    throw AipsError(ss.str());
    116119  }
    117120
  • trunk/src/Scantable.cpp

    r2880 r2883  
    25822582  }
    25832583
    2584   STBaselineTable bt = STBaselineTable(*this);
     2584  STBaselineTable* btp;
    25852585  ROScalarColumn<Double> tcol = ROScalarColumn<Double>(table_, "TIME");
    25862586  Vector<Double> timeSecCol = tcol.getColumn();
    25872587
    2588   if (outBaselineTable && !outbltableexists) {
    2589     for (int i = 0; i < nRowSt; ++i) {
    2590       bt.appendbasedata(getScan(i), getCycle(i), getBeam(i), getIF(i), getPol(i),
    2591                          0, timeSecCol[i]);
    2592       bt.setApply(i, false);
     2588  if (outBaselineTable) {
     2589    if (outbltableexists) {
     2590      btp = new STBaselineTable((String)outbltable);
     2591    } else {
     2592      btp = new STBaselineTable(*this);
     2593      for (int i = 0; i < nRowSt; ++i) {
     2594        btp->appendbasedata(getScan(i), getCycle(i), getBeam(i), getIF(i), getPol(i),
     2595                           0, timeSecCol[i]);
     2596        btp->setApply(i, false);
     2597      }
    25932598    }
    25942599  }
     
    26262631        }
    26272632
    2628         bt.setdata(uInt(irow),
     2633        btp->setdata(uInt(irow),
    26292634                    uInt(getScan(irow)), uInt(getCycle(irow)),
    26302635                    uInt(getBeam(irow)), uInt(getIF(irow)), uInt(getPol(irow)),
     
    26392644
    26402645  if (outBaselineTable) {
    2641     bt.save(outbltable);
    2642   }
    2643 
     2646    btp->save(outbltable);
     2647  }
     2648
     2649  delete btp;
    26442650  return res;
    26452651}
     
    27562762  ss >> masklist0;
    27572763  mask = getMaskFromMaskList(nchan(getIF(irow)), splitToIntList(masklist0, ','));
     2764  ss.clear(); ss.str("");
    27582765
    27592766  ss << res[4];
Note: See TracChangeset for help on using the changeset viewer.