Changeset 443 for trunk/src/SDFITSImageWriter.cc
- Timestamp:
- 02/15/05 11:59:01 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDFITSImageWriter.cc
r414 r443 52 52 53 53 #include <measures/Measures/MEpoch.h> 54 #include <measures/Measures/Stokes.h> 54 55 55 56 #include <tables/Tables/Table.h> … … 60 61 #include "SDContainer.h" 61 62 #include "SDMemTable.h" 63 #include "SDPol.h" 62 64 63 65 using namespace casa; … … 73 75 74 76 Bool SDFITSImageWriter::write(const SDMemTable& sdTable, 75 const String& dirName, Bool verbose) 77 const String& dirName, Bool toStokes, 78 Bool verbose) 76 79 { 77 80 … … 131 134 Vector<Double> refPixLonLat(2,0.0); 132 135 136 // Do we have linear or circular ? No way to know yet... 137 138 Bool linear = True; 139 133 140 // Loop over rows 134 141 … … 147 154 for (uInt iRow=0; iRow<nRows; iRow++) { 148 155 149 // Get data 150 151 const MaskedArray<Float>& dataIn(sdTable.rowAsMaskedArray(iRow ));156 // Get data converted to Stokes 157 158 const MaskedArray<Float>& dataIn(sdTable.rowAsMaskedArray(iRow,False,toStokes)); 152 159 const Array<Float>& values = dataIn.getArray(); 153 160 const Array<Bool>& mask = dataIn.getMask(); … … 196 203 refPixLonLat[0], refPixLonLat[1]); 197 204 198 // Form Stokes Coordinate (no true Stokes info yet); 199 200 whichStokes(0) = convertStokes(pos(stokesAxis)); 205 // Form Stokes Coordinate (Stokes info still sketchy); 206 207 Stokes::StokesTypes stokes = SDPolUtil::convertStokes(pos(stokesAxis), toStokes, linear); 208 String stokesName = Stokes::name(stokes); 209 whichStokes(0) = Int(stokes); 201 210 StokesCoordinate stC(whichStokes); 202 211 … … 226 235 ostringstream oss; 227 236 oss << "row" << iRow << "_beam" << pos(0) << "_if" 228 << pos(1) << "_ pol" << pos(2)<< "_" << srcCol(iRow) << ".fits";237 << pos(1) << "_" << stokesName << "_" << srcCol(iRow) << ".fits"; 229 238 String tS(oss); 230 239 String fileName = dirName2 + String("/") + tS; … … 256 265 257 266 258 Int SDFITSImageWriter::convertStokes(Int val)259 {260 Stokes::StokesTypes stokes = Stokes::RR;261 if (val==0) {262 stokes = Stokes::XX;263 } else if (val==1) {264 stokes = Stokes::YY;265 } else if (val==2) {266 stokes = Stokes::XY;267 } else if (val==3) {268 stokes = Stokes::YX;269 } else {270 stokes = Stokes::Undefined;271 }272 //273 return Int(stokes);274 }
Note: See TracChangeset
for help on using the changeset viewer.