Changeset 2262 for branches/parallel/external-alma
- Timestamp:
- 08/04/11 12:58:21 (13 years ago)
- Location:
- branches/parallel
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/parallel
- Property svn:mergeinfo changed
/trunk merged: 2154,2156,2198-2203,2212,2261
- Property svn:mergeinfo changed
-
branches/parallel/external-alma
- Property svn:mergeinfo changed
/trunk/external-alma merged: 2154,2156,2198,2200-2203,2212,2261
- Property svn:mergeinfo changed
-
branches/parallel/external-alma/atnf/PKSIO/ASTEReader.cc
r1868 r2262 118 118 } 119 119 120 Int ASTEReader::getNumIF() 121 { 122 vector<Bool> v ; 123 vector<int> arry = dataset_->getARRY() ; 124 for ( uInt i = 0 ; i < arry.size() ; i++ ) { 125 if ( arry[i] != 0 ) { 126 v.push_back( True ) ; 127 } 128 } 129 Int nif = v.size() ; 130 return nif ; 131 } 132 133 Int ASTEReader::getNumBeam() 134 { 135 // ASTE doesn't have array receiver so far 136 return 1 ; 137 } -
branches/parallel/external-alma/atnf/PKSIO/ASTEReader.h
r1757 r2262 81 81 virtual int read() ; 82 82 83 // get number of IF 84 virtual Int getNumIF() ; 85 86 // get number of Beams 87 virtual Int getNumBeam() ; 88 83 89 protected: 84 90 // Get Antenna Position in ITRF coordinate -
branches/parallel/external-alma/atnf/PKSIO/NRO45Reader.cc
r1868 r2262 124 124 } 125 125 126 Int NRO45Reader::getNumIF() 127 { 128 Int nif = 1 ; 129 if ( (dataset_->getRX()[0]).find("MULT2-") == string::npos ) { 130 vector<Bool> v ; 131 vector<int> arry = dataset_->getARRY() ; 132 for ( uInt i = 0 ; i < arry.size() ; i++ ) { 133 if ( arry[i] != 0 ) { 134 v.push_back( True ) ; 135 } 136 } 137 nif = v.size() ; 138 } 139 return nif ; 140 } 141 142 Int NRO45Reader::getNumBeam() 143 { 144 Int nbeam = 25 ; 145 if ( (dataset_->getRX()[0]).find("MULT2-") == string::npos ) { 146 nbeam = 1 ; 147 } 148 return nbeam ; 149 } -
branches/parallel/external-alma/atnf/PKSIO/NRO45Reader.h
r1757 r2262 83 83 virtual int read() ; 84 84 85 // get number of IF 86 virtual Int getNumIF() ; 87 88 // get number of Beams 89 virtual Int getNumBeam() ; 90 85 91 protected: 86 92 // Get Antenna Position in ITRF coordinate -
branches/parallel/external-alma/atnf/PKSIO/NRODataset.cc
r2031 r2262 83 83 } 84 84 same_ = -1 ; 85 86 // Record for frequency setting 87 frec_ = Record() ; 85 88 } 86 89 … … 602 605 } 603 606 607 double NRODataset::getScanTime( int i ) 608 { 609 double startTime = getStartIntTime( i ) ; 610 double interval = getIPTIM() / 86400.0 ; // [sec]->[day] 611 return startTime+0.5*interval ; 612 } 613 604 614 vector<bool> NRODataset::getIFs() 605 615 { … … 657 667 NRODataRecord *record = getRecord( i ) ; 658 668 string arryt = string( record->ARRYT ) ; 659 //string sbeamno = arryt.substr( 1, arryt.size()-1 ) ;660 //uInt ib = atoi( sbeamno.c_str() ) - 1 ;661 669 uInt ib = getArrayId( arryt ) ; 662 663 int ia = -1 ; 670 string rxname = getRX()[0] ; 671 string key = arryt ; 672 if ( rxname.find("MULT2") != string::npos ) 673 key = "BEARS" ; 674 675 if ( frec_.isDefined( key ) ) { 676 // frequency for the array is already calculated 677 Vector<Double> f = frec_.asArrayDouble( key ) ; 678 Double *f_p = f.data() ; 679 for ( int i = 0 ; i < 3 ; i++ ) 680 v[i] = (double)(f_p[i]) ; 681 return v ; 682 } 683 684 //int ia = -1 ; 664 685 bool isAOS = false ; 665 686 //cout << "NRODataset::getFrequencies() record->ARRYT=" << record->ARRYT << endl ; 666 687 //cout << "NRODataset::getFrequencies() ib = " << ib << endl ; 667 688 668 if ( strncmp( record->ARRYT, "X", 1 ) == 0 ) { 669 // FX 670 if ( strncmp( (record->ARRYT)+1, "1", 1 ) == 0 671 || strncmp( (record->ARRYT)+1, "3", 1 ) ) { 672 // FX1, 3 673 ia = 2 ; 674 } 675 else { 676 // FX2, 4 677 ia = 1 ; 678 } 679 } 680 else if ( strncmp( record->ARRYT, "A", 1 ) == 0 ) 681 ia = 2 ; // AC 682 else if ( strncmp( record->ARRYT, "W", 1 ) == 0 ) { 683 // AOS-W 684 ia = 2 ; 689 if ( arryt[0] == 'W' || arryt[0] == 'U' || arryt[0] == 'H' ) 685 690 isAOS = true ; 686 } 687 else if ( strncmp( record->ARRYT, "U", 1 ) == 0 ) { 688 // AOS-U 689 ia = 2 ; 690 isAOS = true ; 691 } 692 else if ( strncmp( record->ARRYT, "H", 1 ) == 0 ) { 693 // AOS-H 694 isAOS = true ; 695 //cout << record->ARRYT << " " << strlen(record->ARRYT) << endl ; 696 //cout << (record->ARRYT)+1 << endl ; 697 if ( strncmp( (record->ARRYT)+2, " ", 1 ) == 0 ) { 698 // H1-9 699 if ( strncmp( (record->ARRYT)+1, "9", 1 ) == 0 ) { 700 // H9 701 ia = 2 ; 702 } 703 else { 704 // H1-8 705 ia = 1 ; 706 } 707 } 708 else { 709 // H10-16 710 ia = 2 ; 711 } 712 } 713 714 int iu ; 691 692 Bool isUSB ; 715 693 if ( record->FQIF1 > 0 ) 716 i u = 1; // USB694 isUSB = True ; // USB 717 695 else 718 i u = 2; // LSB696 isUSB = False ; // LSB 719 697 720 698 int ivdef = -1 ; 721 //if ( strncmp( (dataset_->getVDEF()).c_str(), "RAD", 3 ) == 0 )722 699 if ( (getVDEF()).compare( 0, 3, "RAD" ) == 0 ) 723 700 ivdef = 0 ; 724 //else if ( strncmp( dataset_->getVDEF(), "OPT", 3 ) == 0 )725 701 else if ( (getVDEF()).compare( 0, 3, "OPT" ) == 0 ) 726 702 ivdef = 1 ; … … 734 710 735 711 int ncal = getNFCAL()[ib] ; 736 vector<double> freqs( ncal ) ;737 712 double cw = 0.0 ; 738 713 vector<double> fqcal = getFQCAL()[ib] ; 739 714 vector<double> chcal = getCHCAL()[ib] ; 740 715 double f0cal = getF0CAL()[ib] ; 716 Vector<Double> freqs( ncal, fq0-f0cal ) ; 717 718 double factor = vel / cvel ; 719 if ( ivdef == 0 ) 720 factor = 1.0 / ( 1.0 - factor ) ; 741 721 for ( int ii = 0 ; ii < ncal ; ii++ ) { 742 freqs[ii] = fqcal[ii] ; 743 freqs[ii] -= getF0CAL()[ib] ; 744 if ( ia == 1 ) { 745 if ( iu == 1 ) { 746 freqs[ii] = fq0 + freqs[ii] ; 747 } 748 else if ( iu == 2 ) { 749 freqs[ii] = fq0 - freqs[ii] ; 750 } 751 } 752 else if ( ia == 2 ) { 753 if ( iu == 1 ) { 754 freqs[ii] = fq0 - freqs[ii] ; 755 } 756 else if ( iu == 2 ) { 757 freqs[ii] = fq0 + freqs[ii] ; 758 } 759 } 760 // if ( ivdef == 0 ) { 761 // double factor = 1.0 / ( 1.0 - vel / cvel ) ; 762 // freqs[ii] = freqs[ii] * factor - record->FQTRK * ( factor - 1.0 ) ; 763 // } 764 // else if ( ivdef == 1 ) { 765 // double factor = vel / cvel ; 766 // freqs[ii] = freqs[ii] * ( 1.0 + factor ) - record->FQTRK * factor ; 767 // } 722 freqs[ii] += fqcal[ii] ; 723 if ( ivdef == 0 ) { 724 freqs[ii] = freqs[ii] * factor + record->FQTRK * ( 1.0 - factor ) ; 725 } 726 else if ( ivdef == 1 ) { 727 freqs[ii] = freqs[ii] * ( 1.0 + factor ) - record->FQTRK * factor ; 728 } 729 730 //ofstream ofs("freqs.txt",ios::out|ios::app) ; 731 //ofs << setprecision(16) ; 732 //ofs << i << " " << record->ARRYT << " " << chcal[ii] << " " << freqs[ii] << " " << record->ISCAN << " " << fqcal[ii] << " " << f0cal << " " << record->FQTRK << " " << vel << endl ; 733 //ofs.close() ; 734 768 735 } 769 736 … … 790 757 } 791 758 else { 792 cw = getBERES()[ib] ; 759 760 cw = ( freqs[1] - freqs[0] ) 761 / ( chcal[1] - chcal[0] ) ; 762 763 if ( isUSB ) { 764 // channel frequency inversion 765 cw *= -1.0 ; 766 Double tmp = freqs[1] ; 767 freqs[1] = freqs[0] ; 768 freqs[0] = tmp ; 769 } 793 770 794 if ( iu == 2 )795 cw *= -1.0 ;796 797 if ( cw == 0.0 ) {798 cw = ( freqs[1] - freqs[0] )799 / ( chcal[1] - chcal[0] ) ;800 // if ( cw < 0.0 )801 // cw = - cw ;802 }803 771 v[0] = chcal[0] - 1 ; // 0-base 804 772 v[1] = freqs[0] ; … … 806 774 } 807 775 808 // conversion from TOPO to LSRK 809 v[1] = toLSR( v[1], getStartIntTime( i ), record_->SCX, record_->SCY ) ; 810 811 if ( refFreq_[ib] != 0.0 ) { 812 v[1] = refFreq_[ib] ; 813 } 814 else { 776 if ( refFreq_[ib] == 0.0 ) 815 777 refFreq_[ib] = v[1] ; 816 } 778 779 // register frequency setting to Record 780 Vector<Double> f( v ) ; 781 frec_.define( key, f ) ; 817 782 818 783 return v ; -
branches/parallel/external-alma/atnf/PKSIO/NRODataset.h
r1868 r2262 41 41 //#include <casa/aips.h> 42 42 #include <casa/Logging/LogIO.h> 43 #include <casa/Containers/Record.h> 43 44 #include <atnf/PKSIO/NRODataRecord.h> 44 45 #include <casa/namespace.h> … … 194 195 virtual vector<double> getStartIntTime() ; 195 196 virtual double getStartIntTime( int i ) ; 197 virtual double getScanTime( int i ) ; 196 198 virtual double getMJD( char *time ) ; 197 199 virtual vector<bool> getIFs() ; … … 512 514 // reference frequency for each array 513 515 vector<double> refFreq_ ; 516 517 // record to store REFPIX, REFVAL, INCREMENT pair for each array 518 Record frec_ ; 514 519 } ; 515 520 -
branches/parallel/external-alma/atnf/PKSIO/NROFITSDataset.cc
r1869 r2262 622 622 // for ( int i = 0 ; i < ARYNM ; i++ ) { 623 623 // if ( i == 0 ) { 624 // //cout << "RX " ;624 // cout << "RX " ; 625 625 // } 626 626 // else if ( ( i % 5 ) == 0 ) { 627 // //cout << endl << " " ;628 // } 629 // //cout << "\'" << RX[i] << "\' " ;627 // cout << endl << " " ; 628 // } 629 // cout << "\'" << RX[i] << "\' " ; 630 630 // } 631 // //cout << endl ;631 // cout << endl ; 632 632 // 633 633 if ( readColumn( HPBW, "HPBW", sameEndian ) != 0 ) { … … 2734 2734 } 2735 2735 2736 double NROFITSDataset::getScanTime( int i ) 2737 { 2738 double startTime = getStartIntTime( i ) ; 2739 double interval = getIPTIM() ; 2740 interval /= 86400.0 ; 2741 return startTime+0.5*interval ; 2742 } 2743 2736 2744 // double NROFITSDataset::toLSR( double v, double t, double x, double y ) 2737 2745 // { -
branches/parallel/external-alma/atnf/PKSIO/NROFITSDataset.h
r1868 r2262 96 96 virtual uInt getArrayId( string type ) ; 97 97 virtual double getStartIntTime( int i ) ; 98 virtual double getScanTime( int i ) ; 98 99 99 100 protected: -
branches/parallel/external-alma/atnf/PKSIO/NROReader.cc
r1868 r2262 39 39 #include <atnf/PKSIO/ASTEDataset.h> 40 40 41 #include <measures/Measures/MEpoch.h> 42 #include <measures/Measures/MPosition.h> 41 43 #include <measures/Measures/MDirection.h> 42 44 #include <measures/Measures/MCDirection.h> 45 #include <measures/Measures/MeasFrame.h> 43 46 #include <measures/Measures/MeasConvert.h> 44 47 … … 314 317 //<< srcra << "," << srcdec << ") B1950 to (" 315 318 //<< v( 0 ) << ","<< v( 1 ) << ") J2000" << endl ; 316 os << LogIO::NORMAL << "SRCDIRECTION convert from ("317 << srcra << "," << srcdec << ") B1950 to ("318 << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;319 //os << LogIO::NORMAL << "SRCDIRECTION convert from (" 320 // << srcra << "," << srcdec << ") B1950 to (" 321 // << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ; 319 322 } 320 323 else if ( strncmp( epoch, "J2000", 5 ) == 0 ) { … … 353 356 //<< dirx << "," << diry << ") LB to (" 354 357 //<< v( 0 ) << ","<< v( 1 ) << ") RADEC" << endl ; 355 os << LogIO::NORMAL << "DIRECTION convert from ("356 << dirx << "," << diry << ") LB to ("357 << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;358 //os << LogIO::NORMAL << "DIRECTION convert from (" 359 // << dirx << "," << diry << ") LB to (" 360 // << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ; 358 361 } 359 362 else if ( icoord == 2 ) { 360 363 // convert from AZEL to RADEC 364 vector<double> antpos = getAntennaPosition() ; 365 Vector<Quantity> qantpos( 3 ) ; 366 for ( int ip = 0 ; ip < 3 ; ip++ ) 367 qantpos[ip] = Quantity( antpos[ip], "m" ) ; 368 Double scantime = Double( dataset_->getScanTime( i ) ) ; 369 MEpoch me( Quantity( scantime, "d" ), MEpoch::UTC ) ; 370 MPosition mp( MVPosition( qantpos ), MPosition::ITRF ) ; 371 MeasFrame mf( me, mp ) ; 361 372 MDirection result = 362 373 MDirection::Convert( MDirection( Quantity( dirx, "rad" ), 363 374 Quantity( diry, "rad" ), 364 375 MDirection::Ref( MDirection::AZEL ) ), 365 MDirection::Ref( MDirection::J2000 ) ) () ;376 MDirection::Ref( MDirection::J2000, mf ) ) () ; 366 377 v = result.getAngle().getValue() ; 367 378 //cout << "NROReader::getDirection() DIRECTION convert from (" 368 379 //<< dirx << "," << diry << ") AZEL to (" 369 380 //<< v( 0 ) << ","<< v( 1 ) << ") RADEC" << endl ; 370 os << LogIO::NORMAL << "DIRECTION convert from ("371 << dirx << "," << diry << ") AZEL to ("372 << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;381 //os << LogIO::NORMAL << "DIRECTION convert from (" 382 // << dirx << "," << diry << ") AZEL to (" 383 // << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ; 373 384 } 374 385 else if ( icoord == 0 ) { … … 387 398 //<< dirx << "," << diry << ") B1950 to (" 388 399 //<< v( 0 ) << ","<< v( 1 ) << ") J2000" << endl ; 389 os << LogIO::NORMAL << "DIRECTION convert from ("390 << dirx << "," << diry << ") B1950 to ("391 << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;400 //os << LogIO::NORMAL << "DIRECTION convert from (" 401 // << dirx << "," << diry << ") B1950 to (" 402 // << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ; 392 403 } 393 404 else if ( strncmp( epoch, "J2000", 5 ) == 0 ) { … … 441 452 //cout << "antpos = " << antpos << endl ; 442 453 string eq = dataset_->getEPOCH() ; 443 if ( eq.compare( 0, 5, "B1950" ) == 0 ) 444 equinox = 1950.0 ; 445 else if ( eq.compare( 0, 5, "J2000" ) == 0 ) 446 equinox = 2000.0 ; 454 // if ( eq.compare( 0, 5, "B1950" ) == 0 ) 455 // equinox = 1950.0 ; 456 // else if ( eq.compare( 0, 5, "J2000" ) == 0 ) 457 // equinox = 2000.0 ; 458 // equinox is always 2000.0 459 equinox = 2000.0 ; 447 460 //cout << "equinox = " << equinox << endl ; 448 461 string vref = dataset_->getVREF() ; … … 456 469 } 457 470 //freqref = vref ; 458 freqref = "LSRK" ; 471 //freqref = "LSRK" ; 472 freqref = "REST" ; 459 473 //cout << "freqref = " << freqref << endl ; 460 474 NRODataRecord *record = dataset_->getRecord( 0 ) ; … … 483 497 //cout << "poltype = " << poltype << endl ; 484 498 485 vector<Bool> ifs = getIFs() ; 486 nif = ifs.size() ; 499 //vector<Bool> ifs = getIFs() ; 500 //nif = ifs.size() ; 501 nif = getNumIF() ; 487 502 //cout << "nif = " << nif << endl ; 488 503 489 vector<Bool> beams = getBeams() ; 490 nbeam = beams.size() ; 504 //vector<Bool> beams = getBeams() ; 505 //nbeam = beams.size() ; 506 nbeam = getNumBeam() ; 491 507 //cout << "nbeam = " << nbeam << endl ; 492 508 … … 505 521 uInt &scanno, 506 522 uInt &cycleno, 523 uInt &ifno, 507 524 uInt &beamno, 508 525 uInt &polno, … … 548 565 //cout << "cycleno = " << cycleno << endl ; 549 566 550 // beamno 551 string arryt = string( record->ARRYT ) ; 552 string sbeamno = arryt.substr( 1, arryt.size()-1 ) ; 553 uInt ibeamno = atoi( sbeamno.c_str() ) ; 554 beamno = ibeamno - 1 ; 567 // beamno and ifno 568 string rxname = dataset_->getRX()[0] ; 569 if ( rxname.find("MULT2") != string::npos ) { 570 string arryt = string( record->ARRYT ) ; 571 beamno = dataset_->getArrayId( arryt ) ; 572 ifno = 0 ; 573 } 574 else { 575 beamno = 0 ; 576 string arryt = string( record->ARRYT ) ; 577 ifno = dataset_->getArrayId( arryt ) ; 578 } 555 579 //cout << "beamno = " << beamno << endl ; 556 580 … … 575 599 576 600 // scantime 577 scantime = Double( dataset_->getStartIntTime( irow ) ) ; 601 //scantime = Double( dataset_->getStartIntTime( irow ) ) ; 602 scantime = Double( dataset_->getScanTime( irow ) ) ; 578 603 //cout << "scantime = " << scantime << endl ; 579 604 -
branches/parallel/external-alma/atnf/PKSIO/NROReader.h
r1757 r2262 129 129 uInt &scanno, 130 130 uInt &cycleno, 131 uInt &ifno, 131 132 uInt &beamno, 132 133 uInt &polno, … … 171 172 virtual vector<Bool> getIFs() ; 172 173 174 // Get Number of IFs 175 virtual Int getNumIF() = 0 ; 176 173 177 // Get Beam settings 174 178 virtual vector<Bool> getBeams() ; 179 180 // Get Number of Beams 181 virtual Int getNumBeam() = 0 ; 175 182 176 183 protected: -
branches/parallel/external-alma/atnf/pks/pks_maths.cc
- Property svn:mergeinfo changed (with no actual effect on merging)
Note:
See TracChangeset
for help on using the changeset viewer.