Changeset 799
- Timestamp:
- 12/23/05 09:52:30 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Release12/src/SDMath.cc
r798 r799 1394 1394 } 1395 1395 1396 //SDHeader sh = in.getSDHeader(); 1397 //Instrument inst = SDAttr::convertInstrument(sh.antennaname, False); 1398 // SDAttr sdAtt; 1399 // if (sdAtt.feedPolType(inst) != LINEAR) { 1400 // throw(AipsError("Only linear polarizations are supported")); 1401 //} 1402 // 1403 const Table& tabIn = in.table(); 1404 ArrayColumn<Float> specCol(tabIn,"SPECTRA"); 1405 IPosition start(asap::nAxes,0); 1406 IPosition end(asap::nAxes); 1396 const Table& tabIn = in.table(); 1397 ArrayColumn<Float> specCol(tabIn,"SPECTRA"); 1398 IPosition start(asap::nAxes,0); 1399 IPosition end(asap::nAxes); 1407 1400 1408 1401 // Set cursor slice. Assumes shape the same for all rows 1409 1402 1410 setCursorSlice (start, end, doAll, in); 1411 1412 IPosition start4(start); 1413 start4(asap::PolAxis) = 3; // Imag (XY) 1414 IPosition end4(end); 1415 end4(asap::PolAxis) = 3; 1416 // 1417 uInt nRow = in.nRow(); 1418 Array<Float> data; 1419 for (uInt i=0; i<nRow;++i) { 1420 specCol.get(i,data); 1421 IPosition shape = data.shape(); 1422 1423 // Get polarization slice references 1424 Array<Float> C4 = data(start4,end4); 1425 1426 // Invert 1427 C4 *= -1.0f; 1428 1429 // Put 1430 specCol.put(i,data); 1431 } 1403 setCursorSlice (start, end, doAll, in); 1404 1405 IPosition start4(start); 1406 start4(asap::PolAxis) = 3; // Imag (XY) 1407 IPosition end4(end); 1408 end4(asap::PolAxis) = 3; 1409 1410 uInt nRow = in.nRow(); 1411 Array<Float> data; 1412 for (uInt i=0; i<nRow;++i) { 1413 specCol.get(i,data); 1414 IPosition shape = data.shape(); 1415 1416 // Get polarization slice references 1417 Array<Float> C4 = data(start4,end4); 1418 1419 // Invert 1420 C4 *= Float(-1.0); 1421 1422 specCol.put(i,data); 1423 } 1432 1424 } 1433 1425 … … 1441 1433 throw(AipsError("You must have 2 or 4 polarizations to run this function")); 1442 1434 } 1443 // 1444 // SDHeader sh = in.getSDHeader(); 1445 // Instrument inst = SDAttr::convertInstrument(sh.antennaname, False); 1446 // SDAttr sdAtt; 1447 // if (sdAtt.feedPolType(inst) != LINEAR) { 1448 // throw(AipsError("Only linear polarizations are supported")); 1449 // } 1450 // 1435 1451 1436 const Table& tabIn = in.table(); 1452 1437 ArrayColumn<Float> specCol(tabIn,"SPECTRA"); … … 1458 1443 1459 1444 setCursorSlice (start, end, doAll, in); 1460 // 1445 1461 1446 IPosition start1(start); 1462 1447 start1(asap::PolAxis) = 0; // C1 (XX) 1463 1448 IPosition end1(end); 1464 1449 end1(asap::PolAxis) = 0; 1465 // 1450 1466 1451 IPosition start2(start); 1467 1452 start2(asap::PolAxis) = 1; // C2 (YY) 1468 1453 IPosition end2(end); 1469 1454 end2(asap::PolAxis) = 1; 1470 // 1455 1471 1456 uInt nRow = in.nRow(); 1472 1457 Array<Float> data, stokes; … … 1482 1467 1483 1468 // Swap 1484 1485 1469 Array<Float> tmp; 1486 1470 tmp = C1; 1487 1471 C1 = C2; 1488 C2 = C1; 1489 1490 // Put 1472 C2 = tmp; 1491 1473 1492 1474 specCol.put(i,data);
Note:
See TracChangeset
for help on using the changeset viewer.