Changes in trunk/external-alma [1819:1941]
- Location:
- trunk/external-alma
- Files:
-
- 3 added
- 2 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/atnf/PKSIO/ASTEDataset.cc
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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 } … … 1513 1524 // debug 1514 1525 //cout << "i=" << i << endl ; 1515 if ( i == 16 ) {1516 ofstream ofs0( "spgrid0.dat" ) ;1517 for ( int ii = 0 ; ii < getNUMCH() ; ii++ )1518 ofs0 << xout[ii] << "," ;1519 ofs0 << endl ;1520 for ( int ii = 0 ; ii < getNUMCH() ; ii++ )1521 ofs0 << setprecision(16) << record->FREQ0+yout[ii] << "," ;1522 ofs0 << endl ;1523 ofs0.close() ;1524 }1526 // if ( i == 16 ) { 1527 // ofstream ofs0( "spgrid0.dat" ) ; 1528 // for ( int ii = 0 ; ii < getNUMCH() ; ii++ ) 1529 // ofs0 << xout[ii] << "," ; 1530 // ofs0 << endl ; 1531 // for ( int ii = 0 ; ii < getNUMCH() ; ii++ ) 1532 // ofs0 << setprecision(16) << record->FREQ0+yout[ii] << "," ; 1533 // ofs0 << endl ; 1534 // ofs0.close() ; 1535 // } 1525 1536 // 1526 1537 Vector<Double> z( nchan ) ; … … 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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
r1819 r1941 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/PKSMS2reader.cc
r1819 r1941 101 101 if ( antenna.length() == 0 ) { 102 102 cAntId.resize( 1 ) ; 103 cAntId[0] = 0 ; 103 //cAntId[0] = 0 ; 104 ROScalarColumn<Int> ant1Col( cPKSMS, "ANTENNA1" ) ; 105 cAntId[0] = ant1Col(0) ; 104 106 } 105 107 else { -
trunk/external-alma/atnf/PKSIO/PKSMS2writer.cc
r1819 r1941 732 732 // Extend the DATA_DESCRIPTION subtable. 733 733 while (Int(cDataDescription.nrow()) < IFno) { 734 cDataDescription.addRow( );734 cDataDescription.addRow(1,True); 735 735 } 736 736 Int n = IFno - 1; … … 966 966 { 967 967 // Extend the POLARIZATION subtable. 968 Int nr = cPolarization.nrow() ; 968 969 while (Int(cPolarization.nrow()) < IFno) { 969 cPolarization.addRow( );970 cPolarization.addRow(1,True); 970 971 } 971 972 Int n = IFno - 1; … … 985 986 corrType(1) = Stokes::YY; 986 987 } 988 // initialization 989 for ( Int i = nr ; i < n ; i++ ) 990 cPolarizationCols->corrType().put( i, corrType ) ; 987 991 cPolarizationCols->corrType().put(n, corrType); 988 992 … … 1092 1096 { 1093 1097 // Extend the SPECTRAL_WINDOW subtable. 1098 Int nr = cSpectralWindow.nrow() ; 1094 1099 while (Int(cSpectralWindow.nrow()) < IFno) { 1095 cSpectralWindow.addRow( );1100 cSpectralWindow.addRow(1,True); 1096 1101 } 1097 1102 Int n = IFno - 1; … … 1111 1116 freqs(i) = refFreq + (i - refChan)*freqInc; 1112 1117 } 1118 // initialization 1119 for ( Int i = nr ; i < n ; i++ ) 1120 cSpWindowCols->chanFreq().put( i, freqs ) ; 1113 1121 cSpWindowCols->chanFreq().put(n, freqs); 1114 1122 1115 1123 Vector<Double> chanWidths(nChan, freqInc); 1124 // initialization 1125 for ( Int i = nr ; i < n ; i++ ) { 1126 cSpWindowCols->chanWidth().put( i, chanWidths ) ; 1127 cSpWindowCols->effectiveBW().put( i, chanWidths ) ; 1128 } 1116 1129 cSpWindowCols->chanWidth().put(n, chanWidths); 1117 1130 … … 1120 1133 1121 1134 Vector<Double> resolution(nChan, fabs(freqInc)); 1135 // initialization 1136 for ( Int i = nr ; i < n ; i++ ) 1137 cSpWindowCols->resolution().put( i, resolution ) ; 1122 1138 cSpWindowCols->resolution().put(n, resolution); 1123 1139 -
trunk/external-alma/atnf/PKSIO/PKSreader.cc
r1819 r1941 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. … … 93 102 94 103 } else if (inFile.isDirectory()) { 95 if (File(name + "/DATA_DESCRIPTION").exists()) { 104 Bool isMS = ( (File(name+"/table.info").exists()) 105 && File(name+"/table.dat").exists() ); 106 if (isMS) { 107 RegularFileIO ifs(name+"/table.info") ; 108 char buf[128] ; 109 ifs.read(sizeof(buf),buf,False) ; 110 if ( strstr( buf, "Measurement Set" ) == NULL ) 111 isMS = False ; 112 } 113 //if (File(name + "/DATA_DESCRIPTION").exists()) { 114 if (isMS) { 96 115 // MS version 2. 97 116 #ifdef NOPKSMS -
trunk/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.