Changeset 1140 for trunk/src/STMath.cpp
- Timestamp:
- 08/16/06 09:12:28 (18 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.