Ignore:
Timestamp:
07/30/15 17:11:36 (9 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: Yes/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...

Optimize cubic spline fitting in Scantable::subBaseline.
I expect that the performance will improve about 30%.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r3042 r3043  
    27832783    res = doChebyshevFitting(spec, mask, fpar[0], params, rms, finalmask, clipth, clipn);
    27842784  } else if (ftype == STBaselineFunc::CSpline) {
     2785    int nclip = 0;
     2786    size_t numChan = spec.size();
     2787    if (cubicSplineModelPool_.find(numChan) == cubicSplineModelPool_.end()) {
     2788      cubicSplineModelPool_[numChan] = getPolynomialModel(3, numChan, &Scantable::getNormalPolynomial);
     2789    }
    27852790    if (fpar.size() > 1) { // reading from baseline table in which pieceEdges are already calculated and stored.
    2786       res = doCubicSplineFitting(spec, mask, fpar, params, rms, finalmask, clipth, clipn);
     2791      //res = doCubicSplineFitting(spec, mask, fpar, params, rms, finalmask, clipth, clipn);
     2792      res = doCubicSplineLeastSquareFitting(spec, mask,
     2793                                            cubicSplineModelPool_[numChan],
     2794                                            fpar.size()-1, true, fpar, params,
     2795                                            rms, finalmask, nclip, clipth,
     2796                                            clipn);
    27872797    } else {               // usual cspline fitting by giving nPiece only. fpar will be replaced with pieceEdges.
    2788       res = doCubicSplineFitting(spec, mask, fpar[0], fpar, params, rms, finalmask, clipth, clipn);
     2798      //res = doCubicSplineFitting(spec, mask, fpar[0], fpar, params, rms, finalmask, clipth, clipn);
     2799      res = doCubicSplineLeastSquareFitting(spec, mask,
     2800                                            cubicSplineModelPool_[numChan],
     2801                                            fpar[0], false, fpar, params,
     2802                                            rms, finalmask, nclip, clipth,
     2803                                            clipn);
    27892804    }
    27902805  } else if (ftype == STBaselineFunc::Sinusoid) {
Note: See TracChangeset for help on using the changeset viewer.