Changeset 2986 for trunk/src/RowAccumulator.cpp
- Timestamp:
- 08/15/14 19:24:40 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/RowAccumulator.cpp
r2970 r2986 20 20 using namespace casa; 21 21 using namespace asap; 22 23 namespace { 24 inline uInt nNominal(MaskedArray<uInt> nvalid, MaskedArray<uInt> ninvalid) 25 { 26 return max((allEQ(nvalid, uInt(0))) ? ninvalid : nvalid); 27 } 28 } // anonymous namespace 22 29 23 30 RowAccumulator::RowAccumulator(WeightType wt) : weightType_(wt), initialized_(False) … … 200 207 Float totalWeight = 1.0; 201 208 Vector<Bool> m = data.getMask(); 209 Float tsysWeight = addTsys(tsys, inverseMask); 210 Float intervalWeight = addInterval(interval, inverseMask); 211 addTime(time, inverseMask); 202 212 if (!allEQ(m, False)) { // only add these if not everything masked 203 totalWeight *= addTsys(tsys, inverseMask); 204 totalWeight *= addInterval(interval, inverseMask); 205 addTime(time, inverseMask); 213 totalWeight *= tsysWeight; 214 totalWeight *= intervalWeight; 206 215 207 216 if (weightType_ == W_VAR) { … … 263 272 Double RowAccumulator::getTime() const 264 273 { 265 return timeSum_/Double( max(n_));274 return timeSum_/Double(nNominal(n_, nNoMask_)); 266 275 } 267 276 … … 280 289 { 281 290 // @fixme this assumes tsys.nelements() == 1 282 return tsysSum_/Float( max(n_));291 return tsysSum_/Float(nNominal(n_, nNoMask_)); 283 292 } 284 293 … … 311 320 spectrum_.setData(v, Vector<Bool>(v.nelements(), True)); 312 321 weightSum_.setData(w, Vector<Bool>(w.nelements(), True)); 313 } 322 323 tsysSum_ = tsysSumNoMask_; 324 intervalSum_ = intervalSumNoMask_; 325 }
Note: See TracChangeset
for help on using the changeset viewer.