Changeset 459 for trunk/src/SDPol.cc
- Timestamp:
- 02/17/05 01:43:54 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDPol.cc
r446 r459 57 57 const String& inputColumnName) 58 58 : BaseMappedArrayEngine<Float,Float> (outputColumnName, inputColumnName) 59 {} 59 { 60 setWritable(False); 61 } 60 62 61 63 … … 63 65 : BaseMappedArrayEngine<Float,Float> () 64 66 { 67 setWritable(False); 65 68 if (spec.isDefined("OUTPUTNAME") && spec.isDefined("INPUTNAME")) { 66 69 setNames (spec.asString("OUTPUTNAME"), spec.asString("INPUTNAME")); … … 95 98 String SDStokesEngine::dataManagerName() const 96 99 { 97 return sourceName();100 return virtualName(); 98 101 } 99 102 … … 101 104 { 102 105 Record spec; 103 spec.define ("OUTPUTNAME", sourceName()); // Ger uses opposite meaning for source/target104 spec.define ("INPUTNAME", targetName());106 spec.define ("OUTPUTNAME", virtualName()); 107 spec.define ("INPUTNAME", storedName()); 105 108 return spec; 106 109 } … … 148 151 throw(AipsError("This Virtual Column is not writable")); 149 152 } 150 151 152 153 153 154 154 … … 320 320 return Float(0.5)*(I-V); 321 321 } 322 }323 324 Array<Bool> SDPolUtil::stokesMask (Array<Bool> rawFlags,325 Bool doLinear)326 //327 // Generate mask for each Stokes parameter from the328 // raw flags. This is a lot of computational work and may329 // not be worth the effort.330 //331 {332 IPosition shapeIn = rawFlags.shape();333 uInt nPol = shapeIn(asap::PolAxis);334 const uInt nDim = shapeIn.nelements();335 Array<Bool> stokesFlags;336 //337 IPosition start(nDim,0);338 IPosition end(shapeIn-1);339 IPosition shapeOut = shapeIn;340 //341 if (doLinear) {342 if (nPol==1) {343 stokesFlags.resize(shapeOut);344 stokesFlags = rawFlags;345 } else if (nPol==2 || nPol==4) {346 347 // Set shape of output array348 349 if (nPol==2) {350 shapeOut(asap::PolAxis) = 1;351 } else {352 shapeOut(asap::PolAxis) = 4;353 }354 stokesFlags.resize(shapeOut);355 356 // Get reference slices and assign/compute357 358 start(asap::PolAxis) = 0;359 end(asap::PolAxis) = 0;360 Array<Bool> M1In = rawFlags(start,end);361 //362 start(asap::PolAxis) = 1;363 end(asap::PolAxis) = 1;364 Array<Bool> M2In = rawFlags(start,end);365 //366 start(asap::PolAxis) = 0;367 end(asap::PolAxis) = 0;368 Array<Bool> M1Out = stokesFlags(start,end);369 M1Out = M1In && M2In; // I370 //371 if (nPol==4) {372 start(asap::PolAxis) = 2;373 end(asap::PolAxis) = 2;374 Array<Bool> M3In = rawFlags(start,end);375 //376 start(asap::PolAxis) = 3;377 end(asap::PolAxis) = 3;378 Array<Bool> M4In = rawFlags(start,end);379 //380 start(asap::PolAxis) = 1;381 end(asap::PolAxis) = 1;382 Array<Bool> M2Out = stokesFlags(start,end);383 M2Out = M1Out; // Q384 //385 start(asap::PolAxis) = 2;386 end(asap::PolAxis) = 2;387 Array<Bool> M3Out = stokesFlags(start,end);388 M3Out = M3In; // U389 //390 start(asap::PolAxis) = 3;391 end(asap::PolAxis) = 3;392 Array<Bool> M4Out = stokesFlags(start,end);393 M4Out = M4In; // V394 }395 } else {396 throw(AipsError("Can only handle 1,2 or 4 polarizations"));397 }398 } else {399 throw (AipsError("Only implemented for Linear polarizations"));400 }401 //402 return stokesFlags;403 322 } 404 323
Note: See TracChangeset
for help on using the changeset viewer.