Ignore:
Timestamp:
02/25/11 16:51:50 (13 years ago)
Author:
WataruKawasaki
Message:

New Development: Yes

JIRA Issue: Yes (CAS-2373, CAS-2620)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: For Scantable::polyBaseline(), parameters and return value have been changed.

Test Programs:

Put in Release Notes: Yes

Module(s): sdbaseline, sd.linefinder

Description: (1) CAS-2373-related:

(1.1) Modified Scantable::polyBaseline() to have the row-based loop inside.

Now it fits and subtracts baseline for all rows and also output info
about the fitting result to logger and text file, while in the
previous version this method just did baseline fitting/subtraction
for one row only and had to be put inside a row-based loop at the
python side ("poly_baseline()" in scantable.py) and result output had
also to be controlled at the python side. Using a test data from NRO
45m telescope (348,000 rows, 512 channels), the processing time of
scantable.poly_baseline() has reduced from 130 minutes to 5-6 minutes.

(1.2) For accelerating the another polynomial fitting function, namely

scantable.auto_poly_baseline(), added a method
Scantable::autoPolyBaseline(). This basically does the same thing
with Scantable::polyBaseline(), but uses linefinfer also to
automatically flag the line regions.

(1.3) To make linefinder usable in Scantable class, added a method

linefinder.setdata(). This makes it possible to apply linefinder
for a float-list data given as a parameter, without setting scantable,
while it was indispensable to set scantable to use linefinger previously.

(2) CAS-2620-related:

Added Scantable::cubicSplineBaseline() and autoCubicSplineBaseline() for
fit baseline using the cubic spline function. Parameters include npiece
(number of polynomial pieces), clipthresh (clipping threshold), and
clipniter (maximum iteration number).



File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ScantableWrapper.h

    r1994 r2012  
    230230  { return table_->getFit(whichrow); }
    231231
    232   void calculateAZEL() { table_->calculateAZEL(); };
     232  void calculateAZEL() { table_->calculateAZEL(); }
    233233
    234234  std::vector<std::string> columnNames() const
     
    257257  { table_->reshapeSpectrum( nmin, nmax ); }
    258258
    259   STFitEntry polyBaseline(const std::vector<bool>& mask, int order, int rowno)
    260   { return table_->polyBaseline(mask, order, rowno); }
    261 
    262   void polyBaselineBatch(const std::vector<bool>& mask, int order)
    263   { table_->polyBaselineBatch(mask, order); }
     259  void polyBaseline(const std::vector<bool>& mask, int order, bool outlog=false, const std::string& blfile="")
     260  { table_->polyBaseline(mask, order, outlog, blfile); }
     261
     262  void autoPolyBaseline(const std::vector<bool>& mask, int order, const std::vector<int>& edge, float threshold=5.0, int chan_avg_limit=1, bool outlog=false, const std::string& blfile="")
     263  { table_->autoPolyBaseline(mask, order, edge, threshold, chan_avg_limit, outlog, blfile); }
     264
     265  void cubicSplineBaseline(const std::vector<bool>& mask, int npiece, float clipthresh, int clipniter, bool outlog=false, const std::string& blfile="")
     266  { table_->cubicSplineBaseline(mask, npiece, clipthresh, clipniter, outlog, blfile); }
     267
     268  void autoCubicSplineBaseline(const std::vector<bool>& mask, int npiece, float clipthresh, int clipniter, const std::vector<int>& edge, float threshold=5.0, int chan_avg_limit=1, bool outlog=false, const std::string& blfile="")
     269  { table_->autoCubicSplineBaseline(mask, npiece, clipthresh, clipniter, edge, threshold, chan_avg_limit, outlog, blfile); }
     270
     271  float getRms(const std::vector<bool>& mask, int whichrow)
     272  { return table_->getRms(mask, whichrow); }
     273
     274  std::string formatBaselineParams(const std::vector<float>& params, const std::vector<bool>& fixed, float rms, const std::string& masklist, int whichrow, bool verbose=false)
     275  { return table_->formatBaselineParams(params, fixed, rms, masklist, whichrow, verbose); }
     276
     277  std::string formatPiecewiseBaselineParams(const std::vector<int>& ranges, const std::vector<float>& params, const std::vector<bool>& fixed, float rms, const std::string& masklist, int whichrow, bool verbose=false)
     278  { return table_->formatPiecewiseBaselineParams(ranges, params, fixed, rms, masklist, whichrow, verbose); }
    264279
    265280  bool getFlagtraFast(int whichrow=0) const
    266     { return table_->getFlagtraFast(whichrow); }
     281  { return table_->getFlagtraFast(whichrow); }
     282
    267283
    268284
Note: See TracChangeset for help on using the changeset viewer.