- Timestamp:
- 02/01/05 17:59:02 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMemTable.cc
r329 r347 433 433 // Continue with km/s or Hz. Get FreqID 434 434 435 Vector<uInt> v;436 freqidCol_.get(whichRow, v);437 uInt specidx = v(IFSel_);435 Vector<uInt> freqIDs; 436 freqidCol_.get(whichRow, freqIDs); 437 uInt freqID = freqIDs(IFSel_); 438 438 439 439 // Get SpectralCoordinate, set reference frame conversion, 440 440 // velocity conversion, and rest freq state 441 441 442 SpectralCoordinate spc = getSpectralCoordinate( specidx, whichRow);442 SpectralCoordinate spc = getSpectralCoordinate(freqID, whichRow); 443 443 // 444 444 Vector<Double> pixel(nChan()); … … 482 482 Unit u(sunit); 483 483 // 484 Vector<uInt> v;485 freqidCol_.get(whichRow, v);486 uInt specidx = v(IFSel_);484 Vector<uInt> freqIDs; 485 freqidCol_.get(whichRow, freqIDs); 486 uInt freqID = freqIDs(IFSel_); 487 487 488 488 // Get SpectralCoordinate, with frame, velocity, rest freq state set 489 489 490 SpectralCoordinate spc = getSpectralCoordinate( specidx, whichRow);490 SpectralCoordinate spc = getSpectralCoordinate(freqID, whichRow); 491 491 // 492 492 String s = "Channel"; … … 664 664 665 665 666 SpectralCoordinate SDMemTable::getSpectralCoordinate(uInt whichIdx) const666 SpectralCoordinate SDMemTable::getSpectralCoordinate(uInt freqID) const 667 667 { 668 668 669 669 Table t = table_.keywordSet().asTable("FREQUENCIES"); 670 if ( whichIdx> t.nrow() ) {671 throw(AipsError("SDMemTable::getSpectralCoordinate - whichIdxout of range"));670 if (freqID> t.nrow() ) { 671 throw(AipsError("SDMemTable::getSpectralCoordinate - freqID out of range")); 672 672 } 673 673 … … 686 686 mft = MFrequency::TOPO; 687 687 } 688 rpc.get( whichIdx, rp);689 rvc.get( whichIdx, rv);690 incc.get( whichIdx, inc);688 rpc.get(freqID, rp); 689 rvc.get(freqID, rv); 690 incc.get(freqID, inc); 691 691 // 692 692 SpectralCoordinate spec(mft,rv,inc,rp); … … 696 696 697 697 698 SpectralCoordinate SDMemTable::getSpectralCoordinate(uInt whichIdx, uInt whichRow) const698 SpectralCoordinate SDMemTable::getSpectralCoordinate(uInt freqID, uInt whichRow) const 699 699 { 700 700 // Create basic SC 701 701 702 SpectralCoordinate spec = getSpectralCoordinate ( whichIdx);702 SpectralCoordinate spec = getSpectralCoordinate (freqID); 703 703 // 704 704 Table t = table_.keywordSet().asTable("FREQUENCIES"); 705 705 706 // Set rest frequencies706 // Get rest frequencies from table, one per IF ??? 707 707 708 708 Vector<Double> vec; … … 713 713 // Select rest freq 714 714 715 if ( vec.nelements() >= nIF()) {715 if (IFSel_+1 < vec.nelements()) { 716 716 spec.selectRestFrequency(uInt(IFSel_)); 717 } else { 718 cerr << "There is no rest frequency for this IF; selecting rest freq for IF=0" << endl; 719 spec.selectRestFrequency(0u); 717 720 } 718 721 } … … 725 728 MFrequency::Types mtype; 726 729 if (!MFrequency::getType(mtype, frm)) { 727 c out<< "Frequency type unknown assuming TOPO" << endl; // SHould never happen730 cerr << "Frequency type unknown assuming TOPO" << endl; // SHould never happen 728 731 mtype = MFrequency::TOPO; 729 732 } … … 763 766 764 767 Bool SDMemTable::setCoordinate(const SpectralCoordinate& speccord, 765 uInt whichIdx) {768 uInt freqID) { 766 769 Table t = table_.rwKeywordSet().asTable("FREQUENCIES"); 767 if ( whichIdx> t.nrow() ) {770 if (freqID > t.nrow() ) { 768 771 throw(AipsError("SDMemTable::setCoordinate - coord no out of range")); 769 772 } … … 772 775 ScalarColumn<Double> incc(t, "INCREMENT"); 773 776 774 rpc.put( whichIdx, speccord.referencePixel()[0]);775 rvc.put( whichIdx, speccord.referenceValue()[0]);776 incc.put( whichIdx, speccord.increment()[0]);777 rpc.put(freqID, speccord.referencePixel()[0]); 778 rvc.put(freqID, speccord.referenceValue()[0]); 779 incc.put(freqID, speccord.increment()[0]); 777 780 778 781 return True;
Note:
See TracChangeset
for help on using the changeset viewer.