Changes in trunk/external-alma [1941:1819]
- Location:
- trunk/external-alma
- Files:
-
- 2 added
- 3 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/atnf/PKSIO/ASTEDataset.cc
r1941 r1819 124 124 + sizeof( char ) * 116 // CDMY1 125 125 + sizeof( double ) * ASTE_ARYMAX ; // DSBFC 126 127 refFreq_.resize( ASTE_ARYMAX, 0.0 ) ;128 126 } 129 127 -
trunk/external-alma/atnf/PKSIO/ASTEFXDataset.cc
r1941 r1819 124 124 + sizeof( char ) * 116 // CDMY1 125 125 + sizeof( double ) * ASTE_ARYMAX_FX ; // DSBFC 126 127 refFreq_.resize( ASTE_ARYMAX_FX, 0.0 ) ;128 126 } 129 127 -
trunk/external-alma/atnf/PKSIO/ASTEReader.cc
r1941 r1819 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. ; 93 double elon = -67.7031 ; 94 double nlat = -22.9717 ; 95 double alti = 4800.0 ; 90 double elon = -67. - 42. / 60. - 11. / 3600. ; 91 double nlat = -22. - 58. / 60. - 18. / 3600. ; 92 double alti = 2400. ; 96 93 97 94 // APEX value … … 104 101 Quantity( nlat, "deg" ) ), 105 102 MPosition::Ref( MPosition::WGS84 ) ) ; 106 107 103 MeasFrame frame( p ) ; 108 104 MVPosition mvp ; -
trunk/external-alma/atnf/PKSIO/MBFITSreader.cc
r1941 r1819 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
r1941 r1819 37 37 38 38 #include <atnf/PKSIO/MBrecord.h> 39 #include <atnf/PKSIO/SrcType.h>40 39 41 40 #include <string.h> … … 59 58 decRate = 0.0f; 60 59 nIF = 0; 61 62 srcType = SrcType::NOTYPE ;63 srcVelocity = 0.0 ;64 60 } 65 61 … … 329 325 srcVelocity = other.srcVelocity ; 330 326 331 srcType = other.srcType ;332 333 327 return *this; 334 328 } … … 448 442 srcVelocity = other.srcVelocity ; 449 443 450 srcType = other.srcType ;451 452 444 return 0; 453 445 } -
trunk/external-alma/atnf/PKSIO/MBrecord.h
r1941 r1819 167 167 // mode (added 1999/03/17). 168 168 int polNo ; // polarization ID 169 double srcVelocity ; // source velocity w.r.t. reference frame 170 171 int srcType ; // source type 169 float srcVelocity ; // source velocity w.r.t. reference frame 172 170 173 171 private: -
trunk/external-alma/atnf/PKSIO/NRO45Reader.cc
r1941 r1819 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 // 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 99 MPosition p( MVPosition( Quantity( alti, "m" ), 100 Quantity( elon, "deg" ), 101 Quantity( nlat, "deg" ) ), 102 MPosition::Ref( MPosition::WGS84 ) ) ; 114 103 MeasFrame frame( p ) ; 115 104 MVPosition mvp ; -
trunk/external-alma/atnf/PKSIO/NRODataset.cc
r1941 r1819 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>43 36 44 37 #include <math.h> … … 803 796 } 804 797 805 // conversion from TOPO to LSRK806 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 815 798 return v ; 816 799 } … … 837 820 838 821 } 839 840 double NRODataset::toLSR( double v, double t, double x, double y )841 {842 double vlsr ;843 844 // get epoch845 double tcent = t + 0.5*getIPTIM()/86400.0 ;846 MEpoch me( Quantity( tcent, "d" ), MEpoch::UTC ) ;847 848 // get antenna position849 MPosition mp ;850 if ( SITE.find( "45" ) != string::npos ) {851 // 45m telescope852 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 // ASTE860 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 direction870 MDirection md ;871 if ( SCNCD == 0 ) {872 // RADEC873 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 // LB884 md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ),885 MDirection::GALACTIC ) ;886 }887 else {888 // AZEL889 md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ),890 MDirection::AZEL ) ;891 }892 893 // to LSR894 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
r1941 r1819 233 233 void show() ; 234 234 235 // convert frequency frame236 virtual double toLSR( double v, double t, double x, double y ) ;237 238 235 // Type of file record 239 236 string LOFIL ; … … 509 506 // Logger 510 507 //LogIO os ; 511 512 // reference frequency for each array513 vector<double> refFreq_ ;514 508 } ; 515 509 -
trunk/external-alma/atnf/PKSIO/NROFITSDataset.cc
r1941 r1819 179 179 + sizeof( double ) * ARYNM * 10 * 3 // FQCAL, CHCAL, CWCAL 180 180 + sizeof( char ) * 180 ; // CDMY1 181 182 refFreq_.resize( ARYNM, 0.0 ) ;183 181 } 184 182 … … 1167 1165 } 1168 1166 else { 1169 sprintf( record_->LAVST, "% 4d%02d%02d%02d%02d%02d.000", itmp[0], itmp[1], itmp[2], itmp[3], itmp[4], itmp[5] ) ;1167 sprintf( record_->LAVST, "%d%d%d%d%d%d.000", itmp[0], itmp[1], itmp[2], itmp[3], itmp[4], itmp[5] ) ; 1170 1168 } 1171 1169 // DEBUG … … 1462 1460 // //cout << endl ; 1463 1461 // 1464 1465 1466 // Update IPTIM since it depends on the row for NROFITS1467 int integ ;1468 status = readTable( integ, "INTEG", same_, i ) ;1469 if ( !status ) {1470 IPTIM = (double)integ ;1471 }1472 1473 1462 return status ; 1474 1463 } … … 1524 1513 // debug 1525 1514 //cout << "i=" << i << endl ; 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 //}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 } 1536 1525 // 1537 1526 Vector<Double> z( nchan ) ; … … 2726 2715 return ib ; 2727 2716 } 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
r1941 r1819 95 95 virtual int getPolarizationNum() ; 96 96 virtual uInt getArrayId( string type ) ; 97 virtual double getStartIntTime( int i ) ;98 97 99 98 protected: … … 154 153 int getOffset( char *name ) ; 155 154 156 // convert frequency frame157 // virtual double toLSR( double v, double t, double x, double y ) ;158 159 155 // number of column for scan header 160 156 int numField_ ; -
trunk/external-alma/atnf/PKSIO/NROOTFDataset.cc
r1941 r1819 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 ) ;132 130 } 133 131 -
trunk/external-alma/atnf/PKSIO/NROReader.cc
r1941 r1819 455 455 } 456 456 } 457 //freqref = vref ; 458 freqref = "LSRK" ; 457 freqref = vref ; 458 // DEBUG 459 freqref = "TOPO" ; 460 // 459 461 //cout << "freqref = " << freqref << endl ; 460 462 NRODataRecord *record = dataset_->getRecord( 0 ) ; -
trunk/external-alma/atnf/PKSIO/PKSFITSreader.cc
r1941 r1819 36 36 #include <atnf/PKSIO/MBFITSreader.h> 37 37 #include <atnf/PKSIO/SDFITSreader.h> 38 #include <atnf/PKSIO/GBTFITSreader.h>39 38 #include <atnf/PKSIO/PKSFITSreader.h> 40 39 #include <atnf/PKSIO/PKSrecord.h> … … 59 58 if (fitsType == "SDFITS") { 60 59 cReader = new SDFITSreader(); 61 } else if (fitsType == "GBTFITS") {62 cReader = new GBTFITSreader();63 60 } else { 64 61 cReader = new MBFITSreader(retry, interpolate ? 1 : 0); … … 432 429 } 433 430 } 434 435 pksrec.srcType = cMBrec.srcType ;436 431 437 432 pksrec.srcDir.resize(2); -
trunk/external-alma/atnf/PKSIO/PKSMS2reader.cc
r1941 r1819 101 101 if ( antenna.length() == 0 ) { 102 102 cAntId.resize( 1 ) ; 103 //cAntId[0] = 0 ; 104 ROScalarColumn<Int> ant1Col( cPKSMS, "ANTENNA1" ) ; 105 cAntId[0] = ant1Col(0) ; 103 cAntId[0] = 0 ; 106 104 } 107 105 else { -
trunk/external-alma/atnf/PKSIO/PKSMS2writer.cc
r1941 r1819 732 732 // Extend the DATA_DESCRIPTION subtable. 733 733 while (Int(cDataDescription.nrow()) < IFno) { 734 cDataDescription.addRow( 1,True);734 cDataDescription.addRow(); 735 735 } 736 736 Int n = IFno - 1; … … 966 966 { 967 967 // Extend the POLARIZATION subtable. 968 Int nr = cPolarization.nrow() ;969 968 while (Int(cPolarization.nrow()) < IFno) { 970 cPolarization.addRow( 1,True);969 cPolarization.addRow(); 971 970 } 972 971 Int n = IFno - 1; … … 986 985 corrType(1) = Stokes::YY; 987 986 } 988 // initialization989 for ( Int i = nr ; i < n ; i++ )990 cPolarizationCols->corrType().put( i, corrType ) ;991 987 cPolarizationCols->corrType().put(n, corrType); 992 988 … … 1096 1092 { 1097 1093 // Extend the SPECTRAL_WINDOW subtable. 1098 Int nr = cSpectralWindow.nrow() ;1099 1094 while (Int(cSpectralWindow.nrow()) < IFno) { 1100 cSpectralWindow.addRow( 1,True);1095 cSpectralWindow.addRow(); 1101 1096 } 1102 1097 Int n = IFno - 1; … … 1116 1111 freqs(i) = refFreq + (i - refChan)*freqInc; 1117 1112 } 1118 // initialization1119 for ( Int i = nr ; i < n ; i++ )1120 cSpWindowCols->chanFreq().put( i, freqs ) ;1121 1113 cSpWindowCols->chanFreq().put(n, freqs); 1122 1114 1123 1115 Vector<Double> chanWidths(nChan, freqInc); 1124 // initialization1125 for ( Int i = nr ; i < n ; i++ ) {1126 cSpWindowCols->chanWidth().put( i, chanWidths ) ;1127 cSpWindowCols->effectiveBW().put( i, chanWidths ) ;1128 }1129 1116 cSpWindowCols->chanWidth().put(n, chanWidths); 1130 1117 … … 1133 1120 1134 1121 Vector<Double> resolution(nChan, fabs(freqInc)); 1135 // initialization1136 for ( Int i = nr ; i < n ; i++ )1137 cSpWindowCols->resolution().put( i, resolution ) ;1138 1122 cSpWindowCols->resolution().put(n, resolution); 1139 1123 -
trunk/external-alma/atnf/PKSIO/PKSreader.cc
r1941 r1819 81 81 buf[30] = '\0'; 82 82 if (String(buf) == "SIMPLE = T") { 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 } 83 // Looks like SDFITS. 84 format = "SDFITS"; 85 reader = new PKSFITSreader("SDFITS"); 86 96 87 } else { 97 88 // Assume it's MBFITS. … … 102 93 103 94 } else if (inFile.isDirectory()) { 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) { 95 if (File(name + "/DATA_DESCRIPTION").exists()) { 115 96 // MS version 2. 116 97 #ifdef NOPKSMS -
trunk/external-alma/atnf/pks/pks_maths.cc
- Property svn:mergeinfo changed
/branches/asap4casa3.1.0/external-alma/atnf/pks/pks_maths.cc removed
- Property svn:mergeinfo changed
Note:
See TracChangeset
for help on using the changeset viewer.