Changeset 2142 for branches/casa-prerelease
- Timestamp:
- 04/15/11 21:17:28 (14 years ago)
- Location:
- branches/casa-prerelease/pre-asap
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/casa-prerelease/pre-asap
-
branches/casa-prerelease/pre-asap/Makefile
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/casa-prerelease/pre-asap/SConstruct
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/casa-prerelease/pre-asap/apps
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/casa-prerelease/pre-asap/external-alma
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/casa-prerelease/pre-asap/external-alma/atnf/pks/pks_maths.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/casa-prerelease/pre-asap/getsvnrev.sh
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/casa-prerelease/pre-asap/python
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/casa-prerelease/pre-asap/python/flagtoolbar.py
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/casa-prerelease/pre-asap/src
- Property svn:mergeinfo changed
/trunk/src merged: 2141
- Property svn:mergeinfo changed
-
branches/casa-prerelease/pre-asap/src/RowAccumulator.cpp
r2136 r2142 90 90 const Double interval, 91 91 const Double time, 92 const Bool i gnoreMask)92 const Bool inverseMask) 93 93 { 94 94 Vector<Float> vUse = v.copy(); 95 95 Vector<Bool> mUse = m.copy(); 96 if (ignoreMask) mUse = !mUse; 97 96 if (inverseMask) mUse = !mUse; 98 97 MaskedArray<Float> vadd(vUse, mUse); 99 Float totalWeight = getTotalWeight(vadd, tsys, interval, time, i gnoreMask);98 Float totalWeight = getTotalWeight(vadd, tsys, interval, time, inverseMask); 100 99 vadd *= totalWeight; 101 100 MaskedArray<Float> wadd(Vector<Float>(mUse.nelements(), totalWeight), mUse); 102 101 MaskedArray<uInt> inc(Vector<uInt>(mUse.nelements(), 1), mUse); 103 102 104 if (i gnoreMask) {103 if (inverseMask) { 105 104 spectrumNoMask_ += vadd; 106 105 weightSumNoMask_ += wadd; … … 117 116 const Double interval, 118 117 const Double time, 119 const Bool i gnoreMask)118 const Bool inverseMask) 120 119 { 121 120 Float totalWeight = 1.0; 122 123 121 Vector<Bool> m = data.getMask(); 124 122 if (!allEQ(m, False)) { // only add these if not everything masked 125 totalWeight *= addTsys(tsys, i gnoreMask);126 totalWeight *= addInterval(interval, i gnoreMask);127 addTime(time, i gnoreMask);128 } 129 130 if (weightType_ == W_VAR) {131 Float fac = 1.0/variance(data);132 if (!ignoreMask && (m.nelements() == userMask_.nelements())) 133 fac = 1.0/variance(data(userMask_)); 134 135 totalWeight *= fac;123 totalWeight *= addTsys(tsys, inverseMask); 124 totalWeight *= addInterval(interval, inverseMask); 125 addTime(time, inverseMask); 126 127 if (weightType_ == W_VAR) { 128 Float fac = 1.0/variance(data); 129 if (!inverseMask && (m.nelements() == userMask_.nelements())) 130 fac = 1.0/variance(data(userMask_)); 131 132 totalWeight *= fac; 133 } 136 134 } 137 135 … … 139 137 } 140 138 141 Float RowAccumulator::addTsys(const Vector<Float>& v, Bool i gnoreMask)139 Float RowAccumulator::addTsys(const Vector<Float>& v, Bool inverseMask) 142 140 { 143 141 // @fixme this assume tsys is the same for all channels 144 142 145 143 Float w = 1.0; 146 if (i gnoreMask) {144 if (inverseMask) { 147 145 tsysSumNoMask_ += v[0]; 148 146 } else { … … 155 153 } 156 154 157 void RowAccumulator::addTime(Double t, Bool i gnoreMask)158 { 159 if (i gnoreMask) {155 void RowAccumulator::addTime(Double t, Bool inverseMask) 156 { 157 if (inverseMask) { 160 158 timeSumNoMask_ += t; 161 159 } else { … … 164 162 } 165 163 166 Float RowAccumulator::addInterval(Double inter, Bool i gnoreMask)164 Float RowAccumulator::addInterval(Double inter, Bool inverseMask) 167 165 { 168 166 Float w = 1.0; 169 if (i gnoreMask) {167 if (inverseMask) { 170 168 intervalSumNoMask_ += inter; 171 169 } else { -
branches/casa-prerelease/pre-asap/src/RowAccumulator.h
r2126 r2142 108 108 const casa::Double interval, 109 109 const casa::Double time, 110 const casa::Bool i gnoreMask);110 const casa::Bool inverseMask); 111 111 casa::Float getTotalWeight(const casa::MaskedArray<casa::Float>& data, 112 112 const casa::Vector<casa::Float>& tsys, 113 113 const casa::Double interval, 114 114 const casa::Double time, 115 const casa::Bool i gnoreMask);116 casa::Float addTsys(const casa::Vector<casa::Float>& v, casa::Bool i gnoreMask);117 casa::Float addInterval(casa::Double inter, casa::Bool i gnoreMask);118 void addTime(casa::Double t, casa::Bool i gnoreMask);115 const casa::Bool inverseMask); 116 casa::Float addTsys(const casa::Vector<casa::Float>& v, casa::Bool inverseMask); 117 casa::Float addInterval(casa::Double inter, casa::Bool inverseMask); 118 void addTime(casa::Double t, casa::Bool inverseMask); 119 119 120 120 WeightType weightType_; -
branches/casa-prerelease/pre-asap/src/SConscript
- Property svn:mergeinfo changed (with no actual effect on merging)
Note:
See TracChangeset
for help on using the changeset viewer.