Changeset 1519 for branches/alma/src
- Timestamp:
- 02/25/09 19:32:49 (16 years ago)
- Location:
- branches/alma/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/Makefile
r1455 r1519 7 7 ### 3. Replase library names in G2CARCH '-lcasa_*' with '-l*'. 8 8 ### 4. Comment-IN the definition of 'CXXOPTS'. 9 TARGET := /tmp/_asap.so 9 #TARGET := /tmp/_asap.so 10 TARGET := /home/nakazato/tmp/_asap.so 10 11 11 12 # the casa environment AIPSPATH has to be defined … … 25 26 CXXFLAGS += -ansi -Wno-long-long -Wall 26 27 #CXXOPTS := -DAIPS_NO_TEMPLATE_SRC 28 CXXOPTS := -DAIPS_64B 27 29 28 30 # darwin specific flags … … 56 58 -lcasa_lattices -lcasa_fits -lcasa_measures -lcasa_measures_f \ 57 59 -lcasa_tables -lcasa_scimath -lcasa_scimath_f -lcasa_casa \ 58 $(CASALIB)/libwcs.a\60 /usr/lib64/libwcs.so \ 59 61 $(RPFITSLIB) $(CFITSIOLIB) $(G2CLIB) -lstdc++ 60 62 -
branches/alma/src/STFiller.cpp
r1518 r1519 480 480 } 481 481 482 // DEBUG 483 //cout << "STFiller::openNRO() getHeaderInfo " << endl ; 484 // 485 482 486 ifOffset_ = 0; 483 487 vector<Bool> ifs = nreader_->getIFs() ; … … 499 503 } 500 504 505 // DEBUG 506 //cout << "STFiller::openNRO() nIF " << endl ; 507 // 508 501 509 beamOffset_ = 0; 502 510 vector<Bool> beams = nreader_->getBeams() ; … … 518 526 } 519 527 528 // DEBUG 529 //cout << "STFiller::openNRO() nBeam " << endl ; 530 // 531 520 532 header_->nbeam = nBeam_ ; 521 533 header_->nif = nIF_ ; … … 557 569 // 558 570 559 // get header560 NROHeader *h = nreader_->getHeader() ;561 562 571 // fill row 563 572 uInt id ; … … 566 575 uInt i = 0 ; 567 576 int count = 0 ; 577 uInt scanno ; 578 uInt cycleno ; 579 uInt beamno ; 580 uInt polno ; 581 vector<double> fqs ; 582 Vector<Double> restfreq ; 583 uInt refbeamno ; 584 Double scantime ; 585 Double interval ; 586 String srcname ; 587 String fieldname ; 588 Array<Float> spectra ; 589 Array<uChar> flagtra ; 590 Array<Float> tsys ; 591 Array<Double> direction ; 592 Float azimuth ; 593 Float elevation ; 594 Float parangle ; 595 Float opacity ; 596 uInt tcalid ; 597 Int fitid ; 598 uInt focusid ; 599 Float temperature ; 600 Float pressure ; 601 Float humidity ; 602 Float windvel ; 603 Float winddir ; 604 Double srcvel ; 605 Array<Double> propermotion ; 606 Vector<Double> srcdir ; 607 Array<Double> scanrate ; 568 608 for ( i = 0 ; i < imax ; i++ ) { 569 609 if( nreader_->getData( i ) != 0 ) { … … 571 611 return -1 ; 572 612 } 573 NRODataset *d = nreader_->getData() ; 574 575 char *scanType = d->SCANTP ; 613 614 string scanType = nreader_->getScanType( i ) ; 576 615 Int srcType = -1 ; 577 if ( s trncmp( scanType, "ON", 2) == 0 ) {616 if ( scanType.compare( 0, 2, "ON") == 0 ) { 578 617 srcType = 0 ; 579 618 } 580 else if ( s trncmp( scanType, "OFF", 3) == 0 ) {619 else if ( scanType.compare( 0, 3, "OFF" ) == 0 ) { 581 620 //cout << "OFF srcType: " << i << endl ; 582 621 srcType = 1 ; 583 622 } 584 else if ( s trncmp( scanType, "ZERO", 4) == 0 ) {623 else if ( scanType.compare( 0, 4, "ZERO" ) == 0 ) { 585 624 //cout << "ZERO srcType: " << i << endl ; 586 625 srcType = 2 ; … … 596 635 TableRecord& rec = row.record(); 597 636 598 RecordFieldPtr<Int> srctCol(rec, "SRCTYPE") ; 599 *srctCol = srcType ; 600 RecordFieldPtr<Array<Double> > srateCol(rec, "SCANRATE"); 601 Array<Double> srcarr( IPosition( 1, 2 ) ) ; 602 srcarr = 0.0 ; 603 *srateCol = srcarr ; 604 RecordFieldPtr<Array<Double> > spmCol(rec, "SRCPROPERMOTION") ; 605 *spmCol = srcarr ; 606 RecordFieldPtr<Array<Double> > sdirCol(rec, "SRCDIRECTION") ; 607 *sdirCol = nreader_->getSourceDirection() ; 608 RecordFieldPtr<Double> svelCol(rec, "SRCVELOCITY") ; 609 *svelCol = h->getURVEL() ; // [m/s] 610 RecordFieldPtr<Int> fitCol(rec, "FIT_ID") ; 611 *fitCol = -1 ; 637 if ( nreader_->getScanInfo( i, 638 scanno, 639 cycleno, 640 beamno, 641 polno, 642 fqs, 643 restfreq, 644 refbeamno, 645 scantime, 646 interval, 647 srcname, 648 fieldname, 649 spectra, 650 flagtra, 651 tsys, 652 direction, 653 azimuth, 654 elevation, 655 parangle, 656 opacity, 657 tcalid, 658 fitid, 659 focusid, 660 temperature, 661 pressure, 662 humidity, 663 windvel, 664 winddir, 665 srcvel, 666 propermotion, 667 srcdir, 668 scanrate ) ) { 669 cerr << "STFiller::readNRO() Failed to get scan information." << endl ; 670 return 1 ; 671 } 672 612 673 RecordFieldPtr<uInt> scannoCol( rec, "SCANNO" ) ; 613 //*scannoCol = (uInt)(d->getISCAN()) ; 614 *scannoCol = (uInt)(d->ISCAN) ; 615 RecordFieldPtr<uInt> cyclenoCol(rec, "CYCLENO"); 616 RecordFieldPtr<Double> mjdCol( rec, "TIME" ) ; 617 *mjdCol = Double( nreader_->getStartIntTime( i ) ) ; 618 RecordFieldPtr<Double> intervalCol( rec, "INTERVAL" ) ; 619 *intervalCol = Double( h->getIPTIM() ) ; 620 RecordFieldPtr<String> srcnCol(rec, "SRCNAME") ; 621 *srcnCol = String( h->getOBJ() ) ; 622 RecordFieldPtr<String> fieldnCol(rec, "FIELDNAME"); 623 *fieldnCol = String( h->getOBJ() ) ; 624 // BEAMNO is 0-base 674 *scannoCol = scanno ; 675 RecordFieldPtr<uInt> cyclenoCol(rec, "CYCLENO") ; 676 *cyclenoCol = cycleno ; 625 677 RecordFieldPtr<uInt> beamCol(rec, "BEAMNO") ; 626 string arryt = string( d->ARRYT ) ; 627 string sbeamno = arryt.substr( 1, arryt.size()-1 ) ; 628 uInt ibeamno = atoi( sbeamno.c_str() ) ; 629 *beamCol = ibeamno - 1 ; 630 RecordFieldPtr<Int> rbCol(rec, "REFBEAMNO") ; 678 *beamCol = beamno ; 631 679 RecordFieldPtr<uInt> ifCol(rec, "IFNO") ; 680 RecordFieldPtr< uInt > polnoCol(rec, "POLNO") ; 681 *polnoCol = polno ; 632 682 RecordFieldPtr<uInt> mfreqidCol(rec, "FREQ_ID") ; 633 vector<double> fqs = nreader_->getFrequencies( i ) ;634 //cout << "STFiller::readNRO() fqs[1] = " << fqs[1] << endl ;635 683 if ( freqs.size() == 0 ) { 636 684 id = table_->frequencies().addEntry( Double( fqs[0] ), … … 666 714 } 667 715 RecordFieldPtr<uInt> molidCol(rec, "MOLECULE_ID") ; 668 Vector<Double> restfreq( IPosition( 1, 1 ) ) ;669 restfreq( 0 ) = d->FREQ0 ;670 716 id = table_->molecules().addEntry( restfreq ) ; 671 717 *molidCol = id ; 718 RecordFieldPtr<Int> rbCol(rec, "REFBEAMNO") ; 719 *rbCol = refbeamno ; 720 RecordFieldPtr<Double> mjdCol( rec, "TIME" ) ; 721 *mjdCol = scantime ; 722 RecordFieldPtr<Double> intervalCol( rec, "INTERVAL" ) ; 723 *intervalCol = interval ; 724 RecordFieldPtr<String> srcnCol(rec, "SRCNAME") ; 725 *srcnCol = srcname ; 726 RecordFieldPtr<Int> srctCol(rec, "SRCTYPE") ; 727 *srctCol = srcType ; 728 RecordFieldPtr<String> fieldnCol(rec, "FIELDNAME"); 729 *fieldnCol = fieldname ; 730 RecordFieldPtr< Array<Float> > specCol(rec, "SPECTRA") ; 731 *specCol = spectra ; 732 RecordFieldPtr< Array<uChar> > flagCol(rec, "FLAGTRA") ; 733 *flagCol = flagtra ; 734 RecordFieldPtr< Array<Float> > tsysCol(rec, "TSYS") ; 735 *tsysCol = tsys ; 736 RecordFieldPtr< Array<Double> > dirCol(rec, "DIRECTION") ; 737 *dirCol = direction ; 738 RecordFieldPtr<Float> azCol(rec, "AZIMUTH") ; 739 *azCol = azimuth ; 740 RecordFieldPtr<Float> elCol(rec, "ELEVATION") ; 741 *elCol = elevation ; 742 RecordFieldPtr<Float> parCol(rec, "PARANGLE") ; 743 *parCol = parangle ; 744 RecordFieldPtr<Float> tauCol(rec, "OPACITY") ; 745 *tauCol = opacity ; 672 746 RecordFieldPtr<uInt> mcalidCol(rec, "TCAL_ID") ; 673 // 674 // No Tcal information in the data 675 // 676 // 2008/11/20 Takeshi Nakazato 677 // 678 *mcalidCol = 0 ; 747 *mcalidCol = tcalid ; 748 RecordFieldPtr<Int> fitCol(rec, "FIT_ID") ; 749 *fitCol = fitid ; 750 RecordFieldPtr<uInt> mfocusidCol(rec, "FOCUS_ID") ; 751 *mfocusidCol = focusid ; 679 752 RecordFieldPtr<uInt> mweatheridCol(rec, "WEATHER_ID") ; 680 681 id = table_->weather().addEntry( Float( d->TEMP ), 682 Float( d->PATM ), 683 Float( d->PH2O ), 684 Float( d->VWIND ), 685 Float( d->DWIND ) ) ; 686 753 id = table_->weather().addEntry( temperature, 754 pressure, 755 humidity, 756 windvel, 757 winddir ) ; 687 758 *mweatheridCol = id ; 688 RecordFieldPtr<uInt> mfocusidCol(rec, "FOCUS_ID") ; 689 RecordFieldPtr< Array<Double> > dirCol(rec, "DIRECTION") ; 690 *dirCol = nreader_->getDirection( i ) ; 691 RecordFieldPtr<Float> azCol(rec, "AZIMUTH") ; 692 *azCol = d->RAZ ; 693 RecordFieldPtr<Float> elCol(rec, "ELEVATION") ; 694 *elCol = d->REL ; 695 RecordFieldPtr<Float> parCol(rec, "PARANGLE") ; 696 RecordFieldPtr< Array<Float> > specCol(rec, "SPECTRA") ; 697 vector<double> spec = nreader_->getSpectrum( i ) ; 698 Array<Float> sp( IPosition( 1, spec.size() ) ) ; 699 int index = 0 ; 700 for ( Array<Float>::iterator itr = sp.begin() ; itr != sp.end() ; itr++ ) { 701 *itr = spec[index++] ; 702 } 703 *specCol = sp ; 704 RecordFieldPtr< Array<uChar> > flagCol(rec, "FLAGTRA") ; 705 Array<uChar> flag( sp.shape() ) ; 706 flag.set( 0 ) ; 707 *flagCol = flag ; 708 RecordFieldPtr< uInt > polnoCol(rec, "POLNO") ; 709 *polnoCol = 0 ; 710 RecordFieldPtr< Array<Float> > tsysCol(rec, "TSYS") ; 711 Array<Float> tsys( IPosition( 1, 1 ), d->TSYS ) ; 712 *tsysCol = tsys ; 759 RecordFieldPtr<Double> svelCol(rec, "SRCVELOCITY") ; 760 *svelCol = srcvel ; 761 RecordFieldPtr<Array<Double> > spmCol(rec, "SRCPROPERMOTION") ; 762 *spmCol = propermotion ; 763 RecordFieldPtr<Array<Double> > sdirCol(rec, "SRCDIRECTION") ; 764 *sdirCol = srcdir ; 765 RecordFieldPtr<Array<Double> > srateCol(rec, "SCANRATE"); 766 *srateCol = scanrate ; 713 767 714 768 table_->table().addRow() ;
Note:
See TracChangeset
for help on using the changeset viewer.