Ignore:
Timestamp:
10/04/16 18:20:50 (8 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes/No?

Interface Changes: Yes/No?

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...


Check-in asap modifications from Jim regarding casacore namespace conversion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/asdm2ASAP/ASDMReader.cc

    r2755 r3106  
    5757}
    5858
    59 bool ASDMReader::open( const string &filename, const casa::Record &rec )
    60 {
    61   casa::String funcName = "open" ;
     59bool ASDMReader::open( const string &filename, const casacore::Record &rec )
     60{
     61  casacore::String funcName = "open" ;
    6262
    6363  // return value
     
    7272  // parsing ASDM options
    7373  if ( rec.isDefined( "asdm" ) ) {
    74     casa::Record asdmrec = rec.asRecord( "asdm" ) ;
     74    casacore::Record asdmrec = rec.asRecord( "asdm" ) ;
    7575
    7676    // antenna
    7777    if ( asdmrec.isDefined( "antenna" ) ) {
    78       if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casa::TpInt ) {
     78      if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casacore::TpInt ) {
    7979        antennaId_ = asdmrec.asInt( "antenna" ) ;
    8080      }
     
    183183    vector<AntennaRow *> rows = atab.get() ;
    184184    int idx = -1 ;
    185     for ( casa::uInt irow = 0 ; irow < rows.size() ; irow++ ) {
    186       if ( casa::String(rows[irow]->getName()) == antennaName_ ) {
     185    for ( casacore::uInt irow = 0 ; irow < rows.size() ; irow++ ) {
     186      if ( casacore::String(rows[irow]->getName()) == antennaName_ ) {
    187187        idx = rows[irow]->getAntennaId().getTagValue() ;
    188188        break ;
     
    191191    if ( idx == -1 ) {
    192192      close() ;
    193       throw (casa::AipsError( antennaName_ + " not found." )) ;
     193      throw (casacore::AipsError( antennaName_ + " not found." )) ;
    194194    }
    195195    else {
     
    204204    if ( antennaRow == 0 ) {
    205205      close() ;
    206       throw (casa::AipsError( "AntennaId " + casa::String::toString(antennaId_) + " is invalid." ) ) ;
     206      throw (casacore::AipsError( "AntennaId " + casacore::String::toString(antennaId_) + " is invalid." ) ) ;
    207207    }
    208208  }
     
    211211  // set antenna name
    212212  if ( antennaName_.size() == 0 ) {
    213     antennaName_ = casa::String( antennaRow->getName() ) ;
     213    antennaName_ = casacore::String( antennaRow->getName() ) ;
    214214  }
    215215
     
    218218
    219219  // station name
    220   stationName_ = casa::String( stationRow->getName() ) ;
     220  stationName_ = casacore::String( stationRow->getName() ) ;
    221221
    222222  // antenna position
    223223  antennaPosition_.resize( 3 ) ;
    224224  vector<Length> antpos = stationRow->getPosition() ;
    225   for ( casa::uInt i = 0 ; i < 3 ; i++ )
    226     antennaPosition_[i] = Quantity( casa::Double( antpos[i].get() ), Unit( "m" ) ) ;
    227   mp_ = casa::MPosition( casa::MVPosition( antennaPosition_ ),
    228                          casa::MPosition::ITRF ) ;
     225  for ( casacore::uInt i = 0 ; i < 3 ; i++ )
     226    antennaPosition_[i] = Quantity( casacore::Double( antpos[i].get() ), Unit( "m" ) ) ;
     227  mp_ = casacore::MPosition( casacore::MVPosition( antennaPosition_ ),
     228                         casacore::MPosition::ITRF ) ;
    229229  mf_.set( mp_ ) ;
    230230
     
    233233
    234234  // get Main rows
    235   //mainRow_ = casa::Vector<MainRow *>(asdm_->getMain().get()) ;
     235  //mainRow_ = casacore::Vector<MainRow *>(asdm_->getMain().get()) ;
    236236
    237237  // set up IFNO
     
    266266}
    267267
    268 void ASDMReader::fillHeader( casa::Int &nchan,
    269                              casa::Int &npol,
    270                              casa::Int &nif,
    271                              casa::Int &nbeam,
    272                              casa::String &observer,
    273                              casa::String &project,
    274                              casa::String &obstype,
    275                              casa::String &antennaname,
    276                              casa::Vector<casa::Double> &antennaposition,
    277                              casa::Float &equinox,
    278                              casa::String &freqref,
    279                              casa::Double &reffreq,
    280                              casa::Double &bandwidth,
    281                              casa::Double &utc,
    282                              casa::String &fluxunit,
    283                              casa::String &epoch,
    284                              casa::String &poltype )
    285 {
    286   casa::String funcName = "fillHeader" ;
     268void ASDMReader::fillHeader( casacore::Int &nchan,
     269                             casacore::Int &npol,
     270                             casacore::Int &nif,
     271                             casacore::Int &nbeam,
     272                             casacore::String &observer,
     273                             casacore::String &project,
     274                             casacore::String &obstype,
     275                             casacore::String &antennaname,
     276                             casacore::Vector<casacore::Double> &antennaposition,
     277                             casacore::Float &equinox,
     278                             casacore::String &freqref,
     279                             casacore::Double &reffreq,
     280                             casacore::Double &bandwidth,
     281                             casacore::Double &utc,
     282                             casacore::String &fluxunit,
     283                             casacore::String &epoch,
     284                             casacore::String &poltype )
     285{
     286  casacore::String funcName = "fillHeader" ;
    287287
    288288  ExecBlockTable &ebtab = asdm_->getExecBlock() ;
    289289  // at the moment take first row of ExecBlock table
    290290  ExecBlockRow *ebrow = ebtab.get()[0] ;
    291   casa::String telescopeName( ebrow->getTelescopeName() ) ;
    292   //casa::String stationName( stationRow_p->getName() ) ;
     291  casacore::String telescopeName( ebrow->getTelescopeName() ) ;
     292  //casacore::String stationName( stationRow_p->getName() ) ;
    293293
    294294  // antennaname
     
    299299  // antennaposition
    300300  antennaposition.resize( 3 ) ;
    301   for ( casa::uInt i = 0 ; i < 3 ; i++ )
     301  for ( casacore::uInt i = 0 ; i < 3 ; i++ )
    302302    antennaposition[i] = antennaPosition_[i].getValue( Unit("m") ) ;
    303303
     
    311311  // utc
    312312  // start time of the project
    313   utc = casa::Double( ebrow->getStartTime().getMJD() ) ;
     313  utc = casacore::Double( ebrow->getStartTime().getMJD() ) ;
    314314 
    315315
     
    330330      refidx = irow ;
    331331  }
    332   nchan = casa::Int( *max_element( nchans.begin(), nchans.end() ) ) ;
     332  nchan = casacore::Int( *max_element( nchans.begin(), nchans.end() ) ) ;
    333333
    334334  //logsink_->postLocally( LogMessage("refidx = "+String::toString(refidx),LogOrigin(className_,funcName,WHERE)) ) ;
     
    341341    }
    342342  }
    343   bandwidth = casa::Double( *max_element( bws.begin(), bws.end() ) ) ;
     343  bandwidth = casacore::Double( *max_element( bws.begin(), bws.end() ) ) ;
    344344
    345345  // reffreq
    346   reffreq = casa::Double( spwrows[refidx]->getRefFreq().get() ) ;
     346  reffreq = casacore::Double( spwrows[refidx]->getRefFreq().get() ) ;
    347347
    348348  // freqref
     
    386386
    387387  // npol
    388   npol = casa::Int( *max_element( npols.begin(), npols.end() ) ) ;
     388  npol = casacore::Int( *max_element( npols.begin(), npols.end() ) ) ;
    389389
    390390  // poltype
     
    425425
    426426  // nbeam
    427   nbeam = casa::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;
     427  nbeam = casacore::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;
    428428
    429429  // fluxunit
     
    445445  obstype = "" ;
    446446  for ( unsigned int imode = 0 ; imode < obsmode.size() ; imode++ ) {
    447     obstype += casa::String(obsmode[imode]) ;
     447    obstype += casacore::String(obsmode[imode]) ;
    448448    if ( imode != obsmode.size()-1 )
    449449      obstype += "#" ;
     
    453453void ASDMReader::selectConfigDescription()
    454454{
    455   casa::String funcName = "selectConfigDescription" ;
     455  casacore::String funcName = "selectConfigDescription" ;
    456456
    457457  vector<ConfigDescriptionRow *> cdrows = asdm_->getConfigDescription().get() ;
     
    466466  configDescIdList_.resize( cdidTags.size() ) ;
    467467  for ( unsigned int i = 0 ; i < cdidTags.size() ; i++ ) {
    468     configDescIdList_[i] = casa::uInt( cdidTags[i].getTagValue() ) ;
     468    configDescIdList_[i] = casacore::uInt( cdidTags[i].getTagValue() ) ;
    469469  }
    470470}
     
    476476  Tag atag( antennaId_, TagType::Antenna ) ;
    477477  for ( unsigned int irow = 0 ; irow < frows.size() ; irow++ ) {
    478     casa::uInt feedId = (casa::uInt)(frows[irow]->getFeedId() ) ;
    479     if ( casa::anyEQ( feedIdList_, feedId ) )
     478    casacore::uInt feedId = (casacore::uInt)(frows[irow]->getFeedId() ) ;
     479    if ( casacore::anyEQ( feedIdList_, feedId ) )
    480480      continue ;
    481481    if ( frows[irow]->getAntennaId() == atag ) {
     
    487487}
    488488
    489 casa::Vector<casa::uInt> ASDMReader::getFieldIdList()
    490 {
    491   casa::String funcName = "getFieldIdList" ;
     489casacore::Vector<casacore::uInt> ASDMReader::getFieldIdList()
     490{
     491  casacore::String funcName = "getFieldIdList" ;
    492492
    493493  vector<FieldRow *> frows = asdm_->getField().get() ;
     
    501501}
    502502
    503 casa::uInt ASDMReader::getNumMainRow()
    504 {
    505   casa::uInt nrow = casa::uInt( mainRow_.size() ) ;
     503casacore::uInt ASDMReader::getNumMainRow()
     504{
     505  casacore::uInt nrow = casacore::uInt( mainRow_.size() ) ;
    506506
    507507  return nrow ;
     
    534534}
    535535
    536 casa::Bool ASDMReader::setMainRow( casa::uInt irow )
    537 {
    538   casa::Bool status = true ;
     536casacore::Bool ASDMReader::setMainRow( casacore::uInt irow )
     537{
     538  casacore::Bool status = true ;
    539539  row_ = irow ;
    540540  execBlockTag_ = mainRow_[row_]->getExecBlockId() ;
     
    544544    status = false ;
    545545  else {
    546     status = (casa::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;
     546    status = (casacore::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;
    547547  }
    548548  return status ;
    549549}
    550550
    551 casa::Bool ASDMReader::setMainRow( casa::uInt configDescId, casa::uInt fieldId )
     551casacore::Bool ASDMReader::setMainRow( casacore::uInt configDescId, casacore::uInt fieldId )
    552552{
    553553  clearMainRow() ;
     
    558558  if (rows == 0)
    559559    return false;
    560   mainRow_ = casa::Vector<MainRow *>( *rows ) ;
     560  mainRow_ = casacore::Vector<MainRow *>( *rows ) ;
    561561 
    562562  return true ;
     
    570570void ASDMReader::setupIFNO()
    571571{
    572   casa::String funcName = "setupIFNO" ;
     572  casacore::String funcName = "setupIFNO" ;
    573573
    574574  vector<SpectralWindowRow *> spwrows = asdm_->getSpectralWindow().get() ;
    575575  unsigned int nrow = spwrows.size() ;
    576576  ifno_.clear() ;
    577   casa::uInt idx = 0 ;
    578   casa::uInt wvridx = 0 ;
     577  casacore::uInt idx = 0 ;
     578  casacore::uInt wvridx = 0 ;
    579579  for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) {
    580     casa::uInt index ;
     580    casacore::uInt index ;
    581581    if ( isWVR( spwrows[irow] ) ) {
    582582      //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+" is WVR",LogOrigin(className_,funcName,WHERE)) ) ;
     
    586586      index = ++idx ;
    587587    }
    588     ifno_.insert( pair<Tag,casa::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ;
     588    ifno_.insert( pair<Tag,casacore::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ;
    589589    //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+": IFNO="+String::toString(index),LogOrigin(className_,funcName,WHERE)) ) ;
    590590  }
     
    601601}
    602602
    603 casa::Bool ASDMReader::setData()
    604 {
    605   casa::String funcName = "setData" ;
     603casacore::Bool ASDMReader::setData()
     604{
     605  casacore::String funcName = "setData" ;
    606606
    607607  //logsink_->postLocally( LogMessage("try to retrieve binary data",LogOrigin(className_,funcName,WHERE)) ) ;
     
    678678}
    679679
    680 casa::uInt ASDMReader::getIFNo( unsigned int idx )
     680casacore::uInt ASDMReader::getIFNo( unsigned int idx )
    681681{
    682682  prepareData( idx ) ;
     
    684684}
    685685
    686 casa::uInt ASDMReader::getIFNo()
    687 {
    688   map<Tag,casa::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;
     686casacore::uInt ASDMReader::getIFNo()
     687{
     688  map<Tag,casacore::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;
    689689  if ( iter != ifno_.end() )
    690690    return iter->second ;
     
    720720                               string &freqref )
    721721{
    722   casa::String funcName = "getFrequency" ;
     722  casacore::String funcName = "getFrequency" ;
    723723
    724724  int nchan = specWinRow_p->getNumChan() ;
     
    737737    }
    738738    else {
    739       throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     739      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
    740740    }     
    741741  }
     
    752752    }
    753753    else {
    754       throw (casa::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
     754      throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
    755755    }     
    756756    if ( specWinRow_p->isChanFreqStepExists() ) {
     
    764764    }
    765765    else {
    766       throw (casa::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
     766      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
    767767    }         
    768768    if ( specWinRow_p->isChanFreqStartExists() ) {
     
    773773    }
    774774    else {
    775       throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     775      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
    776776    }     
    777777  }
     
    788788    }
    789789    else {
    790       throw (casa::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
     790      throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
    791791    }
    792792    if ( specWinRow_p->isChanFreqStepExists() ) {
     
    800800    }
    801801    else {
    802       throw (casa::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
     802      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
    803803    }         
    804804    if ( specWinRow_p->isChanFreqStartExists() ) {
     
    810810    }
    811811    else {
    812       throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     812      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
    813813    }     
    814814  }
     
    12641264    for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) {
    12651265      CalAtmosphereRow *atmrow = atmrows[irow] ;
    1266       if ( casa::String(atmrow->getAntennaName()) != antennaName_
     1266      if ( casacore::String(atmrow->getAntennaName()) != antennaName_
    12671267           //|| atmrow->getReceiverBand() != rb
    12681268           //|| atmrow->getBasebandName() != bbname
     
    13101310                                 float &windaz )
    13111311{
    1312   casa::String funcName = "getWeatherInfo" ;
     1312  casacore::String funcName = "getWeatherInfo" ;
    13131313
    13141314  temperature = 0.0 ;
     
    17101710
    17111711vector<double> ASDMReader::toJ2000( vector<double> &dir,
    1712                                     casa::String &dirref,
     1712                                    casacore::String &dirref,
    17131713                                    double &mjd )
    17141714{
    1715   casa::String funcName = "toJ2000" ;
     1715  casacore::String funcName = "toJ2000" ;
    17161716
    17171717  vector<double> newd( dir ) ;
    17181718  if ( dirref != "J2000" ) {
    1719     me_ = casa::MEpoch( casa::Quantity( (casa::Double)mjd, "d" ), casa::MEpoch::UTC ) ;
     1719    me_ = casacore::MEpoch( casacore::Quantity( (casacore::Double)mjd, "d" ), casacore::MEpoch::UTC ) ;
    17201720    mf_.set( me_ ) ;
    1721     casa::MDirection::Types dirtype ;
    1722     casa::Bool b = casa::MDirection::getType( dirtype, dirref ) ;
     1721    casacore::MDirection::Types dirtype ;
     1722    casacore::Bool b = casacore::MDirection::getType( dirtype, dirref ) ;
    17231723    if ( b ) {
    1724       casa::Vector<casa::Double> cdir = toj2000_( dir ).getAngle( "rad" ).getValue() ;
     1724      casacore::Vector<casacore::Double> cdir = toj2000_( dir ).getAngle( "rad" ).getValue() ;
    17251725      //logsink_->postLocally( LogMessage("cdir = "+String::toString(cdir),LogOrigin(className_,funcName,WHERE)) ) ;
    17261726      newd[0] = (double)(cdir[0]) ;
     
    17381738string ASDMReader::getFrame()
    17391739{
    1740   casa::String funcName = "getFrame" ;
     1740  casacore::String funcName = "getFrame" ;
    17411741 
    17421742  // default is TOPO
     
    17671767int ASDMReader::getNumIFs()
    17681768{
    1769   casa::String funcName = "getNumIFs" ;
     1769  casacore::String funcName = "getNumIFs" ;
    17701770
    17711771  int nif = 0 ;
Note: See TracChangeset for help on using the changeset viewer.