Ignore:
Location:
trunk/external-alma
Files:
2 added
3 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/atnf/PKSIO/ASTEDataset.cc

    r1941 r1819  
    124124    + sizeof( char ) * 116                       // CDMY1
    125125    + sizeof( double ) * ASTE_ARYMAX ;           // DSBFC
    126 
    127   refFreq_.resize( ASTE_ARYMAX, 0.0 ) ;
    128126}
    129127
  • trunk/external-alma/atnf/PKSIO/ASTEFXDataset.cc

    r1941 r1819  
    124124    + sizeof( char ) * 116                          // CDMY1
    125125    + sizeof( double ) * ASTE_ARYMAX_FX ;           // DSBFC
    126 
    127   refFreq_.resize( ASTE_ARYMAX_FX, 0.0 ) ;
    128126}
    129127
  • trunk/external-alma/atnf/PKSIO/ASTEReader.cc

    r1941 r1819  
    8888  // Ref.: Ezawa, H. et al. 2004, Proc. SPIE, 5489, 763
    8989  //
    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. ;
    9693
    9794  // APEX value
     
    104101                           Quantity( nlat, "deg" ) ),
    105102               MPosition::Ref( MPosition::WGS84 ) ) ;
    106 
    107103  MeasFrame frame( p ) ;
    108104  MVPosition mvp ;
  • trunk/external-alma/atnf/PKSIO/MBFITSreader.cc

    r1941 r1819  
    146146  if (rpfitsin(jstat)) {
    147147    sprintf(cMsg, "Failed to open MBFITS file\n%s", rpname);
    148     //os << LogIO::SEVERE << cMsg << LogIO::POST ;
     148    os << LogIO::SEVERE << cMsg << LogIO::POST ;
    149149    return 1;
    150150  }
     
    165165    sprintf(cMsg, "Failed to read MBFITS header in file\n"
    166166                  "%s", rpname);
    167     //os << LogIO::SEVERE << cMsg << LogIO::POST ;
     167    os << LogIO::SEVERE << cMsg << LogIO::POST ;
    168168    close();
    169169    return 1;
  • trunk/external-alma/atnf/PKSIO/MBrecord.cc

    r1941 r1819  
    3737
    3838#include <atnf/PKSIO/MBrecord.h>
    39 #include <atnf/PKSIO/SrcType.h>
    4039
    4140#include <string.h>
     
    5958  decRate = 0.0f;
    6059  nIF     = 0;
    61 
    62   srcType = SrcType::NOTYPE ;
    63   srcVelocity = 0.0 ;
    6460}
    6561
     
    329325  srcVelocity = other.srcVelocity ;
    330326
    331   srcType = other.srcType ;
    332 
    333327  return *this;
    334328}
     
    448442  srcVelocity = other.srcVelocity ;
    449443
    450   srcType = other.srcType ;
    451 
    452444  return 0;
    453445}
  • trunk/external-alma/atnf/PKSIO/MBrecord.h

    r1941 r1819  
    167167                                // mode (added 1999/03/17).
    168168    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
    172170
    173171  private:
  • trunk/external-alma/atnf/PKSIO/NRO45Reader.cc

    r1941 r1819  
    9393  // (conversion is done by http://vldb.gsi.go.jp/sokuchi/tky2jgd/)
    9494 
    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. ;
    9898
    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 ) ) ;
    114103  MeasFrame frame( p ) ;
    115104  MVPosition mvp ;
  • trunk/external-alma/atnf/PKSIO/NRODataset.cc

    r1941 r1819  
    3434#include <casa/OS/Time.h>
    3535#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>
    4336
    4437#include <math.h>
     
    803796  }
    804797
    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 
    815798  return v ;
    816799}
     
    837820
    838821}
    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

    r1941 r1819  
    233233  void show() ;
    234234
    235   // convert frequency frame
    236   virtual double toLSR( double v, double t, double x, double y ) ;
    237 
    238235  // Type of file record
    239236  string LOFIL ;
     
    509506  // Logger
    510507  //LogIO os ;
    511 
    512   // reference frequency for each array
    513   vector<double> refFreq_ ;
    514508} ;
    515509
  • trunk/external-alma/atnf/PKSIO/NROFITSDataset.cc

    r1941 r1819  
    179179    + sizeof( double ) * ARYNM * 10 * 3    // FQCAL, CHCAL, CWCAL
    180180    + sizeof( char ) * 180 ;               // CDMY1
    181 
    182   refFreq_.resize( ARYNM, 0.0 ) ;
    183181}
    184182
     
    11671165  }
    11681166  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] ) ;
    11701168  }
    11711169  // DEBUG
     
    14621460//   //cout << endl ;
    14631461  //
    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 
    14731462  return status ;
    14741463}
     
    15241513    // debug
    15251514    //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    }
    15361525    //
    15371526    Vector<Double> z( nchan ) ;
     
    27262715  return ib ;
    27272716}
    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  
    9595  virtual int getPolarizationNum() ;
    9696  virtual uInt getArrayId( string type ) ;
    97   virtual double getStartIntTime( int i ) ;
    9897
    9998 protected:
     
    154153  int getOffset( char *name ) ;
    155154
    156   // convert frequency frame
    157 //   virtual double toLSR( double v, double t, double x, double y ) ;
    158 
    159155  // number of column for scan header
    160156  int numField_ ;
  • trunk/external-alma/atnf/PKSIO/NROOTFDataset.cc

    r1941 r1819  
    128128    + sizeof( double ) * NRO_ARYMAX * 10 * 3    // FQCAL, CHCAL, CWCAL
    129129    + sizeof( char ) * 180 ;                    // CDMY1
    130 
    131   refFreq_.resize( NRO_ARYMAX, 0.0 ) ;
    132130}
    133131
  • trunk/external-alma/atnf/PKSIO/NROReader.cc

    r1941 r1819  
    455455    }
    456456  }
    457   //freqref = vref ;
    458   freqref = "LSRK" ;
     457  freqref = vref ;
     458  // DEBUG
     459  freqref = "TOPO" ;
     460  //
    459461  //cout << "freqref = " << freqref << endl ;
    460462  NRODataRecord *record = dataset_->getRecord( 0 ) ;
  • trunk/external-alma/atnf/PKSIO/PKSFITSreader.cc

    r1941 r1819  
    3636#include <atnf/PKSIO/MBFITSreader.h>
    3737#include <atnf/PKSIO/SDFITSreader.h>
    38 #include <atnf/PKSIO/GBTFITSreader.h>
    3938#include <atnf/PKSIO/PKSFITSreader.h>
    4039#include <atnf/PKSIO/PKSrecord.h>
     
    5958  if (fitsType == "SDFITS") {
    6059    cReader = new SDFITSreader();
    61   } else if (fitsType == "GBTFITS") {
    62     cReader = new GBTFITSreader();
    6360  } else {
    6461    cReader = new MBFITSreader(retry, interpolate ? 1 : 0);
     
    432429    }
    433430  }
    434  
    435   pksrec.srcType = cMBrec.srcType ;
    436431
    437432  pksrec.srcDir.resize(2);
  • trunk/external-alma/atnf/PKSIO/PKSMS2reader.cc

    r1941 r1819  
    101101  if ( antenna.length() == 0 ) {
    102102    cAntId.resize( 1 ) ;
    103     //cAntId[0] = 0 ;
    104     ROScalarColumn<Int> ant1Col( cPKSMS, "ANTENNA1" ) ;
    105     cAntId[0] = ant1Col(0) ;
     103    cAntId[0] = 0 ;
    106104  }
    107105  else {
  • trunk/external-alma/atnf/PKSIO/PKSMS2writer.cc

    r1941 r1819  
    732732  // Extend the DATA_DESCRIPTION subtable.
    733733  while (Int(cDataDescription.nrow()) < IFno) {
    734     cDataDescription.addRow(1,True);
     734    cDataDescription.addRow();
    735735  }
    736736  Int n = IFno - 1;
     
    966966{
    967967  // Extend the POLARIZATION subtable.
    968   Int nr = cPolarization.nrow() ;
    969968  while (Int(cPolarization.nrow()) < IFno) {
    970     cPolarization.addRow(1,True);
     969    cPolarization.addRow();
    971970  }
    972971  Int n = IFno - 1;
     
    986985  corrType(1) = Stokes::YY;
    987986  }
    988   // initialization
    989   for ( Int i = nr ; i < n ; i++ )
    990     cPolarizationCols->corrType().put( i, corrType ) ;
    991987  cPolarizationCols->corrType().put(n, corrType);
    992988
     
    10961092{
    10971093  // Extend the SPECTRAL_WINDOW subtable.
    1098   Int nr = cSpectralWindow.nrow() ;
    10991094  while (Int(cSpectralWindow.nrow()) < IFno) {
    1100     cSpectralWindow.addRow(1,True);
     1095    cSpectralWindow.addRow();
    11011096  }
    11021097  Int n = IFno - 1;
     
    11161111    freqs(i) = refFreq + (i - refChan)*freqInc;
    11171112  }
    1118   // initialization
    1119   for ( Int i = nr ; i < n ; i++ )
    1120     cSpWindowCols->chanFreq().put( i, freqs ) ;
    11211113  cSpWindowCols->chanFreq().put(n, freqs);
    11221114
    11231115  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   }
    11291116  cSpWindowCols->chanWidth().put(n, chanWidths);
    11301117
     
    11331120
    11341121  Vector<Double> resolution(nChan, fabs(freqInc));
    1135   // initialization
    1136   for ( Int i = nr ; i < n ; i++ )
    1137     cSpWindowCols->resolution().put( i, resolution ) ;
    11381122  cSpWindowCols->resolution().put(n, resolution);
    11391123
  • trunk/external-alma/atnf/PKSIO/PKSreader.cc

    r1941 r1819  
    8181      buf[30] = '\0';
    8282      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
    9687       } else {
    9788         // Assume it's MBFITS.
     
    10293
    10394  } 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()) {
    11596      // MS version 2.
    11697      #ifdef NOPKSMS
  • trunk/external-alma/atnf/pks/pks_maths.cc

Note: See TracChangeset for help on using the changeset viewer.