- Timestamp:
- 09/17/10 18:00:47 (14 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.cpp
r1929 r1931 543 543 // take the first POLNO,IFNO,CYCLENO as nbeam shouldn't vary with these 544 544 Table t = table_(table_.col("SCANNO") == scanno); 545 if ( t.nrow() == 0 ) return 0 ;546 545 ROTableRow row(t); 547 546 const TableRecord& rec = row.get(0); … … 564 563 // take the first POLNO,BEAMNO,CYCLENO as nbeam shouldn't vary with these 565 564 Table t = table_(table_.col("SCANNO") == scanno); 566 if ( t.nrow() == 0 ) return 0 ;567 565 ROTableRow row(t); 568 566 const TableRecord& rec = row.get(0); … … 586 584 // take the first POLNO,IFNO,CYCLENO as nbeam shouldn't vary with these 587 585 Table t = table_(table_.col("SCANNO") == scanno); 588 if ( t.nrow() == 0 ) return 0 ;589 586 ROTableRow row(t); 590 587 const TableRecord& rec = row.get(0); … … 614 611 } else { 615 612 Table t = table_(table_.col("SCANNO") == scanno); 616 if ( t.nrow() == 0 ) return 0 ;617 613 ROTableRow row(t); 618 614 const TableRecord& rec = row.get(0); … … 1754 1750 } 1755 1751 1756 void Scantable::polyBaselineBatch(const std::vector<bool>& mask, int order, int rowno) 1752 void Scantable::polyBaselineBatch(const std::vector<bool>& mask, int order) 1753 { 1754 Fitter fitter = Fitter(); 1755 for (uInt rowno=0; rowno < nrow(); ++rowno) { 1756 doPolyBaseline(mask, order, rowno, fitter); 1757 setSpectrum(fitter.getResidual(), rowno); 1758 } 1759 } 1760 1761 STFitEntry Scantable::polyBaseline(const std::vector<bool>& mask, int order, int rowno) 1757 1762 { 1758 1763 Fitter fitter = Fitter(); 1759 1764 doPolyBaseline(mask, order, rowno, fitter); 1760 1765 setSpectrum(fitter.getResidual(), rowno); 1761 } 1762 1763 void Scantable::polyBaseline(const std::vector<bool>& mask, int order, int rowno, long pars_ptr, long pars_size, long errs_ptr, long errs_size, long fmask_ptr, long fmask_size) 1764 { 1765 Fitter fitter = Fitter(); 1766 doPolyBaseline(mask, order, rowno, fitter); 1767 setSpectrum(fitter.getResidual(), rowno); 1768 1769 std::vector<float> pars = fitter.getParameters(); 1770 if (pars_size != pars.size()) { 1771 throw(AipsError("wrong pars size")); 1772 } 1773 float *ppars = reinterpret_cast<float*>(pars_ptr); 1774 for (int i = 0; i < pars_size; i++) { 1775 ppars[i] = pars[i]; 1776 } 1777 1778 std::vector<float> errs = fitter.getErrors(); 1779 if (errs_size != errs.size()) { 1780 throw(AipsError("wrong errors size")); 1781 } 1782 float *perrs = reinterpret_cast<float*>(errs_ptr); 1783 for (int i = 0; i < errs_size; i++) { 1784 perrs[i] = errs[i]; 1785 } 1786 1787 std::vector<bool> fmask = getMask(rowno); 1788 if (fmask_size != fmask.size()) { 1789 throw(AipsError("wrong fmask size")); 1790 } 1791 int *pfmask = reinterpret_cast<int*>(fmask_ptr); 1792 for (int i = 0; i < fmask_size; i++) { 1793 pfmask[i] = ((fmask[i] && mask[i]) ? 1 : 0); 1794 } 1766 return fitter.getFitEntry(); 1795 1767 } 1796 1768 -
trunk/src/Scantable.h
r1919 r1931 18 18 // AIPS++ 19 19 #include <casa/aips.h> 20 #include <casa/Containers/Record.h> 20 21 #include <casa/Arrays/MaskedArray.h> 21 22 #include <casa/BasicSL/String.h> … … 489 490 bool getFlagtraFast(int whichrow); 490 491 491 void polyBaselineBatch(const std::vector<bool>& mask, int order, int rowno); 492 void polyBaseline(const std::vector<bool>& mask, int order, int rowno, long pars_ptr, long pars_size, long errs_ptr, long errs_size, long fmask_ptr, long fmask_size); 493 492 void polyBaselineBatch(const std::vector<bool>& mask, int order); 493 STFitEntry polyBaseline(const std::vector<bool>& mask, int order, int rowno); 494 494 495 495 private: -
trunk/src/ScantableWrapper.h
r1919 r1931 19 19 #include "MathUtils.h" 20 20 #include "STFit.h" 21 #include "STFitEntry.h" 21 22 #include "Scantable.h" 22 23 #include "STCoordinate.h" … … 250 251 { table_->reshapeSpectrum( nmin, nmax ); } 251 252 252 void polyBaseline(const std::vector<bool>& mask, int order, int rowno, long pars_ptr, long pars_size, long errs_ptr, long errs_size, long fmask_ptr, long fmask_size)253 { table_->polyBaseline(mask, order, rowno, pars_ptr, pars_size, errs_ptr, errs_size, fmask_ptr, fmask_size); }254 255 void polyBaselineBatch(const std::vector<bool>& mask, int order , int rowno)256 { table_->polyBaselineBatch(mask, order , rowno); }253 STFitEntry polyBaseline(const std::vector<bool>& mask, int order, int rowno) 254 { return table_->polyBaseline(mask, order, rowno); } 255 256 void polyBaselineBatch(const std::vector<bool>& mask, int order) 257 { table_->polyBaselineBatch(mask, order); } 257 258 258 259 bool getFlagtraFast(int whichrow=0) const
Note:
See TracChangeset
for help on using the changeset viewer.