diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 4b41dcd2a..af29e783b 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -112,7 +112,7 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, observationCode["GALILEO_E5_IQ"] = "8X"; // "8X" GALILEO E5 I+Q observationCode["GALILEO_E56_A"] = "6A"; // "6A" GALILEO E6 A observationCode["GALILEO_E56_B"] = "6B"; // "6B" GALILEO E6 B - observationCode["GALILEO_E56_B"] = "6C"; // "6C" GALILEO E6 C + observationCode["GALILEO_E56_C"] = "6C"; // "6C" GALILEO E6 C observationCode["GALILEO_E56_BC"] = "6X"; // "6X" GALILEO E6 B+C observationCode["GALILEO_E56_ABC"] = "6Z"; // "6Z" GALILEO E6 A+B+C observationCode["SBAS_L1_CA"] = "1C"; // "1C" SBAS L1 C/A @@ -621,10 +621,22 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons d_rinex_header_written = true; // do not write header anymore } break; + case 100: // Galileo E6B + if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + const std::string gal_signal("E6"); + rinex_obs_header(obsFile, galileo_ephemeris_iter->second, rx_time, gal_signal); + rinex_nav_header(navGalFile, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); + output_navfilename.push_back(navGalfilename); + log_rinex_nav(navGalFile, pvt_solver->galileo_ephemeris_map); + d_rinex_header_written = true; // do not write header anymore + } + break; case 101: // Galileo E1B + Galileo E6B if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) { - rinex_obs_header(obsFile, galileo_ephemeris_iter->second, rx_time); + const std::string gal_signal("1B E6"); + rinex_obs_header(obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, rx_time, gal_signal); rinex_nav_header(navGalFile, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); output_navfilename.push_back(navGalfilename); log_rinex_nav(navGalFile, pvt_solver->galileo_ephemeris_map); @@ -634,7 +646,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 102: // Galileo E5a + Galileo E6B if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) { - const std::string signal("5X"); + const std::string signal("5X E6"); rinex_obs_header(obsFile, galileo_ephemeris_iter->second, rx_time, signal); rinex_nav_header(navGalFile, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); output_navfilename.push_back(navGalfilename); @@ -645,7 +657,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 103: // Galileo E5b + Galileo E6B if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) { - const std::string signal("7X"); + const std::string signal("7X E6"); rinex_obs_header(obsFile, galileo_ephemeris_iter->second, rx_time, signal); rinex_nav_header(navGalFile, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); output_navfilename.push_back(navGalfilename); @@ -656,7 +668,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 104: // Galileo E1B + Galileo E5a + Galileo E6B if ((galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend())) { - const std::string gal_signal("1B 5X"); + const std::string gal_signal("1B 5X E6"); rinex_obs_header(obsFile, galileo_ephemeris_iter->second, rx_time, gal_signal); rinex_nav_header(navGalFile, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); output_navfilename.push_back(navGalfilename); @@ -667,7 +679,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 105: // Galileo E1B + Galileo E5b + Galileo E6B if ((galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend())) { - const std::string gal_signal("1B 7X"); + const std::string gal_signal("1B 7X E6"); rinex_obs_header(obsFile, galileo_ephemeris_iter->second, rx_time, gal_signal); rinex_nav_header(navGalFile, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); output_navfilename.push_back(navGalfilename); @@ -678,7 +690,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 106: // GPS L1 C/A + Galileo E1B + Galileo E6B if ((galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != pvt_solver->gps_ephemeris_map.cend())) { - const std::string gal_signal("1B"); + const std::string gal_signal("1B E6"); rinex_obs_header(obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, rx_time, gal_signal); rinex_nav_header(navMixFile, pvt_solver->gps_iono, pvt_solver->gps_utc_model, gps_ephemeris_iter->second, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); output_navfilename.push_back(navMixfilename); @@ -1077,10 +1089,22 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons } } break; + case 100: // Galileo E6B + if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) + { + log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "E6"); + } + if (!d_rinex_header_updated and (pvt_solver->galileo_utc_model.A0 != 0)) + { + update_nav_header(navGalFile, pvt_solver->galileo_iono, pvt_solver->galileo_utc_model); + update_obs_header(obsFile, pvt_solver->galileo_utc_model); + d_rinex_header_updated = true; + } + break; case 101: // Galileo E1B + Galileo E6B if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) { - log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "1B"); + log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "1B E6"); } if (!d_rinex_header_updated and (pvt_solver->galileo_utc_model.A0 != 0)) { @@ -1092,7 +1116,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 102: // Galileo E5a + Galileo E6B if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) { - log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "5X"); + log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "5X E6"); } if (!d_rinex_header_updated and (pvt_solver->galileo_utc_model.A0 != 0)) { @@ -1104,7 +1128,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 103: // Galileo E5b + Galileo E6B if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) { - log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "5X"); + log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "7X E6"); } if (!d_rinex_header_updated and (pvt_solver->galileo_utc_model.A0 != 0)) { @@ -1116,7 +1140,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 104: // Galileo E1B + Galileo E5a + Galileo E6B if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) { - log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "1B 5X"); + log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "1B 5X E6"); } if (!d_rinex_header_updated and (pvt_solver->galileo_utc_model.A0 != 0)) { @@ -1128,7 +1152,7 @@ void Rinex_Printer::print_rinex_annotation(const Rtklib_Solver* pvt_solver, cons case 105: // Galileo E1B + Galileo E5b + Galileo E6B if (galileo_ephemeris_iter != pvt_solver->galileo_ephemeris_map.cend()) { - log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "1B 7X"); + log_rinex_obs(obsFile, galileo_ephemeris_iter->second, rx_time, gnss_observables_map, "1B 7X E6"); } if (!d_rinex_header_updated and (pvt_solver->galileo_utc_model.A0 != 0)) { @@ -1317,6 +1341,7 @@ void Rinex_Printer::log_rinex_nav_gal_nav(int type_of_rx, const std::mapsecond; @@ -8899,7 +8932,6 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& number_of_observations = number_of_observations + 4; } - line.clear(); signal_ = "7X"; const std::size_t found_7X = bands.find(signal_); if (found_7X != std::string::npos) @@ -8907,6 +8939,13 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& number_of_observations = number_of_observations + 4; } + signal_ = "E6"; + const std::size_t found_E6 = bands.find(signal_); + if (found_E6 != std::string::npos) + { + number_of_observations = number_of_observations + 4; + } + line.clear(); line += satelliteSystem.find("Galileo")->second; @@ -8961,6 +9000,22 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += observationCode["GALILEO_E5b_IQ"]; } + if (found_E6 != std::string::npos) + { + line += std::string(1, ' '); + line += observationType["PSEUDORANGE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["CARRIER_PHASE"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["DOPPLER"]; + line += observationCode["GALILEO_E56_B"]; + line += std::string(1, ' '); + line += observationType["SIGNAL_STRENGTH"]; + line += observationCode["GALILEO_E56_B"]; + } + line += std::string(60 - line.size(), ' '); line += Rinex_Printer::leftJustify("SYS / # / OBS TYPES", 20); Rinex_Printer::lengthCheck(line); @@ -11586,6 +11641,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep std::map observablesE1B; std::map observablesE5A; std::map observablesE5B; + std::map observablesE6B; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -11606,10 +11662,15 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } + if ((system_ == "E") && (sig_ == "E6")) + { + observablesE6B.insert(std::pair(observables_iter->first, observables_iter->second)); + } } const std::size_t found_1B = galileo_bands.find("1B"); const std::size_t found_E5a = galileo_bands.find("5X"); const std::size_t found_E5b = galileo_bands.find("7X"); + const std::size_t found_E6b = galileo_bands.find("E6"); std::multimap total_map; std::set available_prns; @@ -11706,6 +11767,23 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep total_map.insert(std::pair(prn_, observables_iter->second)); } } + + if (found_E6b != std::string::npos) + { + for (observables_iter = observablesE6B.cbegin(); + observables_iter != observablesE6B.cend(); + observables_iter++) + { + const uint32_t prn_ = observables_iter->second.PRN; + total_map.insert(std::pair(prn_, observables_iter->second)); + it = available_prns.find(prn_); + if (it == available_prns.end()) + { + available_prns.insert(prn_); + } + } + } + const int32_t numSatellitesObserved = available_prns.size(); line += Rinex_Printer::rightJustify(std::to_string(numSatellitesObserved), 3); // Receiver clock offset (optional) @@ -11834,6 +11912,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::map observablesE1B; std::map observablesE5A; std::map observablesE5B; + std::map observablesE6B; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -11854,6 +11933,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } + if ((system_ == "E") && (sig_ == "E6")) + { + observablesE6B.insert(std::pair(observables_iter->first, observables_iter->second)); + } if ((system_ == "G") && (sig_ == "1C")) { observablesG1C.insert(std::pair(observables_iter->first, observables_iter->second)); @@ -11902,6 +11985,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } } + for (observables_iter = observablesE6B.cbegin(); + observables_iter != observablesE6B.cend(); + observables_iter++) + { + const uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + const int32_t numGalSatellitesObserved = available_gal_prns.size(); const int32_t numGpsSatellitesObserved = observablesG1C.size(); const int32_t numSatellitesObserved = numGalSatellitesObserved + numGpsSatellitesObserved; @@ -12107,6 +12203,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e std::map observablesE1B; std::map observablesE5A; std::map observablesE5B; + std::map observablesE6B; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -12127,6 +12224,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } + if ((system_ == "E") && (sig_ == "E6")) + { + observablesE6B.insert(std::pair(observables_iter->first, observables_iter->second)); + } if ((system_ == "G") && (sig_ == "2S")) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); @@ -12181,6 +12282,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e } } + for (observables_iter = observablesE6B.cbegin(); + observables_iter != observablesE6B.cend(); + observables_iter++) + { + const uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + for (observables_iter = observablesG2S.cbegin(); observables_iter != observablesG2S.cend(); observables_iter++) @@ -12405,6 +12519,7 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep std::map observablesE1B; std::map observablesE5A; std::map observablesE5B; + std::map observablesE6B; std::map::const_iterator observables_iter; for (observables_iter = observables.cbegin(); @@ -12425,6 +12540,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { observablesE5B.insert(std::pair(observables_iter->first, observables_iter->second)); } + if ((system_ == "E") && (sig_ == "E6")) + { + observablesE6B.insert(std::pair(observables_iter->first, observables_iter->second)); + } if ((system_ == "G") && (sig_ == "2S")) { observablesG2S.insert(std::pair(observables_iter->first, observables_iter->second)); @@ -12483,6 +12602,19 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep } } + for (observables_iter = observablesE6B.cbegin(); + observables_iter != observablesE6B.cend(); + observables_iter++) + { + const uint32_t prn_ = observables_iter->second.PRN; + total_gal_map.insert(std::pair(prn_, observables_iter->second)); + it = available_gal_prns.find(prn_); + if (it == available_gal_prns.end()) + { + available_gal_prns.insert(prn_); + } + } + for (observables_iter = observablesG1C.cbegin(); observables_iter != observablesG1C.cend(); observables_iter++)