Changeset 209 for trunk/src/SDAsciiWriter.cc
- Timestamp:
- 01/18/05 17:31:59 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDAsciiWriter.cc
r198 r209 30 30 //#--------------------------------------------------------------------------- 31 31 32 #include "SDAsciiWriter.h"33 34 32 #include <casa/aips.h> 35 33 #include <casa/Arrays/Array.h> … … 40 38 #include <casa/Quanta/MVAngle.h> 41 39 40 41 #include <casa/iostream.h> 42 #include <casa/fstream.h> 43 42 44 #include <coordinates/Coordinates/CoordinateUtil.h> 43 45 #include <coordinates/Coordinates/SpectralCoordinate.h> … … 51 53 #include <tables/Tables/ArrayColumn.h> 52 54 55 #include "Definitions.h" 53 56 #include "SDContainer.h" 54 57 #include "SDMemTable.h" 55 56 #include <casa/iostream.h> 57 #include <casa/fstream.h> 58 58 #include "SDAsciiWriter.h" 59 59 60 60 using namespace casa; … … 69 69 70 70 71 Bool SDAsciiWriter::write(const SDMemTable& sdTable, 71 Bool SDAsciiWriter::write(const SDMemTable& sdTable, const String& fileName) 72 72 { 73 73 … … 86 86 ROScalarColumn<String> src(tab, "SRCNAME"); 87 87 88 // Axes (should be in header)89 90 const uInt beamAxis = 0;91 const uInt ifAxis = 1;92 const uInt polAxis = 2;93 const uInt chanAxis = 3;94 95 88 // Temps 96 89 … … 109 102 // Write header 110 103 111 of << "row beam IF pol source longitude latitude time nchan spectrum mask" << endl; 112 104 of << "row beam IF pol source longitude latitude time nchan spectrum mask" 105 << endl; 106 113 107 // Loop over rows 114 108 … … 131 125 // Iterate through data in this row by spectra 132 126 133 ReadOnlyVectorIterator<Float> itData(values, chanAxis);134 ReadOnlyVectorIterator<Bool> itMask(mask, chanAxis);127 ReadOnlyVectorIterator<Float> itData(values, asap::ChanAxis); 128 ReadOnlyVectorIterator<Bool> itMask(mask, asap::ChanAxis); 135 129 while (!itData.pastEnd()) { 136 130 const IPosition& pos = itData.pos(); … … 144 138 145 139 dir.get(iRow, whichDir); 146 posDir(0) = pos( beamAxis);140 posDir(0) = pos(asap::BeamAxis); 147 141 posDir(1) = 0; 148 142 lonLat[0] = whichDir(posDir); 149 143 // 150 posDir(0) = pos( beamAxis);144 posDir(0) = pos(asap::BeamAxis); 151 145 posDir(1) = 1; 152 146 lonLat[1] = whichDir(posDir); 153 147 154 // Write. This formats the vectors as [,,,,] which we probably don't want. 155 156 of << iRow << " " << pos(beamAxis) << " " << pos(ifAxis) << " " << pos(polAxis) << " " << 157 src(iRow) << " " << formatDirection(lonLat) << " " << dTmp << " " << 158 itData.vector().nelements() << " " << itData.vector() << " " << itMask.vector() << endl; 148 // Write. This formats the vectors as [,,,,] which we 149 // probably don't want. 150 uInt ba = uInt(asap::BeamAxis); 151 uInt ia = uInt(asap::IFAxis); 152 uInt pa = uInt(asap::PolAxis); 153 154 of << iRow << " " << pos(ba) << " " 155 << pos(ia) << " " << pos(pa) << " " 156 << src(iRow) << " " << formatDirection(lonLat) << " " 157 << dTmp << " " 158 << itData.vector().nelements() << " " << itData.vector() 159 << " " << itMask.vector() << endl; 159 160 160 161 // Next spectrum … … 172 173 173 174 174 Int SDAsciiWriter::convertStokes 175 Int SDAsciiWriter::convertStokes(Int val) 175 176 { 176 177 Stokes::StokesTypes stokes = Stokes::RR; … … 191 192 192 193 193 String SDAsciiWriter::formatDirection 194 String SDAsciiWriter::formatDirection(const Vector<Double>& lonLat) 194 195 { 195 196 MVAngle x1(lonLat(0));
Note: See TracChangeset
for help on using the changeset viewer.