Changeset 1575
- Timestamp:
- 06/29/09 13:32:17 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STWriter.cpp
r1477 r1575 51 51 #include "STAsciiWriter.h" 52 52 #include "STHeader.h" 53 #include "STMath.h" 54 53 55 54 56 #include "STWriter.h" … … 104 106 const std::string &filename) 105 107 { 108 // If we write out foreign formats we have to convert the frequency system 109 // into the output frame, as we do everything related to SPectarlCoordinates 110 // in asap on-the-fly. 111 112 CountedPtr<Scantable> inst = in; 113 if (in->frequencies().getFrame(true) != in->frequencies().getFrame(false)) { 114 STMath stm(false); 115 inst = stm.frequencyAlign(in); 116 } 106 117 107 118 if (format_=="ASCII") { 108 119 STAsciiWriter iw; 120 // ASCII calls SpectralCoordinate::toWorld so no freqAlign use 'in' 109 121 if (iw.write(*in, filename)) { 110 122 return 0; … … 117 129 iw.setClass(True); 118 130 } 119 if (iw.write(*in , filename)) {131 if (iw.write(*inst, filename)) { 120 132 return 0; 121 133 } … … 127 139 // this is a little different from what I have done 128 140 // before. Need to check with the Offline User Test data 129 STHeader hdr = in ->getHeader();141 STHeader hdr = inst->getHeader(); 130 142 //const Int nPol = hdr.npol; 131 143 //const Int nChan = hdr.nchan; 132 std::vector<uint> ifs = in ->getIFNos();133 int nIF = in ->nif();//ifs.size();144 std::vector<uint> ifs = inst->getIFNos(); 145 int nIF = inst->nif();//ifs.size(); 134 146 Vector<uInt> nPol(nIF),nChan(nIF); 135 147 Vector<Bool> havexpol(nIF); … … 138 150 nPol = 0;nChan = 0; havexpol = False; 139 151 for (uint i=0;i<ifs.size();++i) { 140 nPol(ifs[i]) = in ->npol();141 nChan(ifs[i]) = in ->nchan(ifs[i]);152 nPol(ifs[i]) = inst->npol(); 153 nChan(ifs[i]) = inst->nchan(ifs[i]); 142 154 havexpol(ifs[i]) = nPol(ifs[i]) > 2; 143 155 } 144 156 145 const Table table = in ->table();157 const Table table = inst->table(); 146 158 147 159 // Create the output file and write static data. … … 155 167 throw(AipsError("Failed to create output file")); 156 168 } 157 158 169 159 170 Int count = 0; … … 201 212 Float tmp0,tmp1,tmp2,tmp3,tmp4; 202 213 String stmp0,stmp1; 203 in ->frequencies().getEntry(crpix,crval, pksrec.freqInc,214 inst->frequencies().getEntry(crpix,crval, pksrec.freqInc, 204 215 rec.asuInt("FREQ_ID")); 205 in ->focus().getEntry(pksrec.focusAxi, pksrec.focusTan,216 inst->focus().getEntry(pksrec.focusAxi, pksrec.focusTan, 206 217 pksrec.focusRot, tmp0,tmp1,tmp2,tmp3,tmp4, 207 218 rec.asuInt("FOCUS_ID")); 208 in ->molecules().getEntry(pksrec.restFreq,stmp0,stmp1,219 inst->molecules().getEntry(pksrec.restFreq,stmp0,stmp1, 209 220 rec.asuInt("MOLECULE_ID")); 210 in ->tcal().getEntry(pksrec.tcalTime, pksrec.tcal,221 inst->tcal().getEntry(pksrec.tcalTime, pksrec.tcal, 211 222 rec.asuInt("TCAL_ID")); 212 in ->weather().getEntry(pksrec.temperature, pksrec.pressure,223 inst->weather().getEntry(pksrec.temperature, pksrec.pressure, 213 224 pksrec.humidity, pksrec.windSpeed, 214 225 pksrec.windAz, rec.asuInt("WEATHER_ID"));
Note:
See TracChangeset
for help on using the changeset viewer.