Changeset 3026
- Timestamp:
- 02/09/15 17:27:27 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.cpp
r3025 r3026 12 12 #include <map> 13 13 #include <sys/time.h> 14 #include <assert.h>15 14 16 15 #include <atnf/PKSIO/SrcType.h> … … 37 36 #include <casa/Quanta/MVTime.h> 38 37 #include <casa/Utilities/GenSort.h> 38 #include <casa/Utilities/Assert.h> 39 39 40 40 #include <coordinates/Coordinates/CoordinateUtil.h> … … 2567 2567 { 2568 2568 std::size_t nvalid=0; 2569 assert(static_cast<std::size_t>(true)==1); 2570 assert(static_cast<std::size_t>(false)==0); 2569 // the assertion lines had better be replaced with static_assert when c++11 is supported 2570 AlwaysAssert(static_cast<std::size_t>(true)==1, AipsError); 2571 AlwaysAssert(static_cast<std::size_t>(false)==0, AipsError); 2571 2572 for (uInt i = 1; i < mask.size(); ++i) { 2572 2573 nvalid += static_cast<std::size_t>(mask[i]); … … 3046 3047 STBaselineTable bt = STBaselineTable(*this); 3047 3048 Vector<Double> timeSecCol; 3049 size_t flagged=0; 3048 3050 3049 3051 initialiseBaselining(blfile, ofs, outLogger, outTextFile, csvFormat, … … 3089 3091 // no valid channels to fit (flag the row) 3090 3092 flagrowCol_.put(whichrow, 1); 3093 ++flagged; 3091 3094 if (outBaselineTable) { 3092 3095 params.resize(nModel); … … 3106 3109 3107 3110 finaliseBaselining(outBaselineTable, &bt, bltable, outTextFile, ofs); 3108 3111 if (flagged > 0) { 3112 LogIO os( LogOrigin( "Scantable", "polyBaseline()") ) ; 3113 os << LogIO::WARN << "Baseline subtraction is skipped for " << flagged << " spectra due to too few valid channels to operate fit. The spectra will be flagged in output data." << LogIO::POST; 3114 } 3109 3115 } catch (...) { 3110 3116 throw; … … 3139 3145 Vector<Double> timeSecCol; 3140 3146 STLineFinder lineFinder = STLineFinder(); 3147 size_t flagged=0; 3141 3148 3142 3149 initialiseBaselining(blfile, ofs, outLogger, outTextFile, csvFormat, … … 3185 3192 // no valid channels to fit (flag the row) 3186 3193 flagrowCol_.put(whichrow, 1); 3194 ++flagged; 3187 3195 if (outBaselineTable) { 3188 3196 params.resize(nModel); … … 3202 3210 3203 3211 finaliseBaselining(outBaselineTable, &bt, bltable, outTextFile, ofs); 3204 3212 if (flagged > 0) { 3213 LogIO os( LogOrigin( "Scantable", "autoPolyBaseline()") ) ; 3214 os << LogIO::WARN << "Baseline subtraction is skipped for " << flagged << " spectra due to too few valid channels to operate fit. The spectra will be flagged in output data." << LogIO::POST; 3215 } 3205 3216 } catch (...) { 3206 3217 throw; … … 3230 3241 STBaselineTable bt = STBaselineTable(*this); 3231 3242 Vector<Double> timeSecCol; 3243 size_t flagged=0; 3232 3244 3233 3245 initialiseBaselining(blfile, ofs, outLogger, outTextFile, csvFormat, … … 3273 3285 // no valid channels to fit (flag the row) 3274 3286 flagrowCol_.put(whichrow, 1); 3287 ++flagged; 3275 3288 if (outBaselineTable) { 3276 3289 params.resize(nModel); … … 3291 3304 finaliseBaselining(outBaselineTable, &bt, bltable, outTextFile, ofs); 3292 3305 3306 if (flagged > 0) { 3307 LogIO os( LogOrigin( "Scantable", "chebyshevBaseline()") ) ; 3308 os << LogIO::WARN << "Baseline subtraction is skipped for " << flagged << " spectra due to too few valid channels to operate fit. The spectra will be flagged in output data." << LogIO::POST; 3309 } 3293 3310 } catch (...) { 3294 3311 throw; … … 3323 3340 Vector<Double> timeSecCol; 3324 3341 STLineFinder lineFinder = STLineFinder(); 3342 size_t flagged=0; 3325 3343 3326 3344 initialiseBaselining(blfile, ofs, outLogger, outTextFile, csvFormat, … … 3369 3387 // no valid channels to fit (flag the row) 3370 3388 flagrowCol_.put(whichrow, 1); 3389 ++flagged; 3371 3390 if (outBaselineTable) { 3372 3391 params.resize(nModel); … … 3387 3406 finaliseBaselining(outBaselineTable, &bt, bltable, outTextFile, ofs); 3388 3407 3408 if (flagged > 0) { 3409 LogIO os( LogOrigin( "Scantable", "autoChebyshevBaseline()") ) ; 3410 os << LogIO::WARN << "Baseline subtraction is skipped for " << flagged << " spectra due to too few valid channels to operate fit. The spectra will be flagged in output data." << LogIO::POST; 3411 } 3389 3412 } catch (...) { 3390 3413 throw; … … 3917 3940 STBaselineTable bt = STBaselineTable(*this); 3918 3941 Vector<Double> timeSecCol; 3942 size_t flagged=0; 3919 3943 3920 3944 initialiseBaselining(blfile, ofs, outLogger, outTextFile, csvFormat, … … 3961 3985 // no valid channels to fit (flag the row) 3962 3986 flagrowCol_.put(whichrow, 1); 3987 ++flagged; 3963 3988 if (outBaselineTable) { 3964 3989 pieceEdges.resize(nPiece+1); … … 3983 4008 finaliseBaselining(outBaselineTable, &bt, bltable, outTextFile, ofs); 3984 4009 4010 if (flagged > 0) { 4011 LogIO os( LogOrigin( "Scantable", "cubicSplineBaseline()") ) ; 4012 os << LogIO::WARN << "Baseline subtraction is skipped for " << flagged << " spectra due to too few valid channels to operate fit. The spectra will be flagged in output data." << LogIO::POST; 4013 } 3985 4014 } catch (...) { 3986 4015 throw; … … 4015 4044 Vector<Double> timeSecCol; 4016 4045 STLineFinder lineFinder = STLineFinder(); 4046 size_t flagged=0; 4017 4047 4018 4048 initialiseBaselining(blfile, ofs, outLogger, outTextFile, csvFormat, … … 4062 4092 // no valid channels to fit (flag the row) 4063 4093 flagrowCol_.put(whichrow, 1); 4094 ++flagged; 4064 4095 if (outBaselineTable) { 4065 4096 pieceEdges.resize(nPiece+1); … … 4084 4115 finaliseBaselining(outBaselineTable, &bt, bltable, outTextFile, ofs); 4085 4116 4117 if (flagged > 0) { 4118 LogIO os( LogOrigin( "Scantable", "autoCubicSplineBaseline()") ) ; 4119 os << LogIO::WARN << "Baseline subtraction is skipped for " << flagged << " spectra due to too few valid channels to operate fit. The spectra will be flagged in output data." << LogIO::POST; 4120 } 4086 4121 } catch (...) { 4087 4122 throw; … … 4688 4723 STBaselineTable bt = STBaselineTable(*this); 4689 4724 Vector<Double> timeSecCol; 4725 size_t flagged=0; 4690 4726 4691 4727 initialiseBaselining(blfile, ofs, outLogger, outTextFile, csvFormat, … … 4745 4781 // no valid channels to fit (flag the row) 4746 4782 flagrowCol_.put(whichrow, 1); 4783 ++flagged; 4747 4784 if (outBaselineTable) { 4748 4785 params.resize(nModel); … … 4763 4800 finaliseBaselining(outBaselineTable, &bt, bltable, outTextFile, ofs); 4764 4801 4802 if (flagged > 0) { 4803 LogIO os( LogOrigin( "Scantable", "sinusoidBaseline()") ) ; 4804 os << LogIO::WARN << "Baseline subtraction is skipped for " << flagged << " spectra due to too few valid channels to operate fit. The spectra will be flagged in output data." << LogIO::POST; 4805 } 4765 4806 } catch (...) { 4766 4807 throw; … … 4797 4838 Vector<Double> timeSecCol; 4798 4839 STLineFinder lineFinder = STLineFinder(); 4840 size_t flagged=0; 4799 4841 4800 4842 initialiseBaselining(blfile, ofs, outLogger, outTextFile, csvFormat, … … 4857 4899 // no valid channels to fit (flag the row) 4858 4900 flagrowCol_.put(whichrow, 1); 4901 ++flagged; 4859 4902 if (outBaselineTable) { 4860 4903 params.resize(nModel); … … 4875 4918 finaliseBaselining(outBaselineTable, &bt, bltable, outTextFile, ofs); 4876 4919 4920 if (flagged > 0) { 4921 LogIO os( LogOrigin( "Scantable", "autoSinusoidBaseline()") ) ; 4922 os << LogIO::WARN << "Baseline subtraction is skipped for " << flagged << " spectra due to too few valid channels to operate fit. The spectra will be flagged in output data." << LogIO::POST; 4923 } 4877 4924 } catch (...) { 4878 4925 throw;
Note:
See TracChangeset
for help on using the changeset viewer.