Changeset 3106 for trunk/external-alma
- Timestamp:
- 10/04/16 18:20:50 (8 years ago)
- Location:
- trunk/external-alma
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/asdm2ASAP/ASDMFiller.cc
r2869 r3106 90 90 //logsink_->postLocally( LogMessage("sFreqFrame = "+sFreqFrame,LogOrigin(className_,funcName,WHERE)) ) ; 91 91 92 Vector<casa ::Double> antpos = table_->getHeader().antennaposition ;92 Vector<casacore::Double> antpos = table_->getHeader().antennaposition ; 93 93 94 94 // data selection … … 194 194 195 195 // fill MOLECULE_ID and add MOLECULES row if necessary 196 Vector<casa ::Double> restFreqs( rf.size() ) ;196 Vector<casacore::Double> restFreqs( rf.size() ) ; 197 197 for ( uInt i = 0 ; i < rf.size() ; i++ ) 198 restFreqs[i] = (casa ::Double)(rf[i]) ;198 restFreqs[i] = (casacore::Double)(rf[i]) ; 199 199 setMolecule( restFreqs ) ; 200 200 201 201 // 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()) ; 204 204 //logsink_->postLocally( LogMessage("mjd = "+String::toString(mjd),LogOrigin(className_,funcName,WHERE)) ) ; 205 205 … … 208 208 209 209 // 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 ) ; 217 217 218 218 // fill FLAGROW … … 231 231 windspeed, 232 232 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 ) ; 238 238 //logsink_->postLocally( LogMessage("temperature = "+String::toString(temperature),LogOrigin(className_,funcName,WHERE)) ) ; 239 239 // fill AZIMUTH, ELEVATION, DIRECTION and SCANRATE … … 246 246 el, 247 247 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 ) ; 250 250 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]) ; 253 253 } 254 254 setScanRate( scanRate ) ; 255 255 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]) ; 258 258 } 259 259 else { … … 261 261 } 262 262 //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 ) ; 264 264 265 265 // REFPIX, REFVAL, INCREMENT … … 270 270 else { 271 271 reader_->getFrequency( refpix, refval, incr, freqref ) ; 272 refval = (double)toLSRK( casa ::Double(refval),272 refval = (double)toLSRK( casacore::Double(refval), 273 273 String(freqref), 274 274 hdr.utc, … … 281 281 282 282 // 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 ) ; 284 284 285 285 // loop on polarization … … 303 303 // OPACITY 304 304 vector<float> tau = reader_->getOpacity() ; 305 Vector<casa ::Float> opacity = toVector( tau, numPol ) ;305 Vector<casacore::Float> opacity = toVector( tau, numPol ) ; 306 306 307 307 // SPECTRA, FLAGTRA, TSYS, TCAL … … 311 311 vector< vector<float> > tc ; 312 312 reader_->getTcalAndTsys( tc, ts ) ; 313 Matrix<casa ::Float> spectra = toMatrix( sp, numPol, numChan ) ;313 Matrix<casacore::Float> spectra = toMatrix( sp, numPol, numChan ) ; 314 314 //logsink_->postLocally( LogMessage("spectra(0,0) = "+String::toString(spectra(0,0)),LogOrigin(className_,funcName,WHERE)) ) ; 315 315 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 ) ; 318 318 //logsink_->postLocally( LogMessage("tsys(0,0) = "+String::toString(tsys(0,0)),LogOrigin(className_,funcName,WHERE)) ) ; 319 319 // String caltime = "" ; 320 // if ( anyNE( tcal, (casa ::Float)1.0 ) )320 // if ( anyNE( tcal, (casacore::Float)1.0 ) ) 321 321 // caltime = toTcalTime( mjd ) ; 322 322 String caltime = toTcalTime( mjd ) ; … … 401 401 string ref ; 402 402 reader_->getSourceDirection( sdir, ref ) ; 403 Vector<casa ::Double> sourceDir( sdir ) ;403 Vector<casacore::Double> sourceDir( sdir ) ; 404 404 hdr.reffreq = toLSRK( hdr.reffreq, hdr.freqref, hdr.utc, hdr.antennaposition, sdir, String(ref) ) ; 405 405 hdr.freqref = "LSRK" ; … … 437 437 } 438 438 439 Matrix<casa ::Float> ASDMFiller::toMatrix( float *sp,439 Matrix<casacore::Float> ASDMFiller::toMatrix( float *sp, 440 440 unsigned int npol, 441 441 unsigned int nchan ) 442 442 { 443 Matrix<casa ::Float> mSp( npol, nchan ) ;443 Matrix<casacore::Float> mSp( npol, nchan ) ; 444 444 if ( npol <= 2 ) { 445 445 // 1 or 2 polarization case 446 446 for ( unsigned int ich = 0 ; ich < nchan ; ich++ ) { 447 447 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]) ; 449 449 } 450 450 } … … 453 453 // 4 polarization case 454 454 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) 459 459 } 460 460 } … … 462 462 } 463 463 464 Matrix<casa ::Float> ASDMFiller::toMatrix( vector< vector<float> > &tsys,464 Matrix<casacore::Float> ASDMFiller::toMatrix( vector< vector<float> > &tsys, 465 465 unsigned int npol, 466 466 unsigned int nchan ) … … 468 468 unsigned int numRec = tsys.size() ; 469 469 unsigned int numChan = tsys[0].size() ; 470 Matrix<casa ::Float> ret ;470 Matrix<casacore::Float> ret ; 471 471 if ( npol == numRec && nchan == numChan ) { 472 472 ret.resize( npol, nchan ) ; 473 473 for ( unsigned int ip = 0 ; ip < npol ; ip++ ) 474 474 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]) ; 476 476 } 477 477 else if ( npol == numRec && numChan == 1 ) { 478 478 ret.resize( npol, 1 ) ; 479 479 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]) ; 481 481 } 482 482 else if ( numRec == 1 && nchan == numChan ) { … … 484 484 for ( unsigned int ip = 0 ; ip < npol ; ip++ ) 485 485 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]) ; 487 487 } 488 488 else if ( numRec == 1 && numChan == 1 ) { 489 489 ret.resize( npol, 1 ) ; 490 490 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]) ; 492 492 } 493 493 else if ( numRec == 2 && npol == 4 && numChan == nchan ) { … … 496 496 ret.resize( npol, nchan ) ; 497 497 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]) ; 501 501 ret( 2, ic ) = tsysxy ; 502 502 ret( 3, ic ) = tsysxy ; … … 507 507 // at the moment Tsys[XY] = 0.5*(Tsys[X]+Tsys[Y]) 508 508 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]) ; 512 512 ret( 2, 0 ) = tsysxy ; 513 513 ret( 3, 0 ) = tsysxy ; … … 517 517 for ( unsigned int ip = 0 ; ip < npol ; ip++ ) 518 518 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]) ; 520 520 } 521 521 return ret ; 522 522 } 523 523 524 Vector<casa ::Float> ASDMFiller::toVector( vector<float> &tau,524 Vector<casacore::Float> ASDMFiller::toVector( vector<float> &tau, 525 525 unsigned int npol ) 526 526 { 527 527 String funcName = "toVector" ; 528 528 529 Vector<casa ::Float> ret( npol ) ;529 Vector<casacore::Float> ret( npol ) ; 530 530 //logsink_->postLocally( LogMessage("tau0="+String::toString(tau[0]),LogOrigin(className_,funcName,WHERE)) ) ; 531 531 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] ; 534 534 ret[2] = 0.5 * ( ret[0] + ret[1] ) ; 535 535 ret[3] = ret[2] ; … … 537 537 else if ( npol == tau.size() ) { 538 538 for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ ) 539 ret[ipol] = (casa ::Float)tau[ipol] ;539 ret[ipol] = (casacore::Float)tau[ipol] ; 540 540 } 541 541 else { 542 542 // I don't know how to handle... 543 543 for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ ) 544 ret[ipol] = (casa ::Float)tau[0] ;544 ret[ipol] = (casacore::Float)tau[0] ; 545 545 } 546 546 //logsink_->postLocally( LogMessage("tau="+String::toString(ret),LogOrigin(className_,funcName,WHERE)) ) ; … … 548 548 } 549 549 550 String ASDMFiller::toTcalTime( casa ::Double mjd )550 String ASDMFiller::toTcalTime( casacore::Double mjd ) 551 551 { 552 552 return MVTime( mjd ).string( MVTime::YMD ) ; 553 553 } 554 554 555 void ASDMFiller::toJ2000( Vector<casa ::Double> &dir,555 void ASDMFiller::toJ2000( Vector<casacore::Double> &dir, 556 556 double az, 557 557 double el, 558 casa ::Double mjd,559 Vector<casa ::Double> antpos )558 casacore::Double mjd, 559 Vector<casacore::Double> antpos ) 560 560 { 561 561 String funcName = "toJ2000" ; 562 562 563 Vector<casa ::Double> azel( 2 ) ;563 Vector<casacore::Double> azel( 2 ) ; 564 564 azel[0] = az ; 565 565 azel[1] = el ; … … 580 580 } 581 581 582 Vector<casa ::Double> ASDMFiller::toJ2000( Vector<casa::Double> dir,582 Vector<casacore::Double> ASDMFiller::toJ2000( Vector<casacore::Double> dir, 583 583 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 ) ; 588 588 if ( dirref != "J2000" ) { 589 589 MEpoch me( Quantity( mjd, "d" ), MEpoch::UTC ) ; … … 620 620 } 621 621 622 casa ::Double ASDMFiller::toLSRK( casa::Double freq,622 casacore::Double ASDMFiller::toLSRK( casacore::Double freq, 623 623 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, 627 627 String dirref ) 628 628 { … … 630 630 631 631 //logsink_->postLocally( LogMessage("freqref = "+freqref,LogOrigin(className_,funcName,WHERE)) ) ; 632 casa ::Double newf = freq ;632 casacore::Double newf = freq ; 633 633 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 ) ; 636 636 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") ) ; 638 638 MPosition mp( antposQ, MPosition::ITRF ) ; 639 639 MDirection::Types dirtype ; … … 641 641 if ( !b ) 642 642 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") ), 645 645 dirtype ) ; 646 646 MeasFrame mf( me, mp, md ) ; … … 651 651 MFrequency::Convert tolsr( freqtype, 652 652 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() ; 654 654 //logsink_->postLocally( LogMessage("freq = "+String::toString(freq)+", newf = "+String::toString(newf),LogOrigin(className_,funcName,WHERE)) ) ; 655 655 } -
trunk/external-alma/asdm2ASAP/ASDMFiller.h
r2754 r3106 13 13 public: 14 14 // constructor and destructor 15 ASDMFiller( casa ::CountedPtr<asap::Scantable> stable ) ;15 ASDMFiller( casacore::CountedPtr<asap::Scantable> stable ) ; 16 16 ~ASDMFiller() ; 17 17 18 18 // open data 19 bool open( const std::string &filename, const casa ::Record &rec ) ;19 bool open( const std::string &filename, const casacore::Record &rec ) ; 20 20 21 21 // fill data … … 26 26 27 27 // get reader object 28 casa ::CountedPtr<ASDMReader> getReader() { return reader_ ; } ;28 casacore::CountedPtr<ASDMReader> getReader() { return reader_ ; } ; 29 29 30 30 // set logger 31 void setLogger( casa ::CountedPtr<casa::LogSinkInterface> &logsink ) ;31 void setLogger( casacore::CountedPtr<casacore::LogSinkInterface> &logsink ) ; 32 32 33 33 private: … … 36 36 37 37 // get IF key 38 casa ::String getIFKey( casa::uInt ifno ) ;38 casacore::String getIFKey( casacore::uInt ifno ) ; 39 39 40 40 // get FREQUENCIES attributes from ifrec_ 41 void getFrequencyRec( casa ::String key,41 void getFrequencyRec( casacore::String key, 42 42 double &refpix, 43 43 double &refval, … … 45 45 46 46 // set FREQUENCIES attributes to ifrec_ 47 void setFrequencyRec( casa ::String key,47 void setFrequencyRec( casacore::String key, 48 48 double refpix, 49 49 double refval, … … 51 51 52 52 // reshape float array spectra to Matrix<Float> 53 casa ::Matrix<casa::Float> toMatrix( float *sp,53 casacore::Matrix<casacore::Float> toMatrix( float *sp, 54 54 unsigned int npol, 55 55 unsigned int nchan ) ; 56 56 57 57 // 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, 59 59 unsigned int npol, 60 60 unsigned int nchan ) ; 61 61 62 62 // 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, 64 64 unsigned int npol ) ; 65 65 66 66 // create TCAL time string from MJD 67 casa ::String toTcalTime( casa::Double mjd ) ;67 casacore::String toTcalTime( casacore::Double mjd ) ; 68 68 69 69 // AZEL to J2000 70 void toJ2000( casa ::Vector<casa::Double> &dir,70 void toJ2000( casacore::Vector<casacore::Double> &dir, 71 71 double az, 72 72 double el, 73 casa ::Double mjd,74 casa ::Vector<casa::Double> antpos ) ;73 casacore::Double mjd, 74 casacore::Vector<casacore::Double> antpos ) ; 75 75 76 76 // 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 ) ; 81 81 82 82 // get frequency frame enum value from string 83 casa ::MFrequency::Types toFrameType( std::string &s ) ;83 casacore::MFrequency::Types toFrameType( std::string &s ) ; 84 84 85 85 // to LSRK 86 86 // utc must be UTC time in "d" (day) 87 87 // 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 ) ; 94 94 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_ ; 98 98 99 casa ::Record ifrec_ ;99 casacore::Record ifrec_ ; 100 100 101 casa ::CountedPtr<casa::LogSinkInterface> logsink_ ;101 casacore::CountedPtr<casacore::LogSinkInterface> logsink_ ; 102 102 103 casa ::String className_ ;104 casa ::Bool freqToLsr_ ;103 casacore::String className_ ; 104 casacore::Bool freqToLsr_ ; 105 105 106 106 } ; -
trunk/external-alma/asdm2ASAP/ASDMReader.cc
r2755 r3106 57 57 } 58 58 59 bool ASDMReader::open( const string &filename, const casa ::Record &rec )60 { 61 casa ::String funcName = "open" ;59 bool ASDMReader::open( const string &filename, const casacore::Record &rec ) 60 { 61 casacore::String funcName = "open" ; 62 62 63 63 // return value … … 72 72 // parsing ASDM options 73 73 if ( rec.isDefined( "asdm" ) ) { 74 casa ::Record asdmrec = rec.asRecord( "asdm" ) ;74 casacore::Record asdmrec = rec.asRecord( "asdm" ) ; 75 75 76 76 // antenna 77 77 if ( asdmrec.isDefined( "antenna" ) ) { 78 if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casa ::TpInt ) {78 if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casacore::TpInt ) { 79 79 antennaId_ = asdmrec.asInt( "antenna" ) ; 80 80 } … … 183 183 vector<AntennaRow *> rows = atab.get() ; 184 184 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_ ) { 187 187 idx = rows[irow]->getAntennaId().getTagValue() ; 188 188 break ; … … 191 191 if ( idx == -1 ) { 192 192 close() ; 193 throw (casa ::AipsError( antennaName_ + " not found." )) ;193 throw (casacore::AipsError( antennaName_ + " not found." )) ; 194 194 } 195 195 else { … … 204 204 if ( antennaRow == 0 ) { 205 205 close() ; 206 throw (casa ::AipsError( "AntennaId " + casa::String::toString(antennaId_) + " is invalid." ) ) ;206 throw (casacore::AipsError( "AntennaId " + casacore::String::toString(antennaId_) + " is invalid." ) ) ; 207 207 } 208 208 } … … 211 211 // set antenna name 212 212 if ( antennaName_.size() == 0 ) { 213 antennaName_ = casa ::String( antennaRow->getName() ) ;213 antennaName_ = casacore::String( antennaRow->getName() ) ; 214 214 } 215 215 … … 218 218 219 219 // station name 220 stationName_ = casa ::String( stationRow->getName() ) ;220 stationName_ = casacore::String( stationRow->getName() ) ; 221 221 222 222 // antenna position 223 223 antennaPosition_.resize( 3 ) ; 224 224 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 ) ; 229 229 mf_.set( mp_ ) ; 230 230 … … 233 233 234 234 // get Main rows 235 //mainRow_ = casa ::Vector<MainRow *>(asdm_->getMain().get()) ;235 //mainRow_ = casacore::Vector<MainRow *>(asdm_->getMain().get()) ; 236 236 237 237 // set up IFNO … … 266 266 } 267 267 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" ;268 void 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" ; 287 287 288 288 ExecBlockTable &ebtab = asdm_->getExecBlock() ; 289 289 // at the moment take first row of ExecBlock table 290 290 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() ) ; 293 293 294 294 // antennaname … … 299 299 // antennaposition 300 300 antennaposition.resize( 3 ) ; 301 for ( casa ::uInt i = 0 ; i < 3 ; i++ )301 for ( casacore::uInt i = 0 ; i < 3 ; i++ ) 302 302 antennaposition[i] = antennaPosition_[i].getValue( Unit("m") ) ; 303 303 … … 311 311 // utc 312 312 // start time of the project 313 utc = casa ::Double( ebrow->getStartTime().getMJD() ) ;313 utc = casacore::Double( ebrow->getStartTime().getMJD() ) ; 314 314 315 315 … … 330 330 refidx = irow ; 331 331 } 332 nchan = casa ::Int( *max_element( nchans.begin(), nchans.end() ) ) ;332 nchan = casacore::Int( *max_element( nchans.begin(), nchans.end() ) ) ; 333 333 334 334 //logsink_->postLocally( LogMessage("refidx = "+String::toString(refidx),LogOrigin(className_,funcName,WHERE)) ) ; … … 341 341 } 342 342 } 343 bandwidth = casa ::Double( *max_element( bws.begin(), bws.end() ) ) ;343 bandwidth = casacore::Double( *max_element( bws.begin(), bws.end() ) ) ; 344 344 345 345 // reffreq 346 reffreq = casa ::Double( spwrows[refidx]->getRefFreq().get() ) ;346 reffreq = casacore::Double( spwrows[refidx]->getRefFreq().get() ) ; 347 347 348 348 // freqref … … 386 386 387 387 // npol 388 npol = casa ::Int( *max_element( npols.begin(), npols.end() ) ) ;388 npol = casacore::Int( *max_element( npols.begin(), npols.end() ) ) ; 389 389 390 390 // poltype … … 425 425 426 426 // nbeam 427 nbeam = casa ::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;427 nbeam = casacore::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ; 428 428 429 429 // fluxunit … … 445 445 obstype = "" ; 446 446 for ( unsigned int imode = 0 ; imode < obsmode.size() ; imode++ ) { 447 obstype += casa ::String(obsmode[imode]) ;447 obstype += casacore::String(obsmode[imode]) ; 448 448 if ( imode != obsmode.size()-1 ) 449 449 obstype += "#" ; … … 453 453 void ASDMReader::selectConfigDescription() 454 454 { 455 casa ::String funcName = "selectConfigDescription" ;455 casacore::String funcName = "selectConfigDescription" ; 456 456 457 457 vector<ConfigDescriptionRow *> cdrows = asdm_->getConfigDescription().get() ; … … 466 466 configDescIdList_.resize( cdidTags.size() ) ; 467 467 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() ) ; 469 469 } 470 470 } … … 476 476 Tag atag( antennaId_, TagType::Antenna ) ; 477 477 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 ) ) 480 480 continue ; 481 481 if ( frows[irow]->getAntennaId() == atag ) { … … 487 487 } 488 488 489 casa ::Vector<casa::uInt> ASDMReader::getFieldIdList()490 { 491 casa ::String funcName = "getFieldIdList" ;489 casacore::Vector<casacore::uInt> ASDMReader::getFieldIdList() 490 { 491 casacore::String funcName = "getFieldIdList" ; 492 492 493 493 vector<FieldRow *> frows = asdm_->getField().get() ; … … 501 501 } 502 502 503 casa ::uInt ASDMReader::getNumMainRow()504 { 505 casa ::uInt nrow = casa::uInt( mainRow_.size() ) ;503 casacore::uInt ASDMReader::getNumMainRow() 504 { 505 casacore::uInt nrow = casacore::uInt( mainRow_.size() ) ; 506 506 507 507 return nrow ; … … 534 534 } 535 535 536 casa ::Bool ASDMReader::setMainRow( casa::uInt irow )537 { 538 casa ::Bool status = true ;536 casacore::Bool ASDMReader::setMainRow( casacore::uInt irow ) 537 { 538 casacore::Bool status = true ; 539 539 row_ = irow ; 540 540 execBlockTag_ = mainRow_[row_]->getExecBlockId() ; … … 544 544 status = false ; 545 545 else { 546 status = (casa ::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;546 status = (casacore::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ; 547 547 } 548 548 return status ; 549 549 } 550 550 551 casa ::Bool ASDMReader::setMainRow( casa::uInt configDescId, casa::uInt fieldId )551 casacore::Bool ASDMReader::setMainRow( casacore::uInt configDescId, casacore::uInt fieldId ) 552 552 { 553 553 clearMainRow() ; … … 558 558 if (rows == 0) 559 559 return false; 560 mainRow_ = casa ::Vector<MainRow *>( *rows ) ;560 mainRow_ = casacore::Vector<MainRow *>( *rows ) ; 561 561 562 562 return true ; … … 570 570 void ASDMReader::setupIFNO() 571 571 { 572 casa ::String funcName = "setupIFNO" ;572 casacore::String funcName = "setupIFNO" ; 573 573 574 574 vector<SpectralWindowRow *> spwrows = asdm_->getSpectralWindow().get() ; 575 575 unsigned int nrow = spwrows.size() ; 576 576 ifno_.clear() ; 577 casa ::uInt idx = 0 ;578 casa ::uInt wvridx = 0 ;577 casacore::uInt idx = 0 ; 578 casacore::uInt wvridx = 0 ; 579 579 for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) { 580 casa ::uInt index ;580 casacore::uInt index ; 581 581 if ( isWVR( spwrows[irow] ) ) { 582 582 //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+" is WVR",LogOrigin(className_,funcName,WHERE)) ) ; … … 586 586 index = ++idx ; 587 587 } 588 ifno_.insert( pair<Tag,casa ::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ;588 ifno_.insert( pair<Tag,casacore::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ; 589 589 //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+": IFNO="+String::toString(index),LogOrigin(className_,funcName,WHERE)) ) ; 590 590 } … … 601 601 } 602 602 603 casa ::Bool ASDMReader::setData()604 { 605 casa ::String funcName = "setData" ;603 casacore::Bool ASDMReader::setData() 604 { 605 casacore::String funcName = "setData" ; 606 606 607 607 //logsink_->postLocally( LogMessage("try to retrieve binary data",LogOrigin(className_,funcName,WHERE)) ) ; … … 678 678 } 679 679 680 casa ::uInt ASDMReader::getIFNo( unsigned int idx )680 casacore::uInt ASDMReader::getIFNo( unsigned int idx ) 681 681 { 682 682 prepareData( idx ) ; … … 684 684 } 685 685 686 casa ::uInt ASDMReader::getIFNo()687 { 688 map<Tag,casa ::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;686 casacore::uInt ASDMReader::getIFNo() 687 { 688 map<Tag,casacore::uInt>::iterator iter = ifno_.find( specWinTag_ ) ; 689 689 if ( iter != ifno_.end() ) 690 690 return iter->second ; … … 720 720 string &freqref ) 721 721 { 722 casa ::String funcName = "getFrequency" ;722 casacore::String funcName = "getFrequency" ; 723 723 724 724 int nchan = specWinRow_p->getNumChan() ; … … 737 737 } 738 738 else { 739 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;739 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ; 740 740 } 741 741 } … … 752 752 } 753 753 else { 754 throw (casa ::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;754 throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ; 755 755 } 756 756 if ( specWinRow_p->isChanFreqStepExists() ) { … … 764 764 } 765 765 else { 766 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;766 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ; 767 767 } 768 768 if ( specWinRow_p->isChanFreqStartExists() ) { … … 773 773 } 774 774 else { 775 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;775 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ; 776 776 } 777 777 } … … 788 788 } 789 789 else { 790 throw (casa ::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;790 throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ; 791 791 } 792 792 if ( specWinRow_p->isChanFreqStepExists() ) { … … 800 800 } 801 801 else { 802 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;802 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ; 803 803 } 804 804 if ( specWinRow_p->isChanFreqStartExists() ) { … … 810 810 } 811 811 else { 812 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;812 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ; 813 813 } 814 814 } … … 1264 1264 for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) { 1265 1265 CalAtmosphereRow *atmrow = atmrows[irow] ; 1266 if ( casa ::String(atmrow->getAntennaName()) != antennaName_1266 if ( casacore::String(atmrow->getAntennaName()) != antennaName_ 1267 1267 //|| atmrow->getReceiverBand() != rb 1268 1268 //|| atmrow->getBasebandName() != bbname … … 1310 1310 float &windaz ) 1311 1311 { 1312 casa ::String funcName = "getWeatherInfo" ;1312 casacore::String funcName = "getWeatherInfo" ; 1313 1313 1314 1314 temperature = 0.0 ; … … 1710 1710 1711 1711 vector<double> ASDMReader::toJ2000( vector<double> &dir, 1712 casa ::String &dirref,1712 casacore::String &dirref, 1713 1713 double &mjd ) 1714 1714 { 1715 casa ::String funcName = "toJ2000" ;1715 casacore::String funcName = "toJ2000" ; 1716 1716 1717 1717 vector<double> newd( dir ) ; 1718 1718 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 ) ; 1720 1720 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 ) ; 1723 1723 if ( b ) { 1724 casa ::Vector<casa::Double> cdir = toj2000_( dir ).getAngle( "rad" ).getValue() ;1724 casacore::Vector<casacore::Double> cdir = toj2000_( dir ).getAngle( "rad" ).getValue() ; 1725 1725 //logsink_->postLocally( LogMessage("cdir = "+String::toString(cdir),LogOrigin(className_,funcName,WHERE)) ) ; 1726 1726 newd[0] = (double)(cdir[0]) ; … … 1738 1738 string ASDMReader::getFrame() 1739 1739 { 1740 casa ::String funcName = "getFrame" ;1740 casacore::String funcName = "getFrame" ; 1741 1741 1742 1742 // default is TOPO … … 1767 1767 int ASDMReader::getNumIFs() 1768 1768 { 1769 casa ::String funcName = "getNumIFs" ;1769 casacore::String funcName = "getNumIFs" ; 1770 1770 1771 1771 int nif = 0 ; -
trunk/external-alma/asdm2ASAP/ASDMReader.h
r2979 r3106 38 38 * @return boolean status (true or false) 39 39 **/ 40 bool open( const std::string &filename, const casa ::Record &rec ) ;40 bool open( const std::string &filename, const casacore::Record &rec ) ; 41 41 42 42 /** … … 53 53 * get antenna id 54 54 **/ 55 casa ::Int getAntennaId() { return antennaId_ ; } ;55 casacore::Int getAntennaId() { return antennaId_ ; } ; 56 56 57 57 /** 58 58 * get antenna name 59 59 **/ 60 casa ::String getAntennaName() { return antennaName_ ; } ;60 casacore::String getAntennaName() { return antennaName_ ; } ; 61 61 62 62 /** … … 81 81 * @param poltype polarization type 82 82 **/ 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 ) ; 100 100 101 101 /** … … 107 107 * @return list of valid configDescriptionId 108 108 **/ 109 casa ::Vector<casa::uInt> getConfigDescriptionIdList() { return configDescIdList_ ; } ;109 casacore::Vector<casacore::uInt> getConfigDescriptionIdList() { return configDescIdList_ ; } ; 110 110 111 111 /** 112 112 * get list of fieldId 113 113 * 114 * @return list of fieldId as casa ::uInt115 **/ 116 casa ::Vector<casa::uInt> getFieldIdList() ;114 * @return list of fieldId as casacore::uInt 115 **/ 116 casacore::Vector<casacore::uInt> getFieldIdList() ; 117 117 118 118 /** … … 121 121 * @return number of rows in Main table 122 122 **/ 123 casa ::uInt getNumMainRow() ;123 casacore::uInt getNumMainRow() ; 124 124 125 125 /** … … 135 135 * @param fieldId 136 136 **/ 137 casa ::Bool setMainRow( casa::uInt configDescId, casa::uInt fieldId ) ;137 casacore::Bool setMainRow( casacore::uInt configDescId, casacore::uInt fieldId ) ; 138 138 139 139 /** … … 143 143 * @return boolean indicating the row is valid or not 144 144 **/ 145 casa ::Bool setMainRow( casa::uInt irow ) ;145 casacore::Bool setMainRow( casacore::uInt irow ) ; 146 146 147 147 /** … … 181 181 * @return IF number 182 182 **/ 183 casa ::uInt getIFNo( unsigned int idx ) ;184 casa ::uInt getIFNo() ;183 casacore::uInt getIFNo( unsigned int idx ) ; 184 casacore::uInt getIFNo() ; 185 185 186 186 /** … … 387 387 * @return boolean status 388 388 **/ 389 casa ::Bool setData() ;389 casacore::Bool setData() ; 390 390 391 391 /** … … 408 408 * @param logger (LogSinkInterface) 409 409 **/ 410 void setLogger( casa ::CountedPtr<casa::LogSinkInterface> &logsink ) ;410 void setLogger( casacore::CountedPtr<casacore::LogSinkInterface> &logsink ) ; 411 411 412 412 … … 507 507 **/ 508 508 std::vector<double> toJ2000( std::vector<double> &dir, 509 casa ::String &dirref,509 casacore::String &dirref, 510 510 double &mjd ) ; 511 511 … … 579 579 const sdmbin::VMSData *vmsData_ ; 580 580 581 casa ::Int antennaId_ ; // antenna id582 casa ::String antennaName_ ; // antenna name583 casa ::String stationName_ ; // station name584 casa ::Vector<casa::Quantity> antennaPosition_ ; // antenna position585 casa ::Vector<casa::uInt> configDescIdList_ ; // list of valid configDescriptionId586 casa ::Vector<casa::uInt> feedIdList_ ; // list of valid feedId587 casa ::Vector<casa::uInt> fieldIdList_ ; // list of fieldId588 casa ::Int row_ ; // current row index589 map<asdm::Tag,casa ::uInt> ifno_ ; // list of IFNO for each SpectralWindow rows581 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 590 590 unsigned int numData_ ; // number of valid data in vmsData_ where v_antennaId equals antennaId_ 591 591 vector<unsigned int> dataIdList_ ; // list of valid data indexes in vmsData_ … … 597 597 EnumSet<TimeSamplingMod::TimeSampling> timeSampling_ ; // time sampling 598 598 EnumSet<SpectralResolutionTypeMod::SpectralResolutionType> resolutionType_ ; // spectral resolution type 599 casa ::CountedPtr<casa::LogSinkInterface> logsink_ ; // Logger600 casa ::String className_ ;599 casacore::CountedPtr<casacore::LogSinkInterface> logsink_ ; // Logger 600 casacore::String className_ ; 601 601 unsigned int dataIndex_ ; 602 602 603 603 // Tables/Rows for ASDM 604 casa ::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows604 casacore::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows 605 605 //asdm::AntennaRow *antennaRow_p ; // pointer to target Antenna row 606 606 //asdm::StationRow *stationRow_p ; // pointer to target Station row that target antenna is located … … 617 617 asdm::ArrayTimeInterval timeInterval_ ; 618 618 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_ ; 623 623 } ; 624 624 #endif // ASAP_ASDM_READER_H -
trunk/external-alma/atnf/PKSIO/GBTFITSreader.h
r1868 r3106 50 50 51 51 using namespace std; 52 using namespace casa ;52 using namespace casacore; 53 53 54 54 // <summary> -
trunk/external-alma/atnf/PKSIO/NRODataRecord.h
r2765 r3106 192 192 // 193 193 // 2009/02/26 Takeshi Nakazato Moved to NROReader 194 casa ::CountedPtr<char> LDATA ;194 casacore::CountedPtr<char> LDATA ; 195 195 // Spectral data for FITS data 196 196 //vector<int> JDATA ; -
trunk/external-alma/atnf/PKSIO/NROReader.cc
r3105 r3106 73 73 } 74 74 75 // T must be std::string or casa ::String75 // T must be std::string or casacore::String 76 76 template<class T> 77 77 inline String trim_nro_string(T const &s) { -
trunk/external-alma/atnf/PKSIO/SDFITSreader.h
r1757 r3106 48 48 49 49 using namespace std; 50 using namespace casa ;50 using namespace casacore; 51 51 52 52 // <summary> -
trunk/external-alma/atnf/PKSIO/SDFITSwriter.h
r1757 r3106 43 43 44 44 using namespace std; 45 using namespace casa ;45 using namespace casacore; 46 46 47 47 // <summary> -
trunk/external-alma/components/SpectralComponents/CompiledSpectralElement.h
r2980 r3106 69 69 // Construct a compiled string 70 70 explicit CompiledSpectralElement( 71 const String& function, const Vector<Double>& param71 const casacore::String& function, const casacore::Vector<casacore::Double>& param 72 72 ); 73 73 … … 97 97 98 98 // Save to a record. 99 virtual Bool toRecord(RecordInterface& out) const;99 virtual casacore::Bool toRecord(RecordInterface& out) const; 100 100 101 101 protected: … … 105 105 // For subclasses. Parameters and function must be set after construction. 106 106 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) 108 108 ); 109 109 110 110 CompiledSpectralElement( 111 SpectralElement::Types type, uInt nParam111 SpectralElement::Types type, casacore::uInt nParam 112 112 ); 113 113 114 virtual void _setFunction(const String& function);114 virtual void _setFunction(const casacore::String& function); 115 115 116 116 /* -
trunk/external-alma/components/SpectralComponents/GaussianSpectralElement.h
r2980 r3106 76 76 //# Constants 77 77 // Sigma to FWHM conversion factor 78 static const Double SigmaToFWHM;78 static const casacore::Double SigmaToFWHM; 79 79 80 80 //# Constructors … … 86 86 // </thrown> 87 87 GaussianSpectralElement( 88 const Double ampl, constDouble center,89 const Double sigma88 const casacore::Double ampl, const casacore::Double center, 89 const casacore::Double sigma 90 90 ); 91 91 … … 95 95 // <li> AipsError if sigma == 0.0 96 96 // </thrown> 97 GaussianSpectralElement(const Vector<Double> ¶m);97 GaussianSpectralElement(const casacore::Vector<casacore::Double> ¶m); 98 98 // Copy constructor (deep copy) 99 99 // <thrown> … … 114 114 // GaussianSpectralElement& operator=(const GaussianSpectralElement &other); 115 115 // Evaluate the value of the element at x 116 // Double operator()(constDouble x) const;116 //casacore::Double operator()(const casacore::Double x) const; 117 117 118 Double getSigma() const;119 Double getFWHM() const;118 casacore::Double getSigma() const; 119 casacore::Double getFWHM() const; 120 120 121 Double getSigmaErr() const;122 Double getFWHMErr() const;121 casacore::Double getSigmaErr() const; 122 casacore::Double getFWHMErr() const; 123 123 124 124 125 void setSigma( Double sigma);126 void setFWHM( Double fwhm);125 void setSigma(casacore::Double sigma); 126 void setFWHM(casacore::Double fwhm); 127 127 128 void fixSigma(const Bool fix=True);128 void fixSigma(const casacore::Bool fix=True); 129 129 130 Bool fixedSigma() const;130 casacore::Bool fixedSigma() const; 131 131 132 Double getIntegral() const;132 casacore::Double getIntegral() const; 133 133 134 134 // Save to a record. For Gaussian elements, 135 135 // the width is defined as a FWHM in the record interface. 136 Bool toRecord(RecordInterface &out) const;136 casacore::Bool toRecord(RecordInterface &out) const; 137 137 138 138 // Sigma to FWHM 139 139 // Convert from sigma to FWHM and vice versa 140 140 // <group> 141 static Double sigmaFromFWHM (constDouble fwhm);141 static casacore::Double sigmaFromFWHM (const casacore::Double fwhm); 142 142 143 static Double sigmaToFWHM (constDouble sigma);143 static casacore::Double sigmaToFWHM (const casacore::Double sigma); 144 144 // </group> 145 145 146 void set(const Vector<Double>& v);146 void set(const casacore::Vector<casacore::Double>& v); 147 147 148 148 private: … … 150 150 // but the second param of the corresponding Gaussian1D function is the 151 151 // FWHM :( 152 void _set(const Vector<Double>& v);152 void _set(const casacore::Vector<casacore::Double>& v); 153 153 154 154 }; -
trunk/external-alma/components/SpectralComponents/Spectral2Estimate.tcc
r2980 r3106 18 18 //# 19 19 //# Correspondence concerning AIPS++ should be addressed as follows: 20 //# Internet email: aips2-request@nrao.edu.20 //# casacore::Internet email: aips2-request@nrao.edu. 21 21 //# Postal address: AIPS++ Project Office 22 22 //# National Radio Astronomy Observatory … … 40 40 //# Member templates 41 41 template <class MT> 42 const SpectralList &SpectralEstimate::estimate(const Vector<MT> &prof,43 Vector<MT> *der) {42 const SpectralList &SpectralEstimate::estimate(const casacore::Vector<MT> &prof, 43 casacore::Vector<MT> *der) { 44 44 if (prof.nelements() != lprof_p) { 45 45 delete [] deriv_p; deriv_p = 0; lprof_p = 0; 46 46 lprof_p = prof.nelements(); 47 deriv_p = new Double[lprof_p];47 deriv_p = new casacore::Double[lprof_p]; 48 48 }; 49 49 // Check if signal in window 50 50 if (!window(prof)) return slist_p; 51 51 // 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)); 53 53 windowLow_p = max(windowLow_p-q_p , 0 ); 54 54 // Get the second derivatives … … 56 56 // Next for debugging 57 57 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]; 59 59 }; 60 60 // Find the estimates (sorted) … … 65 65 66 66 template <class MT> 67 const SpectralList& SpectralEstimate::estimate(const Vector<MT>& x,68 const Vector<MT>& y)67 const SpectralList& SpectralEstimate::estimate(const casacore::Vector<MT>& x, 68 const casacore::Vector<MT>& y) 69 69 { 70 70 if (x.nelements() != y.nelements()) { … … 77 77 estimate(y); 78 78 // Convert 79 for ( uInt i=0; i<slist_p.nelements(); i++) {79 for (casacore::uInt i=0; i<slist_p.nelements(); i++) { 80 80 if (slist_p[i]->getType() != SpectralElement::GAUSSIAN) { 81 81 throw AipsError("Non-gaussian spectral types cannot be estimated"); … … 90 90 91 91 template <class MT> 92 uInt SpectralEstimate::window(constVector<MT> &prof) {92 casacore::uInt SpectralEstimate::window(const casacore::Vector<MT> &prof) { 93 93 windowLow_p =0; 94 94 windowEnd_p = 0; 95 95 if (!useWindow_p || rms_p <= 0.0 || lprof_p == 0) { 96 96 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)); 99 99 } else windowEnd_p = lprof_p; 100 100 return windowEnd_p-windowLow_p; 101 101 }; 102 102 // 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++) { 107 107 if (prof(i)>pmax) { 108 108 pmax = prof(i); … … 114 114 if (pmax < cutoff_p) return 0; 115 115 // 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; 120 120 do { 121 121 width++; 122 122 cold = cnew; 123 123 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)); 126 126 // 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++) { 130 130 s += prof(i); 131 131 c += i*prof(i); … … 142 142 143 143 template <class MT> 144 void SpectralEstimate::findc2(const Vector<MT> &prof) {145 for ( Int i=windowLow_p; i<windowEnd_p; i++) {144 void SpectralEstimate::findc2(const casacore::Vector<MT> &prof) { 145 for (casacore::Int i=windowLow_p; i<windowEnd_p; i++) { 146 146 // 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)) { 152 152 // add to moments 153 153 m0 += prof(k); … … 161 161 162 162 template <class MT> 163 void SpectralEstimate::findga(const Vector<MT> &prof) {164 Int i(windowLow_p-1);163 void SpectralEstimate::findga(const casacore::Vector<MT> &prof) { 164 casacore::Int i(windowLow_p-1); 165 165 // 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); 168 168 // Peak counter 169 Int nmax = 0;169 casacore::Int nmax = 0; 170 170 GaussianSpectralElement tspel; 171 171 while (++i < windowEnd_p) { … … 187 187 case 2: { 188 188 // 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); 193 193 ichi = i; 194 194 // 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++) { 198 198 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; 200 200 m0 += wi; 201 201 m1 += wi*ic; … … 203 203 }; 204 204 // determinant 205 Double det = m2*m0 - m1*m1;205 casacore::Double det = m2*m0 - m1*m1; 206 206 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); 209 209 // Width above critical? 210 210 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); 214 214 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); 218 218 // modified by dmehringer 2012apr03 to deal with 0 denominator 219 219 // 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)); 221 221 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)); 223 223 if (denom == 0) { 224 224 throw AipsError("Bailing because division by zero is undefined"); … … 252 252 253 253 template <class MT> 254 GaussianSpectralElement SpectralEstimate::convertElement (const Vector<MT>& x,254 GaussianSpectralElement SpectralEstimate::convertElement (const casacore::Vector<MT>& x, 255 255 const GaussianSpectralElement& el) const 256 256 { 257 257 GaussianSpectralElement elOut = el; 258 const Int& idxMax = x.nelements()-1;258 const casacore::Int& idxMax = x.nelements()-1; 259 259 260 260 // Get current (pars are amp, center, width as the SpectralElement 261 261 // will always be a Gaussian) 262 262 263 Vector<Double> par, err;263 casacore::Vector<casacore::Double> par, err; 264 264 el.get(par); 265 265 el.getError(err); … … 267 267 // Center 268 268 269 Int cenIdx =Int(par[1]);269 casacore::Int cenIdx = casacore::Int(par[1]); 270 270 271 271 // Get the x-increment, local to the center, as best we can from … … 273 273 // vector is monotonic 274 274 275 Double incX;275 casacore::Double incX; 276 276 if (cenIdx-1<0) { 277 277 incX = x[1] - x[0]; … … 287 287 par[1] = incX*(par[1]-idxMax) + x[idxMax]; // Extrapolate from x[idxMax] 288 288 } else { 289 Double dIdx = par[1] - cenIdx;290 par[1] = x[cenIdx] + dIdx*incX; // Interpolate289 casacore::Double dIdx = par[1] - cenIdx; 290 par[1] = x[cenIdx] + dIdx*incX; // casacore::Interpolate 291 291 } 292 292 err[1] = abs(err[1] * incX); -
trunk/external-alma/components/SpectralComponents/SpectralElement.cc
r3029 r3106 42 42 #include <casa/iostream.h> 43 43 44 using namespace casacore; 44 45 namespace casa { //# NAMESPACE CASA - BEGIN 45 46 -
trunk/external-alma/components/SpectralComponents/SpectralElement.h
r3029 r3106 34 34 #include <casa/Arrays/Vector.h> 35 35 #include <casa/Containers/RecordInterface.h> 36 37 using namespace casacore; 36 38 37 39 namespace casa { //# NAMESPACE CASA - BEGIN … … 105 107 106 108 // Evaluate the value of the element at x 107 virtual Double operator()(constDouble 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; 110 112 111 113 // Get parameter n … … 113 115 // <li> AipsError if illegal n 114 116 // </thrown> 115 virtual Double operator[](const uInt n) const;116 117 // Get all the types available as String and codes, and number available118 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, 119 121 const SpectralElement::Types *&typ); 120 122 // 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) String123 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); 125 127 126 128 // Get type of this element … … 128 130 129 131 // 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; 133 135 134 136 // 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; 137 139 138 140 // Get the order (i.e. the number of parameters) … … 140 142 141 143 // Set the error fields 142 virtual void setError(const Vector<Double> &err);144 virtual void setError(const casacore::Vector<casacore::Double> &err); 143 145 144 146 // Set fixed parameters (True) or unset them (False) … … 148 150 149 151 // Fix/unfix all in one go 150 virtual void fix(const Vector<Bool>& fix);152 virtual void fix(const casacore::Vector<casacore::Bool>& fix); 151 153 152 154 // Get the fix state[s] 153 const Vector<Bool> &fixed() const;155 const casacore::Vector<casacore::Bool> &fixed() const; 154 156 155 157 // Save to a record. 156 virtual Bool toRecord(RecordInterface& out) const;158 virtual casacore::Bool toRecord(RecordInterface& out) const; 157 159 158 160 // set parameters 159 virtual void set(const Vector<Double>& params);161 virtual void set(const casacore::Vector<casacore::Double>& params); 160 162 161 163 protected: … … 163 165 SpectralElement() {} 164 166 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)); 166 168 167 169 SpectralElement(const SpectralElement& other); … … 169 171 SpectralElement &operator=(const SpectralElement& other); 170 172 171 void _set(const Vector<Double>& params);173 void _set(const casacore::Vector<casacore::Double>& params); 172 174 173 175 void _setType(const Types type); 174 176 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 { 178 180 return _function; 179 181 } … … 186 188 // The parameters of the function. I.e. the polynomial coefficients; 187 189 // amplitude, center and sigma of a Gaussian. 188 Vector<Double> _params;190 casacore::Vector<casacore::Double> _params; 189 191 // The errors of the parameters 190 Vector<Double> _errors;192 casacore::Vector<casacore::Double> _errors; 191 193 // The indication if the parameter has to be fixed (True) or solved (False). 192 194 // 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; 196 198 197 199 }; … … 199 201 ostream &operator<<(ostream& os, const SpectralElement& elem); 200 202 201 Bool near(const SpectralElement& s1, const SpectralElement& s2, constDouble tol);202 203 Bool nearAbs(const SpectralElement& s1, const SpectralElement& s2, constDouble tol);203 casacore::Bool near(const SpectralElement& s1, const SpectralElement& s2, const casacore::Double tol); 204 205 casacore::Bool nearAbs(const SpectralElement& s1, const SpectralElement& s2, const casacore::Double tol); 204 206 205 207 -
trunk/external-alma/components/SpectralComponents/SpectralEstimate.h
r2980 r3106 18 18 //# 19 19 //# Correspondence concerning AIPS++ should be addressed as follows: 20 //# Internet email: aips2-request@nrao.edu.20 //# casacore::Internet email: aips2-request@nrao.edu. 21 21 //# Postal address: AIPS++ Project Office 22 22 //# National Radio Astronomy Observatory … … 34 34 #include <components/SpectralComponents/SpectralList.h> 35 35 36 namespace casacore { 37 template <class T> class Vector; 38 } 39 36 40 namespace casa { //# NAMESPACE CASA - BEGIN 37 41 38 42 //# Forward Declarations 39 43 class GaussianSpectralElement; 40 template <class T> class Vector;41 44 42 45 // <summary> … … 97 100 //# Constants 98 101 // Default maximum number of components to be found 99 static const uInt MAXPAR = 200;102 static const casacore::uInt MAXPAR = 200; 100 103 //# Enumerations 101 104 //# Friends … … 106 109 // of components that will be found. A value of zero will indicate 107 110 // an unlimited number. 108 explicit SpectralEstimate(const uInt maxpar=MAXPAR);111 explicit SpectralEstimate(const casacore::uInt maxpar=MAXPAR); 109 112 // Create an estimator with the given maximum number of possible 110 113 // elements. A value of zero will indicate an unlimited number. … … 112 115 // found, and a minimum width. Cutoff and minsigma default to 0.0, maximum 113 116 // size of list produced to 200. 114 explicit SpectralEstimate(const Double rms,115 const Double cutoff=0.0, constDouble 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); 117 120 // Copy constructor (deep copy) 118 121 SpectralEstimate(const SpectralEstimate &other); … … 138 141 // <group> 139 142 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); 145 148 // </group> 146 149 … … 151 154 // <group> 152 155 // 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); 154 157 // 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); 156 159 // 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); 158 161 // Set the number of points consider at each side of test point (i.e. a 159 162 // 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); 161 164 // Set a region [lo,hi] over which to estimate. Lo and hi are given as 162 165 // zero-based vector indices. 163 void setRegion(const Int lo, constInt hi);166 void setRegion(const casacore::Int lo, const casacore::Int hi); 164 167 // Do you want to look in an automatically determined window with signal? 165 168 // Default is False, meaning the full (possibly regioned) profile. 166 169 void setWindowing(const Bool win=False); 167 170 // 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); 169 172 // </group> 170 173 … … 174 177 Bool useWindow_p; 175 178 // rms estimate in profile 176 Double rms_p;179 casacore::Double rms_p; 177 180 // Source cutoff amplitude 178 Double cutoff_p;181 casacore::Double cutoff_p; 179 182 // Window low and end value 180 183 // <group> 181 Int windowLow_p;182 Int windowEnd_p;184 casacore::Int windowLow_p; 185 casacore::Int windowEnd_p; 183 186 // </group> 184 187 // Region low and high value 185 188 // <group> 186 Int regionLow_p;187 Int regionEnd_p;189 casacore::Int regionLow_p; 190 casacore::Int regionEnd_p; 188 191 // </group> 189 192 // Smoothing parameter. I.e. 2q+1 points are taken 190 Int q_p;191 // Internal cashing of calculated values based on q192 // <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; 195 198 // </group> 196 199 // The minimum Gaussian width 197 Double sigmin_p;200 casacore::Double sigmin_p; 198 201 // The second derivatives 199 Double *deriv_p;202 casacore::Double *deriv_p; 200 203 // The list of components 201 204 SpectralList slist_p; 202 205 // The length of the current profile being estimated 203 uInt lprof_p;206 casacore::uInt lprof_p; 204 207 205 208 //# Member functions 206 209 // Get the window or the total spectrum 207 210 template <class MT> 208 uInt window(constVector<MT> &prof);211 casacore::uInt window(const casacore::Vector<MT> &prof); 209 212 // Get the second derivatives 210 213 template <class MT> 211 void findc2(const Vector<MT> &prof);214 void findc2(const casacore::Vector<MT> &prof); 212 215 // Find the Gaussians 213 216 template <class MT> 214 void findga(const Vector<MT> &prof);217 void findga(const casacore::Vector<MT> &prof); 215 218 // Convert the parameters of the components in the list from 216 219 // 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, 218 221 const GaussianSpectralElement& el) const; 219 222 }; -
trunk/external-alma/components/SpectralComponents/SpectralList.h
r2980 r3106 18 18 //# 19 19 //# Correspondence concerning AIPS++ should be addressed as follows: 20 //# Internet email: aips2-request@nrao.edu.20 //# casacore::Internet email: aips2-request@nrao.edu. 21 21 //# Postal address: AIPS++ Project Office 22 22 //# National Radio Astronomy Observatory … … 34 34 #include <casa/Containers/Block.h> 35 35 36 namespace casacore { 37 38 class RecordInterface; 39 class String; 40 template <class T> class Vector; 41 } 42 36 43 namespace casa { //# NAMESPACE CASA - BEGIN 37 44 38 45 //# Forward Declarations 39 46 class SpectralElement; 40 class RecordInterface;41 class String;42 template <class T> class Vector;43 47 44 48 // <summary> … … 86 90 SpectralList(); 87 91 // Construct a list with a maximum length of n (0: unlimited length) 88 explicit SpectralList( uInt nmax);92 explicit SpectralList(casacore::uInt nmax); 89 93 // Construct with an initial element 90 94 explicit SpectralList(const SpectralElement &in); … … 100 104 SpectralList &operator=(const SpectralList &other); 101 105 // Evaluate the value of the sum of the elements at x 102 Double operator()(constDouble x) const;106 casacore::Double operator()(const casacore::Double x) const; 103 107 // Get element n 104 108 // <thrown> … … 106 110 // </thrown> 107 111 // <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); 110 114 // </group> 111 115 112 116 //# Member functions 113 117 // Get the number of elements in list 114 uInt nelements() const { return list_p.nelements(); };118 casacore::uInt nelements() const { return list_p.nelements(); }; 115 119 116 120 // Get the profile values for all elements in list. The evaluation … … 138 142 // Add elements to list (False if list has max length and full) 139 143 // <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); 142 146 // </group> 143 147 // Insert in sort order in the list … … 148 152 // Set an element in the list. Return False if more than one place beyond 149 153 // end of list; or if beyond max size. 150 Bool set(const SpectralElement &in, constuInt which);154 casacore::Bool set(const SpectralElement &in, const casacore::uInt which); 151 155 152 156 // Clear the list … … 154 158 155 159 // Set a maximum size of the list 156 void set(const uInt nmax);160 void set(const casacore::uInt nmax); 157 161 158 162 // Sort the list on the first parameter (i.e. peak value for Gaussian) … … 161 165 // Convert to and from a Record (see details in SpectralElement) 162 166 // <group> 163 Bool fromRecord (String& errMsg, constRecordInterface& 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; 165 169 //</group> 166 170 … … 168 172 //#Data 169 173 // Max length allowed of list 170 uInt nmax_p;174 casacore::uInt nmax_p; 171 175 // List of elements 172 PtrBlock<SpectralElement *> list_p;176 casacore::PtrBlock<SpectralElement *> list_p; 173 177 174 178 //# Member functions 175 179 // Compare two elements 176 Int compar(const SpectralElement &p1, const SpectralElement &p2) const;180 casacore::Int compar(const SpectralElement &p1, const SpectralElement &p2) const; 177 181 178 182 }; -
trunk/external-alma/oldasdm2ASAP/OldASDMFiller.cc
r2407 r3106 74 74 //logsink_->postLocally( LogMessage("sFreqFrame = "+sFreqFrame,LogOrigin(className_,funcName,WHERE)) ) ; 75 75 76 Vector<casa ::Double> antpos = table_->getHeader().antennaposition ;76 Vector<casacore::Double> antpos = table_->getHeader().antennaposition ; 77 77 78 78 // data selection … … 172 172 173 173 // fill MOLECULE_ID and add MOLECULES row if necessary 174 Vector<casa ::Double> restFreqs( rf.size() ) ;174 Vector<casacore::Double> restFreqs( rf.size() ) ; 175 175 for ( uInt i = 0 ; i < rf.size() ; i++ ) 176 restFreqs[i] = (casa ::Double)(rf[i]) ;176 restFreqs[i] = (casacore::Double)(rf[i]) ; 177 177 setMolecule( restFreqs ) ; 178 178 179 179 // 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()) ; 182 182 183 183 // fill TIME and INTERVAL … … 185 185 186 186 // 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 ) ; 194 194 195 195 // fill FLAGROW … … 208 208 windspeed, 209 209 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 ) ; 215 215 216 216 // fill AZIMUTH, ELEVATION, DIRECTION and SCANRATE … … 223 223 el, 224 224 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 ) ; 227 227 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]) ; 230 230 } 231 231 setScanRate( scanRate ) ; 232 232 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]) ; 235 235 } 236 236 else { … … 238 238 } 239 239 //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 ) ; 241 241 242 242 // REFPIX, REFVAL, INCREMENT … … 247 247 else { 248 248 reader_->getFrequency( refpix, refval, incr, freqref ) ; 249 refval = (double)toLSRK( casa ::Double(refval),249 refval = (double)toLSRK( casacore::Double(refval), 250 250 String(freqref), 251 251 mjd, … … 258 258 259 259 // 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 ) ; 261 261 262 262 // loop on polarization … … 280 280 // OPACITY 281 281 vector<float> tau = reader_->getOpacity() ; 282 Vector<casa ::Float> opacity = toVector( tau, numPol ) ;282 Vector<casacore::Float> opacity = toVector( tau, numPol ) ; 283 283 284 284 // SPECTRA, FLAGTRA, TSYS, TCAL … … 287 287 vector< vector<float> > tc ; 288 288 reader_->getTcalAndTsys( tc, ts ) ; 289 Matrix<casa ::Float> spectra = toMatrix( sp, numPol, numChan ) ;289 Matrix<casacore::Float> spectra = toMatrix( sp, numPol, numChan ) ; 290 290 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 ) ; 293 293 // String caltime = "" ; 294 // if ( anyNE( tcal, (casa ::Float)1.0 ) )294 // if ( anyNE( tcal, (casacore::Float)1.0 ) ) 295 295 // caltime = toTcalTime( mjd ) ; 296 296 String caltime = toTcalTime( mjd ) ; … … 374 374 string ref ; 375 375 reader_->getSourceDirection( sdir, ref ) ; 376 Vector<casa ::Double> sourceDir( sdir ) ;376 Vector<casacore::Double> sourceDir( sdir ) ; 377 377 hdr.reffreq = toLSRK( hdr.reffreq, hdr.freqref, hdr.utc, hdr.antennaposition, sdir, String(ref) ) ; 378 378 hdr.freqref = "LSRK" ; … … 410 410 } 411 411 412 Matrix<casa ::Float> OldASDMFiller::toMatrix( float *sp,412 Matrix<casacore::Float> OldASDMFiller::toMatrix( float *sp, 413 413 unsigned int npol, 414 414 unsigned int nchan ) 415 415 { 416 Matrix<casa ::Float> mSp( npol, nchan ) ;416 Matrix<casacore::Float> mSp( npol, nchan ) ; 417 417 if ( npol <= 2 ) { 418 418 // 1 or 2 polarization case 419 419 for ( unsigned int ich = 0 ; ich < nchan ; ich++ ) { 420 420 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]) ; 422 422 } 423 423 } … … 426 426 // 4 polarization case 427 427 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) 432 432 } 433 433 } … … 435 435 } 436 436 437 Matrix<casa ::Float> OldASDMFiller::toMatrix( vector< vector<float> > &tsys,437 Matrix<casacore::Float> OldASDMFiller::toMatrix( vector< vector<float> > &tsys, 438 438 unsigned int npol, 439 439 unsigned int nchan ) … … 441 441 unsigned int numRec = tsys.size() ; 442 442 unsigned int numChan = tsys[0].size() ; 443 Matrix<casa ::Float> ret ;443 Matrix<casacore::Float> ret ; 444 444 if ( npol == numRec && nchan == numChan ) { 445 445 ret.resize( npol, nchan ) ; 446 446 for ( unsigned int ip = 0 ; ip < npol ; ip++ ) 447 447 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]) ; 449 449 } 450 450 else if ( npol == numRec && numChan == 1 ) { 451 451 ret.resize( npol, 1 ) ; 452 452 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]) ; 454 454 } 455 455 else if ( numRec == 1 && nchan == numChan ) { … … 457 457 for ( unsigned int ip = 0 ; ip < npol ; ip++ ) 458 458 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]) ; 460 460 } 461 461 else if ( numRec == 1 && numChan == 1 ) { 462 462 ret.resize( npol, 1 ) ; 463 463 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]) ; 465 465 } 466 466 else if ( numRec == 2 && npol == 4 && numChan == nchan ) { … … 469 469 ret.resize( npol, nchan ) ; 470 470 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]) ; 474 474 ret( 2, ic ) = tsysxy ; 475 475 ret( 3, ic ) = tsysxy ; … … 480 480 // at the moment Tsys[XY] = 0.5*(Tsys[X]+Tsys[Y]) 481 481 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]) ; 485 485 ret( 2, 0 ) = tsysxy ; 486 486 ret( 3, 0 ) = tsysxy ; … … 490 490 for ( unsigned int ip = 0 ; ip < npol ; ip++ ) 491 491 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]) ; 493 493 } 494 494 return ret ; 495 495 } 496 496 497 Vector<casa ::Float> OldASDMFiller::toVector( vector<float> &tau,497 Vector<casacore::Float> OldASDMFiller::toVector( vector<float> &tau, 498 498 unsigned int npol ) 499 499 { 500 500 String funcName = "toVector" ; 501 501 502 Vector<casa ::Float> ret( npol ) ;502 Vector<casacore::Float> ret( npol ) ; 503 503 //logsink_->postLocally( LogMessage("tau0="+String::toString(tau[0]),LogOrigin(className_,funcName,WHERE)) ) ; 504 504 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] ; 507 507 ret[2] = 0.5 * ( ret[0] + ret[1] ) ; 508 508 ret[3] = ret[2] ; … … 510 510 else if ( npol == tau.size() ) { 511 511 for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ ) 512 ret[ipol] = (casa ::Float)tau[ipol] ;512 ret[ipol] = (casacore::Float)tau[ipol] ; 513 513 } 514 514 else { 515 515 // I don't know how to handle... 516 516 for ( unsigned int ipol = 0 ; ipol < npol ; ipol++ ) 517 ret[ipol] = (casa ::Float)tau[0] ;517 ret[ipol] = (casacore::Float)tau[0] ; 518 518 } 519 519 //logsink_->postLocally( LogMessage("tau="+String::toString(ret),LogOrigin(className_,funcName,WHERE)) ) ; … … 521 521 } 522 522 523 String OldASDMFiller::toTcalTime( casa ::Double mjd )523 String OldASDMFiller::toTcalTime( casacore::Double mjd ) 524 524 { 525 525 return MVTime( mjd ).string( MVTime::YMD ) ; 526 526 } 527 527 528 void OldASDMFiller::toJ2000( Vector<casa ::Double> &dir,528 void OldASDMFiller::toJ2000( Vector<casacore::Double> &dir, 529 529 double az, 530 530 double el, 531 casa ::Double mjd,532 Vector<casa ::Double> antpos )531 casacore::Double mjd, 532 Vector<casacore::Double> antpos ) 533 533 { 534 534 String funcName = "toJ2000" ; 535 535 536 Vector<casa ::Double> azel( 2 ) ;536 Vector<casacore::Double> azel( 2 ) ; 537 537 azel[0] = az ; 538 538 azel[1] = el ; … … 553 553 } 554 554 555 Vector<casa ::Double> OldASDMFiller::toJ2000( Vector<casa::Double> dir,555 Vector<casacore::Double> OldASDMFiller::toJ2000( Vector<casacore::Double> dir, 556 556 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 ) ; 561 561 if ( dirref != "J2000" ) { 562 562 MEpoch me( Quantity( mjd, "d" ), MEpoch::UTC ) ; … … 593 593 } 594 594 595 casa ::Double OldASDMFiller::toLSRK( casa::Double freq,595 casacore::Double OldASDMFiller::toLSRK( casacore::Double freq, 596 596 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, 600 600 String dirref ) 601 601 { … … 603 603 604 604 //logsink_->postLocally( LogMessage("freqref = "+freqref,LogOrigin(className_,funcName,WHERE)) ) ; 605 casa ::Double newf = freq ;605 casacore::Double newf = freq ; 606 606 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 ) ; 609 609 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") ) ; 611 611 MPosition mp( antposQ, MPosition::ITRF ) ; 612 612 MDirection::Types dirtype ; … … 614 614 if ( !b ) 615 615 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") ), 618 618 dirtype ) ; 619 619 MeasFrame mf( me, mp, md ) ; … … 624 624 MFrequency::Convert tolsr( freqtype, 625 625 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() ; 627 627 //logsink_->postLocally( LogMessage("freq = "+String::toString(freq)+", newf = "+String::toString(newf),LogOrigin(className_,funcName,WHERE)) ) ; 628 628 } -
trunk/external-alma/oldasdm2ASAP/OldASDMFiller.h
r2273 r3106 13 13 public: 14 14 // constructor and destructor 15 OldASDMFiller( casa ::CountedPtr<asap::Scantable> stable ) ;15 OldASDMFiller( casacore::CountedPtr<asap::Scantable> stable ) ; 16 16 ~OldASDMFiller() ; 17 17 18 18 // open data 19 bool open( const std::string &filename, const casa ::Record &rec ) ;19 bool open( const std::string &filename, const casacore::Record &rec ) ; 20 20 21 21 // fill data … … 26 26 27 27 // get reader object 28 casa ::CountedPtr<OldASDMReader> getReader() { return reader_ ; } ;28 casacore::CountedPtr<OldASDMReader> getReader() { return reader_ ; } ; 29 29 30 30 // set logger 31 void setLogger( casa ::CountedPtr<casa::LogSinkInterface> &logsink ) ;31 void setLogger( casacore::CountedPtr<casacore::LogSinkInterface> &logsink ) ; 32 32 33 33 private: … … 36 36 37 37 // get IF key 38 casa ::String getIFKey( casa::uInt ifno ) ;38 casacore::String getIFKey( casacore::uInt ifno ) ; 39 39 40 40 // get FREQUENCIES attributes from ifrec_ 41 void getFrequencyRec( casa ::String key,41 void getFrequencyRec( casacore::String key, 42 42 double &refpix, 43 43 double &refval, … … 45 45 46 46 // set FREQUENCIES attributes to ifrec_ 47 void setFrequencyRec( casa ::String key,47 void setFrequencyRec( casacore::String key, 48 48 double refpix, 49 49 double refval, … … 51 51 52 52 // reshape float array spectra to Matrix<Float> 53 casa ::Matrix<casa::Float> toMatrix( float *sp,53 casacore::Matrix<casacore::Float> toMatrix( float *sp, 54 54 unsigned int npol, 55 55 unsigned int nchan ) ; 56 56 57 57 // 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, 59 59 unsigned int npol, 60 60 unsigned int nchan ) ; 61 61 62 62 // 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, 64 64 unsigned int npol ) ; 65 65 66 66 // create TCAL time string from MJD 67 casa ::String toTcalTime( casa::Double mjd ) ;67 casacore::String toTcalTime( casacore::Double mjd ) ; 68 68 69 69 // AZEL to J2000 70 void toJ2000( casa ::Vector<casa::Double> &dir,70 void toJ2000( casacore::Vector<casacore::Double> &dir, 71 71 double az, 72 72 double el, 73 casa ::Double mjd,74 casa ::Vector<casa::Double> antpos ) ;73 casacore::Double mjd, 74 casacore::Vector<casacore::Double> antpos ) ; 75 75 76 76 // 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 ) ; 81 81 82 82 // get frequency frame enum value from string 83 casa ::MFrequency::Types toFrameType( std::string &s ) ;83 casacore::MFrequency::Types toFrameType( std::string &s ) ; 84 84 85 85 // to LSRK 86 86 // utc must be UTC time in "d" (day) 87 87 // 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 ) ; 94 94 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_ ; 98 98 99 casa ::Record ifrec_ ;99 casacore::Record ifrec_ ; 100 100 101 casa ::CountedPtr<casa::LogSinkInterface> logsink_ ;101 casacore::CountedPtr<casacore::LogSinkInterface> logsink_ ; 102 102 103 casa ::String className_ ;103 casacore::String className_ ; 104 104 105 105 } ; -
trunk/external-alma/oldasdm2ASAP/OldASDMReader.cc
r2355 r3106 56 56 } 57 57 58 bool OldASDMReader::open( const string &filename, const casa ::Record &rec )59 { 60 casa ::String funcName = "open" ;58 bool OldASDMReader::open( const string &filename, const casacore::Record &rec ) 59 { 60 casacore::String funcName = "open" ; 61 61 62 62 // return value … … 71 71 // parsing ASDM options 72 72 if ( rec.isDefined( "asdm" ) ) { 73 casa ::Record asdmrec = rec.asRecord( "asdm" ) ;73 casacore::Record asdmrec = rec.asRecord( "asdm" ) ; 74 74 75 75 // antenna 76 76 if ( asdmrec.isDefined( "antenna" ) ) { 77 if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casa ::TpInt ) {77 if ( asdmrec.type( asdmrec.fieldNumber( "antenna" ) ) == casacore::TpInt ) { 78 78 antennaId_ = asdmrec.asInt( "antenna" ) ; 79 79 } … … 182 182 vector<AntennaRow *> rows = atab.get() ; 183 183 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_ ) { 186 186 idx = rows[irow]->getAntennaId().getTagValue() ; 187 187 break ; … … 190 190 if ( idx == -1 ) { 191 191 close() ; 192 throw (casa ::AipsError( antennaName_ + " not found." )) ;192 throw (casacore::AipsError( antennaName_ + " not found." )) ; 193 193 } 194 194 else { … … 203 203 if ( antennaRow == 0 ) { 204 204 close() ; 205 throw (casa ::AipsError( "AntennaId " + casa::String::toString(antennaId_) + " is invalid." ) ) ;205 throw (casacore::AipsError( "AntennaId " + casacore::String::toString(antennaId_) + " is invalid." ) ) ; 206 206 } 207 207 } … … 210 210 // set antenna name 211 211 if ( antennaName_.size() == 0 ) { 212 antennaName_ = casa ::String( antennaRow->getName() ) ;212 antennaName_ = casacore::String( antennaRow->getName() ) ; 213 213 } 214 214 … … 217 217 218 218 // station name 219 stationName_ = casa ::String( stationRow->getName() ) ;219 stationName_ = casacore::String( stationRow->getName() ) ; 220 220 221 221 // antenna position 222 222 antennaPosition_.resize( 3 ) ; 223 223 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" ) ) ; 226 226 227 227 // create SDMBinData object … … 229 229 230 230 // get Main rows 231 //mainRow_ = casa ::Vector<MainRow *>(asdm_->getMain().get()) ;231 //mainRow_ = casacore::Vector<MainRow *>(asdm_->getMain().get()) ; 232 232 233 233 // set up IFNO … … 262 262 } 263 263 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" ;264 void 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" ; 283 283 284 284 ExecBlockTable &ebtab = asdm_->getExecBlock() ; 285 285 // at the moment take first row of ExecBlock table 286 286 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() ) ; 289 289 290 290 // antennaname … … 295 295 // antennaposition 296 296 antennaposition.resize( 3 ) ; 297 for ( casa ::uInt i = 0 ; i < 3 ; i++ )297 for ( casacore::uInt i = 0 ; i < 3 ; i++ ) 298 298 antennaposition[i] = antennaPosition_[i].getValue( Unit("m") ) ; 299 299 … … 307 307 // utc 308 308 // start time of the project 309 utc = casa ::Double( ebrow->getStartTime().getMJD() ) ;309 utc = casacore::Double( ebrow->getStartTime().getMJD() ) ; 310 310 311 311 … … 326 326 refidx = irow ; 327 327 } 328 nchan = casa ::Int( *max_element( nchans.begin(), nchans.end() ) ) ;328 nchan = casacore::Int( *max_element( nchans.begin(), nchans.end() ) ) ; 329 329 330 330 //logsink_->postLocally( LogMessage("refidx = "+String::toString(refidx),LogOrigin(className_,funcName,WHERE)) ) ; … … 337 337 } 338 338 } 339 bandwidth = casa ::Double( *max_element( bws.begin(), bws.end() ) ) ;339 bandwidth = casacore::Double( *max_element( bws.begin(), bws.end() ) ) ; 340 340 341 341 // reffreq 342 reffreq = casa ::Double( spwrows[refidx]->getRefFreq().get() ) ;342 reffreq = casacore::Double( spwrows[refidx]->getRefFreq().get() ) ; 343 343 344 344 // freqref … … 382 382 383 383 // npol 384 npol = casa ::Int( *max_element( npols.begin(), npols.end() ) ) ;384 npol = casacore::Int( *max_element( npols.begin(), npols.end() ) ) ; 385 385 386 386 // poltype … … 421 421 422 422 // nbeam 423 nbeam = casa ::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ;423 nbeam = casacore::Int( *max_element( nbeams.begin(), nbeams.end() ) ) ; 424 424 425 425 // fluxunit … … 441 441 obstype = "" ; 442 442 for ( unsigned int imode = 0 ; imode < obsmode.size() ; imode++ ) { 443 obstype += casa ::String(obsmode[imode]) ;443 obstype += casacore::String(obsmode[imode]) ; 444 444 if ( imode != obsmode.size()-1 ) 445 445 obstype += "#" ; … … 449 449 void OldASDMReader::selectConfigDescription() 450 450 { 451 casa ::String funcName = "selectConfigDescription" ;451 casacore::String funcName = "selectConfigDescription" ; 452 452 453 453 vector<ConfigDescriptionRow *> cdrows = asdm_->getConfigDescription().get() ; … … 462 462 configDescIdList_.resize( cdidTags.size() ) ; 463 463 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() ) ; 465 465 } 466 466 } … … 472 472 Tag atag( antennaId_, TagType::Antenna ) ; 473 473 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 ) ) 476 476 continue ; 477 477 if ( frows[irow]->getAntennaId() == atag ) { … … 483 483 } 484 484 485 casa ::Vector<casa::uInt> OldASDMReader::getFieldIdList()486 { 487 casa ::String funcName = "getFieldIdList" ;485 casacore::Vector<casacore::uInt> OldASDMReader::getFieldIdList() 486 { 487 casacore::String funcName = "getFieldIdList" ; 488 488 489 489 vector<FieldRow *> frows = asdm_->getField().get() ; … … 497 497 } 498 498 499 casa ::uInt OldASDMReader::getNumMainRow()500 { 501 casa ::uInt nrow = casa::uInt( mainRow_.size() ) ;499 casacore::uInt OldASDMReader::getNumMainRow() 500 { 501 casacore::uInt nrow = casacore::uInt( mainRow_.size() ) ; 502 502 503 503 return nrow ; … … 530 530 } 531 531 532 casa ::Bool OldASDMReader::setMainRow( casa::uInt irow )533 { 534 casa ::Bool status = true ;532 casacore::Bool OldASDMReader::setMainRow( casacore::uInt irow ) 533 { 534 casacore::Bool status = true ; 535 535 row_ = irow ; 536 536 execBlockTag_ = mainRow_[row_]->getExecBlockId() ; … … 540 540 status = false ; 541 541 else { 542 status = (casa ::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ;542 status = (casacore::Bool)(sdmBin_->acceptMainRow( mainRow_[row_] )) ; 543 543 } 544 544 return status ; 545 545 } 546 546 547 casa ::Bool OldASDMReader::setMainRow( casa::uInt configDescId, casa::uInt fieldId )547 casacore::Bool OldASDMReader::setMainRow( casacore::uInt configDescId, casacore::uInt fieldId ) 548 548 { 549 549 clearMainRow() ; … … 551 551 Tag configDescTag( (unsigned int)configDescId, TagType::ConfigDescription ) ; 552 552 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 ) ) ) ; 554 554 555 555 return true ; … … 563 563 void OldASDMReader::setupIFNO() 564 564 { 565 casa ::String funcName = "setupIFNO" ;565 casacore::String funcName = "setupIFNO" ; 566 566 567 567 vector<SpectralWindowRow *> spwrows = asdm_->getSpectralWindow().get() ; 568 568 unsigned int nrow = spwrows.size() ; 569 569 ifno_.clear() ; 570 casa ::uInt idx = 0 ;571 casa ::uInt wvridx = 0 ;570 casacore::uInt idx = 0 ; 571 casacore::uInt wvridx = 0 ; 572 572 for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) { 573 casa ::uInt index ;573 casacore::uInt index ; 574 574 if ( isWVR( spwrows[irow] ) ) { 575 575 //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+" is WVR",LogOrigin(className_,funcName,WHERE)) ) ; … … 579 579 index = ++idx ; 580 580 } 581 ifno_.insert( pair<Tag,casa ::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ;581 ifno_.insert( pair<Tag,casacore::uInt>(spwrows[irow]->getSpectralWindowId(),index) ) ; 582 582 //logsink_->postLocally( LogMessage(spwrows[irow]->getSpectralWindowId().toString()+": IFNO="+String::toString(index),LogOrigin(className_,funcName,WHERE)) ) ; 583 583 } … … 594 594 } 595 595 596 casa ::Bool OldASDMReader::setData()597 { 598 casa ::String funcName = "setData" ;596 casacore::Bool OldASDMReader::setData() 597 { 598 casacore::String funcName = "setData" ; 599 599 600 600 //logsink_->postLocally( LogMessage("try to retrieve binary data",LogOrigin(className_,funcName,WHERE)) ) ; … … 671 671 } 672 672 673 casa ::uInt OldASDMReader::getIFNo( unsigned int idx )673 casacore::uInt OldASDMReader::getIFNo( unsigned int idx ) 674 674 { 675 675 prepareData( idx ) ; … … 677 677 } 678 678 679 casa ::uInt OldASDMReader::getIFNo()680 { 681 map<Tag,casa ::uInt>::iterator iter = ifno_.find( specWinTag_ ) ;679 casacore::uInt OldASDMReader::getIFNo() 680 { 681 map<Tag,casacore::uInt>::iterator iter = ifno_.find( specWinTag_ ) ; 682 682 if ( iter != ifno_.end() ) 683 683 return iter->second ; … … 713 713 string &freqref ) 714 714 { 715 casa ::String funcName = "getFrequency" ;715 casacore::String funcName = "getFrequency" ; 716 716 717 717 int nchan = specWinRow_p->getNumChan() ; … … 730 730 } 731 731 else { 732 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;732 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ; 733 733 } 734 734 } … … 745 745 } 746 746 else { 747 throw (casa ::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;747 throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ; 748 748 } 749 749 if ( specWinRow_p->isChanFreqStepExists() ) { … … 757 757 } 758 758 else { 759 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;759 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ; 760 760 } 761 761 if ( specWinRow_p->isChanFreqStartExists() ) { … … 766 766 } 767 767 else { 768 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;768 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ; 769 769 } 770 770 } … … 781 781 } 782 782 else { 783 throw (casa ::AipsError( "Either chanWidthArray or chanWidth must exist." )) ;783 throw (casacore::AipsError( "Either chanWidthArray or chanWidth must exist." )) ; 784 784 } 785 785 if ( specWinRow_p->isChanFreqStepExists() ) { … … 793 793 } 794 794 else { 795 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ;795 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStep must exist." )) ; 796 796 } 797 797 if ( specWinRow_p->isChanFreqStartExists() ) { … … 803 803 } 804 804 else { 805 throw (casa ::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ;805 throw (casacore::AipsError( "Either chanFreqArray or chanFreqStart must exist." )) ; 806 806 } 807 807 } … … 1237 1237 for ( unsigned int irow = 0 ; irow < nrow ; irow++ ) { 1238 1238 CalAtmosphereRow *atmrow = atmrows[irow] ; 1239 if ( casa ::String(atmrow->getAntennaName()) != antennaName_1239 if ( casacore::String(atmrow->getAntennaName()) != antennaName_ 1240 1240 //|| atmrow->getReceiverBand() != rb 1241 1241 //|| atmrow->getBasebandName() != bbname … … 1279 1279 float &windaz ) 1280 1280 { 1281 casa ::String funcName = "getWeatherInfo" ;1281 casacore::String funcName = "getWeatherInfo" ; 1282 1282 1283 1283 temperature = 0.0 ; … … 1668 1668 double &el, 1669 1669 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 ) 1672 1672 { 1673 1673 String funcName = "toJ2000" ; … … 1681 1681 1682 1682 vector<double> OldASDMReader::toJ2000( vector<double> &dir, 1683 casa ::String &dirref,1683 casacore::String &dirref, 1684 1684 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" ; 1689 1689 1690 1690 vector<double> newd( dir ) ; 1691 1691 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 ) ; 1695 1695 //ostringstream oss ; 1696 1696 //mp.print( oss ) ; 1697 1697 //logsink_->postLocally( LogMessage(oss.str(),LogOrigin(className_,funcName,WHERE)) ) ; 1698 1698 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 ) ; 1702 1702 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() ; 1706 1706 //logsink_->postLocally( LogMessage("cdir = "+String::toString(cdir),LogOrigin(className_,funcName,WHERE)) ) ; 1707 1707 newd[0] = (double)(cdir[0]) ; … … 1719 1719 string OldASDMReader::getFrame() 1720 1720 { 1721 casa ::String funcName = "getFrame" ;1721 casacore::String funcName = "getFrame" ; 1722 1722 1723 1723 // default is TOPO … … 1748 1748 int OldASDMReader::getNumIFs() 1749 1749 { 1750 casa ::String funcName = "getNumIFs" ;1750 casacore::String funcName = "getNumIFs" ; 1751 1751 1752 1752 int nif = 0 ; -
trunk/external-alma/oldasdm2ASAP/OldASDMReader.h
r2301 r3106 31 31 * @return boolean status (true or false) 32 32 **/ 33 bool open( const std::string &filename, const casa ::Record &rec ) ;33 bool open( const std::string &filename, const casacore::Record &rec ) ; 34 34 35 35 /** … … 46 46 * get antenna id 47 47 **/ 48 casa ::Int getAntennaId() { return antennaId_ ; } ;48 casacore::Int getAntennaId() { return antennaId_ ; } ; 49 49 50 50 /** 51 51 * get antenna name 52 52 **/ 53 casa ::String getAntennaName() { return antennaName_ ; } ;53 casacore::String getAntennaName() { return antennaName_ ; } ; 54 54 55 55 /** … … 74 74 * @param poltype polarization type 75 75 **/ 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 ) ; 93 93 94 94 /** … … 100 100 * @return list of valid configDescriptionId 101 101 **/ 102 casa ::Vector<casa::uInt> getConfigDescriptionIdList() { return configDescIdList_ ; } ;102 casacore::Vector<casacore::uInt> getConfigDescriptionIdList() { return configDescIdList_ ; } ; 103 103 104 104 /** 105 105 * get list of fieldId 106 106 * 107 * @return list of fieldId as casa ::uInt108 **/ 109 casa ::Vector<casa::uInt> getFieldIdList() ;107 * @return list of fieldId as casacore::uInt 108 **/ 109 casacore::Vector<casacore::uInt> getFieldIdList() ; 110 110 111 111 /** … … 114 114 * @return number of rows in Main table 115 115 **/ 116 casa ::uInt getNumMainRow() ;116 casacore::uInt getNumMainRow() ; 117 117 118 118 /** … … 128 128 * @param fieldId 129 129 **/ 130 casa ::Bool setMainRow( casa::uInt configDescId, casa::uInt fieldId ) ;130 casacore::Bool setMainRow( casacore::uInt configDescId, casacore::uInt fieldId ) ; 131 131 132 132 /** … … 136 136 * @return boolean indicating the row is valid or not 137 137 **/ 138 casa ::Bool setMainRow( casa::uInt irow ) ;138 casacore::Bool setMainRow( casacore::uInt irow ) ; 139 139 140 140 /** … … 174 174 * @return IF number 175 175 **/ 176 casa ::uInt getIFNo( unsigned int idx ) ;177 casa ::uInt getIFNo() ;176 casacore::uInt getIFNo( unsigned int idx ) ; 177 casacore::uInt getIFNo() ; 178 178 179 179 /** … … 380 380 * @return boolean status 381 381 **/ 382 casa ::Bool setData() ;382 casacore::Bool setData() ; 383 383 384 384 /** … … 401 401 * @param logger (LogSinkInterface) 402 402 **/ 403 void setLogger( casa ::CountedPtr<casa::LogSinkInterface> &logsink ) ;403 void setLogger( casacore::CountedPtr<casacore::LogSinkInterface> &logsink ) ; 404 404 405 405 … … 490 490 double &el, 491 491 double &mjd, 492 casa ::Vector<casa::Quantity> &antpos ) ;492 casacore::Vector<casacore::Quantity> &antpos ) ; 493 493 494 494 /** … … 502 502 **/ 503 503 std::vector<double> toJ2000( std::vector<double> &dir, 504 casa ::String &dirref,504 casacore::String &dirref, 505 505 double &mjd, 506 casa ::Vector<casa::Quantity> &antpos ) ;506 casacore::Vector<casacore::Quantity> &antpos ) ; 507 507 /** 508 508 * get nIF … … 569 569 const sdmbin::VMSData *vmsData_ ; 570 570 571 casa ::Int antennaId_ ; // antenna id572 casa ::String antennaName_ ; // antenna name573 casa ::String stationName_ ; // station name574 casa ::Vector<casa::Quantity> antennaPosition_ ; // antenna position575 casa ::Vector<casa::uInt> configDescIdList_ ; // list of valid configDescriptionId576 casa ::Vector<casa::uInt> feedIdList_ ; // list of valid feedId577 casa ::Vector<casa::uInt> fieldIdList_ ; // list of fieldId578 casa ::Int row_ ; // current row index579 map<asdm::Tag,casa ::uInt> ifno_ ; // list of IFNO for each SpectralWindow rows571 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 580 580 unsigned int numData_ ; // number of valid data in vmsData_ where v_antennaId equals antennaId_ 581 581 vector<unsigned int> dataIdList_ ; // list of valid data indexes in vmsData_ … … 587 587 EnumSet<TimeSamplingMod::TimeSampling> timeSampling_ ; // time sampling 588 588 EnumSet<SpectralResolutionTypeMod::SpectralResolutionType> resolutionType_ ; // spectral resolution type 589 casa ::CountedPtr<casa::LogSinkInterface> logsink_ ; // Logger590 casa ::String className_ ;589 casacore::CountedPtr<casacore::LogSinkInterface> logsink_ ; // Logger 590 casacore::String className_ ; 591 591 unsigned int dataIndex_ ; 592 592 593 593 // Tables/Rows for ASDM 594 casa ::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows594 casacore::Vector<asdm::MainRow *> mainRow_ ; // list of pointers to all Main rows 595 595 //asdm::AntennaRow *antennaRow_p ; // pointer to target Antenna row 596 596 //asdm::StationRow *stationRow_p ; // pointer to target Station row that target antenna is located
Note:
See TracChangeset
for help on using the changeset viewer.