Changeset 235
- Timestamp:
- 01/21/05 12:21:36 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMathWrapper.cc
r227 r235 46 46 47 47 48 SDMemTableWrapper SDMathWrapper::simpleBinaryOperate(const SDMemTableWrapper& left, 49 const SDMemTableWrapper& right, 50 const std::string& op) 51 { 52 SDMath sdm; 53 return SDMemTableWrapper(sdm.simpleBinaryOperate(left.getCP(), right.getCP(), 54 String(op))); 55 } 56 57 48 58 void SDMathWrapper::scaleInSitu(SDMemTableWrapper& in, float factor, bool doAll) 49 59 { … … 142 152 SDMemTable* pIn = in.getPtr(); 143 153 SDMath sdm; 144 SDMemTable* pOut = sdm.averagePol (*pIn, mask); 154 Vector<Bool> tMask(mask); 155 SDMemTable* pOut = sdm.averagePol (*pIn, tMask); 145 156 *pIn = *pOut; 146 157 delete pOut; … … 153 164 const CountedPtr<SDMemTable>& pIn = in.getCP(); 154 165 SDMath sdm; 155 return CountedPtr<SDMemTable>(sdm.averagePol(*pIn, mask)); 166 Vector<Bool> tMask(mask); 167 return CountedPtr<SDMemTable>(sdm.averagePol(*pIn, tMask)); 156 168 } 157 169 … … 159 171 std::vector<float> SDMathWrapper::statistic(const SDMemTableWrapper& in, 160 172 const std::vector<bool>& mask, 161 const std::string& which) 162 { 163 SDMath sdm; 164 return sdm.statistic(in.getCP(), mask, String(which)); 173 const std::string& which, int row) 174 { 175 SDMath sdm; 176 Vector<Bool> tMask(mask); 177 return sdm.statistic(in.getCP(), tMask, String(which), Int(row)); 165 178 } 166 179 … … 186 199 187 200 188 void SDMathWrapper::gainElevationInSitu(SDMemTableWrapper& in, const string& fileName, 201 void SDMathWrapper::gainElevationInSitu(SDMemTableWrapper& in, 202 const std::vector<float>& coeffs, 203 const string& fileName, 189 204 const string& method, bool doAll) 190 205 { 191 206 SDMemTable* pIn = in.getPtr(); 192 SDMath sdm; 193 SDMemTable* pOut = sdm.gainElevation(*pIn, String(fileName), String(method), Bool(doAll)); 207 Vector<Float> tCoeffs(coeffs); 208 SDMath sdm; 209 SDMemTable* pOut = sdm.gainElevation(*pIn, tCoeffs, String(fileName), 210 String(method), Bool(doAll)); 194 211 *pIn = *pOut; 195 212 delete pOut; … … 198 215 199 216 SDMemTableWrapper SDMathWrapper::gainElevation(const SDMemTableWrapper& in, 217 const std::vector<float>& coeffs, 200 218 const string& fileName, 201 219 const string& method, bool doAll) 202 220 { 203 221 const CountedPtr<SDMemTable>& pIn = in.getCP(); 204 SDMath sdm; 205 return CountedPtr<SDMemTable>(sdm.gainElevation(*pIn, String(fileName), 222 Vector<Float> tCoeffs(coeffs); 223 SDMath sdm; 224 return CountedPtr<SDMemTable>(sdm.gainElevation(*pIn, tCoeffs, String(fileName), 206 225 String(method), Bool(doAll))); 207 226 } 208 227 228 void SDMathWrapper::opacityInSitu(SDMemTableWrapper& in, float tau, bool doAll) 229 { 230 SDMemTable* pIn = in.getPtr(); 231 SDMath sdm; 232 SDMemTable* pOut = sdm.opacity(*pIn, Float(tau), Bool(doAll)); 233 *pIn = *pOut; 234 delete pOut; 235 } 236 237 238 SDMemTableWrapper SDMathWrapper::opacity(const SDMemTableWrapper& in, 239 float tau, bool doAll) 240 { 241 const CountedPtr<SDMemTable>& pIn = in.getCP(); 242 SDMath sdm; 243 return CountedPtr<SDMemTable>(sdm.opacity(*pIn, Float(tau), Bool(doAll))); 244 } 245 -
trunk/src/SDMathWrapper.h
r228 r235 47 47 const SDMemTableWrapper& off); 48 48 49 // Simple binary operations 50 SDMemTableWrapper simpleBinaryOperate (const SDMemTableWrapper& left, 51 const SDMemTableWrapper& right, 52 const std::string& op); 53 49 54 // Multiply 50 55 void scaleInSitu(SDMemTableWrapper& in, float factor, bool doAll); … … 71 76 72 77 // Apply gain elevation correction 73 void gainElevationInSitu (SDMemTableWrapper& in, const std::string& fileName, 78 void gainElevationInSitu (SDMemTableWrapper& in, const std::vector<float>& coeffs, 79 const std::string& fileName, 74 80 const std::string& method, bool doAll); 75 SDMemTableWrapper gainElevation(const SDMemTableWrapper& in, const std::string& fileName, 81 SDMemTableWrapper gainElevation(const SDMemTableWrapper& in, const std::vector<float>& coeffs, 82 const std::string& fileName, 76 83 const std::string& method, bool doAll); 84 85 // Apply opacity correction 86 void opacityInSitu (SDMemTableWrapper& in, float tau, bool doAll); 87 SDMemTableWrapper opacity (const SDMemTableWrapper& in, float tau, bool doAll); 77 88 78 89 // Average in time … … 89 100 std::vector<float> statistic(const SDMemTableWrapper& in, 90 101 const std::vector<bool>& mask, 91 const std::string& which );102 const std::string& which, int row); 92 103 }; 93 104
Note:
See TracChangeset
for help on using the changeset viewer.