Changeset 1616 for branches/alma/src/STFiller.cpp
- Timestamp:
- 08/07/09 15:49:27 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/STFiller.cpp
r1603 r1616 35 35 #include <casa/System/ProgressMeter.h> 36 36 #include <atnf/PKSIO/NROReader.h> 37 #include <casa/Logging/LogIO.h> 37 38 38 39 #include <time.h> … … 470 471 time( &t0 ) ; 471 472 tm *ttm = localtime( &t0 ) ; 472 473 cout << "STFiller::openNRO() Start time = " << t0 474 << " (" 475 << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 476 << " " 477 << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 478 << ")" << endl ; 473 LogIO os( LogOrigin( "STFiller", "openNRO()", WHERE ) ) ; 474 // cout << "STFiller::openNRO() Start time = " << t0 475 // << " (" 476 // << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 477 // << " " 478 // << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 479 // << ")" << endl ; 480 os << "Start time = " << t0 481 << " (" 482 << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 483 << " " 484 << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 485 << ")" << LogIO::POST ; 479 486 480 487 // fill STHeader … … 498 505 header_->epoch, 499 506 header_->poltype ) ) { 500 cout << "STFiller::openNRO() Failed to get header information." << endl ; 501 return ; 507 // cout << "STFiller::openNRO() Failed to get header information." << endl ; 508 // return ; 509 throw( AipsError("Failed to get header information.") ) ; 502 510 } 503 511 … … 526 534 } 527 535 528 // DEBUG529 //cout << "STFiller::openNRO() nIF " << endl ;530 //531 532 536 beamOffset_ = 0; 533 537 vector<Bool> beams = nreader_->getBeams() ; … … 549 553 } 550 554 551 // DEBUG552 //cout << "STFiller::openNRO() nBeam " << endl ;553 //554 555 555 header_->nbeam = nBeam_ ; 556 556 header_->nif = nIF_ ; … … 558 558 // set header 559 559 table_->setHeader( *header_ ) ; 560 561 // DEBUG562 //cout << "STFiller::openNRO() Velocity Definition = " << nheader->getVDEF() << endl ;563 560 564 561 // DEBUG … … 566 563 time( &t1 ) ; 567 564 ttm = localtime( &t1 ) ; 568 cout << "STFiller::openNRO() End time = " << t1 569 << " (" 570 << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 571 << " " 572 << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 573 << ")" << endl ; 574 cout << "STFiller::openNRO() Elapsed time = " << t1 - t0 << " sec" << endl ; 565 // cout << "STFiller::openNRO() End time = " << t1 566 // << " (" 567 // << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 568 // << " " 569 // << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 570 // << ")" << endl ; 571 // cout << "STFiller::openNRO() Elapsed time = " << t1 - t0 << " sec" << endl ; 572 os << "End time = " << t1 573 << " (" 574 << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 575 << " " 576 << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 577 << ")" << endl ; 578 os << "Elapsed time = " << t1 - t0 << " sec" << endl ; 579 os.post() ; 575 580 // 576 581 … … 584 589 time( &t0 ) ; 585 590 tm *ttm = localtime( &t0 ) ; 586 cout << "STFiller::readNRO() Start time = " << t0 587 << " (" 588 << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 589 << " " 590 << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 591 << ")" << endl ; 591 LogIO os( LogOrigin( "STFiller", "readNRO()", WHERE ) ) ; 592 // cout << "STFiller::readNRO() Start time = " << t0 593 // << " (" 594 // << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 595 // << " " 596 // << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 597 // << ")" << endl ; 598 os << "Start time = " << t0 599 << " (" 600 << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 601 << " " 602 << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 603 << ")" << LogIO::POST ; 592 604 // 593 605 … … 630 642 Array<Double> scanrate ; 631 643 for ( i = 0 ; i < imax ; i++ ) { 632 // if( nreader_->getDataset()->getRecord( i ) == NULL ) {633 // cerr << "STFiller::readNRO() error while reading row " << i << endl ;634 // return -1 ;635 // }636 637 644 string scanType = nreader_->getScanType( i ) ; 638 645 Int srcType = -1 ; 639 646 if ( scanType.compare( 0, 2, "ON") == 0 ) { 640 // cout << "ON srcType: " << i << endl;647 // os << "ON srcType: " << i << LogIO::POST ; 641 648 srcType = 0 ; 642 649 } 643 650 else if ( scanType.compare( 0, 3, "OFF" ) == 0 ) { 644 // cout << "OFF srcType: " << i << endl;651 //os << "OFF srcType: " << i << LogIO::POST ; 645 652 srcType = 1 ; 646 653 } 647 654 else if ( scanType.compare( 0, 4, "ZERO" ) == 0 ) { 648 // cout << "ZERO srcType: " << i << endl;655 //os << "ZERO srcType: " << i << LogIO::POST ; 649 656 srcType = 2 ; 650 657 } 651 658 else { 652 // cout << "Undefined srcType: " << i << endl;659 //os << "Undefined srcType: " << i << LogIO::POST ; 653 660 srcType = 3 ; 654 661 } … … 691 698 srcdir, 692 699 scanrate ) ) { 693 cerr << "STFiller::readNRO() Failed to get scan information." << endl ; 694 return 1 ; 700 // cerr << "STFiller::readNRO() Failed to get scan information." << endl ; 701 // return 1 ; 702 throw( AipsError("Failed to get scan information.") ) ; 695 703 } 696 704 … … 716 724 int iadd = -1 ; 717 725 for ( uInt iif = 0 ; iif < freqs.size() ; iif++ ) { 718 // cout << "STFiller::readNRO() freqs[" << iif << "][1] = " << freqs[iif][1] << endl;726 //os << "freqs[" << iif << "][1] = " << freqs[iif][1] << LogIO::POST ; 719 727 double fdiff = abs( freqs[iif][1] - fqs[1] ) / freqs[iif][1] ; 720 // cout << "STFiller::readNRO() fdiff = " << fdiff << endl;728 //os << "fdiff = " << fdiff << LogIO::POST ; 721 729 if ( fdiff < 1.0e-8 ) { 722 730 iadd = iif ; … … 798 806 // DEBUG 799 807 //int rownum = nreader_->getRowNum() ; 800 // cout << "STFiller::readNRO() Finished row " << i << "/" << rownum << endl;808 //os << "Finished row " << i << "/" << rownum << LogIO::POST ; 801 809 // 802 810 } … … 806 814 time( &t1 ) ; 807 815 ttm = localtime( &t1 ) ; 808 cout << "STFiller::readNRO() Processed " << i << " rows" << endl ; 809 cout << "STFiller::readNRO() Added " << i - count << " rows (ignored " 810 << count << " \"ZERO\" scans)" << endl ; 811 cout << "STFiller::readNRO() End time = " << t1 812 << " (" 813 << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 814 << " " 815 << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 816 << ")" << endl ; 817 cout << "STFiller::readNRO() Elapsed time = " << t1 - t0 << " sec" << endl ; 816 // cout << "STFiller::readNRO() Processed " << i << " rows" << endl ; 817 // cout << "STFiller::readNRO() Added " << i - count << " rows (ignored " 818 // << count << " \"ZERO\" scans)" << endl ; 819 // cout << "STFiller::readNRO() End time = " << t1 820 // << " (" 821 // << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 822 // << " " 823 // << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 824 // << ")" << endl ; 825 // cout << "STFiller::readNRO() Elapsed time = " << t1 - t0 << " sec" << endl ; 826 os << "Processed " << i << " rows" << endl ; 827 os << "Added " << i - count << " rows (ignored " 828 << count << " \"ZERO\" scans)" << endl ; 829 os.post() ; 830 os << "End time = " << t1 831 << " (" 832 << ttm->tm_year + 1900 << "/" << ttm->tm_mon + 1 << "/" << ttm->tm_mday 833 << " " 834 << ttm->tm_hour << ":" << ttm->tm_min << ":" << ttm->tm_sec 835 << ")" << endl ; 836 os << "Elapsed time = " << t1 - t0 << " sec" << endl ; 837 os.post() ; 818 838 // 819 839
Note: See TracChangeset
for help on using the changeset viewer.