Index: trunk/external-alma/oldasdm2ASAP/OldASDMReader.cc
===================================================================
--- trunk/external-alma/oldasdm2ASAP/OldASDMReader.cc	(revision 2355)
+++ trunk/external-alma/oldasdm2ASAP/OldASDMReader.cc	(revision 3106)
@@ -56,7 +56,7 @@
 }
 
-bool OldASDMReader::open( const string &filename, const casa::Record &rec )
-{
-  casa::String funcName = "open" ;
+bool OldASDMReader::open( const string &filename, const casacore::Record &rec )
+{
+  casacore::String funcName = "open" ;
 
   // return value
@@ -71,9 +71,9 @@
   // parsing ASDM options
   if ( rec.isDefined( "asdm" ) ) {
-    casa::Record asdmrec = rec.asRecord( "asdm" ) ;
+    casacore::Record asdmrec = rec.asRecord( "asdm" ) ;
 
     // antenna
     if ( asdmrec.isDefined( "antenna" ) ) {
-      if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casa::TpInt ) {
+      if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casacore::TpInt ) {
         antennaId_ = asdmrec.asInt( "antenna" ) ;
       }
@@ -182,6 +182,6 @@
     vector<AntennaRow *> rows = atab.get() ;
     int idx = -1 ;
-    for ( casa::uInt irow = 0 ; irow < rows.size() ; irow++ ) {
-      if ( casa::String(rows[irow]->getName()) == antennaName_ ) {
+    for ( casacore::uInt irow = 0 ; irow < rows.size() ; irow++ ) {
+      if ( casacore::String(rows[irow]->getName()) == antennaName_ ) {
         idx = rows[irow]->getAntennaId().getTagValue() ;
         break ;
@@ -190,5 +190,5 @@
     if ( idx == -1 ) {
       close() ;
-      throw (casa::AipsError( antennaName_ + " not found." )) ;
+      throw (casacore::AipsError( antennaName_ + " not found." )) ;
     }
     else {
@@ -203,5 +203,5 @@
     if ( antennaRow == 0 ) {
       close() ;
-      throw (casa::AipsError( "AntennaId " + casa::String::toString(antennaId_) + " is invalid." ) ) ;
+      throw (casacore::AipsError( "AntennaId " + casacore::String::toString(antennaId_) + " is invalid." ) ) ;
     }
   }
@@ -210,5 +210,5 @@
   // set antenna name
   if ( antennaName_.size() == 0 ) {
-    antennaName_ = casa::String( antennaRow->getName() ) ;
+    antennaName_ = casacore::String( antennaRow->getName() ) ;
   }
 
@@ -217,11 +217,11 @@
 
   // station name
-  stationName_ = casa::String( stationRow->getName() ) ;
+  stationName_ = casacore::String( stationRow->getName() ) ;
 
   // antenna position
   antennaPosition_.resize( 3 ) ;
   vector<Length> antpos = stationRow->getPosition() ;
-  for ( casa::uInt i = 0 ; i < 3 ; i++ ) 
-    antennaPosition_[i] = Quantity( casa::Double( antpos[i].get() ), Unit( "m" ) ) ;
+  for ( casacore::uInt i = 0 ; i < 3 ; i++ ) 
+    antennaPosition_[i] = Quantity( casacore::Double( antpos[i].get() ), Unit( "m" ) ) ;
 
   // create SDMBinData object
@@ -229,5 +229,5 @@
 
   // get Main rows
-  //mainRow_ = casa::Vector<MainRow *>(asdm_->getMain().get()) ;
+  //mainRow_ = casacore::Vector<MainRow *>(asdm_->getMain().get()) ;
 
   // set up IFNO
@@ -262,29 +262,29 @@
 }
 
-void OldASDMReader::fillHeader( casa::Int &nchan, 
-                             casa::Int &npol, 
-                             casa::Int &nif, 
-                             casa::Int &nbeam, 
-                             casa::String &observer, 
-                             casa::String &project, 
-                             casa::String &obstype, 
-                             casa::String &antennaname, 
-                             casa::Vector<casa::Double> &antennaposition, 
-                             casa::Float &equinox, 
-                             casa::String &freqref, 
-                             casa::Double &reffreq, 
-                             casa::Double &bandwidth,
-                             casa::Double &utc, 
-                             casa::String &fluxunit, 
-                             casa::String &epoch, 
-                             casa::String &poltype ) 
-{
-  casa::String funcName = "fillHeader" ;
+void OldASDMReader::fillHeader( casacore::Int &nchan, 
+                             casacore::Int &npol, 
+                             casacore::Int &nif, 
+                             casacore::Int &nbeam, 
+                             casacore::String &observer, 
+                             casacore::String &project, 
+                             casacore::String &obstype, 
+                             casacore::String &antennaname, 
+                             casacore::Vector<casacore::Double> &antennaposition, 
+                             casacore::Float &equinox, 
+                             casacore::String &freqref, 
+                             casacore::Double &reffreq, 
+                             casacore::Double &bandwidth,
+                             casacore::Double &utc, 
+                             casacore::String &fluxunit, 
+                             casacore::String &epoch, 
+                             casacore::String &poltype ) 
+{
+  casacore::String funcName = "fillHeader" ;
 
   ExecBlockTable &ebtab = asdm_->getExecBlock() ;
   // at the moment take first row of ExecBlock table
   ExecBlockRow *ebrow = ebtab.get()[0] ;
-  casa::String telescopeName( ebrow->getTelescopeName() ) ;
-  //casa::String stationName( stationRow_p->getName() ) ;
+  casacore::String telescopeName( ebrow->getTelescopeName() ) ;
+  //casacore::String stationName( stationRow_p->getName() ) ;
 
   // antennaname
@@ -295,5 +295,5 @@
   // antennaposition
   antennaposition.resize( 3 ) ;
-  for ( casa::uInt i = 0 ; i < 3 ; i++ ) 
+  for ( casacore::uInt i = 0 ; i < 3 ; i++ ) 
     antennaposition[i] = antennaPosition_[i].getValue( Unit("m") ) ;
 
@@ -307,5 +307,5 @@
   // utc
   // start time of the project
-  utc = casa::Double( ebrow->getStartTime().getMJD() ) ;
+  utc = casacore::Double( ebrow->getStartTime().getMJD() ) ;
   
 
@@ -326,5 +326,5 @@
       refidx = irow ;
   }
-  nchan = casa::Int( *max_element( nchans.begin(), nchans.end() ) ) ;
+  nchan = casacore::Int( *max_element( nchans.begin(), nchans.end() ) ) ;
 
   //logsink_->postLocally( LogMessage("refidx = "+String::toString(refidx),LogOrigin(className_,funcName,WHERE)) ) ;
@@ -337,8 +337,8 @@
     }
   }
-  bandwidth = casa::Double( *max_element( bws.begin(), bws.end() ) ) ;
+  bandwidth = casacore::Double( *max_element( bws.begin(), bws.end() ) ) ;
 
   // reffreq
-  reffreq = casa::Double( spwrows[refidx]->getRefFreq().get() ) ;
+  reffreq = casacore::Double( spwrows[refidx]->getRefFreq().get() ) ;
 
   // freqref
@@ -382,5 +382,5 @@
 
   // npol
-  npol = casa::Int( *max_element( npols.begin(), npols.end() ) ) ;
+  npol = casacore::Int( *max_element( npols.begin(), npols.end() ) ) ;
 
   // poltype
@@ -421,5 +421,5 @@
 
   // nbeam
-  nbeam = casa::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;
+  nbeam = casacore::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;
 
   // fluxunit
@@ -441,5 +441,5 @@
   obstype = "" ;
   for ( unsigned int imode = 0 ; imode < obsmode.size() ; imode++ ) {
-    obstype += casa::String(obsmode[imode]) ;
+    obstype += casacore::String(obsmode[imode]) ;
     if ( imode != obsmode.size()-1 )
       obstype += "#" ;
@@ -449,5 +449,5 @@
 void OldASDMReader::selectConfigDescription() 
 {
-  casa::String funcName = "selectConfigDescription" ;
+  casacore::String funcName = "selectConfigDescription" ;
 
   vector<ConfigDescriptionRow *> cdrows = asdm_->getConfigDescription().get() ;
@@ -462,5 +462,5 @@
   configDescIdList_.resize( cdidTags.size() ) ;
   for ( unsigned int i = 0 ; i < cdidTags.size() ; i++ ) {
-    configDescIdList_[i] = casa::uInt( cdidTags[i].getTagValue() ) ;
+    configDescIdList_[i] = casacore::uInt( cdidTags[i].getTagValue() ) ;
   }
 }
@@ -472,6 +472,6 @@
   Tag atag( antennaId_, TagType::Antenna ) ;
   for ( unsigned int irow = 0 ; irow < frows.size() ; irow++ ) {
-    casa::uInt feedId = (casa::uInt)(frows[irow]->getFeedId() ) ;
-    if ( casa::anyEQ( feedIdList_, feedId ) ) 
+    casacore::uInt feedId = (casacore::uInt)(frows[irow]->getFeedId() ) ;
+    if ( casacore::anyEQ( feedIdList_, feedId ) ) 
       continue ;
     if ( frows[irow]->getAntennaId() == atag ) {
@@ -483,7 +483,7 @@
 }
 
-casa::Vector<casa::uInt> OldASDMReader::getFieldIdList() 
-{
-  casa::String funcName = "getFieldIdList" ;
+casacore::Vector<casacore::uInt> OldASDMReader::getFieldIdList() 
+{
+  casacore::String funcName = "getFieldIdList" ;
 
   vector<FieldRow *> frows = asdm_->getField().get() ;
@@ -497,7 +497,7 @@
 }
 
-casa::uInt OldASDMReader::getNumMainRow() 
-{
-  casa::uInt nrow = casa::uInt( mainRow_.size() ) ;
+casacore::uInt OldASDMReader::getNumMainRow() 
+{
+  casacore::uInt nrow = casacore::uInt( mainRow_.size() ) ;
 
   return nrow ;
@@ -530,7 +530,7 @@
 }
 
-casa::Bool OldASDMReader::setMainRow( casa::uInt irow ) 
-{
-  casa::Bool status = true ;
+casacore::Bool OldASDMReader::setMainRow( casacore::uInt irow ) 
+{
+  casacore::Bool status = true ;
   row_ = irow ;
   execBlockTag_ = mainRow_[row_]->getExecBlockId() ;
@@ -540,10 +540,10 @@
     status = false ;
   else {
-    status = (casa::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;
+    status = (casacore::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;
   }
   return status ;
 }
 
-casa::Bool OldASDMReader::setMainRow( casa::uInt configDescId, casa::uInt fieldId ) 
+casacore::Bool OldASDMReader::setMainRow( casacore::uInt configDescId, casacore::uInt fieldId ) 
 {
   clearMainRow() ;
@@ -551,5 +551,5 @@
   Tag configDescTag( (unsigned int)configDescId, TagType::ConfigDescription ) ;
   Tag fieldTag( (unsigned int)fieldId, TagType::Field ) ;
-  mainRow_ = casa::Vector<MainRow *>( *(asdm_->getMain().getByContext( configDescTag, fieldTag ) ) ) ;
+  mainRow_ = casacore::Vector<MainRow *>( *(asdm_->getMain().getByContext( configDescTag, fieldTag ) ) ) ;
   
   return true ;
@@ -563,13 +563,13 @@
 void OldASDMReader::setupIFNO() 
 {
-  casa::String funcName = "setupIFNO" ;
+  casacore::String funcName = "setupIFNO" ;
 
   vector<SpectralWindowRow *> spwrows = asdm_->getSpectralWindow().get() ;
   unsigned int nrow = spwrows.size() ;
   ifno_.clear() ;
-  casa::uInt idx = 0 ;
-  casa::uInt wvridx = 0 ;
+  casacore::uInt idx = 0 ;
+  casacore::uInt wvridx = 0 ;
   for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) {
-    casa::uInt index ;
+    casacore::uInt index ;
     if ( isWVR( spwrows[irow] ) ) {
       //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+" is WVR",LogOrigin(className_,funcName,WHERE)) ) ;
@@ -579,5 +579,5 @@
       index = ++idx ;
     }
-    ifno_.insert( pair<Tag,casa::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ;
+    ifno_.insert( pair<Tag,casacore::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ;
     //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+": IFNO="+String::toString(index),LogOrigin(className_,funcName,WHERE)) ) ;
   }
@@ -594,7 +594,7 @@
 } 
 
-casa::Bool OldASDMReader::setData()
-{
-  casa::String funcName = "setData" ;
+casacore::Bool OldASDMReader::setData()
+{
+  casacore::String funcName = "setData" ;
 
   //logsink_->postLocally( LogMessage("try to retrieve binary data",LogOrigin(className_,funcName,WHERE)) ) ;
@@ -671,5 +671,5 @@
 }
 
-casa::uInt OldASDMReader::getIFNo( unsigned int idx )
+casacore::uInt OldASDMReader::getIFNo( unsigned int idx )
 {
   prepareData( idx ) ;
@@ -677,7 +677,7 @@
 }
 
-casa::uInt OldASDMReader::getIFNo()
-{
-  map<Tag,casa::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;
+casacore::uInt OldASDMReader::getIFNo()
+{
+  map<Tag,casacore::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;
   if ( iter != ifno_.end() )
     return iter->second ;
@@ -713,5 +713,5 @@
                                string &freqref ) 
 {
-  casa::String funcName = "getFrequency" ;
+  casacore::String funcName = "getFrequency" ;
 
   int nchan = specWinRow_p->getNumChan() ;
@@ -730,5 +730,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     }      
   }
@@ -745,5 +745,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
+      throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
     }      
     if ( specWinRow_p->isChanFreqStepExists() ) {
@@ -757,5 +757,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
     }          
     if ( specWinRow_p->isChanFreqStartExists() ) {
@@ -766,5 +766,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     }      
   }
@@ -781,5 +781,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
+      throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
     }
     if ( specWinRow_p->isChanFreqStepExists() ) {
@@ -793,5 +793,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
     }          
     if ( specWinRow_p->isChanFreqStartExists() ) {
@@ -803,5 +803,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     }      
   }
@@ -1237,5 +1237,5 @@
     for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) {
       CalAtmosphereRow *atmrow = atmrows[irow] ;
-      if ( casa::String(atmrow->getAntennaName()) != antennaName_ 
+      if ( casacore::String(atmrow->getAntennaName()) != antennaName_ 
            //|| atmrow->getReceiverBand() != rb 
            //|| atmrow->getBasebandName() != bbname 
@@ -1279,5 +1279,5 @@
                                  float &windaz ) 
 {
-  casa::String funcName = "getWeatherInfo" ;
+  casacore::String funcName = "getWeatherInfo" ;
 
   temperature = 0.0 ;
@@ -1668,6 +1668,6 @@
                           double &el,
                           double &mjd,
-                          casa::Vector<casa::Quantity> &antpos ) 
-//                          casa::Vector<casa::Double> antpos ) 
+                          casacore::Vector<casacore::Quantity> &antpos ) 
+//                          casacore::Vector<casacore::Double> antpos ) 
 {
   String funcName = "toJ2000" ;
@@ -1681,27 +1681,27 @@
 
 vector<double> OldASDMReader::toJ2000( vector<double> &dir,
-                                    casa::String &dirref,
+                                    casacore::String &dirref,
                                     double &mjd,
-                                    casa::Vector<casa::Quantity> &antpos ) 
-//                                    casa::Vector<casa::Double> antpos ) 
-{
-  casa::String funcName = "toJ2000" ;
+                                    casacore::Vector<casacore::Quantity> &antpos ) 
+//                                    casacore::Vector<casacore::Double> antpos ) 
+{
+  casacore::String funcName = "toJ2000" ;
 
   vector<double> newd( dir ) ;
   if ( dirref != "J2000" ) {
-    casa::MEpoch me( casa::Quantity( (casa::Double)mjd, "d" ), casa::MEpoch::UTC ) ;
-    casa::MPosition mp( casa::MVPosition( antpos ),
-                        casa::MPosition::ITRF ) ;
+    casacore::MEpoch me( casacore::Quantity( (casacore::Double)mjd, "d" ), casacore::MEpoch::UTC ) ;
+    casacore::MPosition mp( casacore::MVPosition( antpos ),
+                        casacore::MPosition::ITRF ) ;
     //ostringstream oss ;
     //mp.print( oss ) ;
     //logsink_->postLocally( LogMessage(oss.str(),LogOrigin(className_,funcName,WHERE)) ) ;
     
-    casa::MeasFrame mf( me, mp ) ;
-    casa::MDirection::Types dirtype ;
-    casa::Bool b = casa::MDirection::getType( dirtype, dirref ) ;
+    casacore::MeasFrame mf( me, mp ) ;
+    casacore::MDirection::Types dirtype ;
+    casacore::Bool b = casacore::MDirection::getType( dirtype, dirref ) ;
     if ( b ) {
-      casa::MDirection::Convert toj2000( dirtype,
-                                         casa::MDirection::Ref( casa::MDirection::J2000, mf ) ) ;
-      casa::Vector<casa::Double> cdir = toj2000( dir ).getAngle( "rad" ).getValue() ; 
+      casacore::MDirection::Convert toj2000( dirtype,
+                                         casacore::MDirection::Ref( casacore::MDirection::J2000, mf ) ) ;
+      casacore::Vector<casacore::Double> cdir = toj2000( dir ).getAngle( "rad" ).getValue() ; 
       //logsink_->postLocally( LogMessage("cdir = "+String::toString(cdir),LogOrigin(className_,funcName,WHERE)) ) ;
       newd[0] = (double)(cdir[0]) ;
@@ -1719,5 +1719,5 @@
 string OldASDMReader::getFrame()
 {
-  casa::String funcName = "getFrame" ;
+  casacore::String funcName = "getFrame" ;
  
   // default is TOPO
@@ -1748,5 +1748,5 @@
 int OldASDMReader::getNumIFs()
 {
-  casa::String funcName = "getNumIFs" ;
+  casacore::String funcName = "getNumIFs" ;
 
   int nif = 0 ;
