Changeset 902 for trunk/src/Scantable.cpp
- Timestamp:
- 03/17/06 10:10:59 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.cpp
r901 r902 28 28 #include <casa/Quanta/MVAngle.h> 29 29 #include <casa/Containers/RecordField.h> 30 #include <casa/Utilities/GenSort.h> 30 31 31 32 #include <tables/Tables/TableParse.h> … … 56 57 #include "STPolLinear.h" 57 58 #include "STAttr.h" 59 #include "MathUtils.h" 58 60 59 61 using namespace casa; … … 126 128 Bool(clear)); 127 129 table_ = Table(newname, Table::Update); 128 copySubtables(other);130 if ( clear ) copySubtables(other); 129 131 table_.markForDelete(); 130 132 } … … 328 330 int Scantable::nscan() const { 329 331 int n = 0; 330 int previous = -1; int current = 0; 331 for (uInt i=0; i< scanCol_.nrow();i++) { 332 scanCol_.getScalar(i,current); 333 if (previous != current) { 334 previous = current; 335 n++; 336 } 337 } 338 return n; 332 Int previous = -1; Int current = 0; 333 Vector<uInt> scannos(scanCol_.getColumn()); 334 uInt nout = GenSort<uInt>::sort( scannos, Sort::Ascending, 335 Sort::QuickSort|Sort::NoDuplicates ); 336 return int(nout); 339 337 } 340 338 … … 482 480 while ( !it.pastEnd() ) { 483 481 ++n; 482 ++it; 484 483 } 485 484 return n; … … 595 594 596 595 std::vector<float> Scantable::getSpectrum( int whichrow, 597 const std::string& poltype) const 598 { 596 const std::string& poltype ) const 597 { 598 if ( whichrow < 0 || whichrow >= nrow() ) 599 throw(AipsError("Illegal row number.")); 599 600 std::vector<float> out; 600 601 Vector<Float> arr; … … 610 611 stpol->setSpectra(getPolMatrix(row)); 611 612 Float frot,fang,ftan; 612 focusTable_.getEntry(frot, fang, ftan, row);613 focusTable_.getEntry(frot, fang, ftan, mfocusidCol_(row)); 613 614 stpol->setPhaseCorrections(frot, fang, ftan); 614 615 arr = stpol->getSpectrum(requestedpol, poltype); … … 619 620 } 620 621 } 622 if ( arr.nelements() == 0 ) 623 pushLog("Not enough polarisations present to do the conversion."); 621 624 arr.tovector(out); 622 625 return out; … … 653 656 { 654 657 return table_.keywordSet().asString("POLTYPE"); 655 }656 657 658 std::string Scantable::getPolarizationLabel(bool linear, bool stokes,659 bool linpol, int polidx) const660 {661 uInt idx = 0;662 if (polidx >=0) idx = polidx;663 return "";664 //return SDPolUtil::polarizationLabel(idx, linear, stokes, linpol);665 658 } 666 659 … … 892 885 } 893 886 894 895 }//namespace asap 887 std::vector< std::string > asap::Scantable::columnNames( ) const 888 { 889 Vector<String> vec = table_.tableDesc().columnNames(); 890 return mathutil::tovectorstring(vec); 891 } 892 893 } //namespace asap
Note: See TracChangeset
for help on using the changeset viewer.