Index: trunk/external-alma/asdm2ASAP/ASDMReader.cc
===================================================================
--- trunk/external-alma/asdm2ASAP/ASDMReader.cc	(revision 2755)
+++ trunk/external-alma/asdm2ASAP/ASDMReader.cc	(revision 3106)
@@ -57,7 +57,7 @@
 }
 
-bool ASDMReader::open( const string &filename, const casa::Record &rec )
-{
-  casa::String funcName = "open" ;
+bool ASDMReader::open( const string &filename, const casacore::Record &rec )
+{
+  casacore::String funcName = "open" ;
 
   // return value
@@ -72,9 +72,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" ) ;
       }
@@ -183,6 +183,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 ;
@@ -191,5 +191,5 @@
     if ( idx == -1 ) {
       close() ;
-      throw (casa::AipsError( antennaName_ + " not found." )) ;
+      throw (casacore::AipsError( antennaName_ + " not found." )) ;
     }
     else {
@@ -204,5 +204,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." ) ) ;
     }
   }
@@ -211,5 +211,5 @@
   // set antenna name
   if ( antennaName_.size() == 0 ) {
-    antennaName_ = casa::String( antennaRow->getName() ) ;
+    antennaName_ = casacore::String( antennaRow->getName() ) ;
   }
 
@@ -218,13 +218,13 @@
 
   // 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" ) ) ;
-  mp_ = casa::MPosition( casa::MVPosition( antennaPosition_ ),
-                         casa::MPosition::ITRF ) ;
+  for ( casacore::uInt i = 0 ; i < 3 ; i++ ) 
+    antennaPosition_[i] = Quantity( casacore::Double( antpos[i].get() ), Unit( "m" ) ) ;
+  mp_ = casacore::MPosition( casacore::MVPosition( antennaPosition_ ),
+                         casacore::MPosition::ITRF ) ;
   mf_.set( mp_ ) ;
 
@@ -233,5 +233,5 @@
 
   // get Main rows
-  //mainRow_ = casa::Vector<MainRow *>(asdm_->getMain().get()) ;
+  //mainRow_ = casacore::Vector<MainRow *>(asdm_->getMain().get()) ;
 
   // set up IFNO
@@ -266,29 +266,29 @@
 }
 
-void ASDMReader::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 ASDMReader::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
@@ -299,5 +299,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") ) ;
 
@@ -311,5 +311,5 @@
   // utc
   // start time of the project
-  utc = casa::Double( ebrow->getStartTime().getMJD() ) ;
+  utc = casacore::Double( ebrow->getStartTime().getMJD() ) ;
   
 
@@ -330,5 +330,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)) ) ;
@@ -341,8 +341,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
@@ -386,5 +386,5 @@
 
   // npol
-  npol = casa::Int( *max_element( npols.begin(), npols.end() ) ) ;
+  npol = casacore::Int( *max_element( npols.begin(), npols.end() ) ) ;
 
   // poltype
@@ -425,5 +425,5 @@
 
   // nbeam
-  nbeam = casa::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;
+  nbeam = casacore::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;
 
   // fluxunit
@@ -445,5 +445,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 += "#" ;
@@ -453,5 +453,5 @@
 void ASDMReader::selectConfigDescription() 
 {
-  casa::String funcName = "selectConfigDescription" ;
+  casacore::String funcName = "selectConfigDescription" ;
 
   vector<ConfigDescriptionRow *> cdrows = asdm_->getConfigDescription().get() ;
@@ -466,5 +466,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() ) ;
   }
 }
@@ -476,6 +476,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 ) {
@@ -487,7 +487,7 @@
 }
 
-casa::Vector<casa::uInt> ASDMReader::getFieldIdList() 
-{
-  casa::String funcName = "getFieldIdList" ;
+casacore::Vector<casacore::uInt> ASDMReader::getFieldIdList() 
+{
+  casacore::String funcName = "getFieldIdList" ;
 
   vector<FieldRow *> frows = asdm_->getField().get() ;
@@ -501,7 +501,7 @@
 }
 
-casa::uInt ASDMReader::getNumMainRow() 
-{
-  casa::uInt nrow = casa::uInt( mainRow_.size() ) ;
+casacore::uInt ASDMReader::getNumMainRow() 
+{
+  casacore::uInt nrow = casacore::uInt( mainRow_.size() ) ;
 
   return nrow ;
@@ -534,7 +534,7 @@
 }
 
-casa::Bool ASDMReader::setMainRow( casa::uInt irow ) 
-{
-  casa::Bool status = true ;
+casacore::Bool ASDMReader::setMainRow( casacore::uInt irow ) 
+{
+  casacore::Bool status = true ;
   row_ = irow ;
   execBlockTag_ = mainRow_[row_]->getExecBlockId() ;
@@ -544,10 +544,10 @@
     status = false ;
   else {
-    status = (casa::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;
+    status = (casacore::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;
   }
   return status ;
 }
 
-casa::Bool ASDMReader::setMainRow( casa::uInt configDescId, casa::uInt fieldId ) 
+casacore::Bool ASDMReader::setMainRow( casacore::uInt configDescId, casacore::uInt fieldId ) 
 {
   clearMainRow() ;
@@ -558,5 +558,5 @@
   if (rows == 0)
     return false;
-  mainRow_ = casa::Vector<MainRow *>( *rows ) ;
+  mainRow_ = casacore::Vector<MainRow *>( *rows ) ;
   
   return true ;
@@ -570,13 +570,13 @@
 void ASDMReader::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)) ) ;
@@ -586,5 +586,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)) ) ;
   }
@@ -601,7 +601,7 @@
 } 
 
-casa::Bool ASDMReader::setData()
-{
-  casa::String funcName = "setData" ;
+casacore::Bool ASDMReader::setData()
+{
+  casacore::String funcName = "setData" ;
 
   //logsink_->postLocally( LogMessage("try to retrieve binary data",LogOrigin(className_,funcName,WHERE)) ) ;
@@ -678,5 +678,5 @@
 }
 
-casa::uInt ASDMReader::getIFNo( unsigned int idx )
+casacore::uInt ASDMReader::getIFNo( unsigned int idx )
 {
   prepareData( idx ) ;
@@ -684,7 +684,7 @@
 }
 
-casa::uInt ASDMReader::getIFNo()
-{
-  map<Tag,casa::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;
+casacore::uInt ASDMReader::getIFNo()
+{
+  map<Tag,casacore::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;
   if ( iter != ifno_.end() )
     return iter->second ;
@@ -720,5 +720,5 @@
                                string &freqref ) 
 {
-  casa::String funcName = "getFrequency" ;
+  casacore::String funcName = "getFrequency" ;
 
   int nchan = specWinRow_p->getNumChan() ;
@@ -737,5 +737,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     }      
   }
@@ -752,5 +752,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
+      throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
     }      
     if ( specWinRow_p->isChanFreqStepExists() ) {
@@ -764,5 +764,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
     }          
     if ( specWinRow_p->isChanFreqStartExists() ) {
@@ -773,5 +773,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     }      
   }
@@ -788,5 +788,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
+      throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
     }
     if ( specWinRow_p->isChanFreqStepExists() ) {
@@ -800,5 +800,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
     }          
     if ( specWinRow_p->isChanFreqStartExists() ) {
@@ -810,5 +810,5 @@
     }
     else {
-      throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
+      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     }      
   }
@@ -1264,5 +1264,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 
@@ -1310,5 +1310,5 @@
                                  float &windaz ) 
 {
-  casa::String funcName = "getWeatherInfo" ;
+  casacore::String funcName = "getWeatherInfo" ;
 
   temperature = 0.0 ;
@@ -1710,17 +1710,17 @@
 
 vector<double> ASDMReader::toJ2000( vector<double> &dir,
-                                    casa::String &dirref,
+                                    casacore::String &dirref,
                                     double &mjd )
 {
-  casa::String funcName = "toJ2000" ;
+  casacore::String funcName = "toJ2000" ;
 
   vector<double> newd( dir ) ;
   if ( dirref != "J2000" ) {
-    me_ = casa::MEpoch( casa::Quantity( (casa::Double)mjd, "d" ), casa::MEpoch::UTC ) ;
+    me_ = casacore::MEpoch( casacore::Quantity( (casacore::Double)mjd, "d" ), casacore::MEpoch::UTC ) ;
     mf_.set( me_ ) ;
-    casa::MDirection::Types dirtype ;
-    casa::Bool b = casa::MDirection::getType( dirtype, dirref ) ;
+    casacore::MDirection::Types dirtype ;
+    casacore::Bool b = casacore::MDirection::getType( dirtype, dirref ) ;
     if ( b ) {
-      casa::Vector<casa::Double> cdir = toj2000_( dir ).getAngle( "rad" ).getValue() ; 
+      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]) ;
@@ -1738,5 +1738,5 @@
 string ASDMReader::getFrame()
 {
-  casa::String funcName = "getFrame" ;
+  casacore::String funcName = "getFrame" ;
  
   // default is TOPO
@@ -1767,5 +1767,5 @@
 int ASDMReader::getNumIFs()
 {
-  casa::String funcName = "getNumIFs" ;
+  casacore::String funcName = "getNumIFs" ;
 
   int nif = 0 ;
