- Timestamp:
- 01/24/11 19:20:57 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MSFiller.cpp
r1975 r1978 191 191 // MAIN 192 192 // Iterate over several ids 193 //194 // ITERATION: OBSERVATION_ID195 //196 TableIterator iter0( tablesel_, "OBSERVATION_ID" ) ;197 Int totalrow = 0 ;198 193 Int oldnr = table_->nrow() ; 199 194 map<Int, uInt> ifmap ; // (IFNO, FREQ_ID) pair … … 205 200 ROMSPointingColumns pointCols( potabsel ) ; 206 201 String telescopeName ; 202 // 203 // ITERATION: OBSERVATION_ID 204 // 205 Int added0 = 0 ; 206 Int current0 = table_->nrow() ; 207 TableIterator iter0( tablesel_, "OBSERVATION_ID" ) ; 207 208 while( !iter0.pastEnd() ) { 208 209 MeasurementSet t0( iter0.table() ) ; … … 218 219 } 219 220 telescopeName = obsCols.telescopeName()(obsId) ; 221 Int nbeam = 0 ; 220 222 // 221 223 // ITERATION: FEED1 222 224 // 223 Int nbeam = 0 ; 225 Int added1 = 0 ; 226 Int current1 = table_->nrow() ; 224 227 TableIterator iter1( t0, "FEED1" ) ; 225 228 while( !iter1.pastEnd() ) { … … 231 234 // ITERATION: FIELD_ID 232 235 // 236 Int added2 = 0 ; 237 Int current2 = table_->nrow() ; 233 238 TableIterator iter2( t1, "FIELD_ID" ) ; 234 239 while( !iter2.pastEnd() ) { … … 243 248 // ITERATION: DATA_DESC_ID 244 249 // 250 Int added3 = 0 ; 251 Int current3 = table_->nrow() ; 245 252 TableIterator iter3( t2, "DATA_DESC_ID" ) ; 246 253 while( !iter3.pastEnd() ) { … … 362 369 // ITERATION: SCAN_NUMBER 363 370 // 371 Int added4 = 0 ; 372 Int current4 = table_->nrow() ; 364 373 TableIterator iter4( t3, "SCAN_NUMBER" ) ; 365 374 while( !iter4.pastEnd() ) { … … 371 380 // ITERATION: STATE_ID 372 381 // 382 Int added5 = 0 ; 383 Int current5 = table_->nrow() ; 373 384 TableIterator iter5( t4, "STATE_ID" ) ; 374 385 while( !iter5.pastEnd() ) { … … 484 495 RefRows rows( prevnr, prevnr+addednr-1 ) ; 485 496 486 // SCANNO487 ScalarColumn<uInt> scannoCol( table_->table(), "SCANNO" ) ;488 Vector<uInt> scanno( addednr, scanNum ) ;489 scannoCol.putColumnCells( rows, scanno ) ;490 //fillId( (uInt)scanNum, "SCANNO", rows ) ;491 492 497 // CYCLENO 493 498 ScalarColumn<uInt> cyclenoCol( table_->table(), "CYCLENO" ) ; … … 501 506 } 502 507 cycle += nrow ; 503 504 // BEAMNO505 ScalarColumn<uInt> beamnoCol( table_->table(), "BEAMNO" ) ;506 Vector<uInt> beamno( addednr, feedId ) ;507 beamnoCol.putColumnCells( rows, beamno ) ;508 //fillId( (uInt)feedId, "BEAMNO", rows ) ;509 510 // IFNO511 ScalarColumn<uInt> ifnoCol( table_->table(), "IFNO" ) ;512 Vector<uInt> ifno( addednr, spwId ) ;513 ifnoCol.putColumnCells( rows, ifno ) ;514 //fillId( (uInt)spwId, "IFNO", rows ) ;515 508 516 509 // POLNO … … 535 528 } 536 529 537 // FREQ_ID538 ScalarColumn<uInt> freqIdCol( table_->table(), "FREQ_ID" ) ;539 Vector<uInt> freqIds( addednr, ifmap[spwId] ) ;540 freqIdCol.putColumnCells( rows, freqIds ) ;541 //fillId( ifmap[spwId], "FREQ_ID", rows ) ;542 543 // MOLECULE_ID544 ScalarColumn<uInt> moleculeIdCol( table_->table(), "MOLECULE_ID" ) ;545 Vector<uInt> moleculeId( addednr, molId ) ;546 moleculeIdCol.putColumnCells( rows, moleculeId ) ;547 548 // REFBEAMNO549 // set 0 at the moment550 ScalarColumn<Int> refBeamCol( table_->table(), "REFBEAMNO" ) ;551 Vector<Int> refBeam( addednr, 0 ) ;552 refBeamCol.putColumnCells( rows, refBeam ) ;553 //fillId( 0, "REFBEAMNO", rows ) ;554 555 556 530 // FLAGROW 557 531 ScalarColumn<uInt> flagRowCol( table_->table(), "FLAGROW" ) ; … … 587 561 } 588 562 589 590 // SRCNAME591 ScalarColumn<String> srcNameCol( table_->table(), "SRCNAME" ) ;592 Vector<String> vSrcName( addednr, srcName ) ;593 srcNameCol.putColumnCells( rows, vSrcName ) ;594 595 563 // SRCTYPE 596 564 ScalarColumn<Int> srcTypeCol( table_->table(), "SRCTYPE" ) ; … … 598 566 srcTypeCol.putColumnCells( rows, srcType ) ; 599 567 600 // FIELDNAME601 ScalarColumn<String> fieldNameCol( table_->table(), "FIELDNAME" ) ;602 Vector<String> vFieldName( addednr, fieldName ) ;603 fieldNameCol.putColumnCells( rows, vFieldName ) ;604 605 568 // TSYS 606 569 ArrayColumn<Float> tsysCol( table_->table(), "TSYS" ) ; … … 640 603 tsysCol.putColumnCells( rows, tsys ) ; 641 604 } 642 643 605 644 606 // DIRECTION, AZIMUTH, ELEVATION, SCANRATE … … 746 708 } 747 709 748 // OPACITY749 // not used?750 ScalarColumn<Float> opacityCol( table_->table(), "OPACITY" ) ;751 Vector<Float> opacity( addednr, 0.0 ) ;752 opacityCol.putColumnCells( rows, opacity ) ;753 754 755 710 // TCAL_ID 756 711 ScalarColumn<uInt> tcalIdCol( table_->table(), "TCAL_ID" ) ; … … 772 727 } 773 728 774 // FIT_ID775 // nothing to do776 ScalarColumn<Int> fitIdCol( table_->table(), "FIT_ID" ) ;777 Vector<Int> fitId( addednr, -1 ) ;778 fitIdCol.putColumnCells( rows, fitId ) ;779 780 781 // FOCUS_ID782 // tentative783 ScalarColumn<uInt> focusIdCol( table_->table(), "FOCUS_ID" ) ;784 Vector<uInt> focusId( addednr, 0 ) ;785 focusIdCol.putColumnCells( rows, focusId ) ;786 787 788 729 // WEATHER_ID 789 730 uInt widprev = 0 ; … … 807 748 } 808 749 809 // SRCVELOCITY, SRCPROPERMOTION and SRCDIRECTION810 // no reference conversion for direction at the moment (assume J2000)811 // no reference conversion for velocity at the moment (assume LSRK)812 ArrayColumn<Double> srcPMCol( table_->table(), "SRCPROPERMOTION" ) ;813 ArrayColumn<Double> srcDirCol( table_->table(), "SRCDIRECTION" ) ;814 ScalarColumn<Double> srcVelCol( table_->table(), "SRCVELOCITY" ) ;815 for ( int i = 0 ; i < addednr ; i++ ) {816 int idx = i + prevnr ;817 srcPMCol.put( idx, srcPM ) ; // [rad/s]818 srcDirCol.put( idx, srcDir ) ; // [rad]819 srcVelCol.put( idx, sysVel ) ; // [m/s]820 }821 822 823 750 //os_ << "field: " << fieldId << " scan: " << scanNum << " obs: " << obsId << " state: " << stateId << " ddid: " << ddId << endl ; 824 751 //os_ << "t.nrow() = " << t5.nrow() << endl ; 825 totalrow += t5.nrow() ; 826 //os_ << "totalrow = " << totalrow << LogIO::POST ; 752 added5 += addednr ; 827 753 iter5.next() ; 828 754 } 755 756 // SCANNO 757 RefRows rows5( current5, current5+added5-1 ) ; 758 Vector<uInt> scanno( added5, scanNum ) ; 759 ScalarColumn<uInt> scannoCol( table_->table(), "SCANNO" ) ; 760 scannoCol.putColumnCells( rows5, scanno ) ; 761 762 added4 += added5 ; 829 763 iter4.next() ; 830 764 } 765 766 // IFNO 767 RefRows rows4( current4, current4+added4-1 ) ; 768 Vector<uInt> shareduIArr( added4, spwId ) ; 769 ScalarColumn<uInt> shareduIArrCol( table_->table(), "IFNO" ) ; 770 shareduIArrCol.putColumnCells( rows4, shareduIArr ) ; 771 772 // FREQ_ID 773 shareduIArr = ifmap[spwId] ; 774 shareduIArrCol.attach( table_->table(), "FREQ_ID" ) ; 775 shareduIArrCol.putColumnCells( rows4, shareduIArr ) ; 776 777 // MOLECULE_ID 778 shareduIArr = molId ; 779 shareduIArrCol.attach( table_->table(), "MOLECULE_ID" ) ; 780 shareduIArrCol.putColumnCells( rows4, shareduIArr ) ; 781 782 // SRCNAME 783 ScalarColumn<String> srcNameCol( table_->table(), "SRCNAME" ) ; 784 Vector<String> vSrcName( added4, srcName ) ; 785 srcNameCol.putColumnCells( rows4, vSrcName ) ; 786 787 // SRCVELOCITY, SRCPROPERMOTION and SRCDIRECTION 788 // no reference conversion for direction at the moment (assume J2000) 789 // no reference conversion for velocity at the moment (assume LSRK) 790 Matrix<Double> sharedDArr( 2, added4 ) ; 791 for ( uInt icol = 0 ; icol < added4 ; icol++ ) { 792 sharedDArr.column(icol) = srcPM ; 793 } 794 ArrayColumn<Double> sharedDArrCol( table_->table(), "SRCPROPERMOTION" ) ; 795 sharedDArrCol.putColumnCells( rows4, sharedDArr ) ; 796 for ( uInt icol = 0 ; icol < added4 ; icol++ ) { 797 sharedDArr.column(icol) = srcDir ; 798 } 799 sharedDArrCol.attach( table_->table(), "SRCDIRECTION" ) ; 800 sharedDArrCol.putColumnCells( rows4, sharedDArr ) ; 801 ScalarColumn<Double> sysVelCol( table_->table(), "SRCVELOCITY" ) ; 802 Vector<Double> sysVelArr( added4, sysVel ) ; 803 sysVelCol.putColumnCells( rows4, sysVelArr ) ; 804 805 added3 += added4 ; 831 806 iter3.next() ; 832 807 } 808 809 // FIELDNAME 810 RefRows rows3( current3, current3+added3-1 ) ; 811 Vector<String> vFieldName( added3, fieldName ) ; 812 ScalarColumn<String> fieldNameCol( table_->table(), "FIELDNAME" ) ; 813 fieldNameCol.putColumnCells( rows3, vFieldName ) ; 814 815 added2 += added3 ; 833 816 iter2.next() ; 834 817 } 818 819 // BEAMNO 820 RefRows rows2( current2, current2+added2-1 ) ; 821 Vector<uInt> beamno( added2, feedId ) ; 822 ScalarColumn<uInt> beamnoCol( table_->table(), "BEAMNO" ) ; 823 beamnoCol.putColumnCells( rows2, beamno ) ; 824 825 // FOCUS_ID 826 // tentative 827 beamnoCol.attach( table_->table(), "FOCUS_ID" ) ; 828 beamno = 0 ; 829 beamnoCol.putColumnCells( rows2, beamno ) ; 830 831 added1 += added2 ; 835 832 iter1.next() ; 836 833 } 837 834 if ( sdh.nbeam < nbeam ) sdh.nbeam = nbeam ; 835 836 added0 += added1 ; 838 837 iter0.next() ; 839 838 } 840 839 841 // Keywords 840 // REFBEAMNO 841 // set 0 at the moment 842 ScalarColumn<Int> sharedICol( table_->table(), "REFBEAMNO" ) ; 843 Vector<Int> sharedI( added0, 0 ) ; 844 sharedICol.putColumn( sharedI ) ; 845 846 // OPACITY 847 // not used? 848 ScalarColumn<Float> opacityCol( table_->table(), "OPACITY" ) ; 849 Vector<Float> opacity( added0, 0.0 ) ; 850 opacityCol.putColumn( opacity ) ; 851 852 // FIT_ID 853 // nothing to do 854 sharedICol.attach( table_->table(), "FIT_ID" ) ; 855 sharedI = -1 ; 856 sharedICol.putColumn( sharedI ) ; 857 858 859 // Table Keywords 842 860 sdh.nif = ifmap.size() ; 843 861 String antennaName = antCols.name()(antenna_) ;
Note:
See TracChangeset
for help on using the changeset viewer.