Index: branches/parallel/external-alma/atnf/PKSIO/NROReader.cc
===================================================================
--- branches/parallel/external-alma/atnf/PKSIO/NROReader.cc	(revision 2195)
+++ branches/parallel/external-alma/atnf/PKSIO/NROReader.cc	(revision 2262)
@@ -39,6 +39,9 @@
 #include <atnf/PKSIO/ASTEDataset.h>
 
+#include <measures/Measures/MEpoch.h>
+#include <measures/Measures/MPosition.h>
 #include <measures/Measures/MDirection.h>
 #include <measures/Measures/MCDirection.h>
+#include <measures/Measures/MeasFrame.h>
 #include <measures/Measures/MeasConvert.h>
 
@@ -314,7 +317,7 @@
     //<< srcra << "," << srcdec << ") B1950 to (" 
     //<< v( 0 ) << ","<< v( 1 ) << ") J2000" << endl ;
-    os << LogIO::NORMAL << "SRCDIRECTION convert from (" 
-       << srcra << "," << srcdec << ") B1950 to (" 
-       << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;
+    //os << LogIO::NORMAL << "SRCDIRECTION convert from (" 
+    //   << srcra << "," << srcdec << ") B1950 to (" 
+    //   << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;
   }
   else if ( strncmp( epoch, "J2000", 5 ) == 0 ) {
@@ -353,22 +356,30 @@
     //<< dirx << "," << diry << ") LB to (" 
     //<< v( 0 ) << ","<< v( 1 ) << ") RADEC" << endl ;
-    os << LogIO::NORMAL << "DIRECTION convert from (" 
-       << dirx << "," << diry << ") LB to (" 
-       << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;
+    //os << LogIO::NORMAL << "DIRECTION convert from (" 
+    //   << dirx << "," << diry << ") LB to (" 
+    //   << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;
   }
   else if ( icoord == 2 ) {
     // convert from AZEL to RADEC
+    vector<double> antpos = getAntennaPosition() ;
+    Vector<Quantity> qantpos( 3 ) ;
+    for ( int ip = 0 ; ip < 3 ; ip++ )
+      qantpos[ip] = Quantity( antpos[ip], "m" ) ;
+    Double scantime = Double( dataset_->getScanTime( i ) ) ;
+    MEpoch me( Quantity( scantime, "d" ), MEpoch::UTC ) ;
+    MPosition mp( MVPosition( qantpos ), MPosition::ITRF ) ;
+    MeasFrame mf( me, mp ) ;
     MDirection result = 
       MDirection::Convert( MDirection( Quantity( dirx, "rad" ), 
 				       Quantity( diry, "rad" ),
 				       MDirection::Ref( MDirection::AZEL ) ),
-			   MDirection::Ref( MDirection::J2000 ) ) () ;
+			   MDirection::Ref( MDirection::J2000, mf ) ) () ;
     v = result.getAngle().getValue() ;
     //cout << "NROReader::getDirection()  DIRECTION convert from (" 
     //<< dirx << "," << diry << ") AZEL to (" 
     //<< v( 0 ) << ","<< v( 1 ) << ") RADEC" << endl ;
-    os << LogIO::NORMAL << "DIRECTION convert from (" 
-       << dirx << "," << diry << ") AZEL to (" 
-       << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;
+    //os << LogIO::NORMAL << "DIRECTION convert from (" 
+    //   << dirx << "," << diry << ") AZEL to (" 
+    //   << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;
   }
   else if ( icoord == 0 ) {
@@ -387,7 +398,7 @@
       //<< dirx << "," << diry << ") B1950 to (" 
       //<< v( 0 ) << ","<< v( 1 ) << ") J2000" << endl ;
-      os << LogIO::NORMAL << "DIRECTION convert from (" 
-         << dirx << "," << diry << ") B1950 to (" 
-         << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;
+      //os << LogIO::NORMAL << "DIRECTION convert from (" 
+      //   << dirx << "," << diry << ") B1950 to (" 
+      //   << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;
     }
     else if ( strncmp( epoch, "J2000", 5 ) == 0 ) {
@@ -441,8 +452,10 @@
   //cout << "antpos = " << antpos << endl ;
   string eq = dataset_->getEPOCH() ;
-  if ( eq.compare( 0, 5, "B1950" ) == 0 )
-    equinox = 1950.0 ;
-  else if ( eq.compare( 0, 5, "J2000" ) == 0 ) 
-    equinox = 2000.0 ;
+//   if ( eq.compare( 0, 5, "B1950" ) == 0 )
+//     equinox = 1950.0 ;
+//   else if ( eq.compare( 0, 5, "J2000" ) == 0 ) 
+//     equinox = 2000.0 ;
+  // equinox is always 2000.0
+  equinox = 2000.0 ;
   //cout << "equinox = " << equinox << endl ;
   string vref = dataset_->getVREF() ;
@@ -456,5 +469,6 @@
   }
   //freqref = vref ;
-  freqref = "LSRK" ;
+  //freqref = "LSRK" ;
+  freqref = "REST" ;
   //cout << "freqref = " << freqref << endl ;
   NRODataRecord *record = dataset_->getRecord( 0 ) ;
@@ -483,10 +497,12 @@
   //cout << "poltype = " << poltype << endl ;
 
-  vector<Bool> ifs = getIFs() ;
-  nif = ifs.size() ;
+  //vector<Bool> ifs = getIFs() ;
+  //nif = ifs.size() ;
+  nif = getNumIF() ;
   //cout << "nif = " << nif << endl ;
 
-  vector<Bool> beams = getBeams() ;
-  nbeam = beams.size() ;
+  //vector<Bool> beams = getBeams() ;
+  //nbeam = beams.size() ;
+  nbeam = getNumBeam() ;
   //cout << "nbeam = " << nbeam << endl ;
 
@@ -505,4 +521,5 @@
                             uInt &scanno,
                             uInt &cycleno,
+                            uInt &ifno,
                             uInt &beamno,
                             uInt &polno,
@@ -548,9 +565,16 @@
   //cout << "cycleno = " << cycleno << endl ;
 
-  // beamno
-  string arryt = string( record->ARRYT ) ;
-  string sbeamno = arryt.substr( 1, arryt.size()-1 ) ;
-  uInt ibeamno = atoi( sbeamno.c_str() ) ; 
-  beamno = ibeamno - 1 ;
+  // beamno and ifno
+  string rxname = dataset_->getRX()[0] ;
+  if ( rxname.find("MULT2") != string::npos ) {
+    string arryt = string( record->ARRYT ) ;
+    beamno = dataset_->getArrayId( arryt ) ;
+    ifno = 0 ;
+  }
+  else {
+    beamno = 0 ;
+    string arryt = string( record->ARRYT ) ;
+    ifno = dataset_->getArrayId( arryt ) ;
+  }
   //cout << "beamno = " << beamno << endl ;
 
@@ -575,5 +599,6 @@
 
   // scantime
-  scantime = Double( dataset_->getStartIntTime( irow ) ) ;
+  //scantime = Double( dataset_->getStartIntTime( irow ) ) ;
+  scantime = Double( dataset_->getScanTime( irow ) ) ;
   //cout << "scantime = " << scantime << endl ;
 
