Changeset 2239
- Timestamp:
- 07/21/11 16:23:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MSFiller.cpp
r2238 r2239 273 273 274 274 //double time1 = gettimeofday_sec() ; 275 //os_ << "end fill init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;275 //os_ << "end init fill: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 276 276 277 277 // row based … … 293 293 RecordFieldPtr<uInt> widRF( trec, "WEATHER_ID" ) ; 294 294 RecordFieldPtr<uInt> polnoRF( trec, "POLNO" ) ; 295 295 RecordFieldPtr<Int> refbRF( trec, "REFBEAMNO" ) ; 296 RecordFieldPtr<Int> fitidRF( trec, "FIT_ID" ) ; 297 RecordFieldPtr<Float> tauRF( trec, "OPACITY" ) ; 298 RecordFieldPtr<uInt> beamRF( trec, "BEAMNO" ) ; 299 RecordFieldPtr<uInt> focusidRF( trec, "FOCUS_ID" ) ; 300 RecordFieldPtr<uInt> ifnoRF( trec, "IFNO" ) ; 301 RecordFieldPtr<uInt> molidRF( trec, "MOLECULE_ID" ) ; 302 RecordFieldPtr<uInt> freqidRF( trec, "FREQ_ID" ) ; 303 RecordFieldPtr<uInt> scanRF( trec, "SCANNO" ) ; 304 RecordFieldPtr<Int> srctypeRF( trec, "SRCTYPE" ) ; 305 RecordFieldPtr<String> srcnameRF( trec, "SRCNAME" ) ; 306 RecordFieldPtr<String> fieldnameRF( trec, "FIELDNAME" ) ; 307 RecordFieldPtr< Array<Double> > srcpmRF( trec, "SRCPROPERMOTION" ) ; 308 RecordFieldPtr< Array<Double> > srcdirRF( trec, "SRCDIRECTION" ) ; 309 RecordFieldPtr<Double> sysvelRF( trec, "SRCVELOCITY" ) ; 296 310 297 311 // REFBEAMNO 298 RecordFieldPtr<Int> intRF( trec, "REFBEAMNO" ) ; 299 *intRF = -1 ; 312 *refbRF = -1 ; 300 313 301 314 // FIT_ID 302 intRF.attachToRecord( trec, "FIT_ID" ) ; 303 *intRF = -1 ; 315 *fitidRF = -1 ; 304 316 305 317 // OPACITY 306 RecordFieldPtr<Float> floatRF( trec, "OPACITY" ) ; 307 *floatRF = 0.0 ; 318 *tauRF = 0.0 ; 308 319 309 320 // … … 347 358 348 359 // BEAMNO 349 RecordFieldPtr<uInt> uintRF( trec, "BEAMNO" ) ; 350 *uintRF = feedId ; 360 *beamRF = feedId ; 351 361 352 362 // FOCUS_ID 353 uintRF.attachToRecord( trec, "FOCUS_ID" ) ; 354 *uintRF = 0 ; 363 *focusidRF = 0 ; 355 364 356 365 //time1 = gettimeofday_sec() ; … … 373 382 374 383 // FIELDNAME 375 RecordFieldPtr<String> strRF( trec, "FIELDNAME" ) ; 376 *strRF = fieldName ; 384 *fieldnameRF = fieldName ; 377 385 378 386 … … 392 400 393 401 // IFNO 394 uintRF.attachToRecord( trec, "IFNO" ) ; 395 *uintRF = (uInt)spwId ; 402 *ifnoRF = (uInt)spwId ; 396 403 397 404 // polarization information … … 415 422 416 423 // SRCNAME 417 strRF.attachToRecord( trec, "SRCNAME" ) ; 418 *strRF = srcName ; 424 *srcnameRF = srcName ; 419 425 420 426 // os_ << "srcName = " << srcName << LogIO::POST ; 421 427 422 428 // SRCPROPERMOTION 423 RecordFieldPtr< Array<Double> > darrRF( trec, "SRCPROPERMOTION" ) ; 424 *darrRF = srcPM ; 429 *srcpmRF = srcPM ; 425 430 426 431 //os_ << "srcPM = " << srcPM << LogIO::POST ; 427 432 428 433 // SRCDIRECTION 429 darrRF.attachToRecord( trec, "SRCDIRECTION" ) ; 430 // *darrRF = srcDir ; 431 *darrRF = md.getAngle().getValue( "rad" ) ; 434 *srcdirRF = md.getAngle().getValue( "rad" ) ; 432 435 433 436 //os_ << "srcDir = " << srcDir << LogIO::POST ; … … 437 440 if ( !sysVels.empty() ) 438 441 sysVel = sysVels[0] ; 439 RecordFieldPtr<Double> doubleRF( trec, "SRCVELOCITY" ) ; 440 *doubleRF = sysVel ; 442 *sysvelRF = sysVel ; 441 443 442 444 // os_ << "sysVel = " << sysVel << LogIO::POST ; … … 445 447 446 448 // MOLECULE_ID 447 uintRF.attachToRecord( trec, "MOLECULE_ID" ) ; 448 *uintRF = molId ; 449 *molidRF = molId ; 449 450 450 451 // spectral setup … … 483 484 484 485 // FREQ_ID 485 uintRF.attachToRecord( trec, "FREQ_ID" ) ; 486 *uintRF = freqId ; 486 *freqidRF = freqId ; 487 487 488 488 // for TSYS and TCAL … … 520 520 521 521 // SCANNO 522 uintRF.attachToRecord( trec, "SCANNO" ) ; 523 *uintRF = scanNum - 1 ; 522 *scanRF = scanNum - 1 ; 524 523 525 524 //time1 = gettimeofday_sec() ; … … 600 599 601 600 // SRCTYPE 602 intRF.attachToRecord( trec, "SRCTYPE" ) ; 603 *intRF = srcType ; 601 *srctypeRF = srcType ; 604 602 605 603 for ( Int irow = 0 ; irow < nrow ; irow++ ) { … … 679 677 cycle++ ; 680 678 } 681 679 682 680 //time1 = gettimeofday_sec() ; 683 681 //os_ << "end 5th iteration: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; … … 1623 1621 { 1624 1622 //double startSec = gettimeofday_sec() ; 1625 //os_ << "start M Filler::reshapeSpectraAndFlagtra() startSec=" << startSec << LogIO::POST ;1623 //os_ << "start MSFiller::reshapeSpectraAndFlagtra() startSec=" << startSec << LogIO::POST ; 1626 1624 if ( isFloatData_ ) { 1627 1625 ROArrayColumn<Bool> mFlagCol( tab, "FLAG" ) ; … … 1646 1644 IPosition inc( 3, 2, 1, 1 ) ; 1647 1645 sp = tmp( start, end, inc ) ; 1648 // sp = tmp( Slice( 0, npol, 2 ),1649 // Slice( 0, nchan, 1 ),1650 // Slice( 0, nrow, 1 ) ) ;1651 //sp = real( mDataCol.getColumn() ) ;1652 1646 fl = mFlagCol.getColumn() ; 1653 1647 } … … 1663 1657 || corrtype[ipol] == Stokes::RL || corrtype[ipol] == Stokes::LR ) { 1664 1658 if ( !crossOK ) { 1665 spxy.row( ipol ) = real( mSp.row( ipol ) ) ; 1659 Vector<Float> tmp = ComplexToReal( mSp.row( ipol ) ) ; 1660 IPosition start( 1, 0 ) ; 1661 IPosition end( 1, 2*nchan-1 ) ; 1662 IPosition inc( 1, 2 ) ; 1663 spxy.row( ipol ) = tmp( start, end, inc ) ; 1666 1664 flxy.row( ipol ) = mFl.row( ipol ) ; 1667 if ( corrtype[ipol] == Stokes::XY || corrtype[ipol] == Stokes::RL ) { 1668 spxy.row( ipol+1 ) = imag( mSp.row( ipol ) ) ; 1669 flxy.row( ipol+1 ) = mFl.row( ipol ) ; 1670 } 1671 else { 1672 spxy.row( ipol+1 ) = imag( conj( mSp.row( ipol ) ) ) ; 1673 flxy.row( ipol+1 ) = mFl.row( ipol ) ; 1665 start = IPosition( 1, 1 ) ; 1666 spxy.row( ipol+1 ) = tmp( start, end, inc ) ; 1667 flxy.row( ipol+1 ) = mFl.row( ipol ) ; 1668 if ( corrtype[ipol] == Stokes::YX || corrtype[ipol] == Stokes::LR ) { 1669 spxy.row( ipol+1 ) = spxy.row( ipol+1 ) * (Float)-1.0 ; 1674 1670 } 1675 1671 crossOK = True ; … … 1677 1673 } 1678 1674 else { 1679 spxy.row( ipol ) = real( mSp.row( ipol ) ) ; 1675 Vector<Float> tmp = ComplexToReal( mSp.row( ipol ) ) ; 1676 IPosition start( 1, 0 ) ; 1677 IPosition end( 1, 2*nchan-1 ) ; 1678 IPosition inc( 1, 2 ) ; 1679 spxy.row( ipol ) = tmp( start, end, inc ) ; 1680 1680 flxy.row( ipol ) = mFl.row( ipol ) ; 1681 1681 } … … 1698 1698 { 1699 1699 //double startSec = gettimeofday_sec() ; 1700 //os_ << "start M Filler::getDirection2() startSec=" << startSec << LogIO::POST ;1700 //os_ << "start MSFiller::getDirection2() startSec=" << startSec << LogIO::POST ; 1701 1701 String refString ; 1702 1702 MDirection::Types dirType ; 1703 //uInt diridx = getDirection( idx, dir, srate, refString, ptab, t.get("s").getValue() ) ;1704 1703 uInt diridx = getDirection( idx, dir, srate, refString, ptcol, pdcol, t.get("s").getValue() ) ; 1705 1704 MDirection::getType( dirType, refString ) ; … … 1720 1719 dir = toj2000( dir ).getAngle("rad").getValue() ; 1721 1720 } 1722 if ( srate.size() == 0 ) 1723 srate = Vector<Double>( 2, 0.0 ) ; 1721 if ( srate.size() == 0 ) { 1722 srate.resize( 2 ) ; 1723 srate = 0.0 ; 1724 } 1724 1725 //double endSec = gettimeofday_sec() ; 1725 1726 //os_ << "end MSFiller::getDirection2() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; … … 1735 1736 { 1736 1737 //double startSec = gettimeofday_sec() ; 1737 //os_ << "start M Filler::getSourceDirection() startSec=" << startSec << LogIO::POST ;1738 //os_ << "start MSFiller::getSourceDirection() startSec=" << startSec << LogIO::POST ; 1738 1739 Vector<Double> defaultScanrate( 2, 0.0 ) ; 1739 1740 Vector<Double> defaultDir = srcdir[0].getAngle( "rad" ).getValue() ; … … 1859 1860 { 1860 1861 //double startSec = gettimeofday_sec() ; 1861 //os_ << "start M Filler::sourceInfo() startSec=" << startSec << LogIO::POST ;1862 //os_ << "start MSFiller::sourceInfo() startSec=" << startSec << LogIO::POST ; 1862 1863 1863 1864 MSSource srctab = mstable_.source() ; … … 1930 1931 { 1931 1932 //double startSec = gettimeofday_sec() ; 1932 //os_ << "start M Filler::spectralSetup() startSec=" << startSec << LogIO::POST ;1933 //os_ << "start MSFiller::spectralSetup() startSec=" << startSec << LogIO::POST ; 1933 1934 1934 1935 MSSpectralWindow spwtab = mstable_.spectralWindow() ;
Note:
See TracChangeset
for help on using the changeset viewer.