Changeset 3106 for trunk/external-alma


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.

Location:
trunk/external-alma
Files:
20 edited

Legend:

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

    r2869 r3106  
    9090  //logsink_->postLocally( LogMessage("sFreqFrame = "+sFreqFrame,LogOrigin(className_,funcName,WHERE)) ) ;
    9191 
    92   Vector<casa::Double> antpos = table_->getHeader().antennaposition ;
     92  Vector<casacore::Double> antpos = table_->getHeader().antennaposition ;
    9393
    9494  // data selection
     
    194194
    195195          // fill MOLECULE_ID and add MOLECULES row if necessary
    196           Vector<casa::Double> restFreqs( rf.size() ) ;
     196          Vector<casacore::Double> restFreqs( rf.size() ) ;
    197197          for ( uInt i = 0 ; i < rf.size() ; i++ )
    198             restFreqs[i] = (casa::Double)(rf[i]) ;
     198            restFreqs[i] = (casacore::Double)(rf[i]) ;
    199199          setMolecule( restFreqs ) ;
    200200         
    201201          // time and interval
    202           casa::Double mjd = (casa::Double)(reader_->getTime()) ;
    203           casa::Double interval = (casa::Double)(reader_->getInterval()) ;
     202          casacore::Double mjd = (casacore::Double)(reader_->getTime()) ;
     203          casacore::Double interval = (casacore::Double)(reader_->getInterval()) ;
    204204          //logsink_->postLocally( LogMessage("mjd = "+String::toString(mjd),LogOrigin(className_,funcName,WHERE)) ) ;
    205205
     
    208208         
    209209          // fill SRCNAME, SRCTYPE, FIELDNAME, SRCDIRECTION, SRCPROPERMOTION, and SRCVELOCITY
    210           Vector<casa::Double> srcDir( 2 ) ;
    211           srcDir[0] = (casa::Double)(srcDirection[0]) ;
    212           srcDir[1] = (casa::Double)(srcDirection[1]) ;
    213           Vector<casa::Double> srcPM( 2 ) ;
    214           srcPM[0] = (casa::Double)(srcProperMotion[0]) ;
    215           srcPM[1] = (casa::Double)(srcProperMotion[1]) ;
    216           setSource( srcname, srctype, fieldname, srcDir, srcPM, (casa::Double)sysVel ) ;
     210          Vector<casacore::Double> srcDir( 2 ) ;
     211          srcDir[0] = (casacore::Double)(srcDirection[0]) ;
     212          srcDir[1] = (casacore::Double)(srcDirection[1]) ;
     213          Vector<casacore::Double> srcPM( 2 ) ;
     214          srcPM[0] = (casacore::Double)(srcProperMotion[0]) ;
     215          srcPM[1] = (casacore::Double)(srcProperMotion[1]) ;
     216          setSource( srcname, srctype, fieldname, srcDir, srcPM, (casacore::Double)sysVel ) ;
    217217
    218218          // fill FLAGROW
     
    231231                                   windspeed,
    232232                                   windaz ) ;
    233           setWeather2( (casa::Float)temperature,
    234                        (casa::Float)pressure,
    235                        (casa::Float)humidity,
    236                        (casa::Float)windspeed,
    237                        (casa::Float)windaz ) ;
     233          setWeather2( (casacore::Float)temperature,
     234                       (casacore::Float)pressure,
     235                       (casacore::Float)humidity,
     236                       (casacore::Float)windspeed,
     237                       (casacore::Float)windaz ) ;
    238238          //logsink_->postLocally( LogMessage("temperature = "+String::toString(temperature),LogOrigin(className_,funcName,WHERE)) ) ;
    239239          // fill AZIMUTH, ELEVATION, DIRECTION and SCANRATE
     
    246246                                    el,
    247247                                    srate ) ;
    248           Vector<casa::Double> scanRate( 2, 0.0 ) ;
    249           Vector<casa::Double> direction( 2, 0.0 ) ;
     248          Vector<casacore::Double> scanRate( 2, 0.0 ) ;
     249          Vector<casacore::Double> direction( 2, 0.0 ) ;
    250250          if ( srate.size() > 0 ) {
    251             scanRate[0] = (casa::Double)(srate[0]) ;
    252             scanRate[1] = (casa::Double)(srate[1]) ;
     251            scanRate[0] = (casacore::Double)(srate[0]) ;
     252            scanRate[1] = (casacore::Double)(srate[1]) ;
    253253          }
    254254          setScanRate( scanRate ) ;
    255255          if ( dir.size() > 0 ) {
    256             direction[0] = (casa::Double)(dir[0]) ;
    257             direction[1] = (casa::Double)(dir[1]) ;
     256            direction[0] = (casacore::Double)(dir[0]) ;
     257            direction[1] = (casacore::Double)(dir[1]) ;
    258258          }
    259259          else {
     
    261261          }
    262262          //logsink_->postLocally( LogMessage("direction = "+String::toString(direction),LogOrigin(className_,funcName,WHERE)) ) ;
    263           setDirection( direction, (casa::Float)az, (casa::Float)el ) ;
     263          setDirection( direction, (casacore::Float)az, (casacore::Float)el ) ;
    264264
    265265           // REFPIX, REFVAL, INCREMENT
     
    270270          else {
    271271            reader_->getFrequency( refpix, refval, incr, freqref ) ;
    272             refval = (double)toLSRK( casa::Double(refval),
     272            refval = (double)toLSRK( casacore::Double(refval),
    273273                                     String(freqref),
    274274                                     hdr.utc,
     
    281281
    282282          // fill FREQ_ID and add FREQUENCIES row if necessary
    283           setFrequency( (casa::Double)refpix, (casa::Double)refval, (casa::Double)incr ) ;
     283          setFrequency( (casacore::Double)refpix, (casacore::Double)refval, (casacore::Double)incr ) ;
    284284
    285285          // loop on polarization
     
    303303          // OPACITY
    304304          vector<float> tau = reader_->getOpacity() ;
    305           Vector<casa::Float> opacity = toVector( tau, numPol ) ;
     305          Vector<casacore::Float> opacity = toVector( tau, numPol ) ;
    306306
    307307          // SPECTRA, FLAGTRA, TSYS, TCAL
     
    311311          vector< vector<float> > tc ;
    312312          reader_->getTcalAndTsys( tc, ts ) ;
    313           Matrix<casa::Float> spectra = toMatrix( sp, numPol, numChan ) ;
     313          Matrix<casacore::Float> spectra = toMatrix( sp, numPol, numChan ) ;
    314314          //logsink_->postLocally( LogMessage("spectra(0,0) = "+String::toString(spectra(0,0)),LogOrigin(className_,funcName,WHERE)) ) ;
    315315          Vector<uChar> flagtra( numChan, 0 ) ;
    316           Matrix<casa::Float> tsys = toMatrix( ts, numPol, numChan ) ;
    317           Matrix<casa::Float> tcal = toMatrix( tc, numPol, numChan ) ;
     316          Matrix<casacore::Float> tsys = toMatrix( ts, numPol, numChan ) ;
     317          Matrix<casacore::Float> tcal = toMatrix( tc, numPol, numChan ) ;
    318318          //logsink_->postLocally( LogMessage("tsys(0,0) = "+String::toString(tsys(0,0)),LogOrigin(className_,funcName,WHERE)) ) ;
    319319//           String caltime = "" ;
    320 //           if ( anyNE( tcal, (casa::Float)1.0 ) )
     320//           if ( anyNE( tcal, (casacore::Float)1.0 ) )
    321321//             caltime = toTcalTime( mjd ) ;
    322322          String caltime = toTcalTime( mjd ) ;
     
    401401    string ref ;
    402402    reader_->getSourceDirection( sdir, ref ) ;
    403     Vector<casa::Double> sourceDir( sdir ) ;
     403    Vector<casacore::Double> sourceDir( sdir ) ;
    404404    hdr.reffreq = toLSRK( hdr.reffreq, hdr.freqref, hdr.utc, hdr.antennaposition, sdir, String(ref) ) ;
    405405    hdr.freqref = "LSRK" ;
     
    437437}
    438438
    439 Matrix<casa::Float> ASDMFiller::toMatrix( float *sp,
     439Matrix<casacore::Float> ASDMFiller::toMatrix( float *sp,
    440440                                         unsigned int npol,
    441441                                         unsigned int nchan )
    442442{
    443   Matrix<casa::Float> mSp( npol, nchan ) ;
     443  Matrix<casacore::Float> mSp( npol, nchan ) ;
    444444  if ( npol <= 2 ) {
    445445    // 1 or 2 polarization case
    446446    for ( unsigned int ich = 0 ; ich < nchan ; ich++ ) {
    447447      for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ ) {
    448         mSp(ipol,ich) = (casa::Float)(sp[npol*ich+ipol]) ;
     448        mSp(ipol,ich) = (casacore::Float)(sp[npol*ich+ipol]) ;
    449449      }
    450450    }
     
    453453    // 4 polarization case
    454454    for ( unsigned int ich = 0 ; ich < nchan ; ich++ ) {
    455       mSp(0,ich) = (casa::Float)(sp[4*ich]) ;   // Re(XX)
    456       mSp(1,ich) = (casa::Float)(sp[4*ich+4]) ; // Re(YY)
    457       mSp(2,ich) = (casa::Float)(sp[4*ich+2]) ; // Re(XY)
    458       mSp(3,ich) = (casa::Float)(sp[4*ich+3]) ; // Im(XY)
     455      mSp(0,ich) = (casacore::Float)(sp[4*ich]) ;   // Re(XX)
     456      mSp(1,ich) = (casacore::Float)(sp[4*ich+4]) ; // Re(YY)
     457      mSp(2,ich) = (casacore::Float)(sp[4*ich+2]) ; // Re(XY)
     458      mSp(3,ich) = (casacore::Float)(sp[4*ich+3]) ; // Im(XY)
    459459    }
    460460  }
     
    462462}
    463463
    464 Matrix<casa::Float> ASDMFiller::toMatrix( vector< vector<float> > &tsys,
     464Matrix<casacore::Float> ASDMFiller::toMatrix( vector< vector<float> > &tsys,
    465465                                               unsigned int npol,
    466466                                               unsigned int nchan )
     
    468468  unsigned int numRec = tsys.size() ;
    469469  unsigned int numChan = tsys[0].size() ;
    470   Matrix<casa::Float> ret ;
     470  Matrix<casacore::Float> ret ;
    471471  if ( npol == numRec && nchan == numChan ) {
    472472    ret.resize( npol, nchan ) ;
    473473    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    474474      for ( unsigned int ic = 0 ; ic < nchan ; ic++ )
    475         ret( ip, ic ) = (casa::Float)(tsys[ip][ic]) ;
     475        ret( ip, ic ) = (casacore::Float)(tsys[ip][ic]) ;
    476476  }
    477477  else if ( npol == numRec && numChan == 1 ) {
    478478    ret.resize( npol, 1 ) ;
    479479    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    480       ret( ip, 0 ) = (casa::Float)(tsys[0][0]) ;
     480      ret( ip, 0 ) = (casacore::Float)(tsys[0][0]) ;
    481481  }
    482482  else if ( numRec == 1 && nchan == numChan ) {
     
    484484    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    485485      for ( unsigned int ic = 0 ; ic < nchan ; ic++ )
    486         ret( ip, ic ) = (casa::Float)(tsys[0][ic]) ;
     486        ret( ip, ic ) = (casacore::Float)(tsys[0][ic]) ;
    487487  }
    488488  else if ( numRec == 1 && numChan == 1 ) {
    489489    ret.resize( npol, 1 ) ;
    490490    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    491       ret( ip, 0 ) = (casa::Float)(tsys[0][0]) ;
     491      ret( ip, 0 ) = (casacore::Float)(tsys[0][0]) ;
    492492  }
    493493  else if ( numRec == 2 && npol == 4 && numChan == nchan ) {
     
    496496    ret.resize( npol, nchan ) ;
    497497    for ( unsigned int ic = 0 ; ic < nchan ; ic++ ) {
    498       casa::Float tsysxy = (casa::Float)(0.5*(tsys[0][ic]+tsys[1][ic])) ;
    499       ret( 0, ic ) = (casa::Float)(tsys[0][ic]) ;
    500       ret( 1, ic ) = (casa::Float)(tsys[1][ic]) ;
     498      casacore::Float tsysxy = (casacore::Float)(0.5*(tsys[0][ic]+tsys[1][ic])) ;
     499      ret( 0, ic ) = (casacore::Float)(tsys[0][ic]) ;
     500      ret( 1, ic ) = (casacore::Float)(tsys[1][ic]) ;
    501501      ret( 2, ic ) = tsysxy ;
    502502      ret( 3, ic ) = tsysxy ;
     
    507507    //       at the moment Tsys[XY] = 0.5*(Tsys[X]+Tsys[Y])
    508508    ret.resize( npol, 1 ) ;
    509     casa::Float tsysxy = (casa::Float)(0.5*(tsys[0][0]+tsys[1][0])) ;
    510     ret( 0, 0 ) = (casa::Float)(tsys[0][0]) ;
    511     ret( 1, 0 ) = (casa::Float)(tsys[1][0]) ;
     509    casacore::Float tsysxy = (casacore::Float)(0.5*(tsys[0][0]+tsys[1][0])) ;
     510    ret( 0, 0 ) = (casacore::Float)(tsys[0][0]) ;
     511    ret( 1, 0 ) = (casacore::Float)(tsys[1][0]) ;
    512512    ret( 2, 0 ) = tsysxy ;
    513513    ret( 3, 0 ) = tsysxy ;
     
    517517    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    518518      for ( unsigned int ic = 0 ; ic < nchan ; ic++ )
    519         ret( ip, ic ) = (casa::Float)(tsys[0][ic]) ;   
     519        ret( ip, ic ) = (casacore::Float)(tsys[0][ic]) ;   
    520520  }
    521521  return ret ;
    522522}
    523523
    524 Vector<casa::Float> ASDMFiller::toVector( vector<float> &tau,
     524Vector<casacore::Float> ASDMFiller::toVector( vector<float> &tau,
    525525                                               unsigned int npol )
    526526{
    527527  String funcName = "toVector" ;
    528528
    529   Vector<casa::Float> ret( npol ) ;
     529  Vector<casacore::Float> ret( npol ) ;
    530530  //logsink_->postLocally( LogMessage("tau0="+String::toString(tau[0]),LogOrigin(className_,funcName,WHERE)) ) ;
    531531  if ( npol == 4 ) {
    532     ret[0] = (casa::Float)tau[0] ;
    533     ret[1] = (casa::Float)tau[1] ;
     532    ret[0] = (casacore::Float)tau[0] ;
     533    ret[1] = (casacore::Float)tau[1] ;
    534534    ret[2] = 0.5 * ( ret[0] + ret[1] ) ;
    535535    ret[3] = ret[2] ;
     
    537537  else if ( npol == tau.size() ) {
    538538    for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ )
    539       ret[ipol] = (casa::Float)tau[ipol] ;
     539      ret[ipol] = (casacore::Float)tau[ipol] ;
    540540  }
    541541  else {
    542542    // I don't know how to handle...
    543543    for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ )
    544       ret[ipol] = (casa::Float)tau[0] ;
     544      ret[ipol] = (casacore::Float)tau[0] ;
    545545  }
    546546  //logsink_->postLocally( LogMessage("tau="+String::toString(ret),LogOrigin(className_,funcName,WHERE)) ) ;
     
    548548}
    549549
    550 String ASDMFiller::toTcalTime( casa::Double mjd )
     550String ASDMFiller::toTcalTime( casacore::Double mjd )
    551551{
    552552  return MVTime( mjd ).string( MVTime::YMD ) ;
    553553}
    554554
    555 void ASDMFiller::toJ2000( Vector<casa::Double> &dir,
     555void ASDMFiller::toJ2000( Vector<casacore::Double> &dir,
    556556                               double az,
    557557                               double el,
    558                                casa::Double mjd,
    559                                Vector<casa::Double> antpos )
     558                               casacore::Double mjd,
     559                               Vector<casacore::Double> antpos )
    560560{
    561561  String funcName = "toJ2000" ;
    562562
    563   Vector<casa::Double> azel( 2 ) ;
     563  Vector<casacore::Double> azel( 2 ) ;
    564564  azel[0] = az ;
    565565  azel[1] = el ;
     
    580580}
    581581
    582 Vector<casa::Double> ASDMFiller::toJ2000( Vector<casa::Double> dir,
     582Vector<casacore::Double> ASDMFiller::toJ2000( Vector<casacore::Double> dir,
    583583                                          String dirref,
    584                                           casa::Double mjd,
    585                                           Vector<casa::Double> antpos )
    586 {
    587   Vector<casa::Double> newd( dir ) ;
     584                                          casacore::Double mjd,
     585                                          Vector<casacore::Double> antpos )
     586{
     587  Vector<casacore::Double> newd( dir ) ;
    588588  if ( dirref != "J2000" ) {
    589589    MEpoch me( Quantity( mjd, "d" ), MEpoch::UTC ) ;
     
    620620}
    621621
    622 casa::Double ASDMFiller::toLSRK( casa::Double freq,
     622casacore::Double ASDMFiller::toLSRK( casacore::Double freq,
    623623                                 String freqref,
    624                                  casa::Double utc,
    625                                  Vector<casa::Double> antpos,
    626                                  Vector<casa::Double> dir,
     624                                 casacore::Double utc,
     625                                 Vector<casacore::Double> antpos,
     626                                 Vector<casacore::Double> dir,
    627627                                 String dirref )
    628628{
     
    630630
    631631  //logsink_->postLocally( LogMessage("freqref = "+freqref,LogOrigin(className_,funcName,WHERE)) ) ;
    632   casa::Double newf = freq ;
     632  casacore::Double newf = freq ;
    633633  if ( freqToLsr_ && freqref != "LSRK" ) {
    634     MEpoch me( Quantum<casa::Double>( utc, Unit("d") ), MEpoch::UTC ) ;
    635     Vector< Quantum<casa::Double> > antposQ( 3 ) ;
     634    MEpoch me( Quantum<casacore::Double>( utc, Unit("d") ), MEpoch::UTC ) ;
     635    Vector< Quantum<casacore::Double> > antposQ( 3 ) ;
    636636    for ( int i = 0 ; i < 3 ; i++ )
    637       antposQ[i] = Quantum<casa::Double>( antpos[i], Unit("m") ) ;
     637      antposQ[i] = Quantum<casacore::Double>( antpos[i], Unit("m") ) ;
    638638    MPosition mp( antposQ, MPosition::ITRF ) ;
    639639    MDirection::Types dirtype ;
     
    641641    if ( !b )
    642642      dirtype = MDirection::J2000 ;
    643     MDirection md( Quantum<casa::Double>( dir[0], Unit("rad") ),
    644                    Quantum<casa::Double>( dir[1], Unit("rad") ),
     643    MDirection md( Quantum<casacore::Double>( dir[0], Unit("rad") ),
     644                   Quantum<casacore::Double>( dir[1], Unit("rad") ),
    645645                   dirtype ) ;
    646646    MeasFrame mf( me, mp, md ) ;
     
    651651    MFrequency::Convert tolsr( freqtype,
    652652                               MFrequency::Ref( MFrequency::LSRK, mf ) ) ;
    653     newf = tolsr( Quantum<casa::Double>( freq, Unit("Hz") ) ).get( "Hz" ).getValue() ;
     653    newf = tolsr( Quantum<casacore::Double>( freq, Unit("Hz") ) ).get( "Hz" ).getValue() ;
    654654    //logsink_->postLocally( LogMessage("freq = "+String::toString(freq)+", newf = "+String::toString(newf),LogOrigin(className_,funcName,WHERE)) ) ;
    655655  }
  • trunk/external-alma/asdm2ASAP/ASDMFiller.h

    r2754 r3106  
    1313public:
    1414  // constructor and destructor
    15   ASDMFiller( casa::CountedPtr<asap::Scantable> stable ) ;
     15  ASDMFiller( casacore::CountedPtr<asap::Scantable> stable ) ;
    1616  ~ASDMFiller() ;
    1717
    1818  // open data
    19   bool open( const std::string &filename, const casa::Record &rec ) ;
     19  bool open( const std::string &filename, const casacore::Record &rec ) ;
    2020
    2121  // fill data
     
    2626 
    2727  // get reader object
    28   casa::CountedPtr<ASDMReader> getReader() { return reader_ ; } ;
     28  casacore::CountedPtr<ASDMReader> getReader() { return reader_ ; } ;
    2929
    3030  // set logger
    31   void setLogger( casa::CountedPtr<casa::LogSinkInterface> &logsink ) ;
     31  void setLogger( casacore::CountedPtr<casacore::LogSinkInterface> &logsink ) ;
    3232
    3333private:
     
    3636
    3737  // get IF key
    38   casa::String getIFKey( casa::uInt ifno ) ;
     38  casacore::String getIFKey( casacore::uInt ifno ) ;
    3939
    4040  // get FREQUENCIES attributes from ifrec_
    41   void getFrequencyRec( casa::String key,
     41  void getFrequencyRec( casacore::String key,
    4242                        double &refpix,
    4343                        double &refval,
     
    4545
    4646  // set FREQUENCIES attributes to ifrec_
    47   void setFrequencyRec( casa::String key,
     47  void setFrequencyRec( casacore::String key,
    4848                        double refpix,
    4949                        double refval,
     
    5151                     
    5252  // reshape float array spectra to Matrix<Float>
    53   casa::Matrix<casa::Float> toMatrix( float *sp,
     53  casacore::Matrix<casacore::Float> toMatrix( float *sp,
    5454                                      unsigned int npol,
    5555                                      unsigned int nchan ) ;
    5656
    5757  // reshape 2d vector Tsys to Matrix<Float>
    58   casa::Matrix<casa::Float> toMatrix( std::vector< std::vector<float> > &tsys,
     58  casacore::Matrix<casacore::Float> toMatrix( std::vector< std::vector<float> > &tsys,
    5959                                      unsigned int npol,
    6060                                      unsigned int nchan ) ;
    6161
    6262  // reshape vector<float> to Vector<Float> with appropriate length
    63   casa::Vector<casa::Float> toVector( std::vector<float> &tau,
     63  casacore::Vector<casacore::Float> toVector( std::vector<float> &tau,
    6464                                      unsigned int npol ) ;
    6565
    6666  // create TCAL time string from MJD
    67   casa::String toTcalTime( casa::Double mjd ) ;
     67  casacore::String toTcalTime( casacore::Double mjd ) ;
    6868
    6969  // AZEL to J2000
    70   void toJ2000( casa::Vector<casa::Double> &dir,
     70  void toJ2000( casacore::Vector<casacore::Double> &dir,
    7171                double az,
    7272                double el,
    73                 casa::Double mjd,
    74                 casa::Vector<casa::Double> antpos ) ;
     73                casacore::Double mjd,
     74                casacore::Vector<casacore::Double> antpos ) ;
    7575
    7676  // to J2000
    77   casa::Vector<casa::Double> toJ2000( casa::Vector<casa::Double> dir,
    78                                       casa::String dirref,
    79                                       casa::Double mjd,
    80                                       casa::Vector<casa::Double> antpos ) ;
     77  casacore::Vector<casacore::Double> toJ2000( casacore::Vector<casacore::Double> dir,
     78                                      casacore::String dirref,
     79                                      casacore::Double mjd,
     80                                      casacore::Vector<casacore::Double> antpos ) ;
    8181
    8282  // get frequency frame enum value from string
    83   casa::MFrequency::Types toFrameType( std::string &s ) ;
     83  casacore::MFrequency::Types toFrameType( std::string &s ) ;
    8484
    8585  // to LSRK
    8686  // utc must be UTC time in "d" (day)
    8787  // antpos must be ITRF value in "m"
    88   casa::Double toLSRK( casa::Double freq,
    89                        casa::String freqref,
    90                        casa::Double utc,
    91                        casa::Vector<casa::Double> antpos,
    92                        casa::Vector<casa::Double> dir,
    93                        casa::String dirref ) ;
     88  casacore::Double toLSRK( casacore::Double freq,
     89                       casacore::String freqref,
     90                       casacore::Double utc,
     91                       casacore::Vector<casacore::Double> antpos,
     92                       casacore::Vector<casacore::Double> dir,
     93                       casacore::String dirref ) ;
    9494
    95   casa::CountedPtr<ASDMReader> reader_ ;
    96   casa::Int antennaId_ ;
    97   casa::String antennaName_ ;
     95  casacore::CountedPtr<ASDMReader> reader_ ;
     96  casacore::Int antennaId_ ;
     97  casacore::String antennaName_ ;
    9898
    99   casa::Record ifrec_ ;
     99  casacore::Record ifrec_ ;
    100100
    101   casa::CountedPtr<casa::LogSinkInterface> logsink_ ;
     101  casacore::CountedPtr<casacore::LogSinkInterface> logsink_ ;
    102102
    103   casa::String className_ ;
    104   casa::Bool freqToLsr_ ;
     103  casacore::String className_ ;
     104  casacore::Bool freqToLsr_ ;
    105105
    106106} ;
  • 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 ;
  • trunk/external-alma/asdm2ASAP/ASDMReader.h

    r2979 r3106  
    3838   * @return boolean status (true or false)
    3939   **/
    40   bool open( const std::string &filename, const casa::Record &rec ) ;
     40  bool open( const std::string &filename, const casacore::Record &rec ) ;
    4141
    4242  /**
     
    5353   * get antenna id
    5454   **/
    55   casa::Int getAntennaId() { return antennaId_ ; } ;
     55  casacore::Int getAntennaId() { return antennaId_ ; } ;
    5656
    5757  /**
    5858   * get antenna name
    5959   **/
    60   casa::String getAntennaName() { return antennaName_ ; } ;
     60  casacore::String getAntennaName() { return antennaName_ ; } ;
    6161
    6262  /**
     
    8181   * @param poltype polarization type
    8282   **/
    83   void fillHeader( casa::Int &nchan,
    84                    casa::Int &npol,
    85                    casa::Int &nif,
    86                    casa::Int &nbeam,
    87                    casa::String &observer,
    88                    casa::String &project,
    89                    casa::String &obstype,
    90                    casa::String &antennaname,
    91                    casa::Vector<casa::Double> &antennaposition,
    92                    casa::Float &equinox,
    93                    casa::String &freqref,
    94                    casa::Double &reffreq,
    95                    casa::Double &bandwidth,
    96                    casa::Double &utc,
    97                    casa::String &fluxunit,
    98                    casa::String &epoch,
    99                    casa::String &poltype ) ; 
     83  void fillHeader( casacore::Int &nchan,
     84                   casacore::Int &npol,
     85                   casacore::Int &nif,
     86                   casacore::Int &nbeam,
     87                   casacore::String &observer,
     88                   casacore::String &project,
     89                   casacore::String &obstype,
     90                   casacore::String &antennaname,
     91                   casacore::Vector<casacore::Double> &antennaposition,
     92                   casacore::Float &equinox,
     93                   casacore::String &freqref,
     94                   casacore::Double &reffreq,
     95                   casacore::Double &bandwidth,
     96                   casacore::Double &utc,
     97                   casacore::String &fluxunit,
     98                   casacore::String &epoch,
     99                   casacore::String &poltype ) ; 
    100100
    101101  /**
     
    107107   * @return list of valid configDescriptionId
    108108   **/
    109   casa::Vector<casa::uInt> getConfigDescriptionIdList() { return configDescIdList_ ; } ;
     109  casacore::Vector<casacore::uInt> getConfigDescriptionIdList() { return configDescIdList_ ; } ;
    110110
    111111  /**
    112112   * get list of fieldId
    113113   *
    114    * @return list of fieldId as casa::uInt
    115    **/
    116   casa::Vector<casa::uInt> getFieldIdList() ;
     114   * @return list of fieldId as casacore::uInt
     115   **/
     116  casacore::Vector<casacore::uInt> getFieldIdList() ;
    117117
    118118  /**
     
    121121   * @return number of rows in Main table
    122122   **/
    123   casa::uInt getNumMainRow() ;
     123  casacore::uInt getNumMainRow() ;
    124124
    125125  /**
     
    135135   * @param fieldId
    136136   **/
    137   casa::Bool setMainRow( casa::uInt configDescId, casa::uInt fieldId ) ;
     137  casacore::Bool setMainRow( casacore::uInt configDescId, casacore::uInt fieldId ) ;
    138138
    139139  /**
     
    143143   * @return boolean indicating the row is valid or not
    144144   **/
    145   casa::Bool setMainRow( casa::uInt irow ) ;
     145  casacore::Bool setMainRow( casacore::uInt irow ) ;
    146146
    147147  /**
     
    181181   * @return IF number
    182182   **/
    183   casa::uInt getIFNo( unsigned int idx ) ;
    184   casa::uInt getIFNo() ;
     183  casacore::uInt getIFNo( unsigned int idx ) ;
     184  casacore::uInt getIFNo() ;
    185185
    186186  /**
     
    387387   * @return boolean status
    388388   **/
    389   casa::Bool setData() ;
     389  casacore::Bool setData() ;
    390390
    391391  /**
     
    408408   * @param logger (LogSinkInterface)
    409409   **/
    410   void setLogger( casa::CountedPtr<casa::LogSinkInterface> &logsink ) ;
     410  void setLogger( casacore::CountedPtr<casacore::LogSinkInterface> &logsink ) ;
    411411
    412412
     
    507507  **/
    508508  std::vector<double> toJ2000( std::vector<double> &dir,
    509                                casa::String &dirref,
     509                               casacore::String &dirref,
    510510                               double &mjd ) ;
    511511
     
    579579  const sdmbin::VMSData *vmsData_ ;
    580580 
    581   casa::Int antennaId_ ; // antenna id
    582   casa::String antennaName_ ; // antenna name
    583   casa::String stationName_ ; // station name
    584   casa::Vector<casa::Quantity> antennaPosition_ ; // antenna position
    585   casa::Vector<casa::uInt> configDescIdList_ ; // list of valid configDescriptionId
    586   casa::Vector<casa::uInt> feedIdList_ ; // list of valid feedId
    587   casa::Vector<casa::uInt> fieldIdList_ ; // list of fieldId
    588   casa::Int row_ ; // current row index
    589   map<asdm::Tag,casa::uInt> ifno_ ; // list of IFNO for each SpectralWindow rows
     581  casacore::Int antennaId_ ; // antenna id
     582  casacore::String antennaName_ ; // antenna name
     583  casacore::String stationName_ ; // station name
     584  casacore::Vector<casacore::Quantity> antennaPosition_ ; // antenna position
     585  casacore::Vector<casacore::uInt> configDescIdList_ ; // list of valid configDescriptionId
     586  casacore::Vector<casacore::uInt> feedIdList_ ; // list of valid feedId
     587  casacore::Vector<casacore::uInt> fieldIdList_ ; // list of fieldId
     588  casacore::Int row_ ; // current row index
     589  map<asdm::Tag,casacore::uInt> ifno_ ; // list of IFNO for each SpectralWindow rows
    590590  unsigned int numData_ ; // number of valid data in vmsData_ where v_antennaId equals antennaId_
    591591  vector<unsigned int> dataIdList_ ; // list of valid data indexes in vmsData_ 
     
    597597  EnumSet<TimeSamplingMod::TimeSampling> timeSampling_ ; // time sampling
    598598  EnumSet<SpectralResolutionTypeMod::SpectralResolutionType> resolutionType_ ; // spectral resolution type
    599   casa::CountedPtr<casa::LogSinkInterface> logsink_ ; // Logger
    600   casa::String className_ ;
     599  casacore::CountedPtr<casacore::LogSinkInterface> logsink_ ; // Logger
     600  casacore::String className_ ;
    601601  unsigned int dataIndex_ ;
    602602
    603603  // Tables/Rows for ASDM
    604   casa::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows
     604  casacore::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows
    605605  //asdm::AntennaRow *antennaRow_p ; // pointer to target Antenna row
    606606  //asdm::StationRow *stationRow_p ; // pointer to target Station row that target antenna is located
     
    617617  asdm::ArrayTimeInterval timeInterval_ ;
    618618
    619   casa::MDirection::Convert toj2000_ ;
    620   casa::MeasFrame mf_ ;
    621   casa::MPosition mp_ ;
    622   casa::MEpoch me_ ;
     619  casacore::MDirection::Convert toj2000_ ;
     620  casacore::MeasFrame mf_ ;
     621  casacore::MPosition mp_ ;
     622  casacore::MEpoch me_ ;
    623623} ;
    624624#endif // ASAP_ASDM_READER_H
  • trunk/external-alma/atnf/PKSIO/GBTFITSreader.h

    r1868 r3106  
    5050
    5151using namespace std;
    52 using namespace casa;
     52using namespace casacore;
    5353
    5454// <summary>
  • trunk/external-alma/atnf/PKSIO/NRODataRecord.h

    r2765 r3106  
    192192  //
    193193  // 2009/02/26 Takeshi Nakazato  Moved to NROReader
    194   casa::CountedPtr<char> LDATA ;
     194  casacore::CountedPtr<char> LDATA ;
    195195  // Spectral data for FITS data
    196196  //vector<int> JDATA ;
  • trunk/external-alma/atnf/PKSIO/NROReader.cc

    r3105 r3106  
    7373}
    7474
    75 // T must be std::string or casa::String
     75// T must be std::string or casacore::String
    7676template<class T>
    7777inline String trim_nro_string(T const &s) {
  • trunk/external-alma/atnf/PKSIO/SDFITSreader.h

    r1757 r3106  
    4848
    4949using namespace std;
    50 using namespace casa;
     50using namespace casacore;
    5151
    5252// <summary>
  • trunk/external-alma/atnf/PKSIO/SDFITSwriter.h

    r1757 r3106  
    4343
    4444using namespace std;
    45 using namespace casa;
     45using namespace casacore;
    4646
    4747// <summary>
  • trunk/external-alma/components/SpectralComponents/CompiledSpectralElement.h

    r2980 r3106  
    6969        // Construct a compiled string
    7070        explicit CompiledSpectralElement(
    71                 const String& function, const Vector<Double>& param
     71                const casacore::String& function, const casacore::Vector<casacore::Double>& param
    7272        );
    7373
     
    9797
    9898        // Save to a record.
    99         virtual Bool toRecord(RecordInterface& out) const;
     99        virtual casacore::Bool toRecord(RecordInterface& out) const;
    100100
    101101protected:
     
    105105        // For subclasses. Parameters and function must be set after construction.
    106106        explicit CompiledSpectralElement(
    107                 SpectralElement::Types type, const Vector<Double>& param=Vector<Double>(0)
     107                SpectralElement::Types type, const casacore::Vector<casacore::Double>& param=casacore::Vector<casacore::Double>(0)
    108108        );
    109109
    110110        CompiledSpectralElement(
    111                 SpectralElement::Types type, uInt nParam
     111                SpectralElement::Types type, casacore::uInt nParam
    112112        );
    113113
    114         virtual void _setFunction(const String& function);
     114        virtual void _setFunction(const casacore::String& function);
    115115
    116116        /*
  • trunk/external-alma/components/SpectralComponents/GaussianSpectralElement.h

    r2980 r3106  
    7676        //# Constants
    7777        // Sigma to FWHM conversion factor
    78         static const Double SigmaToFWHM;
     78        static const casacore::Double SigmaToFWHM;
    7979
    8080        //# Constructors
     
    8686        // </thrown>
    8787        GaussianSpectralElement(
    88                 const Double ampl, const Double center,
    89                 const Double sigma
     88                const casacore::Double ampl, const casacore::Double center,
     89                const casacore::Double sigma
    9090        );
    9191
     
    9595        //   <li> AipsError if sigma == 0.0
    9696        // </thrown>
    97         GaussianSpectralElement(const Vector<Double> &param);
     97        GaussianSpectralElement(const casacore::Vector<casacore::Double> &param);
    9898        // Copy constructor (deep copy)
    9999        // <thrown>
     
    114114//      GaussianSpectralElement& operator=(const GaussianSpectralElement &other);
    115115        // Evaluate the value of the element at x
    116         //Double operator()(const Double x) const;
     116        //casacore::Double operator()(const casacore::Double x) const;
    117117
    118         Double getSigma() const;
    119         Double getFWHM() const;
     118        casacore::Double getSigma() const;
     119        casacore::Double getFWHM() const;
    120120
    121         Double getSigmaErr() const;
    122         Double getFWHMErr() const;
     121        casacore::Double getSigmaErr() const;
     122        casacore::Double getFWHMErr() const;
    123123
    124124
    125         void setSigma(Double sigma);
    126         void setFWHM(Double fwhm);
     125        void setSigma(casacore::Double sigma);
     126        void setFWHM(casacore::Double fwhm);
    127127
    128         void fixSigma(const Bool fix=True);
     128        void fixSigma(const casacore::Bool fix=True);
    129129
    130         Bool fixedSigma() const;
     130        casacore::Bool fixedSigma() const;
    131131
    132         Double getIntegral() const;
     132        casacore::Double getIntegral() const;
    133133
    134134        // Save to a record.   For Gaussian elements,
    135135        // the width is defined as a FWHM in the record interface.
    136         Bool toRecord(RecordInterface &out) const;
     136        casacore::Bool toRecord(RecordInterface &out) const;
    137137
    138138        // Sigma to FWHM
    139139        // Convert from sigma to FWHM and vice versa
    140140        // <group>
    141         static Double sigmaFromFWHM (const Double fwhm);
     141        static casacore::Double sigmaFromFWHM (const casacore::Double fwhm);
    142142
    143         static Double sigmaToFWHM (const Double sigma);
     143        static casacore::Double sigmaToFWHM (const casacore::Double sigma);
    144144        // </group>
    145145
    146         void set(const Vector<Double>& v);
     146        void set(const casacore::Vector<casacore::Double>& v);
    147147
    148148private:
     
    150150        // but the second param of the corresponding Gaussian1D function is the
    151151        // FWHM :(
    152         void _set(const Vector<Double>& v);
     152        void _set(const casacore::Vector<casacore::Double>& v);
    153153
    154154};
  • trunk/external-alma/components/SpectralComponents/Spectral2Estimate.tcc

    r2980 r3106  
    1818//#
    1919//# Correspondence concerning AIPS++ should be addressed as follows:
    20 //#        Internet email: aips2-request@nrao.edu.
     20//#        casacore::Internet email: aips2-request@nrao.edu.
    2121//#        Postal address: AIPS++ Project Office
    2222//#                        National Radio Astronomy Observatory
     
    4040//# Member templates
    4141template <class MT>
    42 const SpectralList &SpectralEstimate::estimate(const Vector<MT> &prof,
    43                                                Vector<MT> *der) {
     42const SpectralList &SpectralEstimate::estimate(const casacore::Vector<MT> &prof,
     43                                               casacore::Vector<MT> *der) {
    4444          if (prof.nelements() != lprof_p) {
    4545    delete [] deriv_p; deriv_p = 0; lprof_p = 0;
    4646    lprof_p = prof.nelements();
    47     deriv_p = new Double[lprof_p];
     47    deriv_p = new casacore::Double[lprof_p];
    4848  };
    4949  // Check if signal in window
    5050  if (!window(prof)) return slist_p;
    5151  // Limit window
    52   windowEnd_p = min(windowEnd_p+q_p , Int(lprof_p));
     52  windowEnd_p = min(windowEnd_p+q_p , casacore::Int(lprof_p));
    5353  windowLow_p = max(windowLow_p-q_p , 0 );
    5454  // Get the second derivatives
     
    5656  // Next for debugging
    5757  if (der) {
    58     for (uInt i=0; i<lprof_p; i++) (*der)[i] = deriv_p[i];
     58    for (casacore::uInt i=0; i<lprof_p; i++) (*der)[i] = deriv_p[i];
    5959  };
    6060  // Find the estimates (sorted)
     
    6565
    6666template <class MT>
    67 const SpectralList& SpectralEstimate::estimate(const Vector<MT>& x,
    68                                                const Vector<MT>& y)
     67const SpectralList& SpectralEstimate::estimate(const casacore::Vector<MT>& x,
     68                                               const casacore::Vector<MT>& y)
    6969{
    7070  if (x.nelements() != y.nelements()) {
     
    7777  estimate(y);
    7878  // Convert
    79   for (uInt i=0; i<slist_p.nelements(); i++) {
     79  for (casacore::uInt i=0; i<slist_p.nelements(); i++) {
    8080          if (slist_p[i]->getType() != SpectralElement::GAUSSIAN) {
    8181                  throw AipsError("Non-gaussian spectral types cannot be estimated");
     
    9090
    9191template <class MT>
    92 uInt SpectralEstimate::window(const Vector<MT> &prof) {
     92casacore::uInt SpectralEstimate::window(const casacore::Vector<MT> &prof) {
    9393  windowLow_p =0;
    9494  windowEnd_p = 0;
    9595  if (!useWindow_p || rms_p <= 0.0 || lprof_p == 0) {
    9696    if (regionEnd_p) {
    97       windowLow_p = min(max(0,regionLow_p),Int(lprof_p));
    98       windowEnd_p = min(regionEnd_p, Int(lprof_p));
     97      windowLow_p = min(max(0,regionLow_p),casacore::Int(lprof_p));
     98      windowEnd_p = min(regionEnd_p, casacore::Int(lprof_p));
    9999    } else windowEnd_p = lprof_p;
    100100    return windowEnd_p-windowLow_p;
    101101  };
    102102  // Total flux in profile and max position
    103   Double flux(0.0);
    104   Double pmax(prof(0));
    105   uInt imax(0);
    106   for (Int i=windowLow_p; i<windowEnd_p; i++) {
     103  casacore::Double flux(0.0);
     104  casacore::Double pmax(prof(0));
     105  casacore::uInt imax(0);
     106  for (casacore::Int i=windowLow_p; i<windowEnd_p; i++) {
    107107    if (prof(i)>pmax) {
    108108      pmax = prof(i);
     
    114114  if (pmax < cutoff_p) return 0;
    115115  // Window boundaries; new/old base and centre; width
    116   Int width(-1);
    117   Int nw(0);
    118   Double bnew(flux), bold;
    119   Double cnew(imax), cold;
     116  casacore::Int width(-1);
     117  casacore::Int nw(0);
     118  casacore::Double bnew(flux), bold;
     119  casacore::Double cnew(imax), cold;
    120120  do {
    121121    width++;
    122122    cold = cnew;
    123123    bold = bnew;
    124     windowLow_p = max(0, Int(cold-width+0.5));
    125     windowEnd_p = min(Int(lprof_p), Int(cold+width+1.5));
     124    windowLow_p = max(0, casacore::Int(cold-width+0.5));
     125    windowEnd_p = min(casacore::Int(lprof_p), casacore::Int(cold+width+1.5));
    126126    // flux and first moment in window
    127     Double s(0);
    128     Double c(0);
    129     for (Int i=windowLow_p; i<windowEnd_p; i++) {
     127    casacore::Double s(0);
     128    casacore::Double c(0);
     129    for (casacore::Int i=windowLow_p; i<windowEnd_p; i++) {
    130130      s += prof(i);
    131131      c += i*prof(i);
     
    142142
    143143template <class MT>
    144 void SpectralEstimate::findc2(const Vector<MT> &prof) {
    145   for (Int i=windowLow_p; i<windowEnd_p; i++) {
     144void SpectralEstimate::findc2(const casacore::Vector<MT> &prof) {
     145  for (casacore::Int i=windowLow_p; i<windowEnd_p; i++) {
    146146    // Moments
    147     Double m0(0.0);
    148     Double m2(0.0);
    149     for (Int j = -q_p; j <= q_p; j++) {
    150       Int k = i+j;
    151       if (k >= 0 && k<Int(lprof_p)) {
     147    casacore::Double m0(0.0);
     148    casacore::Double m2(0.0);
     149    for (casacore::Int j = -q_p; j <= q_p; j++) {
     150      casacore::Int k = i+j;
     151      if (k >= 0 && k<casacore::Int(lprof_p)) {
    152152        // add to moments
    153153        m0 += prof(k);
     
    161161
    162162template <class MT>
    163 void SpectralEstimate::findga(const Vector<MT> &prof) {
    164         Int i(windowLow_p-1);
     163void SpectralEstimate::findga(const casacore::Vector<MT> &prof) {
     164        casacore::Int i(windowLow_p-1);
    165165        // Window on Gaussian
    166         Int iclo(windowLow_p);
    167         Int ichi(windowLow_p);
     166        casacore::Int iclo(windowLow_p);
     167        casacore::Int ichi(windowLow_p);
    168168        // Peak counter
    169         Int nmax = 0;
     169        casacore::Int nmax = 0;
    170170        GaussianSpectralElement tspel;
    171171        while (++i < windowEnd_p) {
     
    187187                case 2: {
    188188                        // Some moments
    189                         Double m0m(0);
    190                         Double m0(0);
    191                         Double m1(0);
    192                         Double m2(0);
     189                        casacore::Double m0m(0);
     190                        casacore::Double m0(0);
     191                        casacore::Double m1(0);
     192                        casacore::Double m2(0);
    193193                        ichi = i;
    194194                        // Do Schwarz' calculation
    195                         Double b = deriv_p[iclo];
    196                         Double a = (deriv_p[ichi] - b) / (ichi-iclo);
    197                         for (Int ic=iclo; ic<=ichi; ic++) {
     195                        casacore::Double b = deriv_p[iclo];
     196                        casacore::Double a = (deriv_p[ichi] - b) / (ichi-iclo);
     197                        for (casacore::Int ic=iclo; ic<=ichi; ic++) {
    198198                                m0m += min(deriv_p[ic], 0.0);
    199                                 Double wi = deriv_p[ic] - a*(ic-iclo) - b;
     199                                casacore::Double wi = deriv_p[ic] - a*(ic-iclo) - b;
    200200                                m0 += wi;
    201201                                m1 += wi*ic;
     
    203203                        };
    204204                        // determinant
    205                         Double det = m2*m0 - m1*m1;
     205                        casacore::Double det = m2*m0 - m1*m1;
    206206                        if (det > 0.0 && fabs(m0m) >  FLT_EPSILON) {
    207                                 Double   xm = m1/m0;
    208                                 Double sg = 1.69*sqrt(det) / fabs(m0);
     207                                casacore::Double   xm = m1/m0;
     208                                casacore::Double sg = 1.69*sqrt(det) / fabs(m0);
    209209                                // Width above critical?
    210210                                if (sg > sigmin_p) {
    211                                         Int is = Int(1.73*sg+0.5);
    212                                         Int im = Int(xm+0.5);
    213                                         Double yl(0);
     211                                        casacore::Int is = casacore::Int(1.73*sg+0.5);
     212                                        casacore::Int im = casacore::Int(xm+0.5);
     213                                        casacore::Double yl(0);
    214214                                        if ((im-is) >= 0) yl = prof(im-is);
    215                                         Double yh(0);
    216                                         if ((im + is) <= Int(lprof_p-1)) yh = prof(im+is);
    217                                         Double ym = prof(im);
     215                                        casacore::Double yh(0);
     216                                        if ((im + is) <= casacore::Int(lprof_p-1)) yh = prof(im+is);
     217                                        casacore::Double ym = prof(im);
    218218                    // modified by dmehringer 2012apr03 to deal with 0 denominator
    219219                    // 0.0/0.0 produces NaN on Linux but 0 on OSX
    220                     Double pg = (ym-0.5*(yh+yl));
     220                    casacore::Double pg = (ym-0.5*(yh+yl));
    221221                                        if (pg != 0) {
    222                                                 Double denom = (1.0-exp(-0.5*(is*is)/sg/sg));
     222                                                casacore::Double denom = (1.0-exp(-0.5*(is*is)/sg/sg));
    223223                                                if (denom == 0) {
    224224                                                        throw AipsError("Bailing because division by zero is undefined");
     
    252252
    253253template <class MT>
    254 GaussianSpectralElement SpectralEstimate::convertElement (const Vector<MT>& x,
     254GaussianSpectralElement SpectralEstimate::convertElement (const casacore::Vector<MT>& x,
    255255                                                  const GaussianSpectralElement& el) const
    256256{
    257257        GaussianSpectralElement elOut = el;
    258    const Int& idxMax = x.nelements()-1;
     258   const casacore::Int& idxMax = x.nelements()-1;
    259259
    260260// Get current (pars are amp, center, width as the SpectralElement
    261261// will always be a Gaussian)
    262262
    263    Vector<Double> par, err;
     263   casacore::Vector<casacore::Double> par, err;
    264264   el.get(par);
    265265   el.getError(err);
     
    267267// Center
    268268
    269    Int cenIdx = Int(par[1]);
     269   casacore::Int cenIdx = casacore::Int(par[1]);
    270270
    271271// Get the x-increment, local to the center, as best we can from
     
    273273// vector is monotonic
    274274
    275    Double incX;
     275   casacore::Double incX;
    276276   if (cenIdx-1<0) {
    277277      incX = x[1] - x[0];
     
    287287      par[1] = incX*(par[1]-idxMax) + x[idxMax];   // Extrapolate from x[idxMax]
    288288   } else {
    289       Double dIdx = par[1] - cenIdx;
    290       par[1] = x[cenIdx] + dIdx*incX;              // Interpolate
     289      casacore::Double dIdx = par[1] - cenIdx;
     290      par[1] = x[cenIdx] + dIdx*incX;              // casacore::Interpolate
    291291   }
    292292   err[1] = abs(err[1] * incX);
  • trunk/external-alma/components/SpectralComponents/SpectralElement.cc

    r3029 r3106  
    4242#include <casa/iostream.h>
    4343
     44using namespace casacore;
    4445namespace casa { //# NAMESPACE CASA - BEGIN
    4546
  • trunk/external-alma/components/SpectralComponents/SpectralElement.h

    r3029 r3106  
    3434#include <casa/Arrays/Vector.h>
    3535#include <casa/Containers/RecordInterface.h>
     36
     37using namespace casacore;
    3638
    3739namespace casa { //# NAMESPACE CASA - BEGIN
     
    105107
    106108        // Evaluate the value of the element at x
    107         virtual Double operator()(const Double x) const;
    108 
    109         Bool operator==(const SpectralElement& other) const;
     109        virtual casacore::Double operator()(const casacore::Double x) const;
     110
     111        casacore::Bool operator==(const SpectralElement& other) const;
    110112
    111113        // Get parameter n
     
    113115        //  <li> AipsError if illegal n
    114116        // </thrown>
    115         virtual Double operator[](const uInt n) const;
    116 
    117         // Get all the types available as String and codes, and number available
    118         static const String* allTypes(Int &nall,
     117        virtual casacore::Double operator[](const uInt n) const;
     118
     119        // Get all the types available as casacore::String and codes, and number available
     120        static const casacore::String* allTypes(Int &nall,
    119121                        const SpectralElement::Types *&typ);
    120122        // Get a string from the type
    121         static const String &fromType(SpectralElement::Types tp);
    122         // Get a type from a (non-case sensitive; minimum match) String
    123         static Bool toType(SpectralElement::Types &tp,
    124                         const String &typName);
     123        static const casacore::String &fromType(SpectralElement::Types tp);
     124        // Get a type from a (non-case sensitive; minimum match) casacore::String
     125        static casacore::Bool toType(SpectralElement::Types &tp,
     126                        const casacore::String &typName);
    125127
    126128        // Get type of this element
     
    128130
    129131        // Get all parameters
    130         void get(Vector<Double>& params) const;
    131 
    132         Vector<Double> get() const;
     132        void get(casacore::Vector<casacore::Double>& params) const;
     133
     134        casacore::Vector<casacore::Double> get() const;
    133135
    134136        // Get error estimates of parameters
    135         void getError(Vector<Double> &err) const;
    136         Vector<Double> getError() const;
     137        void getError(casacore::Vector<casacore::Double> &err) const;
     138        casacore::Vector<casacore::Double> getError() const;
    137139
    138140        // Get the order (i.e. the number of parameters)
     
    140142
    141143        // Set the error fields
    142         virtual void setError(const Vector<Double> &err);
     144        virtual void setError(const casacore::Vector<casacore::Double> &err);
    143145
    144146        // Set fixed parameters (True) or unset them (False)
     
    148150
    149151        // Fix/unfix all in one go
    150         virtual void fix(const Vector<Bool>& fix);
     152        virtual void fix(const casacore::Vector<casacore::Bool>& fix);
    151153
    152154        // Get the fix state[s]
    153         const Vector<Bool> &fixed() const;
     155        const casacore::Vector<casacore::Bool> &fixed() const;
    154156
    155157        // Save to a record.
    156         virtual Bool toRecord(RecordInterface& out) const;
     158        virtual casacore::Bool toRecord(RecordInterface& out) const;
    157159
    158160        // set parameters
    159         virtual void set(const Vector<Double>& params);
     161        virtual void set(const casacore::Vector<casacore::Double>& params);
    160162
    161163protected:
     
    163165        SpectralElement() {}
    164166
    165         SpectralElement(Types type, const Vector<Double>& parms=Vector<Double>(0));
     167        SpectralElement(Types type, const casacore::Vector<casacore::Double>& parms=casacore::Vector<casacore::Double>(0));
    166168
    167169        SpectralElement(const SpectralElement& other);
     
    169171        SpectralElement &operator=(const SpectralElement& other);
    170172
    171         void _set(const Vector<Double>& params);
     173        void _set(const casacore::Vector<casacore::Double>& params);
    172174
    173175        void _setType(const Types type);
    174176
    175         void _setFunction(const SHARED_PTR<Function<Double, Double> >& f);
    176 
    177         virtual SHARED_PTR<Function<Double, Double> > _getFunction() const {
     177        void _setFunction(const SHARED_PTR<Function<casacore::Double, casacore::Double> >& f);
     178
     179        virtual SHARED_PTR<Function<casacore::Double, casacore::Double> > _getFunction() const {
    178180                return _function;
    179181        }
     
    186188        // The parameters of the function. I.e. the polynomial coefficients;
    187189        // amplitude, center and sigma of a Gaussian.
    188         Vector<Double> _params;
     190        casacore::Vector<casacore::Double> _params;
    189191        // The errors of the parameters
    190         Vector<Double> _errors;
     192        casacore::Vector<casacore::Double> _errors;
    191193        // The indication if the parameter has to be fixed (True) or solved (False).
    192194        // Solved is the default.
    193         Vector<Bool> _fixed;
    194 
    195         SHARED_PTR<Function<Double, Double> > _function;
     195        casacore::Vector<casacore::Bool> _fixed;
     196
     197        SHARED_PTR<Function<casacore::Double, casacore::Double> > _function;
    196198
    197199};
     
    199201ostream &operator<<(ostream& os, const SpectralElement& elem);
    200202
    201 Bool near(const SpectralElement& s1, const SpectralElement& s2, const Double tol);
    202 
    203 Bool nearAbs(const SpectralElement& s1, const SpectralElement& s2, const Double tol);
     203casacore::Bool near(const SpectralElement& s1, const SpectralElement& s2, const casacore::Double tol);
     204
     205casacore::Bool nearAbs(const SpectralElement& s1, const SpectralElement& s2, const casacore::Double tol);
    204206
    205207
  • trunk/external-alma/components/SpectralComponents/SpectralEstimate.h

    r2980 r3106  
    1818//#
    1919//# Correspondence concerning AIPS++ should be addressed as follows:
    20 //#        Internet email: aips2-request@nrao.edu.
     20//#        casacore::Internet email: aips2-request@nrao.edu.
    2121//#        Postal address: AIPS++ Project Office
    2222//#                        National Radio Astronomy Observatory
     
    3434#include <components/SpectralComponents/SpectralList.h>
    3535
     36namespace casacore {
     37    template <class T> class Vector;
     38}
     39
    3640namespace casa { //# NAMESPACE CASA - BEGIN
    3741
    3842//# Forward Declarations
    3943class GaussianSpectralElement;
    40 template <class T> class Vector;
    4144
    4245// <summary>
     
    97100  //# Constants
    98101  // Default maximum number of components to be found
    99   static const uInt MAXPAR = 200;
     102  static const casacore::uInt MAXPAR = 200;
    100103  //# Enumerations
    101104  //# Friends
     
    106109  // of components that will be found. A value of zero will indicate
    107110  // an unlimited number.
    108   explicit SpectralEstimate(const uInt maxpar=MAXPAR);
     111  explicit SpectralEstimate(const casacore::uInt maxpar=MAXPAR);
    109112  // Create an estimator with the given maximum number of possible
    110113  // elements. A value of zero will indicate an unlimited number.
     
    112115  // found, and a minimum width. Cutoff and minsigma default to 0.0, maximum
    113116  // size of list produced to 200.
    114   explicit SpectralEstimate(const Double rms,
    115                             const Double cutoff=0.0, const Double minsigma=0.0,
    116                             const uInt maxpar=MAXPAR);
     117  explicit SpectralEstimate(const casacore::Double rms,
     118                            const casacore::Double cutoff=0.0, const casacore::Double minsigma=0.0,
     119                            const casacore::uInt maxpar=MAXPAR);
    117120  // Copy constructor (deep copy)
    118121  SpectralEstimate(const SpectralEstimate &other);
     
    138141  // <group>
    139142  template <class MT>
    140     const SpectralList& estimate(const Vector<MT>& ordinate,
    141                                  Vector<MT> *der = 0);
    142   template <class MT>
    143     const SpectralList& estimate(const Vector<MT>& abcissa,
    144                                  const Vector<MT>& ordinate);
     143    const SpectralList& estimate(const casacore::Vector<MT>& ordinate,
     144                                 casacore::Vector<MT> *der = 0);
     145  template <class MT>
     146    const SpectralList& estimate(const casacore::Vector<MT>& abcissa,
     147                                 const casacore::Vector<MT>& ordinate);
    145148  // </group>
    146149
     
    151154  // <group>
    152155  // Set the profile's estimated rms (forced to abs(rms))
    153   void setRMS(const Double rms=0.0);
     156  void setRMS(const casacore::Double rms=0.0);
    154157  // Set the amplitude cutoff for valid estimate (forced to max(0,cutoff))
    155   void setCutoff(const Double cutoff=0.0);
     158  void setCutoff(const casacore::Double cutoff=0.0);
    156159  // Set the minimum width allowed (forced to max(0,minsigma))
    157   void setMinSigma(const Double minsigma=0.0);
     160  void setMinSigma(const casacore::Double minsigma=0.0);
    158161  // Set the number of points consider at each side of test point (i.e. a
    159162  // width of 2q+1 is taken). Default internally is 2; max(1,q) taken.
    160   void setQ(const uInt q=2);
     163  void setQ(const casacore::uInt q=2);
    161164  // Set a region [lo,hi] over which to estimate. Lo and hi are given as
    162165  // zero-based vector indices.
    163   void setRegion(const Int lo, const Int hi);
     166  void setRegion(const casacore::Int lo, const casacore::Int hi);
    164167  // Do you want to look in an automatically determined window with signal?
    165168  // Default is False, meaning the full (possibly regioned) profile.
    166169  void setWindowing(const Bool win=False);
    167170  // Set the maximum number of estimates to find (forced to >=1; 200 default)
    168   void setMaxN(const uInt maxpar=MAXPAR);
     171  void setMaxN(const casacore::uInt maxpar=MAXPAR);
    169172  // </group>
    170173
     
    174177  Bool useWindow_p;
    175178  // rms estimate in profile
    176   Double rms_p;
     179  casacore::Double rms_p;
    177180  // Source cutoff amplitude
    178   Double cutoff_p;
     181  casacore::Double cutoff_p;
    179182  // Window low and end value
    180183  // <group>
    181   Int windowLow_p;
    182   Int windowEnd_p;
     184  casacore::Int windowLow_p;
     185  casacore::Int windowEnd_p;
    183186  // </group>
    184187  // Region low and high value
    185188  // <group>
    186   Int regionLow_p;
    187   Int regionEnd_p;
     189  casacore::Int regionLow_p;
     190  casacore::Int regionEnd_p;
    188191  // </group>
    189192  // Smoothing parameter. I.e. 2q+1 points are taken
    190   Int q_p;
    191   // Internal cashing of calculated values based on q
    192   // <group>
    193   Double a_p;
    194   Double b_p;
     193  casacore::Int q_p;
     194  // casacore::Internal cashing of calculated values based on q
     195  // <group>
     196  casacore::Double a_p;
     197  casacore::Double b_p;
    195198  // </group>
    196199  // The minimum Gaussian width
    197   Double sigmin_p;
     200  casacore::Double sigmin_p;
    198201  // The second derivatives
    199   Double *deriv_p;
     202  casacore::Double *deriv_p;
    200203  // The list of components
    201204  SpectralList slist_p;
    202205  // The length of the current profile being estimated
    203   uInt lprof_p;
     206  casacore::uInt lprof_p;
    204207
    205208  //# Member functions
    206209  // Get the window or the total spectrum
    207210  template <class MT>
    208     uInt window(const Vector<MT> &prof);
     211    casacore::uInt window(const casacore::Vector<MT> &prof);
    209212  // Get the second derivatives
    210213  template <class MT>
    211     void findc2(const Vector<MT> &prof);
     214    void findc2(const casacore::Vector<MT> &prof);
    212215  // Find the Gaussians
    213216  template <class MT>
    214     void findga(const Vector<MT> &prof);
     217    void findga(const casacore::Vector<MT> &prof);
    215218  // Convert the parameters of the components in the list from
    216219  // pixel-based indices to the given abcissa-vector space.
    217   template <class MT> GaussianSpectralElement convertElement (const Vector<MT>& abcissa,
     220  template <class MT> GaussianSpectralElement convertElement (const casacore::Vector<MT>& abcissa,
    218221                                                      const GaussianSpectralElement& el) const;
    219222};
  • trunk/external-alma/components/SpectralComponents/SpectralList.h

    r2980 r3106  
    1818//#
    1919//# Correspondence concerning AIPS++ should be addressed as follows:
    20 //#        Internet email: aips2-request@nrao.edu.
     20//#        casacore::Internet email: aips2-request@nrao.edu.
    2121//#        Postal address: AIPS++ Project Office
    2222//#                        National Radio Astronomy Observatory
     
    3434#include <casa/Containers/Block.h>
    3535
     36namespace casacore {
     37
     38    class RecordInterface;
     39    class String;
     40    template <class T> class Vector;
     41}
     42
    3643namespace casa { //# NAMESPACE CASA - BEGIN
    3744
    3845//# Forward Declarations
    3946class SpectralElement;
    40 class RecordInterface;
    41 class String;
    42 template <class T> class Vector;
    4347
    4448// <summary>
     
    8690  SpectralList();
    8791  // Construct a list with a maximum length of n (0: unlimited length)
    88   explicit SpectralList(uInt nmax);
     92  explicit SpectralList(casacore::uInt nmax);
    8993  // Construct with an initial element
    9094  explicit SpectralList(const SpectralElement &in);
     
    100104  SpectralList &operator=(const SpectralList &other);
    101105  // Evaluate the value of the sum of the elements at x
    102   Double operator()(const Double x) const;
     106  casacore::Double operator()(const casacore::Double x) const;
    103107  // Get element n
    104108  // <thrown>
     
    106110  // </thrown>
    107111  // <group>
    108   const SpectralElement* operator[](const uInt n) const;
    109   SpectralElement* operator[](const uInt n);
     112  const SpectralElement* operator[](const casacore::uInt n) const;
     113  SpectralElement* operator[](const casacore::uInt n);
    110114  // </group>
    111115
    112116  //# Member functions
    113117  // Get the number of elements in list
    114   uInt nelements() const { return list_p.nelements(); };
     118  casacore::uInt nelements() const { return list_p.nelements(); };
    115119
    116120  // Get the profile values for all elements in list. The evaluation
     
    138142  // Add elements to list (False if list has max length and full)
    139143  // <group>
    140   Bool add(const SpectralElement &in);
    141   Bool add(const SpectralList &in);
     144  casacore::Bool add(const SpectralElement &in);
     145  casacore::Bool add(const SpectralList &in);
    142146  // </group>
    143147  // Insert in sort order in the list
     
    148152  // Set an element in the list. Return False if more than one place beyond
    149153  // end of list; or if beyond max size.
    150   Bool set(const SpectralElement &in, const uInt which);
     154  casacore::Bool set(const SpectralElement &in, const casacore::uInt which);
    151155
    152156  // Clear the list
     
    154158
    155159  // Set a maximum size of the list
    156   void set(const uInt nmax);
     160  void set(const casacore::uInt nmax);
    157161
    158162  // Sort the list on the first parameter (i.e. peak value for Gaussian)
     
    161165  // Convert to and from a Record (see details in SpectralElement)
    162166  // <group>
    163   Bool fromRecord (String& errMsg, const RecordInterface& container);
    164   Bool toRecord(RecordInterface& container) const;
     167  casacore::Bool fromRecord (casacore::String& errMsg, const casacore::RecordInterface& container);
     168  casacore::Bool toRecord(casacore::RecordInterface& container) const;
    165169  //</group>
    166170
     
    168172  //#Data
    169173  // Max length allowed of list
    170   uInt nmax_p;
     174  casacore::uInt nmax_p;
    171175  // List of elements
    172   PtrBlock<SpectralElement *> list_p;
     176  casacore::PtrBlock<SpectralElement *> list_p;
    173177
    174178  //# Member functions
    175179  // Compare two elements
    176   Int compar(const SpectralElement &p1, const SpectralElement &p2) const;
     180  casacore::Int compar(const SpectralElement &p1, const SpectralElement &p2) const;
    177181
    178182};
  • trunk/external-alma/oldasdm2ASAP/OldASDMFiller.cc

    r2407 r3106  
    7474  //logsink_->postLocally( LogMessage("sFreqFrame = "+sFreqFrame,LogOrigin(className_,funcName,WHERE)) ) ;
    7575 
    76   Vector<casa::Double> antpos = table_->getHeader().antennaposition ;
     76  Vector<casacore::Double> antpos = table_->getHeader().antennaposition ;
    7777
    7878  // data selection
     
    172172         
    173173          // fill MOLECULE_ID and add MOLECULES row if necessary
    174           Vector<casa::Double> restFreqs( rf.size() ) ;
     174          Vector<casacore::Double> restFreqs( rf.size() ) ;
    175175          for ( uInt i = 0 ; i < rf.size() ; i++ )
    176             restFreqs[i] = (casa::Double)(rf[i]) ;
     176            restFreqs[i] = (casacore::Double)(rf[i]) ;
    177177          setMolecule( restFreqs ) ;
    178178         
    179179          // time and interval
    180           casa::Double mjd = (casa::Double)(reader_->getTime()) ;
    181           casa::Double interval = (casa::Double)(reader_->getInterval()) ;
     180          casacore::Double mjd = (casacore::Double)(reader_->getTime()) ;
     181          casacore::Double interval = (casacore::Double)(reader_->getInterval()) ;
    182182
    183183          // fill TIME and INTERVAL
     
    185185         
    186186          // fill SRCNAME, SRCTYPE, FIELDNAME, SRCDIRECTION, SRCPROPERMOTION, and SRCVELOCITY
    187           Vector<casa::Double> srcDir( 2 ) ;
    188           srcDir[0] = (casa::Double)(srcDirection[0]) ;
    189           srcDir[1] = (casa::Double)(srcDirection[1]) ;
    190           Vector<casa::Double> srcPM( 2 ) ;
    191           srcPM[0] = (casa::Double)(srcProperMotion[0]) ;
    192           srcPM[1] = (casa::Double)(srcProperMotion[1]) ;
    193           setSource( srcname, srctype, fieldname, srcDir, srcPM, (casa::Double)sysVel ) ;
     187          Vector<casacore::Double> srcDir( 2 ) ;
     188          srcDir[0] = (casacore::Double)(srcDirection[0]) ;
     189          srcDir[1] = (casacore::Double)(srcDirection[1]) ;
     190          Vector<casacore::Double> srcPM( 2 ) ;
     191          srcPM[0] = (casacore::Double)(srcProperMotion[0]) ;
     192          srcPM[1] = (casacore::Double)(srcProperMotion[1]) ;
     193          setSource( srcname, srctype, fieldname, srcDir, srcPM, (casacore::Double)sysVel ) ;
    194194
    195195          // fill FLAGROW
     
    208208                                   windspeed,
    209209                                   windaz ) ;
    210           setWeather2( (casa::Float)temperature,
    211                        (casa::Float)pressure,
    212                        (casa::Float)humidity,
    213                        (casa::Float)windspeed,
    214                        (casa::Float)windaz ) ;
     210          setWeather2( (casacore::Float)temperature,
     211                       (casacore::Float)pressure,
     212                       (casacore::Float)humidity,
     213                       (casacore::Float)windspeed,
     214                       (casacore::Float)windaz ) ;
    215215
    216216          // fill AZIMUTH, ELEVATION, DIRECTION and SCANRATE
     
    223223                                    el,
    224224                                    srate ) ;
    225           Vector<casa::Double> scanRate( 2, 0.0 ) ;
    226           Vector<casa::Double> direction( 2, 0.0 ) ;
     225          Vector<casacore::Double> scanRate( 2, 0.0 ) ;
     226          Vector<casacore::Double> direction( 2, 0.0 ) ;
    227227          if ( srate.size() > 0 ) {
    228             scanRate[0] = (casa::Double)(srate[0]) ;
    229             scanRate[1] = (casa::Double)(srate[1]) ;
     228            scanRate[0] = (casacore::Double)(srate[0]) ;
     229            scanRate[1] = (casacore::Double)(srate[1]) ;
    230230          }
    231231          setScanRate( scanRate ) ;
    232232          if ( dir.size() > 0 ) {
    233             direction[0] = (casa::Double)(dir[0]) ;
    234             direction[1] = (casa::Double)(dir[1]) ;
     233            direction[0] = (casacore::Double)(dir[0]) ;
     234            direction[1] = (casacore::Double)(dir[1]) ;
    235235          }
    236236          else {
     
    238238          }
    239239          //logsink_->postLocally( LogMessage("direction = "+String::toString(direction),LogOrigin(className_,funcName,WHERE)) ) ;
    240           setDirection( direction, (casa::Float)az, (casa::Float)el ) ;
     240          setDirection( direction, (casacore::Float)az, (casacore::Float)el ) ;
    241241
    242242           // REFPIX, REFVAL, INCREMENT
     
    247247          else {
    248248            reader_->getFrequency( refpix, refval, incr, freqref ) ;
    249             refval = (double)toLSRK( casa::Double(refval),
     249            refval = (double)toLSRK( casacore::Double(refval),
    250250                                     String(freqref),
    251251                                     mjd,
     
    258258
    259259          // fill FREQ_ID and add FREQUENCIES row if necessary
    260           setFrequency( (casa::Double)refpix, (casa::Double)refval, (casa::Double)incr ) ;
     260          setFrequency( (casacore::Double)refpix, (casacore::Double)refval, (casacore::Double)incr ) ;
    261261
    262262          // loop on polarization
     
    280280          // OPACITY
    281281          vector<float> tau = reader_->getOpacity() ;
    282           Vector<casa::Float> opacity = toVector( tau, numPol ) ;
     282          Vector<casacore::Float> opacity = toVector( tau, numPol ) ;
    283283
    284284          // SPECTRA, FLAGTRA, TSYS, TCAL
     
    287287          vector< vector<float> > tc ;
    288288          reader_->getTcalAndTsys( tc, ts ) ;
    289           Matrix<casa::Float> spectra = toMatrix( sp, numPol, numChan ) ;
     289          Matrix<casacore::Float> spectra = toMatrix( sp, numPol, numChan ) ;
    290290          Vector<uChar> flagtra( numChan, 0 ) ;
    291           Matrix<casa::Float> tsys = toMatrix( ts, numPol, numChan ) ;
    292           Matrix<casa::Float> tcal = toMatrix( tc, numPol, numChan ) ;
     291          Matrix<casacore::Float> tsys = toMatrix( ts, numPol, numChan ) ;
     292          Matrix<casacore::Float> tcal = toMatrix( tc, numPol, numChan ) ;
    293293//           String caltime = "" ;
    294 //           if ( anyNE( tcal, (casa::Float)1.0 ) )
     294//           if ( anyNE( tcal, (casacore::Float)1.0 ) )
    295295//             caltime = toTcalTime( mjd ) ;
    296296          String caltime = toTcalTime( mjd ) ;
     
    374374    string ref ;
    375375    reader_->getSourceDirection( sdir, ref ) ;
    376     Vector<casa::Double> sourceDir( sdir ) ;
     376    Vector<casacore::Double> sourceDir( sdir ) ;
    377377    hdr.reffreq = toLSRK( hdr.reffreq, hdr.freqref, hdr.utc, hdr.antennaposition, sdir, String(ref) ) ;
    378378    hdr.freqref = "LSRK" ;
     
    410410}
    411411
    412 Matrix<casa::Float> OldASDMFiller::toMatrix( float *sp,
     412Matrix<casacore::Float> OldASDMFiller::toMatrix( float *sp,
    413413                                         unsigned int npol,
    414414                                         unsigned int nchan )
    415415{
    416   Matrix<casa::Float> mSp( npol, nchan ) ;
     416  Matrix<casacore::Float> mSp( npol, nchan ) ;
    417417  if ( npol <= 2 ) {
    418418    // 1 or 2 polarization case
    419419    for ( unsigned int ich = 0 ; ich < nchan ; ich++ ) {
    420420      for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ ) {
    421         mSp(ipol,ich) = (casa::Float)(sp[npol*ich+ipol]) ;
     421        mSp(ipol,ich) = (casacore::Float)(sp[npol*ich+ipol]) ;
    422422      }
    423423    }
     
    426426    // 4 polarization case
    427427    for ( unsigned int ich = 0 ; ich < nchan ; ich++ ) {
    428       mSp(0,ich) = (casa::Float)(sp[4*ich]) ;   // Re(XX)
    429       mSp(1,ich) = (casa::Float)(sp[4*ich+4]) ; // Re(YY)
    430       mSp(2,ich) = (casa::Float)(sp[4*ich+2]) ; // Re(XY)
    431       mSp(3,ich) = (casa::Float)(sp[4*ich+3]) ; // Im(XY)
     428      mSp(0,ich) = (casacore::Float)(sp[4*ich]) ;   // Re(XX)
     429      mSp(1,ich) = (casacore::Float)(sp[4*ich+4]) ; // Re(YY)
     430      mSp(2,ich) = (casacore::Float)(sp[4*ich+2]) ; // Re(XY)
     431      mSp(3,ich) = (casacore::Float)(sp[4*ich+3]) ; // Im(XY)
    432432    }
    433433  }
     
    435435}
    436436
    437 Matrix<casa::Float> OldASDMFiller::toMatrix( vector< vector<float> > &tsys,
     437Matrix<casacore::Float> OldASDMFiller::toMatrix( vector< vector<float> > &tsys,
    438438                                               unsigned int npol,
    439439                                               unsigned int nchan )
     
    441441  unsigned int numRec = tsys.size() ;
    442442  unsigned int numChan = tsys[0].size() ;
    443   Matrix<casa::Float> ret ;
     443  Matrix<casacore::Float> ret ;
    444444  if ( npol == numRec && nchan == numChan ) {
    445445    ret.resize( npol, nchan ) ;
    446446    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    447447      for ( unsigned int ic = 0 ; ic < nchan ; ic++ )
    448         ret( ip, ic ) = (casa::Float)(tsys[ip][ic]) ;
     448        ret( ip, ic ) = (casacore::Float)(tsys[ip][ic]) ;
    449449  }
    450450  else if ( npol == numRec && numChan == 1 ) {
    451451    ret.resize( npol, 1 ) ;
    452452    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    453       ret( ip, 0 ) = (casa::Float)(tsys[0][0]) ;
     453      ret( ip, 0 ) = (casacore::Float)(tsys[0][0]) ;
    454454  }
    455455  else if ( numRec == 1 && nchan == numChan ) {
     
    457457    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    458458      for ( unsigned int ic = 0 ; ic < nchan ; ic++ )
    459         ret( ip, ic ) = (casa::Float)(tsys[0][ic]) ;
     459        ret( ip, ic ) = (casacore::Float)(tsys[0][ic]) ;
    460460  }
    461461  else if ( numRec == 1 && numChan == 1 ) {
    462462    ret.resize( npol, 1 ) ;
    463463    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    464       ret( ip, 0 ) = (casa::Float)(tsys[0][0]) ;
     464      ret( ip, 0 ) = (casacore::Float)(tsys[0][0]) ;
    465465  }
    466466  else if ( numRec == 2 && npol == 4 && numChan == nchan ) {
     
    469469    ret.resize( npol, nchan ) ;
    470470    for ( unsigned int ic = 0 ; ic < nchan ; ic++ ) {
    471       casa::Float tsysxy = (casa::Float)(0.5*(tsys[0][ic]+tsys[1][ic])) ;
    472       ret( 0, ic ) = (casa::Float)(tsys[0][ic]) ;
    473       ret( 1, ic ) = (casa::Float)(tsys[1][ic]) ;
     471      casacore::Float tsysxy = (casacore::Float)(0.5*(tsys[0][ic]+tsys[1][ic])) ;
     472      ret( 0, ic ) = (casacore::Float)(tsys[0][ic]) ;
     473      ret( 1, ic ) = (casacore::Float)(tsys[1][ic]) ;
    474474      ret( 2, ic ) = tsysxy ;
    475475      ret( 3, ic ) = tsysxy ;
     
    480480    //       at the moment Tsys[XY] = 0.5*(Tsys[X]+Tsys[Y])
    481481    ret.resize( npol, 1 ) ;
    482     casa::Float tsysxy = (casa::Float)(0.5*(tsys[0][0]+tsys[1][0])) ;
    483     ret( 0, 0 ) = (casa::Float)(tsys[0][0]) ;
    484     ret( 1, 0 ) = (casa::Float)(tsys[1][0]) ;
     482    casacore::Float tsysxy = (casacore::Float)(0.5*(tsys[0][0]+tsys[1][0])) ;
     483    ret( 0, 0 ) = (casacore::Float)(tsys[0][0]) ;
     484    ret( 1, 0 ) = (casacore::Float)(tsys[1][0]) ;
    485485    ret( 2, 0 ) = tsysxy ;
    486486    ret( 3, 0 ) = tsysxy ;
     
    490490    for ( unsigned int ip = 0 ; ip < npol ; ip++ )
    491491      for ( unsigned int ic = 0 ; ic < nchan ; ic++ )
    492         ret( ip, ic ) = (casa::Float)(tsys[0][ic]) ;   
     492        ret( ip, ic ) = (casacore::Float)(tsys[0][ic]) ;   
    493493  }
    494494  return ret ;
    495495}
    496496
    497 Vector<casa::Float> OldASDMFiller::toVector( vector<float> &tau,
     497Vector<casacore::Float> OldASDMFiller::toVector( vector<float> &tau,
    498498                                               unsigned int npol )
    499499{
    500500  String funcName = "toVector" ;
    501501
    502   Vector<casa::Float> ret( npol ) ;
     502  Vector<casacore::Float> ret( npol ) ;
    503503  //logsink_->postLocally( LogMessage("tau0="+String::toString(tau[0]),LogOrigin(className_,funcName,WHERE)) ) ;
    504504  if ( npol == 4 ) {
    505     ret[0] = (casa::Float)tau[0] ;
    506     ret[1] = (casa::Float)tau[1] ;
     505    ret[0] = (casacore::Float)tau[0] ;
     506    ret[1] = (casacore::Float)tau[1] ;
    507507    ret[2] = 0.5 * ( ret[0] + ret[1] ) ;
    508508    ret[3] = ret[2] ;
     
    510510  else if ( npol == tau.size() ) {
    511511    for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ )
    512       ret[ipol] = (casa::Float)tau[ipol] ;
     512      ret[ipol] = (casacore::Float)tau[ipol] ;
    513513  }
    514514  else {
    515515    // I don't know how to handle...
    516516    for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ )
    517       ret[ipol] = (casa::Float)tau[0] ;
     517      ret[ipol] = (casacore::Float)tau[0] ;
    518518  }
    519519  //logsink_->postLocally( LogMessage("tau="+String::toString(ret),LogOrigin(className_,funcName,WHERE)) ) ;
     
    521521}
    522522
    523 String OldASDMFiller::toTcalTime( casa::Double mjd )
     523String OldASDMFiller::toTcalTime( casacore::Double mjd )
    524524{
    525525  return MVTime( mjd ).string( MVTime::YMD ) ;
    526526}
    527527
    528 void OldASDMFiller::toJ2000( Vector<casa::Double> &dir,
     528void OldASDMFiller::toJ2000( Vector<casacore::Double> &dir,
    529529                               double az,
    530530                               double el,
    531                                casa::Double mjd,
    532                                Vector<casa::Double> antpos )
     531                               casacore::Double mjd,
     532                               Vector<casacore::Double> antpos )
    533533{
    534534  String funcName = "toJ2000" ;
    535535
    536   Vector<casa::Double> azel( 2 ) ;
     536  Vector<casacore::Double> azel( 2 ) ;
    537537  azel[0] = az ;
    538538  azel[1] = el ;
     
    553553}
    554554
    555 Vector<casa::Double> OldASDMFiller::toJ2000( Vector<casa::Double> dir,
     555Vector<casacore::Double> OldASDMFiller::toJ2000( Vector<casacore::Double> dir,
    556556                                          String dirref,
    557                                           casa::Double mjd,
    558                                           Vector<casa::Double> antpos )
    559 {
    560   Vector<casa::Double> newd( dir ) ;
     557                                          casacore::Double mjd,
     558                                          Vector<casacore::Double> antpos )
     559{
     560  Vector<casacore::Double> newd( dir ) ;
    561561  if ( dirref != "J2000" ) {
    562562    MEpoch me( Quantity( mjd, "d" ), MEpoch::UTC ) ;
     
    593593}
    594594
    595 casa::Double OldASDMFiller::toLSRK( casa::Double freq,
     595casacore::Double OldASDMFiller::toLSRK( casacore::Double freq,
    596596                                 String freqref,
    597                                  casa::Double utc,
    598                                  Vector<casa::Double> antpos,
    599                                  Vector<casa::Double> dir,
     597                                 casacore::Double utc,
     598                                 Vector<casacore::Double> antpos,
     599                                 Vector<casacore::Double> dir,
    600600                                 String dirref )
    601601{
     
    603603
    604604  //logsink_->postLocally( LogMessage("freqref = "+freqref,LogOrigin(className_,funcName,WHERE)) ) ;
    605   casa::Double newf = freq ;
     605  casacore::Double newf = freq ;
    606606  if ( freqref != "LSRK" ) {
    607     MEpoch me( Quantum<casa::Double>( utc, Unit("d") ), MEpoch::UTC ) ;
    608     Vector< Quantum<casa::Double> > antposQ( 3 ) ;
     607    MEpoch me( Quantum<casacore::Double>( utc, Unit("d") ), MEpoch::UTC ) ;
     608    Vector< Quantum<casacore::Double> > antposQ( 3 ) ;
    609609    for ( int i = 0 ; i < 3 ; i++ )
    610       antposQ[i] = Quantum<casa::Double>( antpos[i], Unit("m") ) ;
     610      antposQ[i] = Quantum<casacore::Double>( antpos[i], Unit("m") ) ;
    611611    MPosition mp( antposQ, MPosition::ITRF ) ;
    612612    MDirection::Types dirtype ;
     
    614614    if ( !b )
    615615      dirtype = MDirection::J2000 ;
    616     MDirection md( Quantum<casa::Double>( dir[0], Unit("rad") ),
    617                    Quantum<casa::Double>( dir[1], Unit("rad") ),
     616    MDirection md( Quantum<casacore::Double>( dir[0], Unit("rad") ),
     617                   Quantum<casacore::Double>( dir[1], Unit("rad") ),
    618618                   dirtype ) ;
    619619    MeasFrame mf( me, mp, md ) ;
     
    624624    MFrequency::Convert tolsr( freqtype,
    625625                               MFrequency::Ref( MFrequency::LSRK, mf ) ) ;
    626     newf = tolsr( Quantum<casa::Double>( freq, Unit("Hz") ) ).get( "Hz" ).getValue() ;
     626    newf = tolsr( Quantum<casacore::Double>( freq, Unit("Hz") ) ).get( "Hz" ).getValue() ;
    627627    //logsink_->postLocally( LogMessage("freq = "+String::toString(freq)+", newf = "+String::toString(newf),LogOrigin(className_,funcName,WHERE)) ) ;
    628628  }
  • trunk/external-alma/oldasdm2ASAP/OldASDMFiller.h

    r2273 r3106  
    1313public:
    1414  // constructor and destructor
    15   OldASDMFiller( casa::CountedPtr<asap::Scantable> stable ) ;
     15  OldASDMFiller( casacore::CountedPtr<asap::Scantable> stable ) ;
    1616  ~OldASDMFiller() ;
    1717
    1818  // open data
    19   bool open( const std::string &filename, const casa::Record &rec ) ;
     19  bool open( const std::string &filename, const casacore::Record &rec ) ;
    2020
    2121  // fill data
     
    2626 
    2727  // get reader object
    28   casa::CountedPtr<OldASDMReader> getReader() { return reader_ ; } ;
     28  casacore::CountedPtr<OldASDMReader> getReader() { return reader_ ; } ;
    2929
    3030  // set logger
    31   void setLogger( casa::CountedPtr<casa::LogSinkInterface> &logsink ) ;
     31  void setLogger( casacore::CountedPtr<casacore::LogSinkInterface> &logsink ) ;
    3232
    3333private:
     
    3636
    3737  // get IF key
    38   casa::String getIFKey( casa::uInt ifno ) ;
     38  casacore::String getIFKey( casacore::uInt ifno ) ;
    3939
    4040  // get FREQUENCIES attributes from ifrec_
    41   void getFrequencyRec( casa::String key,
     41  void getFrequencyRec( casacore::String key,
    4242                        double &refpix,
    4343                        double &refval,
     
    4545
    4646  // set FREQUENCIES attributes to ifrec_
    47   void setFrequencyRec( casa::String key,
     47  void setFrequencyRec( casacore::String key,
    4848                        double refpix,
    4949                        double refval,
     
    5151                     
    5252  // reshape float array spectra to Matrix<Float>
    53   casa::Matrix<casa::Float> toMatrix( float *sp,
     53  casacore::Matrix<casacore::Float> toMatrix( float *sp,
    5454                                      unsigned int npol,
    5555                                      unsigned int nchan ) ;
    5656
    5757  // reshape 2d vector Tsys to Matrix<Float>
    58   casa::Matrix<casa::Float> toMatrix( std::vector< std::vector<float> > &tsys,
     58  casacore::Matrix<casacore::Float> toMatrix( std::vector< std::vector<float> > &tsys,
    5959                                      unsigned int npol,
    6060                                      unsigned int nchan ) ;
    6161
    6262  // reshape vector<float> to Vector<Float> with appropriate length
    63   casa::Vector<casa::Float> toVector( std::vector<float> &tau,
     63  casacore::Vector<casacore::Float> toVector( std::vector<float> &tau,
    6464                                      unsigned int npol ) ;
    6565
    6666  // create TCAL time string from MJD
    67   casa::String toTcalTime( casa::Double mjd ) ;
     67  casacore::String toTcalTime( casacore::Double mjd ) ;
    6868
    6969  // AZEL to J2000
    70   void toJ2000( casa::Vector<casa::Double> &dir,
     70  void toJ2000( casacore::Vector<casacore::Double> &dir,
    7171                double az,
    7272                double el,
    73                 casa::Double mjd,
    74                 casa::Vector<casa::Double> antpos ) ;
     73                casacore::Double mjd,
     74                casacore::Vector<casacore::Double> antpos ) ;
    7575
    7676  // to J2000
    77   casa::Vector<casa::Double> toJ2000( casa::Vector<casa::Double> dir,
    78                                       casa::String dirref,
    79                                       casa::Double mjd,
    80                                       casa::Vector<casa::Double> antpos ) ;
     77  casacore::Vector<casacore::Double> toJ2000( casacore::Vector<casacore::Double> dir,
     78                                      casacore::String dirref,
     79                                      casacore::Double mjd,
     80                                      casacore::Vector<casacore::Double> antpos ) ;
    8181
    8282  // get frequency frame enum value from string
    83   casa::MFrequency::Types toFrameType( std::string &s ) ;
     83  casacore::MFrequency::Types toFrameType( std::string &s ) ;
    8484
    8585  // to LSRK
    8686  // utc must be UTC time in "d" (day)
    8787  // antpos must be ITRF value in "m"
    88   casa::Double toLSRK( casa::Double freq,
    89                        casa::String freqref,
    90                        casa::Double utc,
    91                        casa::Vector<casa::Double> antpos,
    92                        casa::Vector<casa::Double> dir,
    93                        casa::String dirref ) ;
     88  casacore::Double toLSRK( casacore::Double freq,
     89                       casacore::String freqref,
     90                       casacore::Double utc,
     91                       casacore::Vector<casacore::Double> antpos,
     92                       casacore::Vector<casacore::Double> dir,
     93                       casacore::String dirref ) ;
    9494
    95   casa::CountedPtr<OldASDMReader> reader_ ;
    96   casa::Int antennaId_ ;
    97   casa::String antennaName_ ;
     95  casacore::CountedPtr<OldASDMReader> reader_ ;
     96  casacore::Int antennaId_ ;
     97  casacore::String antennaName_ ;
    9898
    99   casa::Record ifrec_ ;
     99  casacore::Record ifrec_ ;
    100100
    101   casa::CountedPtr<casa::LogSinkInterface> logsink_ ;
     101  casacore::CountedPtr<casacore::LogSinkInterface> logsink_ ;
    102102
    103   casa::String className_ ;
     103  casacore::String className_ ;
    104104
    105105} ;
  • trunk/external-alma/oldasdm2ASAP/OldASDMReader.cc

    r2355 r3106  
    5656}
    5757
    58 bool OldASDMReader::open( const string &filename, const casa::Record &rec )
    59 {
    60   casa::String funcName = "open" ;
     58bool OldASDMReader::open( const string &filename, const casacore::Record &rec )
     59{
     60  casacore::String funcName = "open" ;
    6161
    6262  // return value
     
    7171  // parsing ASDM options
    7272  if ( rec.isDefined( "asdm" ) ) {
    73     casa::Record asdmrec = rec.asRecord( "asdm" ) ;
     73    casacore::Record asdmrec = rec.asRecord( "asdm" ) ;
    7474
    7575    // antenna
    7676    if ( asdmrec.isDefined( "antenna" ) ) {
    77       if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casa::TpInt ) {
     77      if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casacore::TpInt ) {
    7878        antennaId_ = asdmrec.asInt( "antenna" ) ;
    7979      }
     
    182182    vector<AntennaRow *> rows = atab.get() ;
    183183    int idx = -1 ;
    184     for ( casa::uInt irow = 0 ; irow < rows.size() ; irow++ ) {
    185       if ( casa::String(rows[irow]->getName()) == antennaName_ ) {
     184    for ( casacore::uInt irow = 0 ; irow < rows.size() ; irow++ ) {
     185      if ( casacore::String(rows[irow]->getName()) == antennaName_ ) {
    186186        idx = rows[irow]->getAntennaId().getTagValue() ;
    187187        break ;
     
    190190    if ( idx == -1 ) {
    191191      close() ;
    192       throw (casa::AipsError( antennaName_ + " not found." )) ;
     192      throw (casacore::AipsError( antennaName_ + " not found." )) ;
    193193    }
    194194    else {
     
    203203    if ( antennaRow == 0 ) {
    204204      close() ;
    205       throw (casa::AipsError( "AntennaId " + casa::String::toString(antennaId_) + " is invalid." ) ) ;
     205      throw (casacore::AipsError( "AntennaId " + casacore::String::toString(antennaId_) + " is invalid." ) ) ;
    206206    }
    207207  }
     
    210210  // set antenna name
    211211  if ( antennaName_.size() == 0 ) {
    212     antennaName_ = casa::String( antennaRow->getName() ) ;
     212    antennaName_ = casacore::String( antennaRow->getName() ) ;
    213213  }
    214214
     
    217217
    218218  // station name
    219   stationName_ = casa::String( stationRow->getName() ) ;
     219  stationName_ = casacore::String( stationRow->getName() ) ;
    220220
    221221  // antenna position
    222222  antennaPosition_.resize( 3 ) ;
    223223  vector<Length> antpos = stationRow->getPosition() ;
    224   for ( casa::uInt i = 0 ; i < 3 ; i++ )
    225     antennaPosition_[i] = Quantity( casa::Double( antpos[i].get() ), Unit( "m" ) ) ;
     224  for ( casacore::uInt i = 0 ; i < 3 ; i++ )
     225    antennaPosition_[i] = Quantity( casacore::Double( antpos[i].get() ), Unit( "m" ) ) ;
    226226
    227227  // create SDMBinData object
     
    229229
    230230  // get Main rows
    231   //mainRow_ = casa::Vector<MainRow *>(asdm_->getMain().get()) ;
     231  //mainRow_ = casacore::Vector<MainRow *>(asdm_->getMain().get()) ;
    232232
    233233  // set up IFNO
     
    262262}
    263263
    264 void OldASDMReader::fillHeader( casa::Int &nchan,
    265                              casa::Int &npol,
    266                              casa::Int &nif,
    267                              casa::Int &nbeam,
    268                              casa::String &observer,
    269                              casa::String &project,
    270                              casa::String &obstype,
    271                              casa::String &antennaname,
    272                              casa::Vector<casa::Double> &antennaposition,
    273                              casa::Float &equinox,
    274                              casa::String &freqref,
    275                              casa::Double &reffreq,
    276                              casa::Double &bandwidth,
    277                              casa::Double &utc,
    278                              casa::String &fluxunit,
    279                              casa::String &epoch,
    280                              casa::String &poltype )
    281 {
    282   casa::String funcName = "fillHeader" ;
     264void OldASDMReader::fillHeader( casacore::Int &nchan,
     265                             casacore::Int &npol,
     266                             casacore::Int &nif,
     267                             casacore::Int &nbeam,
     268                             casacore::String &observer,
     269                             casacore::String &project,
     270                             casacore::String &obstype,
     271                             casacore::String &antennaname,
     272                             casacore::Vector<casacore::Double> &antennaposition,
     273                             casacore::Float &equinox,
     274                             casacore::String &freqref,
     275                             casacore::Double &reffreq,
     276                             casacore::Double &bandwidth,
     277                             casacore::Double &utc,
     278                             casacore::String &fluxunit,
     279                             casacore::String &epoch,
     280                             casacore::String &poltype )
     281{
     282  casacore::String funcName = "fillHeader" ;
    283283
    284284  ExecBlockTable &ebtab = asdm_->getExecBlock() ;
    285285  // at the moment take first row of ExecBlock table
    286286  ExecBlockRow *ebrow = ebtab.get()[0] ;
    287   casa::String telescopeName( ebrow->getTelescopeName() ) ;
    288   //casa::String stationName( stationRow_p->getName() ) ;
     287  casacore::String telescopeName( ebrow->getTelescopeName() ) ;
     288  //casacore::String stationName( stationRow_p->getName() ) ;
    289289
    290290  // antennaname
     
    295295  // antennaposition
    296296  antennaposition.resize( 3 ) ;
    297   for ( casa::uInt i = 0 ; i < 3 ; i++ )
     297  for ( casacore::uInt i = 0 ; i < 3 ; i++ )
    298298    antennaposition[i] = antennaPosition_[i].getValue( Unit("m") ) ;
    299299
     
    307307  // utc
    308308  // start time of the project
    309   utc = casa::Double( ebrow->getStartTime().getMJD() ) ;
     309  utc = casacore::Double( ebrow->getStartTime().getMJD() ) ;
    310310 
    311311
     
    326326      refidx = irow ;
    327327  }
    328   nchan = casa::Int( *max_element( nchans.begin(), nchans.end() ) ) ;
     328  nchan = casacore::Int( *max_element( nchans.begin(), nchans.end() ) ) ;
    329329
    330330  //logsink_->postLocally( LogMessage("refidx = "+String::toString(refidx),LogOrigin(className_,funcName,WHERE)) ) ;
     
    337337    }
    338338  }
    339   bandwidth = casa::Double( *max_element( bws.begin(), bws.end() ) ) ;
     339  bandwidth = casacore::Double( *max_element( bws.begin(), bws.end() ) ) ;
    340340
    341341  // reffreq
    342   reffreq = casa::Double( spwrows[refidx]->getRefFreq().get() ) ;
     342  reffreq = casacore::Double( spwrows[refidx]->getRefFreq().get() ) ;
    343343
    344344  // freqref
     
    382382
    383383  // npol
    384   npol = casa::Int( *max_element( npols.begin(), npols.end() ) ) ;
     384  npol = casacore::Int( *max_element( npols.begin(), npols.end() ) ) ;
    385385
    386386  // poltype
     
    421421
    422422  // nbeam
    423   nbeam = casa::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;
     423  nbeam = casacore::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;
    424424
    425425  // fluxunit
     
    441441  obstype = "" ;
    442442  for ( unsigned int imode = 0 ; imode < obsmode.size() ; imode++ ) {
    443     obstype += casa::String(obsmode[imode]) ;
     443    obstype += casacore::String(obsmode[imode]) ;
    444444    if ( imode != obsmode.size()-1 )
    445445      obstype += "#" ;
     
    449449void OldASDMReader::selectConfigDescription()
    450450{
    451   casa::String funcName = "selectConfigDescription" ;
     451  casacore::String funcName = "selectConfigDescription" ;
    452452
    453453  vector<ConfigDescriptionRow *> cdrows = asdm_->getConfigDescription().get() ;
     
    462462  configDescIdList_.resize( cdidTags.size() ) ;
    463463  for ( unsigned int i = 0 ; i < cdidTags.size() ; i++ ) {
    464     configDescIdList_[i] = casa::uInt( cdidTags[i].getTagValue() ) ;
     464    configDescIdList_[i] = casacore::uInt( cdidTags[i].getTagValue() ) ;
    465465  }
    466466}
     
    472472  Tag atag( antennaId_, TagType::Antenna ) ;
    473473  for ( unsigned int irow = 0 ; irow < frows.size() ; irow++ ) {
    474     casa::uInt feedId = (casa::uInt)(frows[irow]->getFeedId() ) ;
    475     if ( casa::anyEQ( feedIdList_, feedId ) )
     474    casacore::uInt feedId = (casacore::uInt)(frows[irow]->getFeedId() ) ;
     475    if ( casacore::anyEQ( feedIdList_, feedId ) )
    476476      continue ;
    477477    if ( frows[irow]->getAntennaId() == atag ) {
     
    483483}
    484484
    485 casa::Vector<casa::uInt> OldASDMReader::getFieldIdList()
    486 {
    487   casa::String funcName = "getFieldIdList" ;
     485casacore::Vector<casacore::uInt> OldASDMReader::getFieldIdList()
     486{
     487  casacore::String funcName = "getFieldIdList" ;
    488488
    489489  vector<FieldRow *> frows = asdm_->getField().get() ;
     
    497497}
    498498
    499 casa::uInt OldASDMReader::getNumMainRow()
    500 {
    501   casa::uInt nrow = casa::uInt( mainRow_.size() ) ;
     499casacore::uInt OldASDMReader::getNumMainRow()
     500{
     501  casacore::uInt nrow = casacore::uInt( mainRow_.size() ) ;
    502502
    503503  return nrow ;
     
    530530}
    531531
    532 casa::Bool OldASDMReader::setMainRow( casa::uInt irow )
    533 {
    534   casa::Bool status = true ;
     532casacore::Bool OldASDMReader::setMainRow( casacore::uInt irow )
     533{
     534  casacore::Bool status = true ;
    535535  row_ = irow ;
    536536  execBlockTag_ = mainRow_[row_]->getExecBlockId() ;
     
    540540    status = false ;
    541541  else {
    542     status = (casa::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;
     542    status = (casacore::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;
    543543  }
    544544  return status ;
    545545}
    546546
    547 casa::Bool OldASDMReader::setMainRow( casa::uInt configDescId, casa::uInt fieldId )
     547casacore::Bool OldASDMReader::setMainRow( casacore::uInt configDescId, casacore::uInt fieldId )
    548548{
    549549  clearMainRow() ;
     
    551551  Tag configDescTag( (unsigned int)configDescId, TagType::ConfigDescription ) ;
    552552  Tag fieldTag( (unsigned int)fieldId, TagType::Field ) ;
    553   mainRow_ = casa::Vector<MainRow *>( *(asdm_->getMain().getByContext( configDescTag, fieldTag ) ) ) ;
     553  mainRow_ = casacore::Vector<MainRow *>( *(asdm_->getMain().getByContext( configDescTag, fieldTag ) ) ) ;
    554554 
    555555  return true ;
     
    563563void OldASDMReader::setupIFNO()
    564564{
    565   casa::String funcName = "setupIFNO" ;
     565  casacore::String funcName = "setupIFNO" ;
    566566
    567567  vector<SpectralWindowRow *> spwrows = asdm_->getSpectralWindow().get() ;
    568568  unsigned int nrow = spwrows.size() ;
    569569  ifno_.clear() ;
    570   casa::uInt idx = 0 ;
    571   casa::uInt wvridx = 0 ;
     570  casacore::uInt idx = 0 ;
     571  casacore::uInt wvridx = 0 ;
    572572  for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) {
    573     casa::uInt index ;
     573    casacore::uInt index ;
    574574    if ( isWVR( spwrows[irow] ) ) {
    575575      //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+" is WVR",LogOrigin(className_,funcName,WHERE)) ) ;
     
    579579      index = ++idx ;
    580580    }
    581     ifno_.insert( pair<Tag,casa::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ;
     581    ifno_.insert( pair<Tag,casacore::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ;
    582582    //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+": IFNO="+String::toString(index),LogOrigin(className_,funcName,WHERE)) ) ;
    583583  }
     
    594594}
    595595
    596 casa::Bool OldASDMReader::setData()
    597 {
    598   casa::String funcName = "setData" ;
     596casacore::Bool OldASDMReader::setData()
     597{
     598  casacore::String funcName = "setData" ;
    599599
    600600  //logsink_->postLocally( LogMessage("try to retrieve binary data",LogOrigin(className_,funcName,WHERE)) ) ;
     
    671671}
    672672
    673 casa::uInt OldASDMReader::getIFNo( unsigned int idx )
     673casacore::uInt OldASDMReader::getIFNo( unsigned int idx )
    674674{
    675675  prepareData( idx ) ;
     
    677677}
    678678
    679 casa::uInt OldASDMReader::getIFNo()
    680 {
    681   map<Tag,casa::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;
     679casacore::uInt OldASDMReader::getIFNo()
     680{
     681  map<Tag,casacore::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;
    682682  if ( iter != ifno_.end() )
    683683    return iter->second ;
     
    713713                               string &freqref )
    714714{
    715   casa::String funcName = "getFrequency" ;
     715  casacore::String funcName = "getFrequency" ;
    716716
    717717  int nchan = specWinRow_p->getNumChan() ;
     
    730730    }
    731731    else {
    732       throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     732      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
    733733    }     
    734734  }
     
    745745    }
    746746    else {
    747       throw (casa::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
     747      throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
    748748    }     
    749749    if ( specWinRow_p->isChanFreqStepExists() ) {
     
    757757    }
    758758    else {
    759       throw (casa::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
     759      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
    760760    }         
    761761    if ( specWinRow_p->isChanFreqStartExists() ) {
     
    766766    }
    767767    else {
    768       throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     768      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
    769769    }     
    770770  }
     
    781781    }
    782782    else {
    783       throw (casa::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
     783      throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;
    784784    }
    785785    if ( specWinRow_p->isChanFreqStepExists() ) {
     
    793793    }
    794794    else {
    795       throw (casa::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
     795      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;
    796796    }         
    797797    if ( specWinRow_p->isChanFreqStartExists() ) {
     
    803803    }
    804804    else {
    805       throw (casa::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
     805      throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;
    806806    }     
    807807  }
     
    12371237    for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) {
    12381238      CalAtmosphereRow *atmrow = atmrows[irow] ;
    1239       if ( casa::String(atmrow->getAntennaName()) != antennaName_
     1239      if ( casacore::String(atmrow->getAntennaName()) != antennaName_
    12401240           //|| atmrow->getReceiverBand() != rb
    12411241           //|| atmrow->getBasebandName() != bbname
     
    12791279                                 float &windaz )
    12801280{
    1281   casa::String funcName = "getWeatherInfo" ;
     1281  casacore::String funcName = "getWeatherInfo" ;
    12821282
    12831283  temperature = 0.0 ;
     
    16681668                          double &el,
    16691669                          double &mjd,
    1670                           casa::Vector<casa::Quantity> &antpos )
    1671 //                          casa::Vector<casa::Double> antpos )
     1670                          casacore::Vector<casacore::Quantity> &antpos )
     1671//                          casacore::Vector<casacore::Double> antpos )
    16721672{
    16731673  String funcName = "toJ2000" ;
     
    16811681
    16821682vector<double> OldASDMReader::toJ2000( vector<double> &dir,
    1683                                     casa::String &dirref,
     1683                                    casacore::String &dirref,
    16841684                                    double &mjd,
    1685                                     casa::Vector<casa::Quantity> &antpos )
    1686 //                                    casa::Vector<casa::Double> antpos )
    1687 {
    1688   casa::String funcName = "toJ2000" ;
     1685                                    casacore::Vector<casacore::Quantity> &antpos )
     1686//                                    casacore::Vector<casacore::Double> antpos )
     1687{
     1688  casacore::String funcName = "toJ2000" ;
    16891689
    16901690  vector<double> newd( dir ) ;
    16911691  if ( dirref != "J2000" ) {
    1692     casa::MEpoch me( casa::Quantity( (casa::Double)mjd, "d" ), casa::MEpoch::UTC ) ;
    1693     casa::MPosition mp( casa::MVPosition( antpos ),
    1694                         casa::MPosition::ITRF ) ;
     1692    casacore::MEpoch me( casacore::Quantity( (casacore::Double)mjd, "d" ), casacore::MEpoch::UTC ) ;
     1693    casacore::MPosition mp( casacore::MVPosition( antpos ),
     1694                        casacore::MPosition::ITRF ) ;
    16951695    //ostringstream oss ;
    16961696    //mp.print( oss ) ;
    16971697    //logsink_->postLocally( LogMessage(oss.str(),LogOrigin(className_,funcName,WHERE)) ) ;
    16981698   
    1699     casa::MeasFrame mf( me, mp ) ;
    1700     casa::MDirection::Types dirtype ;
    1701     casa::Bool b = casa::MDirection::getType( dirtype, dirref ) ;
     1699    casacore::MeasFrame mf( me, mp ) ;
     1700    casacore::MDirection::Types dirtype ;
     1701    casacore::Bool b = casacore::MDirection::getType( dirtype, dirref ) ;
    17021702    if ( b ) {
    1703       casa::MDirection::Convert toj2000( dirtype,
    1704                                          casa::MDirection::Ref( casa::MDirection::J2000, mf ) ) ;
    1705       casa::Vector<casa::Double> cdir = toj2000( dir ).getAngle( "rad" ).getValue() ;
     1703      casacore::MDirection::Convert toj2000( dirtype,
     1704                                         casacore::MDirection::Ref( casacore::MDirection::J2000, mf ) ) ;
     1705      casacore::Vector<casacore::Double> cdir = toj2000( dir ).getAngle( "rad" ).getValue() ;
    17061706      //logsink_->postLocally( LogMessage("cdir = "+String::toString(cdir),LogOrigin(className_,funcName,WHERE)) ) ;
    17071707      newd[0] = (double)(cdir[0]) ;
     
    17191719string OldASDMReader::getFrame()
    17201720{
    1721   casa::String funcName = "getFrame" ;
     1721  casacore::String funcName = "getFrame" ;
    17221722 
    17231723  // default is TOPO
     
    17481748int OldASDMReader::getNumIFs()
    17491749{
    1750   casa::String funcName = "getNumIFs" ;
     1750  casacore::String funcName = "getNumIFs" ;
    17511751
    17521752  int nif = 0 ;
  • trunk/external-alma/oldasdm2ASAP/OldASDMReader.h

    r2301 r3106  
    3131   * @return boolean status (true or false)
    3232   **/
    33   bool open( const std::string &filename, const casa::Record &rec ) ;
     33  bool open( const std::string &filename, const casacore::Record &rec ) ;
    3434
    3535  /**
     
    4646   * get antenna id
    4747   **/
    48   casa::Int getAntennaId() { return antennaId_ ; } ;
     48  casacore::Int getAntennaId() { return antennaId_ ; } ;
    4949
    5050  /**
    5151   * get antenna name
    5252   **/
    53   casa::String getAntennaName() { return antennaName_ ; } ;
     53  casacore::String getAntennaName() { return antennaName_ ; } ;
    5454
    5555  /**
     
    7474   * @param poltype polarization type
    7575   **/
    76   void fillHeader( casa::Int &nchan,
    77                    casa::Int &npol,
    78                    casa::Int &nif,
    79                    casa::Int &nbeam,
    80                    casa::String &observer,
    81                    casa::String &project,
    82                    casa::String &obstype,
    83                    casa::String &antennaname,
    84                    casa::Vector<casa::Double> &antennaposition,
    85                    casa::Float &equinox,
    86                    casa::String &freqref,
    87                    casa::Double &reffreq,
    88                    casa::Double &bandwidth,
    89                    casa::Double &utc,
    90                    casa::String &fluxunit,
    91                    casa::String &epoch,
    92                    casa::String &poltype ) ; 
     76  void fillHeader( casacore::Int &nchan,
     77                   casacore::Int &npol,
     78                   casacore::Int &nif,
     79                   casacore::Int &nbeam,
     80                   casacore::String &observer,
     81                   casacore::String &project,
     82                   casacore::String &obstype,
     83                   casacore::String &antennaname,
     84                   casacore::Vector<casacore::Double> &antennaposition,
     85                   casacore::Float &equinox,
     86                   casacore::String &freqref,
     87                   casacore::Double &reffreq,
     88                   casacore::Double &bandwidth,
     89                   casacore::Double &utc,
     90                   casacore::String &fluxunit,
     91                   casacore::String &epoch,
     92                   casacore::String &poltype ) ; 
    9393
    9494  /**
     
    100100   * @return list of valid configDescriptionId
    101101   **/
    102   casa::Vector<casa::uInt> getConfigDescriptionIdList() { return configDescIdList_ ; } ;
     102  casacore::Vector<casacore::uInt> getConfigDescriptionIdList() { return configDescIdList_ ; } ;
    103103
    104104  /**
    105105   * get list of fieldId
    106106   *
    107    * @return list of fieldId as casa::uInt
    108    **/
    109   casa::Vector<casa::uInt> getFieldIdList() ;
     107   * @return list of fieldId as casacore::uInt
     108   **/
     109  casacore::Vector<casacore::uInt> getFieldIdList() ;
    110110
    111111  /**
     
    114114   * @return number of rows in Main table
    115115   **/
    116   casa::uInt getNumMainRow() ;
     116  casacore::uInt getNumMainRow() ;
    117117
    118118  /**
     
    128128   * @param fieldId
    129129   **/
    130   casa::Bool setMainRow( casa::uInt configDescId, casa::uInt fieldId ) ;
     130  casacore::Bool setMainRow( casacore::uInt configDescId, casacore::uInt fieldId ) ;
    131131
    132132  /**
     
    136136   * @return boolean indicating the row is valid or not
    137137   **/
    138   casa::Bool setMainRow( casa::uInt irow ) ;
     138  casacore::Bool setMainRow( casacore::uInt irow ) ;
    139139
    140140  /**
     
    174174   * @return IF number
    175175   **/
    176   casa::uInt getIFNo( unsigned int idx ) ;
    177   casa::uInt getIFNo() ;
     176  casacore::uInt getIFNo( unsigned int idx ) ;
     177  casacore::uInt getIFNo() ;
    178178
    179179  /**
     
    380380   * @return boolean status
    381381   **/
    382   casa::Bool setData() ;
     382  casacore::Bool setData() ;
    383383
    384384  /**
     
    401401   * @param logger (LogSinkInterface)
    402402   **/
    403   void setLogger( casa::CountedPtr<casa::LogSinkInterface> &logsink ) ;
     403  void setLogger( casacore::CountedPtr<casacore::LogSinkInterface> &logsink ) ;
    404404
    405405
     
    490490                double &el,
    491491                double &mjd,
    492                 casa::Vector<casa::Quantity> &antpos ) ;
     492                casacore::Vector<casacore::Quantity> &antpos ) ;
    493493
    494494  /**
     
    502502  **/
    503503  std::vector<double> toJ2000( std::vector<double> &dir,
    504                                casa::String &dirref,
     504                               casacore::String &dirref,
    505505                               double &mjd,
    506                                casa::Vector<casa::Quantity> &antpos ) ;
     506                               casacore::Vector<casacore::Quantity> &antpos ) ;
    507507  /**
    508508   * get nIF
     
    569569  const sdmbin::VMSData *vmsData_ ;
    570570 
    571   casa::Int antennaId_ ; // antenna id
    572   casa::String antennaName_ ; // antenna name
    573   casa::String stationName_ ; // station name
    574   casa::Vector<casa::Quantity> antennaPosition_ ; // antenna position
    575   casa::Vector<casa::uInt> configDescIdList_ ; // list of valid configDescriptionId
    576   casa::Vector<casa::uInt> feedIdList_ ; // list of valid feedId
    577   casa::Vector<casa::uInt> fieldIdList_ ; // list of fieldId
    578   casa::Int row_ ; // current row index
    579   map<asdm::Tag,casa::uInt> ifno_ ; // list of IFNO for each SpectralWindow rows
     571  casacore::Int antennaId_ ; // antenna id
     572  casacore::String antennaName_ ; // antenna name
     573  casacore::String stationName_ ; // station name
     574  casacore::Vector<casacore::Quantity> antennaPosition_ ; // antenna position
     575  casacore::Vector<casacore::uInt> configDescIdList_ ; // list of valid configDescriptionId
     576  casacore::Vector<casacore::uInt> feedIdList_ ; // list of valid feedId
     577  casacore::Vector<casacore::uInt> fieldIdList_ ; // list of fieldId
     578  casacore::Int row_ ; // current row index
     579  map<asdm::Tag,casacore::uInt> ifno_ ; // list of IFNO for each SpectralWindow rows
    580580  unsigned int numData_ ; // number of valid data in vmsData_ where v_antennaId equals antennaId_
    581581  vector<unsigned int> dataIdList_ ; // list of valid data indexes in vmsData_ 
     
    587587  EnumSet<TimeSamplingMod::TimeSampling> timeSampling_ ; // time sampling
    588588  EnumSet<SpectralResolutionTypeMod::SpectralResolutionType> resolutionType_ ; // spectral resolution type
    589   casa::CountedPtr<casa::LogSinkInterface> logsink_ ; // Logger
    590   casa::String className_ ;
     589  casacore::CountedPtr<casacore::LogSinkInterface> logsink_ ; // Logger
     590  casacore::String className_ ;
    591591  unsigned int dataIndex_ ;
    592592
    593593  // Tables/Rows for ASDM
    594   casa::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows
     594  casacore::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows
    595595  //asdm::AntennaRow *antennaRow_p ; // pointer to target Antenna row
    596596  //asdm::StationRow *stationRow_p ; // pointer to target Station row that target antenna is located
Note: See TracChangeset for help on using the changeset viewer.