Changeset 799 for branches/Release12


Ignore:
Timestamp:
12/23/05 09:52:30 (18 years ago)
Author:
phi196
Message:

Bug in swappol, minor indentation reformat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release12/src/SDMath.cc

    r798 r799  
    13941394  }
    13951395
    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);
    14071400
    14081401// Set cursor slice. Assumes shape the same for all rows
    14091402
    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  }
    14321424}
    14331425
     
    14411433      throw(AipsError("You must have 2 or 4 polarizations to run this function"));
    14421434   }
    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
    14511436   const Table& tabIn = in.table();
    14521437   ArrayColumn<Float> specCol(tabIn,"SPECTRA");
     
    14581443
    14591444   setCursorSlice (start, end, doAll, in);
    1460 //
     1445
    14611446   IPosition start1(start);
    14621447   start1(asap::PolAxis) = 0;                // C1 (XX)
    14631448   IPosition end1(end);
    14641449   end1(asap::PolAxis) = 0;
    1465 //
     1450
    14661451   IPosition start2(start);
    14671452   start2(asap::PolAxis) = 1;                 // C2 (YY)
    14681453   IPosition end2(end);
    14691454   end2(asap::PolAxis) = 1;
    1470 //
     1455
    14711456   uInt nRow = in.nRow();
    14721457   Array<Float> data, stokes;
     
    14821467
    14831468// Swap
    1484 
    14851469      Array<Float> tmp;
    14861470      tmp = C1;
    14871471      C1 = C2;
    1488       C2 = C1;
    1489 
    1490 // Put
     1472      C2 = tmp;
    14911473
    14921474      specCol.put(i,data);
Note: See TracChangeset for help on using the changeset viewer.