Changeset 1490
- Timestamp:
- 01/23/09 18:06:33 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/STFiller.cpp
r1489 r1490 456 456 << ")" << endl ; 457 457 // 458 if ( nreader_->open() != 0 ) {459 throw( AipsError( "Error while opening file "+filename_ ) ) ;460 }458 // if ( nreader_->open() != 0 ) { 459 // throw( AipsError( "Error while opening file "+filename_ ) ) ; 460 // } 461 461 462 462 isNRO_ = true ; … … 591 591 uInt id ; 592 592 uInt imax = nreader_->getRowNum() ; 593 vector< vector<double > > freqs ; 593 594 //uInt imax = 30 ; 594 595 uInt i = 0 ; … … 636 637 *sdirCol = nreader_->getSourceDirection() ; 637 638 RecordFieldPtr<Double> svelCol(rec, "SRCVELOCITY") ; 638 *svelCol = h->getURVEL() ; // [m/s]639 //*svelCol = h->getURVEL() + d->VRAD ; // [m/s]639 //*svelCol = h->getURVEL() ; // [m/s] 640 *svelCol = h->getURVEL() + d->VRAD ; // [m/s] 640 641 RecordFieldPtr<Int> fitCol(rec, "FIT_ID") ; 641 642 *fitCol = -1 ; … … 662 663 RecordFieldPtr<uInt> mfreqidCol(rec, "FREQ_ID") ; 663 664 vector<double> fqs = nreader_->getFrequencies( i ) ; 664 id = table_->frequencies().addEntry( Double( fqs[0] ), 665 Double( fqs[1] ), 666 Double( fqs[2] ) ) ; 667 *mfreqidCol = id ; 668 *ifCol = id ; 665 //cout << "STFiller::readNRO() fqs[1] = " << fqs[1] << endl ; 666 if ( freqs.size() == 0 ) { 667 id = table_->frequencies().addEntry( Double( fqs[0] ), 668 Double( fqs[1] ), 669 Double( fqs[2] ) ) ; 670 *mfreqidCol = id ; 671 *ifCol = id ; 672 freqs.push_back( fqs ) ; 673 } 674 else { 675 int iadd = -1 ; 676 for ( uInt iif = 0 ; iif < freqs.size() ; iif++ ) { 677 //cout << "STFiller::readNRO() freqs[" << iif << "][1] = " << freqs[iif][1] << endl ; 678 double fdiff = abs( freqs[iif][1] - fqs[1] ) / freqs[iif][1] ; 679 //cout << "STFiller::readNRO() fdiff = " << fdiff << endl ; 680 if ( fdiff < 1.0e-8 ) { 681 iadd = iif ; 682 break ; 683 } 684 } 685 if ( iadd == -1 ) { 686 id = table_->frequencies().addEntry( Double( fqs[0] ), 687 Double( fqs[1] ), 688 Double( fqs[2] ) ) ; 689 *mfreqidCol = id ; 690 *ifCol = id ; 691 freqs.push_back( fqs ) ; 692 } 693 else { 694 *mfreqidCol = iadd ; 695 *ifCol = iadd ; 696 } 697 } 669 698 RecordFieldPtr<uInt> molidCol(rec, "MOLECULE_ID") ; 670 699 Vector<Double> restfreq( IPosition( 1, 1 ) ) ;
Note:
See TracChangeset
for help on using the changeset viewer.