Changeset 1868 for trunk/external-alma
- Timestamp:
- 08/10/10 12:28:15 (14 years ago)
- Location:
- trunk/external-alma/atnf/PKSIO
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/atnf/PKSIO/ASTEDataset.cc
r1757 r1868 124 124 + sizeof( char ) * 116 // CDMY1 125 125 + sizeof( double ) * ASTE_ARYMAX ; // DSBFC 126 127 refFreq_.resize( ASTE_ARYMAX, 0.0 ) ; 126 128 } 127 129 -
trunk/external-alma/atnf/PKSIO/ASTEFXDataset.cc
r1757 r1868 124 124 + sizeof( char ) * 116 // CDMY1 125 125 + sizeof( double ) * ASTE_ARYMAX_FX ; // DSBFC 126 127 refFreq_.resize( ASTE_ARYMAX_FX, 0.0 ) ; 126 128 } 127 129 -
trunk/external-alma/atnf/PKSIO/ASTEReader.cc
r1757 r1868 88 88 // Ref.: Ezawa, H. et al. 2004, Proc. SPIE, 5489, 763 89 89 // 90 double elon = -67. - 42. / 60. - 11. / 3600. ; 91 double nlat = -22. - 58. / 60. - 18. / 3600. ; 92 double alti = 2400. ; 90 // double elon = -67. - 42. / 60. - 11. / 3600. ; 91 // double nlat = -22. - 58. / 60. - 18. / 3600. ; 92 // double alti = 2400. ; 93 double elon = -67.7031 ; 94 double nlat = -22.9717 ; 95 double alti = 4800.0 ; 93 96 94 97 // APEX value … … 101 104 Quantity( nlat, "deg" ) ), 102 105 MPosition::Ref( MPosition::WGS84 ) ) ; 106 103 107 MeasFrame frame( p ) ; 104 108 MVPosition mvp ; -
trunk/external-alma/atnf/PKSIO/MBFITSreader.cc
r1757 r1868 146 146 if (rpfitsin(jstat)) { 147 147 sprintf(cMsg, "Failed to open MBFITS file\n%s", rpname); 148 os << LogIO::SEVERE << cMsg << LogIO::POST ;148 //os << LogIO::SEVERE << cMsg << LogIO::POST ; 149 149 return 1; 150 150 } … … 165 165 sprintf(cMsg, "Failed to read MBFITS header in file\n" 166 166 "%s", rpname); 167 os << LogIO::SEVERE << cMsg << LogIO::POST ;167 //os << LogIO::SEVERE << cMsg << LogIO::POST ; 168 168 close(); 169 169 return 1; -
trunk/external-alma/atnf/PKSIO/MBrecord.cc
r1757 r1868 37 37 38 38 #include <atnf/PKSIO/MBrecord.h> 39 #include <atnf/PKSIO/SrcType.h> 39 40 40 41 #include <string.h> … … 58 59 decRate = 0.0f; 59 60 nIF = 0; 61 62 srcType = SrcType::NOTYPE ; 63 srcVelocity = 0.0 ; 60 64 } 61 65 … … 325 329 srcVelocity = other.srcVelocity ; 326 330 331 srcType = other.srcType ; 332 327 333 return *this; 328 334 } … … 442 448 srcVelocity = other.srcVelocity ; 443 449 450 srcType = other.srcType ; 451 444 452 return 0; 445 453 } -
trunk/external-alma/atnf/PKSIO/MBrecord.h
r1757 r1868 167 167 // mode (added 1999/03/17). 168 168 int polNo ; // polarization ID 169 float srcVelocity ; // source velocity w.r.t. reference frame 169 double srcVelocity ; // source velocity w.r.t. reference frame 170 171 int srcType ; // source type 170 172 171 173 private: -
trunk/external-alma/atnf/PKSIO/NRO45Reader.cc
r1757 r1868 93 93 // (conversion is done by http://vldb.gsi.go.jp/sokuchi/tky2jgd/) 94 94 95 double elon = 138. + 28. / 60. + 9.96444 / 3600. ;96 double nlat = 35. + 56. / 60. + 52.3314 / 3600. ;97 double alti = 1350. ;95 // double elon = 138. + 28. / 60. + 9.96444 / 3600. ; 96 // double nlat = 35. + 56. / 60. + 52.3314 / 3600. ; 97 // double alti = 1350. ; 98 98 99 MPosition p( MVPosition( Quantity( alti, "m" ), 100 Quantity( elon, "deg" ), 101 Quantity( nlat, "deg" ) ), 102 MPosition::Ref( MPosition::WGS84 ) ) ; 99 // Double elon = 138.4725 ; 100 // Double nlat = 35.9445 ; 101 // Double alti = 1412.599 ; 102 103 // MPosition p( MVPosition( Quantity( alti, "m" ), 104 // Quantity( elon, "deg" ), 105 // Quantity( nlat, "deg" ) ), 106 // MPosition::Ref( MPosition::WGS84 ) ) ; 107 108 Double posx = -3.8710235e6 ; 109 Double posy = 3.4281068e6 ; 110 Double posz = 3.7240395e6 ; 111 MPosition p( MVPosition( posx, posy, posz ), 112 MPosition::ITRF ) ; 113 103 114 MeasFrame frame( p ) ; 104 115 MVPosition mvp ; -
trunk/external-alma/atnf/PKSIO/NRODataset.cc
r1757 r1868 34 34 #include <casa/OS/Time.h> 35 35 #include <scimath/Mathematics/InterpolateArray1D.h> 36 37 #include <measures/Measures/MeasConvert.h> 38 #include <measures/Measures/MCFrequency.h> 39 #include <measures/Measures/MFrequency.h> 40 #include <measures/Measures/MPosition.h> 41 #include <measures/Measures/MEpoch.h> 42 #include <measures/Measures/MDirection.h> 36 43 37 44 #include <math.h> … … 796 803 } 797 804 805 // conversion from TOPO to LSRK 806 v[1] = toLSR( v[1], getStartIntTime( i ), record_->SCX, record_->SCY ) ; 807 808 if ( refFreq_[ib] != 0.0 ) { 809 v[1] = refFreq_[ib] ; 810 } 811 else { 812 refFreq_[ib] = v[1] ; 813 } 814 798 815 return v ; 799 816 } … … 820 837 821 838 } 839 840 double NRODataset::toLSR( double v, double t, double x, double y ) 841 { 842 double vlsr ; 843 844 // get epoch 845 double tcent = t + 0.5*getIPTIM()/86400.0 ; 846 MEpoch me( Quantity( tcent, "d" ), MEpoch::UTC ) ; 847 848 // get antenna position 849 MPosition mp ; 850 if ( SITE.find( "45" ) != string::npos ) { 851 // 45m telescope 852 Double posx = -3.8710235e6 ; 853 Double posy = 3.4281068e6 ; 854 Double posz = 3.7240395e6 ; 855 mp = MPosition( MVPosition( posx, posy, posz ), 856 MPosition::ITRF ) ; 857 } 858 else { 859 // ASTE 860 Vector<Double> pos( 2 ) ; 861 pos[0] = -67.7031 ; 862 pos[1] = -22.9717 ; 863 Double sitealt = 4800.0 ; 864 mp = MPosition( MVPosition( Quantity( sitealt, "m" ), 865 Quantum< Vector<Double> >( pos, "deg" ) ), 866 MPosition::WGS84 ) ; 867 } 868 869 // get direction 870 MDirection md ; 871 if ( SCNCD == 0 ) { 872 // RADEC 873 if ( EPOCH == "B1950" ) { 874 md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ), 875 MDirection::B1950 ) ; 876 } 877 else { 878 md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ), 879 MDirection::J2000 ) ; 880 } 881 } 882 else if ( SCNCD == 1 ) { 883 // LB 884 md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ), 885 MDirection::GALACTIC ) ; 886 } 887 else { 888 // AZEL 889 md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ), 890 MDirection::AZEL ) ; 891 } 892 893 // to LSR 894 MeasFrame mf( me, mp, md ) ; 895 MFrequency::Convert tolsr( MFrequency::TOPO, MFrequency::Ref( MFrequency::LSRK, mf ) ) ; 896 vlsr = (double)(tolsr( Double(v) ).get( "Hz" ).getValue()) ; 897 898 return vlsr ; 899 } -
trunk/external-alma/atnf/PKSIO/NRODataset.h
r1757 r1868 233 233 void show() ; 234 234 235 // convert frequency frame 236 virtual double toLSR( double v, double t, double x, double y ) ; 237 235 238 // Type of file record 236 239 string LOFIL ; … … 506 509 // Logger 507 510 //LogIO os ; 511 512 // reference frequency for each array 513 vector<double> refFreq_ ; 508 514 } ; 509 515 -
trunk/external-alma/atnf/PKSIO/NROFITSDataset.cc
r1757 r1868 179 179 + sizeof( double ) * ARYNM * 10 * 3 // FQCAL, CHCAL, CWCAL 180 180 + sizeof( char ) * 180 ; // CDMY1 181 182 refFreq_.resize( ARYNM, 0.0 ) ; 181 183 } 182 184 … … 1165 1167 } 1166 1168 else { 1167 sprintf( record_->LAVST, "% d%d%d%d%d%d.000", itmp[0], itmp[1], itmp[2], itmp[3], itmp[4], itmp[5] ) ;1169 sprintf( record_->LAVST, "%4d%02d%02d%02d%02d%02d.000", itmp[0], itmp[1], itmp[2], itmp[3], itmp[4], itmp[5] ) ; 1168 1170 } 1169 1171 // DEBUG … … 1460 1462 // //cout << endl ; 1461 1463 // 1464 1465 1466 // Update IPTIM since it depends on the row for NROFITS 1467 int integ ; 1468 status = readTable( integ, "INTEG", same_, i ) ; 1469 if ( !status ) { 1470 IPTIM = (double)integ ; 1471 } 1472 1462 1473 return status ; 1463 1474 } … … 2715 2726 return ib ; 2716 2727 } 2728 2729 double NROFITSDataset::getStartIntTime( int i ) 2730 { 2731 double v ; 2732 readTable( v, "MJDST", same_, i ) ; 2733 return v/86400.0 ; 2734 } 2735 2736 // double NROFITSDataset::toLSR( double v, double t, double x, double y ) 2737 // { 2738 // return v ; 2739 // } -
trunk/external-alma/atnf/PKSIO/NROFITSDataset.h
r1757 r1868 95 95 virtual int getPolarizationNum() ; 96 96 virtual uInt getArrayId( string type ) ; 97 virtual double getStartIntTime( int i ) ; 97 98 98 99 protected: … … 153 154 int getOffset( char *name ) ; 154 155 156 // convert frequency frame 157 // virtual double toLSR( double v, double t, double x, double y ) ; 158 155 159 // number of column for scan header 156 160 int numField_ ; -
trunk/external-alma/atnf/PKSIO/NROOTFDataset.cc
r1757 r1868 128 128 + sizeof( double ) * NRO_ARYMAX * 10 * 3 // FQCAL, CHCAL, CWCAL 129 129 + sizeof( char ) * 180 ; // CDMY1 130 131 refFreq_.resize( NRO_ARYMAX, 0.0 ) ; 130 132 } 131 133 -
trunk/external-alma/atnf/PKSIO/NROReader.cc
r1757 r1868 455 455 } 456 456 } 457 freqref = vref ; 458 // DEBUG 459 freqref = "TOPO" ; 460 // 457 //freqref = vref ; 458 freqref = "LSRK" ; 461 459 //cout << "freqref = " << freqref << endl ; 462 460 NRODataRecord *record = dataset_->getRecord( 0 ) ; -
trunk/external-alma/atnf/PKSIO/PKSFITSreader.cc
r1757 r1868 36 36 #include <atnf/PKSIO/MBFITSreader.h> 37 37 #include <atnf/PKSIO/SDFITSreader.h> 38 #include <atnf/PKSIO/GBTFITSreader.h> 38 39 #include <atnf/PKSIO/PKSFITSreader.h> 39 40 #include <atnf/PKSIO/PKSrecord.h> … … 58 59 if (fitsType == "SDFITS") { 59 60 cReader = new SDFITSreader(); 61 } else if (fitsType == "GBTFITS") { 62 cReader = new GBTFITSreader(); 60 63 } else { 61 64 cReader = new MBFITSreader(retry, interpolate ? 1 : 0); … … 429 432 } 430 433 } 434 435 pksrec.srcType = cMBrec.srcType ; 431 436 432 437 pksrec.srcDir.resize(2); -
trunk/external-alma/atnf/PKSIO/PKSreader.cc
r1757 r1868 81 81 buf[30] = '\0'; 82 82 if (String(buf) == "SIMPLE = T") { 83 // Looks like SDFITS. 84 format = "SDFITS"; 85 reader = new PKSFITSreader("SDFITS"); 86 83 file.seek(560); 84 file.read(26, buf, False); 85 buf[26] = '\0' ; 86 if ( String(buf) == "ORIGIN = 'NRAO Green Bank" ) { 87 // Looks like GBT SDFITS 88 format = "GBTFITS" ; 89 reader = new PKSFITSreader("GBTFITS") ; 90 } 91 else { 92 // Looks like SDFITS. 93 format = "SDFITS"; 94 reader = new PKSFITSreader("SDFITS"); 95 } 87 96 } else { 88 97 // Assume it's MBFITS.
Note:
See TracChangeset
for help on using the changeset viewer.