Changeset 279
- Timestamp:
- 01/24/05 14:12:39 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDFITSImageWriter.cc
r215 r279 37 37 #include <casa/Arrays/VectorIter.h> 38 38 #include <casa/Utilities/CountedPtr.h> 39 #include <casa/OS/Directory.h> 39 40 40 41 #include <coordinates/Coordinates/CoordinateUtil.h> … … 72 73 73 74 Bool SDFITSImageWriter::write(const SDMemTable& sdTable, 74 const String& rootName, Bool verbose)75 const String& dirName, Bool verbose) 75 76 { 76 77 … … 90 91 91 92 Table tab = sdTable.table(); 92 ROArrayColumn<Double> dir (tab, String("DIRECTION"));93 ROScalarColumn<Double> time (tab, "TIME");94 ROArrayColumn<uInt> freqid (tab, "FREQID");95 ROScalarColumn<String> src (tab, "SRCNAME");93 ROArrayColumn<Double> dirCol(tab, String("DIRECTION")); 94 ROScalarColumn<Double> timeCol(tab, "TIME"); 95 ROArrayColumn<uInt> freqidCol(tab, "FREQID"); 96 ROScalarColumn<String> srcCol(tab, "SRCNAME"); 96 97 97 98 // Output Image Shape; spectral axis to be updated … … 106 107 const uInt chanAxis = asap::ChanAxis; 107 108 const Unit RAD(String("rad")); 109 110 // Output Directory 111 112 String dirName2(dirName); 113 if (dirName.length()==0) { 114 dirName2 = String("asap_FITS"); 115 } 116 Directory dir(dirName2); 117 dir.create(True); 118 cerr << "Created directory '" << dirName2 << "' for output files" << endl; 108 119 109 120 // Temps … … 147 158 148 159 Double dTmp; 149 time .get(iRow, dTmp);160 timeCol.get(iRow, dTmp); 150 161 MVEpoch tmp2(Quantum<Double>(dTmp, Unit(String("d")))); 151 162 MEpoch epoch(tmp2, timeRef); … … 162 173 163 174 Vector<uInt> iTmp; 164 freqid .get(iRow, iTmp);175 freqidCol.get(iRow, iTmp); 165 176 SpectralCoordinate sC = sdTable.getCoordinate(iTmp(pos(ifAxis))); 166 177 167 178 // Form DirectionCoordinate 168 179 169 dir .get(iRow, whichDir);180 dirCol.get(iRow, whichDir); 170 181 posDir(0) = pos(beamAxis); 171 182 posDir(1) = 0; … … 210 221 ostringstream oss; 211 222 oss << "row" << iRow << "_beam" << pos(0) << "_if" 212 << pos(1) << "_pol" << pos(2) << "_" << src(iRow) << ".fits"; 213 String fileName; 214 if (rootName.length()>0) { 215 fileName = rootName + "_" + String(oss); 216 } else { 217 fileName = String(oss); 218 } 223 << pos(1) << "_pol" << pos(2) << "_" << srcCol(iRow) << ".fits"; 224 String tS(oss); 225 String fileName = dirName2 + String("/") + tS; 219 226 if (verbose) cerr << "Writing row " << iRow 220 << " into file " << fileName<< endl;227 << " into file '" << tS << "'" << endl; 221 228 // 222 229 Bool ok = ImageFITSConverter::ImageToFITS(errMsg, tIm, fileName,
Note:
See TracChangeset
for help on using the changeset viewer.