62 && (numSvs==0 || obs.empty()) )
return;
64 auxHeader.NumberHeaderRecordsToBeWritten()==0)
return;
70 line = writeTime(
time);
71 line += string(2,
' ');
76 const int maxPrnsPerLine = 12;
78 RinexSatMap::const_iterator obsItr = obs.begin();
81 while ((obsItr != obs.end()) && (satsWritten < maxPrnsPerLine))
92 line += string(68 - line.size(),
' ');
97 while (satsWritten != (
int)obs.size())
99 if ((satsWritten % maxPrnsPerLine) == 0)
101 strm << line << endl;
103 line = string(32,
' ');
113 strm << line << endl;
122 catch(FFStreamError& e)
126 catch(StringException& e)
133 else if (!obs.empty())
136 obsItr = obs.begin();
138 const int maxObsPerLine = 5;
140 while(obsItr != obs.end())
142 vector<RinexObsType>::iterator obsTypeItr =
150 if ( ((obsWritten % maxObsPerLine) == 0) &&
153 strm << line << endl;
158 RinexObsTypeMap::const_iterator rotmi(obsItr->second.find(*obsTypeItr));
160 if (rotmi != obsItr->second.end())
161 thisData = rotmi->second;
163 if (thisData.
lli == 0)
164 line += string(1,
' ');
167 if (thisData.
ssi == 0)
168 line += string(1,
' ');
174 strm << line << endl;
201 bool isValidEpochLine(
false);
202 while( !isValidEpochLine && !strm.eof())
207 isValidEpochLine =
true;
212 if( line.size()>80 ) isValidEpochLine =
false;
220 isValidEpochLine =
false;
224 (void)
asInt(line.substr(29,3));
229 isValidEpochLine =
false;
251 bool noEpochTime = (line.substr(0,26) == string(26,
' '));
255 FFStreamError e(
"Required epoch time missing: " + line);
258 else if (noEpochTime)
264 time = parseTime(line, hdr);
268 numSvs =
asInt(line.substr(29,3));
270 if( line.size() > 68 )
278 int isv, ndx, line_ndx;
279 vector<SatID> satIndex(numSvs);
281 for (isv=1, ndx=0; ndx<numSvs; isv++, ndx++)
289 FFStreamError
err(
"Invalid line size:" +
asString(line.size()));
295 satIndex[ndx] =
RinexSatID(line.substr(col+isv*3-1, 3));
299 FFStreamError ffse(e);
304 for (isv=0; isv < numSvs; isv++)
307 for (ndx=0, line_ndx=0; ndx < numObs; ndx++, line_ndx++)
309 SatID sat = satIndex[isv];
311 if (! (line_ndx % 5))
315 if (line.size() > 80)
317 FFStreamError
err(
"Invalid line size:" +
asString(line.size()));
322 line.resize(80,
' ');
324 obs[sat][obs_type].data =
asDouble(line.substr(line_ndx*16, 14));
325 obs[sat][obs_type].lli =
asInt( line.substr(line_ndx*16+14, 1));
326 obs[sat][obs_type].ssi =
asInt( line.substr(line_ndx*16+15, 1));
334 for(
int i=0; i<numSvs; i++)
342 catch(FFStreamError& e)
346 catch(StringException& e)
365 if ( (line[0] !=
' ') ||
372 FFStreamError e(
"Invalid time format");
377 if (line.substr(0,26) ==
string(26,
' '))
392 sec =
asDouble(line.substr(15, 11));
396 if(sec >= 60.) { ds=sec; sec=0.0; }
398 if(ds != 0) rv.
second += ds;
403 catch (std::exception &e)
405 FFStreamError
err(
"std::exception: " +
string(e.what()));
412 FFStreamError
err(
"gnsstk::Exception in parseTime(): " + text);
422 return string(26,
' ');
427 line = string(1,
' ');
429 line += string(1,
' ');
431 line += string(1,
' ');
433 line += string(1,
' ');
435 line += string(1,
' ');
448 s <<
"Dump of RinexObsData - time: ";
449 s << writeTime(
time) <<
" epochFlag: "
450 <<
" " <<
epochFlag <<
" numSvs: " << numSvs
451 << fixed << setprecision(6)
455 RinexSatMap::const_iterator it;
456 for(it=obs.begin(); it!=obs.end(); it++)
458 s <<
"Sat " << setw(2) <<
RinexSatID(it->first);
459 RinexObsTypeMap::const_iterator jt;
460 for(jt=it->second.begin(); jt!=it->second.end(); jt++)
462 s <<
" " << jt->first.type <<
":" << fixed << setprecision(3)
463 <<
" " << setw(12) << jt->second.data
464 <<
"/" << jt->second.lli <<
"/" << jt->second.ssi;
471 s <<
"aux. header info:\n";