Changeset 490
- Timestamp:
- 02/21/05 13:56:17 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMemTable.cc
r488 r490 370 370 } 371 371 372 373 int SDMemTable::stokesLength() const 374 { 375 return stokesCol_.shape(0).nelements(); // All rows same shape 376 } 377 378 372 379 std::vector<float> SDMemTable::getStokesSpectrum(Int whichRow, Bool doPol, 373 380 Float paOffset) const … … 421 428 } 422 429 430 std::string SDMemTable::getStokesSpectrumLabel (Bool doPol) const 431 // 432 // Gets STokes label depending on cursor polSel location 433 // doPol=False : I,Q,U,V 434 // doPol=True : I,P,PA,V ; P = sqrt(Q**2+U**2), PA = 0.5*atan2(Q,U) 435 // 436 { 437 AlwaysAssert(asap::nAxes==4,AipsError); 438 if (nPol()!=1 && nPol()!=2 && nPol()!=4) { 439 throw (AipsError("You must have 1,2 or 4 polarizations to get the Stokes parameters")); 440 } 441 // 442 Stokes::StokesTypes type = Stokes::Undefined; 443 switch (polSel_) { 444 case 0: 445 { 446 type = Stokes::I; 447 } 448 break; 449 case 1: 450 { 451 if (doPol) { 452 type = Stokes::Plinear; 453 } else { 454 type = Stokes::Q; 455 } 456 } 457 case 2: 458 { 459 if (doPol) { 460 type = Stokes::Pangle; 461 } else { 462 type = Stokes::U; 463 } 464 } 465 break; 466 case 3: 467 { 468 type = Stokes::V; 469 } 470 break; 471 default: 472 { 473 throw(AipsError("Unknown Stokes type")); 474 } 475 } 476 // 477 return SDPolUtil::stokesString(type); 478 } 479 480 481 423 482 std::vector<float> SDMemTable::getCircularSpectrum(Int whichRow, 424 483 Bool doRR) const … … 458 517 return stlout; 459 518 } 519 520 521 std::string SDMemTable::getCircularSpectrumLabel (Bool doRR) const 522 // 523 // Gets Circular label 524 // 525 { 526 Stokes::StokesTypes type = Stokes::Undefined; 527 if (doRR) { 528 type = Stokes::RR; 529 } else { 530 type = Stokes::LL; 531 } 532 // 533 return SDPolUtil::stokesString(type); 534 } 535 536 537 538 539 460 540 461 541 Array<Float> SDMemTable::getStokesSpectrum(Int whichRow, Int iBeam, Int iIF) const -
trunk/src/SDMemTable.h
r488 r490 103 103 // getCircularSpectrum is 'getCircular' 104 104 105 // Get length of STokes spectrum. XX & YY -> I 106 // Anything else the length stays the same. 107 int stokesLength() const; 108 105 109 // Get specific Stokes at cursor location. One of either I,Q,U,V or I,P,PA,V (doPol=True) 106 110 // (determined by the polSel cursor location 0->3) … … 110 114 casa::Float paOffset=0.0) const; 111 115 116 // Returns String for selected Stokes (polSel_) 117 std::string getStokesSpectrumLabel (casa::Bool doPol) const; 118 112 119 // Get RR or LL at cursor location (except not polSel_) 113 120 virtual std::vector<float> getCircularSpectrum(casa::Int whichRow=0, 114 121 casa::Bool rr=casa::True) const; 122 123 // Get circular label 124 std::string getCircularSpectrumLabel (casa::Bool rr=casa::True) const; 115 125 116 126 // Get all Stokes at the specified Beam/IF cursor location (ignoring
Note:
See TracChangeset
for help on using the changeset viewer.