Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDPol.cc
r427 r429 176 176 // array of shape (nBeam,nIF,nPol,nChan) 177 177 // 178 // We use the scaling convention I=(XX+YY) 179 // 178 180 { 179 181 … … 209 211 // 210 212 if (nPol==1) { 211 I = C1;213 I = Float(2.0)*C1; 212 214 return; 213 215 } … … 217 219 Array<Float> C2 = input2(start,end); // Input : C1 218 220 // 219 I = Float(0.5)*(C1 + C2);221 I = C1 + C2; 220 222 if (nPol <= 2) return; 221 223 // … … 231 233 end(polAxis) = 1; 232 234 Array<Float> Q = output(start,end); // Output : Q 233 Q = Float(0.5)*(C1 - C2);235 Q = C1 - C2; 234 236 // 235 237 start(polAxis) = 2; 236 238 end(polAxis) = 2; 237 239 Array<Float> U = output(start,end); // Output : U 238 U = C3;240 U = Float(2.0)*C3; 239 241 // 240 242 start(polAxis) = 3; 241 243 end(polAxis) = 3; 242 244 Array<Float> V = output(start,end); // Output : V 243 V = C4;245 V = Float(2.0)*C4; 244 246 } 245 247 … … 311 313 312 314 315 316 Array<Float> SDPolUtil::getStokesSlice (Array<Float>& in, const IPosition& start, 317 const IPosition& end, const String& stokes) 318 { 319 IPosition s(start); 320 IPosition e(end); 321 // 322 if (stokes=="I") { 323 s(asap::PolAxis) = 0; 324 e(asap::PolAxis) = 0; 325 } else if (stokes=="Q") { 326 s(asap::PolAxis) = 1; 327 e(asap::PolAxis) = 1; 328 } else if (stokes=="U") { 329 s(asap::PolAxis) = 2; 330 e(asap::PolAxis) = 2; 331 } else if (stokes=="V") { 332 s(asap::PolAxis) = 3; 333 e(asap::PolAxis) = 3; 334 } 335 // 336 return in(s,e); 337 } 313 338 339 340 Array<Float> SDPolUtil::circularPolarizationFromStokes (Array<Float>& I, 341 Array<Float>& V, 342 Bool doRR) 343 { 344 if (doRR) { 345 return Float(0.5)*(I+V); 346 } else { 347 return Float(0.5)*(I-V); 348 } 349 } 350 -
trunk/src/SDPol.h
r427 r429 53 53 casa::Array<casa::Float>& C4, 54 54 casa::Float phase); 55 56 // Get Stokes slices from the Array. Start and End should 57 // already be setup to access the Array at the current cursor location 58 // (beam, IF, chanells; see SDMemTable). This function will modify the asap::PolAxis 59 // location to access the desired Stokes slice ("I", "Q", "U", "V") 60 static casa::Array<casa::Float> getStokesSlice (casa::Array<casa::Float>& input, const casa::IPosition& start, 61 const casa::IPosition& end, const casa::String& stokes); 62 63 // Compute Circular polarization RR or LL from I and V 64 static casa::Array<casa::Float> circularPolarizationFromStokes (casa::Array<casa::Float>& I, 65 casa::Array<casa::Float>& V, 66 casa::Bool doRR); 55 67 }; 56 68
Note:
See TracChangeset
for help on using the changeset viewer.