Changeset 500
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDPol.cc
r498 r500 271 271 const Array<Float>& U) 272 272 { 273 return Float(180.0/C::pi/2.0)*atan2(Q,U); // Degrees 274 } 275 276 277 void SDPolUtil::rotateXYPhase (Array<Float>& C3, 278 Array<Float>& C4, 279 Float phase) 273 return Float(180.0/C::pi/2.0)*atan2(U,Q); // Degrees 274 } 275 276 277 void SDPolUtil::rotatePhase (Array<Float>& R, 278 Array<Float>& I, 279 Float phase) 280 // 281 // Apply phase rotation to Z = (R + iI) 282 // 280 283 { 281 284 Float cosVal = cos(C::pi/180.0*phase); 282 285 Float sinVal = sin(C::pi/180.0*phase); 283 286 // 284 C3 = C3*cosVal - C4*sinVal; 285 C4 = C3*sinVal + C4*cosVal; 286 } 287 Array<Float> R2 = R*cosVal - I*sinVal; 288 I = R*sinVal + I*cosVal; 289 R = R2; 290 } 291 292 293 void SDPolUtil::rotateLinPolPhase (Array<Float>& C1, 294 Array<Float>& C2, 295 Array<Float>& C3, 296 Array<Float>& I, 297 Array<Float>& Q, 298 Array<Float>& U, 299 Float phase) 300 // 301 // Rotate P = Q + iU but do it directly on the linear 302 // correlations. 303 // 304 // We are using I=(XX+YY)/2 convention 305 // C1 = XX; C2 = YY, C3 = Real(XY) 306 // 307 { 308 // Rotate Q & U (factor of 2 for polarization) 309 310 rotatePhase(Q, U, 2.0*phase); 311 312 // Now recompute C1,C2,C3 313 // C4 unchanged 314 315 C1 = I + Q; 316 C2 = I - Q; 317 C3 = U; 318 } 319 320 287 321 288 322 -
trunk/src/SDPol.h
r492 r500 155 155 const casa::Array<casa::Float>& U); 156 156 157 // Rotate phase of Complex correlation C3+iC4 by phase (degrees) 158 static void rotateXYPhase (casa::Array<casa::Float>& C3, 159 casa::Array<casa::Float>& C4, 160 casa::Float phase); 157 // Rotate phase of Complex correlation R+iI by phase (degrees) 158 static void rotatePhase (casa::Array<casa::Float>& R, 159 casa::Array<casa::Float>& I, 160 casa::Float phase); 161 162 // Rotate phase of P=(Q+iU) by phase (degrees), but do this by applying 163 // the corrections to the raw linear polarizations 164 static void rotateLinPolPhase (casa::Array<casa::Float>& C1, 165 casa::Array<casa::Float>& C2, 166 casa::Array<casa::Float>& C3, 167 casa::Array<casa::Float>& I, 168 casa::Array<casa::Float>& Q, 169 casa::Array<casa::Float>& U, 170 casa::Float phase); 161 171 162 172 // Get Stokes slices from the Array. Start and End should
Note:
See TracChangeset
for help on using the changeset viewer.