Changeset 3009


Ignore:
Timestamp:
10/30/14 03:28:31 (10 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Bug fix: proper row flag handling in Scantable::subBaseline.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r2969 r3009  
    26522652    } else {
    26532653      btp = new STBaselineTable(*this);
    2654       for (int i = 0; i < nRowSt; ++i) {
    2655         btp->appendbasedata(getScan(i), getCycle(i), getBeam(i), getIF(i), getPol(i),
    2656                            0, timeSecCol[i]);
    2657         btp->setApply(i, false);
    2658       }
     2654      // for (int i = 0; i < nRowSt; ++i) {
     2655      //   btp->appendbasedata(getScan(i), getCycle(i), getBeam(i), getIF(i), getPol(i),
     2656      //                   0, timeSecCol[i]);
     2657      //   btp->setApply(i, false);
     2658      // }
     2659    }
     2660    int nrow = btp->nrow();
     2661    for (int i = nrow; i < nRowSt; ++i) {
     2662      btp->appendbasedata(getScan(i), getCycle(i), getBeam(i), getIF(i), getPol(i),
     2663                          0, timeSecCol[i]);
     2664      btp->setApply(i, false);
    26592665    }
    26602666  }
     
    26782684      float rms;
    26792685      std::vector<bool> finalmask;
    2680 
    2681       std::vector<float> resfit = doSubtractBaseline(spec, mask, ftype, fpar, params, rms, finalmask, clipth, clipn, uself, irow, lfth, lfedge, lfavg);
    2682       setSpectrum(resfit, irow);
     2686      Bool doApply = True;
     2687     
     2688      if (flagrowCol_(irow) == 0) {
     2689        std::vector<float> resfit = doSubtractBaseline(spec, mask, ftype, fpar, params, rms, finalmask, clipth, clipn, uself, irow, lfth, lfedge, lfavg);
     2690        setSpectrum(resfit, irow);
     2691      }
     2692      else {
     2693        doApply = False;
     2694      }
    26832695
    26842696      if (returnfitresult) {
     
    26952707                    uInt(getScan(irow)), uInt(getCycle(irow)),
    26962708                    uInt(getBeam(irow)), uInt(getIF(irow)), uInt(getPol(irow)),
    2697                     uInt(0), timeSecCol[irow], Bool(true), ftype, fparam,
     2709                    uInt(0), timeSecCol[irow], doApply, ftype, fparam,
    26982710                    Vector<Float>(), getMaskListFromMask(finalmask), Vector<Float>(params),
    26992711                    Float(rms), uInt(spec.size()), Float(clipth), uInt(clipn),
     
    29022914  }
    29032915  for (uInt j = 0; j < masklist.size(); j += 2) {
    2904     for (int i = masklist[j]; i <= masklist[j+1]; ++i) {
     2916    for (int i = masklist[j]; i <= min(nchan-1, masklist[j+1]); ++i) {
    29052917      res[i] = true;
    29062918    }
Note: See TracChangeset for help on using the changeset viewer.