Changeset 437
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDPol.cc
r429 r437 138 138 void SDStokesEngine::getArray (uInt rownr, Array<Float>& output) 139 139 { 140 IPosition inputShape = findInputShape (output.shape()); 141 Array<Float> input(inputShape); 140 Array<Float> input; 142 141 roColumn().get(rownr, input); 143 142 // … … 152 151 153 152 154 void SDStokesEngine::setShape (uInt rownr, const IPosition& outputShape) 155 { 156 BaseMappedArrayEngine<Float,Float>::setShape (rownr, findInputShape(outputShape)); 157 } 158 159 void SDStokesEngine::setShapeColumn (const IPosition& outputShape) 160 { 161 BaseMappedArrayEngine<Float,Float>::setShapeColumn (findInputShape(outputShape)); 162 } 163 153 164 154 165 155 IPosition SDStokesEngine::shape (uInt rownr) … … 183 173 184 174 const uInt nDim = input.ndim(); 185 DebugAssert(nDim==4,AipsError); 186 DebugAssert(array.ndim()==4,AipsError); 175 AlwaysAssert(nDim==4,AipsError); 176 AlwaysAssert(output.ndim()==4,AipsError); 177 // 187 178 const IPosition inputShape = input.shape(); 188 179 const uInt polAxis = asap::PolAxis; 189 180 const uInt nPol = inputShape(polAxis); 190 DebugAssert(nPol==1 || nPol==2 || nPol==3, AipsError);181 AlwaysAssert(nPol==1 || nPol==2 || nPol==3, AipsError); 191 182 192 183 // The silly Array slice operator does not give me back … … 247 238 248 239 249 250 IPosition SDStokesEngine::findInputShape (const IPosition& outputShape) const251 //252 // Don't know how to handle the degeneracy that both253 // XX -> I254 // XX,YY -> I255 //256 {257 uInt axis = asap::PolAxis;258 uInt nPol = outputShape(axis);259 IPosition inputShape = outputShape;260 if (nPol==1) {261 inputShape(axis) = 2; // XX YY -> I262 } else if (nPol==4) {263 inputShape(axis) = 4; // XX YY R(XY) I(XY) -> I Q U V264 }265 return inputShape;266 }267 240 268 241 IPosition SDStokesEngine::findOutputShape (const IPosition& inputShape) const -
trunk/src/SDPol.h
r429 r437 116 116 static void registerClass(); 117 117 118 // Non writable 119 virtual casa::Bool isWritable () const {return casa::False;} 120 118 121 private: 119 122 // Copy constructor is only used by clone(). … … 147 150 const casa::Array<casa::Float>& target); 148 151 149 // Set shapes 150 virtual void setShape (casa::uInt rownr, const casa::IPosition& outputShape); 151 virtual void setShapeColumn (const casa::IPosition& outputShape); 152 // Get shape 152 153 virtual casa::IPosition shape (casa::uInt rownr); 153 154 154 // Convert input/output shapes 155 casa::IPosition findInputShape (const casa::IPosition& outputShape) const; 155 // Convert input to output (virtual) shape 156 156 casa::IPosition findOutputShape (const casa::IPosition& inputShape) const; 157 158 157 159 158
Note:
See TracChangeset
for help on using the changeset viewer.