Changeset 911 for trunk


Ignore:
Timestamp:
03/21/06 13:56:43 (19 years ago)
Author:
mar637
Message:

added linpol rotation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STPolLinear.cpp

    r904 r911  
    120120}
    121121
     122void asap::STPolLinear::rotateLinPolPhase( casa::Float phase )
     123{
     124//
     125// Rotate P = Q + iU but do it directly on the  linear
     126// correlations.
     127//
     128// We are using I=(XX+YY)/2 convention
     129// C1 = XX; C2 = YY, C3 = Real(XY)
     130//
     131  Vector<Float> I,Q,U;
     132  I = getStokes(0);
     133  Q = getStokes(1);
     134  U = getStokes(2);
     135  // Rotate Q & U (factor of 2 for polarization)
     136  Float cosVal = cos(C::pi/180.0*2.0*phase);
     137  Float sinVal = sin(C::pi/180.0*2.0*phase);
     138  Vector<Float> Q2 = Q*cosVal - U*sinVal;
     139  U =  Q*sinVal + U*cosVal;
     140  Q = Q2;
     141  Matrix<Float>& specs = getSpectra();
     142  specs.column(0) = I+Q;
     143  specs.column(1) = I-Q;
     144  specs.column(2) = U;
     145
    122146}
     147
     148}
Note: See TracChangeset for help on using the changeset viewer.