Changeset 107
- Timestamp:
- 12/01/04 10:58:27 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMath.cc
r85 r107 175 175 return CountedPtr<SDMemTable>(sdmt); 176 176 } 177 178 CountedPtr<SDMemTable> 179 SDMath::add(const CountedPtr<SDMemTable>& in, Float offset) { 180 SDMemTable* sdmt = new SDMemTable(*in); 181 Table t = sdmt->table(); 182 ArrayColumn<Float> spec(t,"SPECTRA"); 183 184 for (uInt i=0; i < t.nrow(); i++) { 185 // data stuff 186 MaskedArray<Float> marr(sdmt->rowAsMaskedArray(i)); 187 marr += offset; 188 spec.put(i, marr.getArray()); 189 } 190 return CountedPtr<SDMemTable>(sdmt); 191 } 192 193 177 194 178 195 bool SDMath::fit(Vector<Float>& thefit, const Vector<Float>& data, -
trunk/src/SDMath.h
r83 r107 46 46 const CountedPtr<SDMemTable>& off); 47 47 CountedPtr<SDMemTable> multiply(const CountedPtr<SDMemTable>& in, 48 Float factor); 48 Float factor); 49 CountedPtr<SDMemTable> add(const CountedPtr<SDMemTable>& in, 50 Float offset); 49 51 50 52 CountedPtr<SDMemTable> baseline(const CountedPtr<SDMemTable>& in, -
trunk/src/SDMathWrapper.h
r86 r107 58 58 } 59 59 60 SDMemTableWrapper add(const SDMemTableWrapper& in, 61 Float offset) { 62 return SDMemTableWrapper(SDMath::add(in.getCP(), offset)); 63 } 64 60 65 SDMemTableWrapper hanning(const SDMemTableWrapper& in) { 61 66 return SDMemTableWrapper(SDMath::hanning(in.getCP())); -
trunk/src/python_SDMath.cc
r86 r107 58 58 def("quotient", &SDMathWrapper::quotient); 59 59 def("scale", &SDMathWrapper::scale); 60 def("add", &SDMathWrapper::add); 60 61 def("baseline", &SDMathWrapper::baseline); 61 62 def("hanning", &SDMathWrapper::hanning);
Note:
See TracChangeset
for help on using the changeset viewer.