Changeset 1603 for branches/alma/src/RowAccumulator.cpp
- Timestamp:
- 07/18/09 06:35:47 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/RowAccumulator.cpp
r1446 r1603 44 44 Vector<Bool> dummymsk(m.nelements(), True); 45 45 spectrum_.setData(dummy, dummymsk); 46 n_.setData(Vector< Float>(v.nelements(), 0.0), dummymsk);46 n_.setData(Vector<uInt>(v.nelements(), 0), dummymsk); 47 47 weightSum_.setData(Vector<Float>(v.nelements(), 0.0), dummymsk); 48 48 tsysSum_.resize(tsys.nelements()); tsysSum_=0.0; … … 50 50 // add spectrum related weights, so far it is variance only. 51 51 Float totalweight = 1.0; 52 totalweight *= addTsys(tsys); 52 53 53 // only add these if not everything masked 54 54 if ( !allEQ(m, False) ) { 55 totalweight *= addTsys(tsys); 55 56 totalweight *= addInterval(interval); 56 57 addTime(time); … … 79 80 weightSum_ += wadd; 80 81 spectrum_ += data; 81 const MaskedArray< Float> inc(Vector<Float>(m.nelements(),1.0), m);82 const MaskedArray<uInt> inc(Vector<uInt>(m.nelements(),1), m); 82 83 n_ += inc; 83 84 } … … 125 126 casa::Double asap::RowAccumulator::getTime( ) const 126 127 { 127 Float n = max(n_); 128 if (n < 1.0) n = 1.0; 129 return timeSum_/n; 128 uInt n = max(n_); 129 return timeSum_/Float(n); 130 130 } 131 131 … … 138 138 { 139 139 // Return the "total" mask - False where no points have been accumulated. 140 return (n_.getArray() > Float(0.0));140 return (n_.getArray() > uInt(0)); 141 141 } 142 142 … … 144 144 { 145 145 // @fixme this assumes tsys.nelements() == 1 146 return tsysSum_/ max(n_);146 return tsysSum_/Float(max(n_)); 147 147 } 148 148 … … 158 158 return initialized_; 159 159 } 160
Note: See TracChangeset
for help on using the changeset viewer.