Changeset 1140
- Timestamp:
- 08/16/06 09:12:28 (18 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STMath.cpp
r1078 r1140 15 15 #include <casa/Containers/Block.h> 16 16 #include <casa/BasicSL/String.h> 17 #include <tables/Tables/TableIter.h>18 #include <tables/Tables/TableCopy.h>19 17 #include <casa/Arrays/MaskArrLogi.h> 20 18 #include <casa/Arrays/MaskArrMath.h> … … 29 27 #include <tables/Tables/ExprNode.h> 30 28 #include <tables/Tables/TableRecord.h> 29 #include <tables/Tables/TableParse.h> 31 30 #include <tables/Tables/ReadAsciiTable.h> 31 #include <tables/Tables/TableIter.h> 32 #include <tables/Tables/TableCopy.h> 32 33 33 34 #include <lattices/Lattices/LatticeUtilities.h> … … 203 204 ArrayColumn<uChar> flagColOut(tout,"FLAGTRA"); 204 205 ArrayColumn<Float> tsysColOut(tout,"TSYS"); 205 206 ScalarColumn<uInt> scanColOut(tout,"SCANNO"); 207 Table tmp = in->table().sort("BEAMNO"); 206 208 Block<String> cols(3); 207 209 cols[0] = String("BEAMNO"); … … 214 216 uInt outrowCount = 0; 215 217 uChar userflag = 1 << 7; 216 TableIterator iter( in->table(), cols);218 TableIterator iter(tmp, cols); 217 219 while (!iter.pastEnd()) { 218 220 Table subt = iter.table(); … … 224 226 tout.addRow(); 225 227 TableCopy::copyRows(tout, subt, outrowCount, 0, 1); 228 if ( avmode != "SCAN") { 229 scanColOut.put(outrowCount, uInt(0)); 230 } 226 231 Vector<Float> tmp; 227 232 specCol.get(0, tmp); … … 1323 1328 } 1324 1329 1330 CountedPtr< Scantable > 1331 asap::STMath::mxExtract( const CountedPtr< Scantable > & in, 1332 const std::string & scantype ) 1333 { 1334 bool insitu = insitu_; 1335 setInsitu(false); 1336 CountedPtr< Scantable > out = getScantable(in, true); 1337 setInsitu(insitu); 1338 Table& tout = out->table(); 1339 std::string taql = "SELECT FROM $1 WHERE BEAMNO != REFBEAMNO"; 1340 if (scantype == "on") { 1341 taql = "SELECT FROM $1 WHERE BEAMNO == REFBEAMNO"; 1342 } 1343 Table tab = tableCommand(taql, in->table()); 1344 TableCopy::copyRows(tout, tab); 1345 if (scantype == "on") { 1346 TableVector<uInt> vec(tout, "SCANNO"); 1347 vec = 0; 1348 } 1349 return out; 1350 } -
trunk/src/STMath.h
r1106 r1140 62 62 63 63 64 65 66 67 68 69 70 71 72 64 /** 65 * average a vector of Scantables 66 * @param in the vector of Scantables to average 67 * @param an optional mask to apply on specific weights 68 * @param weight weighting scheme 69 * @param avmode the mode ov averaging. Per "SCAN" or "ALL". 70 * @return a casa::CountedPtr<Scantable> which either holds a new Scantable 71 * or returns the imput pointer. 72 */ 73 73 casa::CountedPtr<Scantable> 74 74 average( const std::vector<casa::CountedPtr<Scantable> >& in, … … 77 77 const std::string& avmode = "SCAN"); 78 78 79 80 81 82 83 84 85 86 79 /** 80 * median average a vector of Scantables. See also STMath::average 81 * @param in the Scantable to average 82 * @param mode the averaging mode. Currently only "MEDIAN" 83 * @param avmode the mode ov averaging. Per "SCAN" or "ALL". 84 * @return a casa::CountedPtr<Scantable> which either holds a new Scantable 85 * or returns the imput pointer. 86 */ 87 87 casa::CountedPtr<Scantable> 88 88 averageChannel( const casa::CountedPtr<Scantable> & in, … … 90 90 const std::string& avmode = "SCAN"); 91 91 92 /** 93 * average polarisations together. really only useful if only linears are 94 * available. 95 * @param in the input Scantable 96 * @param mask an optional mask if weight allows one 97 * @param weight weighting scheme 98 * @return 99 */ 92 100 casa::CountedPtr< Scantable > 93 101 averagePolarisations( const casa::CountedPtr< Scantable > & in, 94 95 102 const std::vector<bool>& mask, 103 const std::string& weight ); 96 104 97 105 casa::CountedPtr<Scantable> … … 159 167 convertPolarisation( const casa::CountedPtr<Scantable>& in, 160 168 const std::string& newtype); 169 170 casa::CountedPtr<Scantable> 171 mxExtract( const casa::CountedPtr<Scantable>& in, 172 const std::string& scantype = "on" ); 161 173 162 174 private: -
trunk/src/STMathWrapper.h
r1078 r1140 144 144 const std::string& newtype ) 145 145 { return ScantableWrapper(STMath::convertPolarisation(in.getCP(),newtype)); } 146 147 ScantableWrapper mxExtract( const ScantableWrapper& in, 148 const std::string& scantype="on" ) 149 { return ScantableWrapper(STMath::mxExtract(in.getCP(),scantype)); } 146 150 147 151 }; -
trunk/src/python_STMath.cpp
r1069 r1140 65 65 .def("_swap_linears", &STMathWrapper::swapPolarisations) 66 66 .def("_freq_align", &STMathWrapper::frequencyAlign) 67 ; 67 .def("_mx_extract", &STMathWrapper::mxExtract) 68 ; 68 69 }; 69 70
Note:
See TracChangeset
for help on using the changeset viewer.