119 this->fromString(str);
128 case GAL:
return std::string(
"GAL");
129 case GPSA:
return std::string(
"GPSA");
130 case GPSB:
return std::string(
"GPSB");
134 return std::string(
"ERROR");
142 if (STR == std::string(
"GAL"))
144 else if (STR == std::string(
"GPSA"))
146 else if (STR == std::string(
"GPSB"))
150 Exception e(
"Unknown IonoCorr type: " + str);
175 if (
type > right.
type)
return false;
205 if(line.length() == 0)
continue;
206 else if(line.length() < 60 || line.length() > 80)
208 FFStreamError e(
"Invalid line length");
212 string thisLabel(line, 60, 20);
225 FFStreamError e(
"File type is not NAVIGATION: " +
fileType);
242 FFStreamError e(
"Version 2 file type is invalid: " +
270 ic.
param[i] = line.substr(2 + 12*i, 12);
280 ic.
param[i] = line.substr(2 + 12*i, 12);
295 FFStreamError fse(e.
what());
299 ic.
param[i] = line.substr(5 + 12*i, 12);
339 asInt(line.substr(6,6)),
340 asInt(line.substr(12,6)), 0, 0, 0.0,
375 FFStreamError fse(e.
what());
418 GNSSTK_THROW(FFStreamError(
"Unknown header label >" + thisLabel +
424 unsigned long allValid;
431 FFStreamError e(
"Unknown or unsupported RINEX version "+
436 if((allValid &
valid) != allValid)
438 FFStreamError e(
"Incomplete or invalid header");
455 unsigned long allValid;
466 if((
valid & allValid) != allValid)
468 FFStreamError
err(
"Incomplete or invalid header.");
475 ffs << right << setw(10) << setprecision(2) << fixed <<
version
476 << setw(10) <<
' ' << left << setw(20) <<
fileType;
479 ffs << left << setw(20) <<
fileSys;
481 ffs << setw(20) <<
' ';
493 strm << left << setw(20)
494 <<
printTime(sysTime,
"%02m/%02d/%04Y %02H:%02M:%02S");
498 strm << left << setw(20)
499 <<
printTime(sysTime,
"%04Y%02m%02d %02H%02M%02S UTC");
517 map<string,IonoCorr>::const_iterator it;
520 switch(it->second.type)
526 strm << it->second.param[j];
536 strm << it->second.param[j];
546 strm << it->second.param[j];
556 strm << it->second.param[j];
564 strm << it->second.param[j];
570 FFStreamError
err(
"Unknown IonoCorr type " +
582 map<string,TimeSystemCorrection>::const_iterator it;
601 strm << right << setw(7) << (unsigned)ws.
sow
602 << right << setw(5) << ws.
week;
609 strm << right << setw(7) << (unsigned)ws.
sow
610 << right << setw(5) << ws.
week;
618 strm <<
' ' << right << setw(5) << tc.
geoProvider <<
' ';
622 strm << setw(7) <<
' ';
624 strm << right << setw(2) << tc.
geoUTCid <<
' '
634 << right << setw(9) << (unsigned)ws.
sow
635 << right << setw(9) << ws.
week <<
" "
642 strm << right << setw(6) << civ.
year
643 << right << setw(6) << civ.
month
644 << right << setw(6) << civ.
day
653 << right << setw(7) << (unsigned)ws.
sow
654 << right << setw(5) << ws.
week
656 << right << setw(2) << tc.
geoUTCid <<
" "
678 strm << setw(54) <<
' ';
696 s <<
"---------------------------------- REQUIRED "
697 <<
"----------------------------------\n";
699 s <<
"Rinex Version " << fixed << setw(5) << setprecision(2) <<
version
704 s <<
"(This header is ";
706 s <<
"VALID RINEX version 3";
708 s <<
"VALID RINEX version 2";
709 else s <<
"NOT VALID RINEX";
714 if(!(
valid &
validEoH )) s <<
" End of Header is NOT valid\n";
716 s <<
"---------------------------------- OPTIONAL "
717 <<
"----------------------------------\n";
719 for(map<string,TimeSystemCorrection>::const_iterator tcit
723 tcit->second.dump(s);
727 map<string,IonoCorr>::const_iterator icit;
730 s <<
"Iono correction for " << icit->second.asString() <<
" : "
731 << scientific << setprecision(4);
732 switch(icit->second.type)
735 s <<
"ai0 = " << icit->second.param[0]
736 <<
", ai1 = " << icit->second.param[1]
737 <<
", ai2 = " << icit->second.param[2];
740 s <<
"alpha " << icit->second.param[0]
741 <<
" " << icit->second.param[1]
742 <<
" " << icit->second.param[2]
743 <<
" " << icit->second.param[3];
746 s <<
"beta " << icit->second.param[0]
747 <<
" " << icit->second.param[1]
748 <<
" " << icit->second.param[2]
749 <<
" " << icit->second.param[3];
753 FFStreamError
err(
"Unknown IonoCorr type " +
769 else s <<
" Leap seconds is NOT valid\n";
773 s <<
"Comments (" <<
commentList.size() <<
") :\n";
778 s <<
"-------------------------------- END OF HEADER "
779 <<
"-------------------------------\n";
788 if(str[0] ==
'M' || str[0] ==
'm')
792 Exception e(
"RINEX version 2 'Mixed' Nav files do not exist");
820 Exception e( std::string(
"RINEX version 2 ") +
822 std::string(
" Nav files do not exist") );
836 std::vector<std::string>& diffs,
837 const std::vector<std::string>& inclExclList,
841 std::map<std::string,bool> lineMap;
842 std::map<std::string,bool>::const_iterator lmi;
845 std::set<std::string>
869 std::map<std::string,TimeSystemCorrection>::const_iterator ltci, rtci;
870 std::map<std::string,IonoCorr>::const_iterator lici, rici;
889 lineMap[
stringDUTC] = ltci->second == rtci->second;
918 std::map<std::string,bool> oldLineMap(lineMap);
919 std::map<std::string,bool>::const_iterator olmi;
921 for (
unsigned i = 0; i < inclExclList.size(); i++)
924 if ((olmi = oldLineMap.find(inclExclList[i])) != oldLineMap.end())
927 lineMap[olmi->first] = olmi->second;
934 for (
unsigned i = 0; i < inclExclList.size(); i++)
937 lineMap.erase(inclExclList[i]);
942 for (lmi = lineMap.begin(); lmi != lineMap.end(); lmi++)
946 diffs.push_back(lmi->first);