Changeset 716 for trunk/src/SDMathWrapper.cc
- Timestamp:
- 11/17/05 14:37:33 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMathWrapper.cc
r502 r716 30 30 //#--------------------------------------------------------------------------- 31 31 32 33 32 #include "SDMathWrapper.h" 34 #include "SDMath.h"35 36 33 37 34 using namespace asap; 38 35 using namespace casa; 36 39 37 40 38 SDMemTableWrapper SDMathWrapper::quotient(const SDMemTableWrapper& on, … … 42 40 Bool preserveContinuum) 43 41 { 44 SDMath sdm;42 45 43 Bool doTSys = True; 46 return SDMemTableWrapper(sdm.binaryOperate(on.getCP(), off.getCP(), 47 String("QUOTIENT"), preserveContinuum, doTSys)); 44 return SDMemTableWrapper(sdmath.binaryOperate(on.getCP(), off.getCP(), 45 String("QUOTIENT"), 46 preserveContinuum, doTSys)); 48 47 } 49 48 … … 51 50 SDMemTableWrapper SDMathWrapper::binaryOperate(const SDMemTableWrapper& left, 52 51 const SDMemTableWrapper& right, 53 const std::string& op, bool doTSys) 54 { 55 SDMath sdm; 56 return SDMemTableWrapper(sdm.binaryOperate(left.getCP(), right.getCP(), 57 String(op), False, Bool(doTSys))); 58 } 59 60 61 void SDMathWrapper::scaleInSitu(SDMemTableWrapper& in, float factor, bool doAll, bool doTSys) 52 const std::string& op, 53 bool doTSys) 54 { 55 56 return SDMemTableWrapper(sdmath.binaryOperate(left.getCP(), right.getCP(), 57 String(op), False, 58 Bool(doTSys))); 59 } 60 61 62 void SDMathWrapper::scaleInSitu(SDMemTableWrapper& in, float factor, 63 bool doAll, bool doTSys) 62 64 { 63 65 SDMemTable* pIn = in.getPtr(); 64 66 const uInt what = 0; 65 // 66 SDMath sdm; 67 SDMemTable* pOut = sdm.unaryOperate (*pIn, Float(factor), 67 68 SDMemTable* pOut = sdmath.unaryOperate (*pIn, Float(factor), 68 69 Bool(doAll), what, Bool(doTSys)); 69 70 *pIn = *pOut; … … 76 77 const CountedPtr<SDMemTable>& pIn = in.getCP(); 77 78 const uInt what = 0; 78 SDMath sdm;79 return CountedPtr<SDMemTable>(sdm .unaryOperate(*pIn, Float(factor), Bool(doAll),79 80 return CountedPtr<SDMemTable>(sdmath.unaryOperate(*pIn, Float(factor), Bool(doAll), 80 81 what, Bool (doTSys))); 81 82 } … … 86 87 SDMemTable* pIn = in.getPtr(); 87 88 const uInt what = 1; 88 // 89 SDMath sdm; 89 90 90 Bool doTSys = False; 91 SDMemTable* pOut = sdm .unaryOperate (*pIn, Float(offset),91 SDMemTable* pOut = sdmath.unaryOperate (*pIn, Float(offset), 92 92 Bool(doAll), what, doTSys); 93 93 *pIn = *pOut; … … 100 100 const CountedPtr<SDMemTable>& pIn = in.getCP(); 101 101 const uInt what = 1; 102 SDMath sdm;102 103 103 Bool doTSys = False; 104 return CountedPtr<SDMemTable>(sdm .unaryOperate(*pIn, Float(offset),104 return CountedPtr<SDMemTable>(sdmath.unaryOperate(*pIn, Float(offset), 105 105 Bool(doAll), what, doTSys)); 106 106 } … … 112 112 { 113 113 SDMemTable* pIn = in.getPtr(); 114 SDMath sdm;115 SDMemTable* pOut = sdm .smooth(*pIn, String(kernel),114 115 SDMemTable* pOut = sdmath.smooth(*pIn, String(kernel), 116 116 Float(width), Bool(doAll)); 117 117 *pIn = *pOut; … … 125 125 { 126 126 const CountedPtr<SDMemTable>& pIn = in.getCP(); 127 SDMath sdm;128 return CountedPtr<SDMemTable>(sdm .smooth(*pIn, String(kernel),127 128 return CountedPtr<SDMemTable>(sdmath.smooth(*pIn, String(kernel), 129 129 Float(width), Bool(doAll))); 130 130 } … … 135 135 { 136 136 SDMemTable* pIn = in.getPtr(); 137 SDMath sdm;138 SDMemTable* pOut = sdm .bin (*pIn, Int(width));137 138 SDMemTable* pOut = sdmath.bin (*pIn, Int(width)); 139 139 *pIn = *pOut; 140 140 delete pOut; … … 145 145 { 146 146 const CountedPtr<SDMemTable>& pIn = in.getCP(); 147 SDMath sdm;148 return CountedPtr<SDMemTable>(sdm .bin(*pIn, Int(width)));147 148 return CountedPtr<SDMemTable>(sdmath.bin(*pIn, Int(width))); 149 149 } 150 150 … … 153 153 { 154 154 SDMemTable* pIn = in.getPtr(); 155 SDMath sdm;156 SDMemTable* pOut = sdm .resample(*pIn, String(method), Float(width));155 156 SDMemTable* pOut = sdmath.resample(*pIn, String(method), Float(width)); 157 157 *pIn = *pOut; 158 158 delete pOut; … … 163 163 { 164 164 const CountedPtr<SDMemTable>& pIn = in.getCP(); 165 SDMath sdm;166 return CountedPtr<SDMemTable>(sdm .resample(*pIn, String(method), Float(width)));165 166 return CountedPtr<SDMemTable>(sdmath.resample(*pIn, String(method), Float(width))); 167 167 } 168 168 … … 173 173 { 174 174 SDMemTable* pIn = in.getPtr(); 175 SDMath sdm;175 176 176 Vector<Bool> tMask(mask); 177 SDMemTable* pOut = sdm .averagePol (*pIn, tMask, String(weightStr));177 SDMemTable* pOut = sdmath.averagePol (*pIn, tMask, String(weightStr)); 178 178 *pIn = *pOut; 179 179 delete pOut; … … 185 185 { 186 186 const CountedPtr<SDMemTable>& pIn = in.getCP(); 187 SDMath sdm;187 188 188 Vector<Bool> tMask(mask); 189 return CountedPtr<SDMemTable>(sdm .averagePol(*pIn, tMask, String(weightStr)));189 return CountedPtr<SDMemTable>(sdmath.averagePol(*pIn, tMask, String(weightStr))); 190 190 } 191 191 … … 195 195 const std::string& which, int row) 196 196 { 197 SDMath sdm;197 198 198 Vector<Bool> tMask(mask); 199 return sdm .statistic(in.getCP(), tMask, String(which), Int(row));199 return sdmath.statistic(in.getCP(), tMask, String(which), Int(row)); 200 200 } 201 201 … … 205 205 { 206 206 SDMemTable* pIn = in.getPtr(); 207 SDMath sdm;208 SDMemTable* pOut = sdm .convertFlux (*pIn, Float(D), Float(eta), Float(JyPerK), Bool(doAll));207 208 SDMemTable* pOut = sdmath.convertFlux (*pIn, Float(D), Float(eta), Float(JyPerK), Bool(doAll)); 209 209 *pIn = *pOut; 210 210 delete pOut; … … 216 216 { 217 217 const CountedPtr<SDMemTable>& pIn = in.getCP(); 218 SDMath sdm;219 return CountedPtr<SDMemTable>(sdm .convertFlux(*pIn, Float(D), Float(eta), Float(JyPerK), Bool(doAll)));218 219 return CountedPtr<SDMemTable>(sdmath.convertFlux(*pIn, Float(D), Float(eta), Float(JyPerK), Bool(doAll))); 220 220 } 221 221 … … 228 228 SDMemTable* pIn = in.getPtr(); 229 229 Vector<Float> tCoeffs(coeffs); 230 SDMath sdm;231 SDMemTable* pOut = sdm .gainElevation(*pIn, tCoeffs, String(fileName),230 231 SDMemTable* pOut = sdmath.gainElevation(*pIn, tCoeffs, String(fileName), 232 232 String(method), Bool(doAll)); 233 233 *pIn = *pOut; … … 243 243 const CountedPtr<SDMemTable>& pIn = in.getCP(); 244 244 Vector<Float> tCoeffs(coeffs); 245 SDMath sdm;246 return CountedPtr<SDMemTable>(sdm .gainElevation(*pIn, tCoeffs, String(fileName),245 246 return CountedPtr<SDMemTable>(sdmath.gainElevation(*pIn, tCoeffs, String(fileName), 247 247 String(method), Bool(doAll))); 248 248 } … … 252 252 { 253 253 SDMemTable* pIn = in.getPtr(); 254 SDMath sdm;255 SDMemTable* pOut = sdm .frequencyAlignment(*pIn, String(refTime), String(method),254 255 SDMemTable* pOut = sdmath.frequencyAlignment(*pIn, String(refTime), String(method), 256 256 Bool(perFreqID)); 257 257 *pIn = *pOut; … … 266 266 { 267 267 const CountedPtr<SDMemTable>& pIn = in.getCP(); 268 SDMath sdm;269 return CountedPtr<SDMemTable>(sdm .frequencyAlignment(*pIn, String(refTime),268 269 return CountedPtr<SDMemTable>(sdmath.frequencyAlignment(*pIn, String(refTime), 270 270 String(method), Bool(perFreqID))); 271 271 } … … 274 274 { 275 275 SDMemTable* pIn = in.getPtr(); 276 SDMath sdm;277 sdm .rotateXYPhase(*pIn, Float(angle), Bool(doAll));276 277 sdmath.rotateXYPhase(*pIn, Float(angle), Bool(doAll)); 278 278 } 279 279 … … 282 282 { 283 283 SDMemTable* pIn = in.getPtr(); 284 SDMath sdm;285 sdm .rotateLinPolPhase(*pIn, Float(angle), Bool(doAll));284 285 sdmath.rotateLinPolPhase(*pIn, Float(angle), Bool(doAll)); 286 286 } 287 287 … … 292 292 { 293 293 SDMemTable* pIn = in.getPtr(); 294 SDMath sdm; 295 SDMemTable* pOut = sdm.opacity(*pIn, Float(tau), Bool(doAll)); 296 *pIn = *pOut; 297 delete pOut; 298 } 299 294 295 SDMemTable* pOut = sdmath.opacity(*pIn, Float(tau), Bool(doAll)); 296 *pIn = *pOut; 297 delete pOut; 298 } 300 299 301 300 SDMemTableWrapper SDMathWrapper::opacity(const SDMemTableWrapper& in, … … 303 302 { 304 303 const CountedPtr<SDMemTable>& pIn = in.getCP(); 304 305 return CountedPtr<SDMemTable>(sdmath.opacity(*pIn, Float(tau), Bool(doAll))); 306 } 307 308 void SDMathWrapper::frequencySwitchInSitu(SDMemTableWrapper& in) 309 { 310 SDMemTable* pIn = in.getPtr(); 305 311 SDMath sdm; 306 return CountedPtr<SDMemTable>(sdm.opacity(*pIn, Float(tau), Bool(doAll))); 307 } 308 312 SDMemTable* pOut = sdm.frequencySwitch(*pIn); 313 *pIn = *pOut; 314 delete pOut; 315 } 316 317 SDMemTableWrapper SDMathWrapper::frequencySwitch(const SDMemTableWrapper& in) 318 { 319 const CountedPtr<SDMemTable>& pIn = in.getCP(); 320 SDMath sdm; 321 return CountedPtr<SDMemTable>(sdm.frequencySwitch(*pIn)); 322 }
Note: See TracChangeset
for help on using the changeset viewer.