Changeset 443
- Timestamp:
- 02/15/05 11:59:01 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDAsciiWriter.cc
r414 r443 69 69 70 70 71 Bool SDAsciiWriter::write(const SDMemTable& sdTable, const String& fileName )71 Bool SDAsciiWriter::write(const SDMemTable& sdTable, const String& fileName, Bool toStokes) 72 72 { 73 73 … … 112 112 // Get data 113 113 114 const MaskedArray<Float>& dataIn(sdTable.rowAsMaskedArray(iRow ));114 const MaskedArray<Float>& dataIn(sdTable.rowAsMaskedArray(iRow,False,toStokes)); 115 115 const Array<Float>& values = dataIn.getArray(); 116 116 const Array<Bool>& mask = dataIn.getMask(); … … 181 181 182 182 183 Int SDAsciiWriter::convertStokes(Int val)184 {185 Stokes::StokesTypes stokes = Stokes::RR;186 if (val==0) {187 stokes = Stokes::RR;188 } else if (val==1) {189 stokes = Stokes::LL;190 } else if (val==2) {191 stokes = Stokes::RL;192 } else if (val==3) {193 stokes = Stokes::LR;194 } else {195 stokes = Stokes::Undefined;196 }197 //198 return Int(stokes);199 }200 201 183 202 184 String SDAsciiWriter::formatDirection(const Vector<Double>& lonLat) -
trunk/src/SDAsciiWriter.h
r209 r443 50 50 51 51 // Write out ascii table 52 casa::Bool write(const SDMemTable& table, const casa::String& name );52 casa::Bool write(const SDMemTable& table, const casa::String& name, casa::Bool toStokes); 53 53 54 54 private: -
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 } -
trunk/src/SDFITSImageWriter.h
r209 r443 49 49 // Write out lots of FITS images, one per row, beam, IF and polarization 50 50 casa::Bool write(const SDMemTable& table, const casa::String& rootName, 51 casa::Bool verbose=casa::True);51 casa::Bool toStokes, casa::Bool verbose=casa::True); 52 52 53 53 private: 54 casa::Int convertStokes(casa::Int val );54 casa::Int convertStokes(casa::Int val, casa::Bool toStokes, casa::Bool linear) const; 55 55 }; 56 56
Note:
See TracChangeset
for help on using the changeset viewer.