Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDPol.cc
r469 r492 328 328 if (toStokes) { 329 329 if (val==0) { 330 stokes = Stokes::I;330 stokes = Stokes::I; 331 331 } else if (val==1) { 332 332 stokes = Stokes::Q; … … 361 361 } 362 362 363 364 365 String SDPolUtil::polarizationLabel (uInt polIdx, Bool linear, Bool stokes, Bool linPol) 366 { 367 Stokes::StokesTypes type = Stokes::Undefined; 368 if (stokes) { 369 switch (polIdx) { 370 case 0: 371 { 372 type = Stokes::I; 373 } 374 break; 375 case 1: 376 { 377 if (linPol) { 378 type = Stokes::Plinear; 379 } else { 380 type = Stokes::Q; 381 } 382 } 383 break; 384 case 2: 385 { 386 if (linPol) { 387 type = Stokes::Pangle; 388 } else { 389 type = Stokes::U; 390 } 391 } 392 break; 393 case 3: 394 { 395 type = Stokes::V; 396 } 397 break; 398 default: 399 { 400 throw(AipsError("Unknown Stokes type")); 401 } 402 } 403 } else { 404 if (linear) { 405 switch (polIdx) { 406 case 0: 407 { 408 type = Stokes::XX; 409 } 410 break; 411 case 1: 412 { 413 type = Stokes::YY; 414 } 415 break; 416 case 2: 417 { 418 type = Stokes::XY; // Really Real(XY) 419 return String("Real(XY)"); 420 } 421 break; 422 case 3: 423 { 424 type = Stokes::YX; // Really Imag(XY) 425 return String("Imag(XY)"); 426 } 427 break; 428 default: 429 { 430 throw(AipsError("Unknown linear polarization type")); 431 } 432 } 433 } else { 434 switch (polIdx) { 435 case 0: 436 { 437 type = Stokes::RR; 438 } 439 break; 440 case 1: 441 { 442 type = Stokes::LL; 443 } 444 case 2: 445 { 446 type = Stokes::RL; // Really Real(RL) 447 return String("Real(RL)"); 448 } 449 break; 450 case 3: 451 { 452 type = Stokes::LR; // Really Imag(RL) 453 return String("Imag(RL)"); 454 } 455 break; 456 default: 457 { 458 throw(AipsError("Unknown circular polarization type")); 459 } 460 } 461 } 462 } 463 // 464 return SDPolUtil::stokesString(type); 465 } 466 467 468 469 470 // private 471 472 String SDPolUtil::stokesString (Stokes::StokesTypes type) 473 { 474 return Stokes::name (type); 475 } 476 477 363 478 Array<casa::uChar> SDPolUtil::andArrays (const Array<casa::uChar>& in1, 364 479 const Array<casa::uChar>& in2) … … 404 519 } 405 520 521 522 523 524 -
trunk/src/SDPol.h
r469 r492 194 194 static casa::Stokes::StokesTypes convertStokes(casa::Int val, casa::Bool toStokes, 195 195 casa::Bool linear); 196 197 // Return a label for the given polarization index (0-3). 198 static casa::String polarizationLabel (casa::uInt polIdx, casa::Bool linear, 199 casa::Bool stokes, casa::Bool linPol); 196 200 197 201 … … 220 224 221 225 private: 226 // Return a label for the given StokesType 227 static casa::String stokesString (casa::Stokes::StokesTypes stokes); 228 229 // specializations 222 230 static casa::Array<casa::Float> andArrays (const casa::Array<casa::Float>& in1, 223 231 const casa::Array<casa::Float>& in2) 224 232 {return (in1+in2)/casa::Float(2.0);} 225 226 233 static casa::Array<casa::Bool> andArrays (const casa::Array<casa::Bool>& in1, 227 234 const casa::Array<casa::Bool>& in2)
Note:
See TracChangeset
for help on using the changeset viewer.