Changeset 490 for trunk/src/SDMemTable.cc
- Timestamp:
- 02/21/05 13:56:17 (19 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.