Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMath.cc
r536 r653 46 46 #include <casa/Arrays/Matrix.h> 47 47 #include <casa/BasicMath/Math.h> 48 #include <casa/Containers/Block.h>49 48 #include <casa/Exceptions.h> 50 49 #include <casa/Quanta/Quantum.h> … … 139 138 140 139 141 CountedPtr<SDMemTable> SDMath::average(const Block<CountedPtr<SDMemTable> >& in,140 CountedPtr<SDMemTable> SDMath::average(const std::vector<CountedPtr<SDMemTable> >& in, 142 141 const Vector<Bool>& mask, Bool scanAv, 143 142 const String& weightStr, Bool alignFreq) const … … 155 154 156 155 SDMemTable* pTabOut = new SDMemTable(*in[0],True); 157 if (in. nelements() > 1) {158 for (uInt i=1; i < in. nelements(); ++i) {156 if (in.size() > 1) { 157 for (uInt i=1; i < in.size(); ++i) { 159 158 pTabOut->appendToHistoryTable(in[i]->getHistoryTable()); 160 159 } … … 252 251 253 252 Float fac = 1.0; 254 const uInt nTables = in. nelements();253 const uInt nTables = in.size(); 255 254 for (uInt iTab=0; iTab<nTables; iTab++) { 256 255 … … 1773 1772 const Array<Float>& tSys, const Array<Float>& nInc, 1774 1773 const Vector<Bool>& mask, Double time, Double interval, 1775 const Block<CountedPtr<SDMemTable> >& in,1774 const std::vector<CountedPtr<SDMemTable> >& in, 1776 1775 uInt iTab, uInt iRow, uInt axis, 1777 1776 uInt nAxesSub, Bool useMask, -
trunk/src/SDMath.h
r536 r653 78 78 79 79 // Average in time 80 casa::CountedPtr<SDMemTable> average(const casa::Block<casa::CountedPtr<SDMemTable> >& in, 81 const casa::Vector<casa::Bool>& mask, 82 casa::Bool scanAverage, 83 const casa::String& weightStr, 84 casa::Bool align=casa::False) const; 80 casa::CountedPtr<SDMemTable> 81 average(const std::vector<casa::CountedPtr<SDMemTable> >& in, 82 const casa::Vector<casa::Bool>& mask, 83 casa::Bool scanAverage, 84 const casa::String& weightStr, 85 casa::Bool align=casa::False) const; 85 86 86 87 // Statistics. If row<0, all rows are done otherwise, just the … … 140 141 // Function to use accumulate data during time averaging 141 142 142 void accumulate (casa::Double& timeSum, casa::Double& intSum, casa::Int& nAccum, 143 casa::MaskedArray<casa::Float>& sum, casa::Array<casa::Float>& sumSq, 144 casa::Array<casa::Float>& nPts, casa::Array<casa::Float>& tSysSum, 145 casa::Array<casa::Float>& tSysSqSum, 146 const casa::Array<casa::Float>& tSys, const casa::Array<casa::Float>& nInc, 147 const casa::Vector<casa::Bool>& mask, casa::Double time, casa::Double interval, 148 const casa::Block<casa::CountedPtr<SDMemTable> >& in, 149 casa::uInt iTab, casa::uInt iRow, casa::uInt axis, casa::uInt nAxesSub, 150 casa::Bool useMask, WeightType wtType) const; 143 void accumulate(casa::Double& timeSum, casa::Double& intSum, 144 casa::Int& nAccum, 145 casa::MaskedArray<casa::Float>& sum, 146 casa::Array<casa::Float>& sumSq, 147 casa::Array<casa::Float>& nPts, 148 casa::Array<casa::Float>& tSysSum, 149 casa::Array<casa::Float>& tSysSqSum, 150 const casa::Array<casa::Float>& tSys, 151 const casa::Array<casa::Float>& nInc, 152 const casa::Vector<casa::Bool>& mask, 153 casa::Double time, casa::Double interval, 154 const std::vector<casa::CountedPtr<SDMemTable> >& in, 155 casa::uInt iTab, casa::uInt iRow, 156 casa::uInt axis, casa::uInt nAxesSub, 157 casa::Bool useMask, WeightType wtType) const; 151 158 152 159 // Work out conversion factor for converting Jy<->K per IF per row and apply … … 201 208 casa::MFrequency::Types system, 202 209 const casa::String& timeRef, 203 const casa::String& method, casa::Bool perIF) const; 210 const casa::String& method, 211 casa::Bool perIF) const; 204 212 205 213 // Generate frequency aligners … … 209 217 casa::MFrequency::Types system, 210 218 const casa::MPosition& refPos, 211 const casa::MEpoch& refEpoch, casa::Bool perFreqID) const; 219 const casa::MEpoch& refEpoch, 220 casa::Bool perFreqID) const; 212 221 213 222 // Generate data description table (combines source and freqID) -
trunk/src/python_SDMath.cc
r502 r653 30 30 //#--------------------------------------------------------------------------- 31 31 #include <boost/python.hpp> 32 #include <vector> 32 33 33 34 #include <casa/aips.h> … … 49 50 int n; 50 51 n = extract<int>(tp.attr("__len__")()); 51 Block<CountedPtr<asap::SDMemTable> > b(n); 52 std::vector<CountedPtr<asap::SDMemTable> > b(n); 53 //Block<CountedPtr<asap::SDMemTable> > b(n); 52 54 for (int i=0;i< n;++i) { 53 55 SDMemTableWrapper sdmw = … … 56 58 } 57 59 Vector<Bool> msk(mask); 58 //60 // 59 61 SDMath sdm; 60 62 return SDMemTableWrapper(sdm.average(b, msk, Bool(scanAv), weightStr)); … … 65 67 void python_SDMath() { 66 68 def("b_operate", &SDMathWrapper::binaryOperate); 67 //69 // 68 70 def("quotient", &SDMathWrapper::quotient); 69 71 //
Note:
See TracChangeset
for help on using the changeset viewer.